offsite 0.0.13 → 0.0.14

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 (81) hide show
  1. package/apps/server/dist/main.mjs +15 -3
  2. package/apps/server/dist/main.mjs.map +1 -1
  3. package/apps/web/dist/assets/{angular-html-CtL9u31h.js → angular-html-6NaagU1P.js} +1 -1
  4. package/apps/web/dist/assets/{angular-ts-D4IFBcAh.js → angular-ts-D8XutLPw.js} +1 -1
  5. package/apps/web/dist/assets/{apl-CqnJhScR.js → apl-BKJEkz6Z.js} +1 -1
  6. package/apps/web/dist/assets/{astro-Dn1_avL_.js → astro-DkrGLOry.js} +1 -1
  7. package/apps/web/dist/assets/{blade-BKSa6Bs3.js → blade-BIc0yPkX.js} +1 -1
  8. package/apps/web/dist/assets/{c-C8sbMt_8.js → c-Ds8U4gsq.js} +1 -1
  9. package/apps/web/dist/assets/{chapel-BWxXvR2-.js → chapel-COXTL8xW.js} +1 -1
  10. package/apps/web/dist/assets/{cobol-DNoVp--S.js → cobol-D0VSGQqK.js} +1 -1
  11. package/apps/web/dist/assets/{coffee-m1P3e2U1.js → coffee-DBrey7sA.js} +1 -1
  12. package/apps/web/dist/assets/{cpp-CDvshXRJ.js → cpp-SKUDYlNR.js} +1 -1
  13. package/apps/web/dist/assets/{crystal-C4b65AQe.js → crystal-CoTn_b8r.js} +1 -1
  14. package/apps/web/dist/assets/{css-CqQV9eEE.js → css-BErHy7fN.js} +1 -1
  15. package/apps/web/dist/assets/{edge-CEdbZQ1U.js → edge-CACFpVrz.js} +1 -1
  16. package/apps/web/dist/assets/{elixir-CYDX6OgA.js → elixir-aPcGiByD.js} +1 -1
  17. package/apps/web/dist/assets/{elm-10RuU89D.js → elm-DN5FfPkL.js} +1 -1
  18. package/apps/web/dist/assets/{erb-BiMfBUaM.js → erb-Dj675b5b.js} +1 -1
  19. package/apps/web/dist/assets/{git-rebase-D4Se-3SO.js → git-rebase-DepNW1h5.js} +1 -1
  20. package/apps/web/dist/assets/{glimmer-js-sKOVTqrH.js → glimmer-js-fCJatm6u.js} +1 -1
  21. package/apps/web/dist/assets/{glimmer-ts-DWMGXcHA.js → glimmer-ts-YwpKoyPh.js} +1 -1
  22. package/apps/web/dist/assets/{glsl-6ltM2JGZ.js → glsl-PGMqKJzL.js} +1 -1
  23. package/apps/web/dist/assets/{graphql-DwyBbitO.js → graphql-3IK2PC2Y.js} +1 -1
  24. package/apps/web/dist/assets/{hack-DKDbxv34.js → hack-C8CJl4zQ.js} +1 -1
  25. package/apps/web/dist/assets/{haml-Bsfivw5f.js → haml-CiYnV6_a.js} +1 -1
  26. package/apps/web/dist/assets/{handlebars-B3HW0h8N.js → handlebars-C4m4mY7m.js} +1 -1
  27. package/apps/web/dist/assets/{html-D9EhGmAq.js → html-D1Ar4Xkj.js} +1 -1
  28. package/apps/web/dist/assets/{html-derivative-Cs1eIi3k.js → html-derivative-CwhughXj.js} +1 -1
  29. package/apps/web/dist/assets/{http-BG4vxnc2.js → http-pzvpiwNw.js} +1 -1
  30. package/apps/web/dist/assets/{hurl-OIF0UEfX.js → hurl-hkZwo5Ou.js} +1 -1
  31. package/apps/web/dist/assets/{index-CEx2Hw3M.js → index-BOrJ0-iI.js} +5 -5
  32. package/apps/web/dist/assets/{java-2iLSH1xc.js → java-CjDcLNWV.js} +1 -1
  33. package/apps/web/dist/assets/{javascript-Di7CdqTh.js → javascript-B1pleYoe.js} +1 -1
  34. package/apps/web/dist/assets/{jinja-2mjIAN_z.js → jinja-erX4wFzj.js} +1 -1
  35. package/apps/web/dist/assets/{jison-Ciw1rqtP.js → jison-CajpWJAS.js} +1 -1
  36. package/apps/web/dist/assets/{json-D7Dp9EFU.js → json-CwL6i1-C.js} +1 -1
  37. package/apps/web/dist/assets/{jsx-WEelr3xJ.js → jsx-DmOLIUT0.js} +1 -1
  38. package/apps/web/dist/assets/{julia-DL3m48KZ.js → julia-DK5bpj3S.js} +1 -1
  39. package/apps/web/dist/assets/{just-B-5HaJEz.js → just-BtwHGit4.js} +1 -1
  40. package/apps/web/dist/assets/{latex-DKmfapvy.js → latex-Dnf1mLFf.js} +1 -1
  41. package/apps/web/dist/assets/{liquid-Bqxp18sH.js → liquid-Bv72E2Is.js} +1 -1
  42. package/apps/web/dist/assets/{lua-BSLGBVbN.js → lua-94ufuXur.js} +1 -1
  43. package/apps/web/dist/assets/{marko-yLzCBGNR.js → marko-BKL0CGzx.js} +1 -1
  44. package/apps/web/dist/assets/{mdc-DSGSIXIk.js → mdc-DNhqDQoU.js} +1 -1
  45. package/apps/web/dist/assets/{nginx-BF1hRuVH.js → nginx-BcYwGlC2.js} +1 -1
  46. package/apps/web/dist/assets/{nim-kAH67IJv.js → nim-CRMgcK-K.js} +1 -1
  47. package/apps/web/dist/assets/{org-DCuW6Ito.js → org-DfnsnSld.js} +1 -1
  48. package/apps/web/dist/assets/{perl-ChYkJruC.js → perl-BEwyXv2a.js} +1 -1
  49. package/apps/web/dist/assets/{php-Dy0o5CHL.js → php-CG9qDJ82.js} +1 -1
  50. package/apps/web/dist/assets/{pug-C-vFGcyR.js → pug-Dg3kkpP7.js} +1 -1
  51. package/apps/web/dist/assets/{qml-Bbhsm3bz.js → qml-Vs1TgYWl.js} +1 -1
  52. package/apps/web/dist/assets/{r-D6AOSU_n.js → r-CFy73Kus.js} +1 -1
  53. package/apps/web/dist/assets/{razor-CsDTm1QE.js → razor-Dcng6YrP.js} +1 -1
  54. package/apps/web/dist/assets/{regexp-Cxw4Sy2X.js → regexp-Bwbv2WPD.js} +1 -1
  55. package/apps/web/dist/assets/{rst-BdEa7eTr.js → rst-Cul2jxkE.js} +1 -1
  56. package/apps/web/dist/assets/{ruby-CrX6uYJq.js → ruby-TMvLq4yj.js} +1 -1
  57. package/apps/web/dist/assets/{sas-Dq1DiCgf.js → sas-D8HC__R6.js} +1 -1
  58. package/apps/web/dist/assets/{scss-Cq-_Yezx.js → scss-dK6Y8mdp.js} +1 -1
  59. package/apps/web/dist/assets/{shellscript-N1TdW_Vo.js → shellscript-BrObD5cd.js} +1 -1
  60. package/apps/web/dist/assets/{shellsession-DGy-5gMa.js → shellsession-gwVDz4P8.js} +1 -1
  61. package/apps/web/dist/assets/{soy-BZmv_HHk.js → soy-BF1mzKmn.js} +1 -1
  62. package/apps/web/dist/assets/{sql-B0TfXN6P.js → sql-rY-oq1Hg.js} +1 -1
  63. package/apps/web/dist/assets/{stata-D0cL92SE.js → stata-DBh-WI4L.js} +1 -1
  64. package/apps/web/dist/assets/{surrealql-B9RWrsWf.js → surrealql-DxG1DYQM.js} +1 -1
  65. package/apps/web/dist/assets/{svelte-Erfh9F_0.js → svelte-IUUmpoTZ.js} +1 -1
  66. package/apps/web/dist/assets/{templ-C1hdk1C3.js → templ-DSD9ChjE.js} +1 -1
  67. package/apps/web/dist/assets/{tex-B6y5Z0Oe.js → tex-ClrklzW1.js} +1 -1
  68. package/apps/web/dist/assets/{ts-tags-B8Q3bBJx.js → ts-tags-CiWqjPoE.js} +1 -1
  69. package/apps/web/dist/assets/{tsx-CA2zlxVX.js → tsx-BVdH_4RP.js} +1 -1
  70. package/apps/web/dist/assets/{twig-xr1-p8qn.js → twig-bBlRyqC3.js} +1 -1
  71. package/apps/web/dist/assets/{typescript-Bdd7ljtG.js → typescript-BWvsrxJs.js} +1 -1
  72. package/apps/web/dist/assets/{typst-BGU6c2s1.js → typst-CoUU-sfH.js} +1 -1
  73. package/apps/web/dist/assets/{vue-CxnbGcMK.js → vue-0_DBul4P.js} +1 -1
  74. package/apps/web/dist/assets/{vue-html-D3pkBH4b.js → vue-html-feH37mKg.js} +1 -1
  75. package/apps/web/dist/assets/{vue-vine-0adNns8e.js → vue-vine-xWSVrEzZ.js} +1 -1
  76. package/apps/web/dist/assets/{xml-Bf5yulh9.js → xml-RE-6RA5e.js} +1 -1
  77. package/apps/web/dist/assets/{xsl-DnGCH2C6.js → xsl-DzQQ-zeR.js} +1 -1
  78. package/apps/web/dist/assets/{yaml-ALFPjwWA.js → yaml-BfSzomC9.js} +1 -1
  79. package/apps/web/dist/index.html +1 -1
  80. package/apps/web/dist/sw.js +1 -1
  81. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CtL9u31h.js","assets/html-D9EhGmAq.js","assets/javascript-Di7CdqTh.js","assets/css-CqQV9eEE.js","assets/angular-ts-D4IFBcAh.js","assets/scss-Cq-_Yezx.js","assets/apl-CqnJhScR.js","assets/xml-Bf5yulh9.js","assets/java-2iLSH1xc.js","assets/json-D7Dp9EFU.js","assets/astro-Dn1_avL_.js","assets/typescript-Bdd7ljtG.js","assets/postcss-BXeXVLqQ.js","assets/tsx-CA2zlxVX.js","assets/blade-BKSa6Bs3.js","assets/html-derivative-Cs1eIi3k.js","assets/sql-B0TfXN6P.js","assets/bsl-_VjlB9mv.js","assets/sdbl-bTVj8UrX.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/chapel-BWxXvR2-.js","assets/c-C8sbMt_8.js","assets/cobol-DNoVp--S.js","assets/coffee-m1P3e2U1.js","assets/cpp-CDvshXRJ.js","assets/regexp-Cxw4Sy2X.js","assets/glsl-6ltM2JGZ.js","assets/crystal-C4b65AQe.js","assets/shellscript-N1TdW_Vo.js","assets/edge-CEdbZQ1U.js","assets/elixir-CYDX6OgA.js","assets/elm-10RuU89D.js","assets/erb-BiMfBUaM.js","assets/ruby-CrX6uYJq.js","assets/haml-Bsfivw5f.js","assets/graphql-DwyBbitO.js","assets/jsx-WEelr3xJ.js","assets/lua-BSLGBVbN.js","assets/yaml-ALFPjwWA.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-xMC7jr7x.js","assets/gdshader-CBce3t8t.js","assets/gdscript-DYvRD3hg.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-D4Se-3SO.js","assets/glimmer-js-sKOVTqrH.js","assets/glimmer-ts-DWMGXcHA.js","assets/hack-DKDbxv34.js","assets/handlebars-B3HW0h8N.js","assets/http-BG4vxnc2.js","assets/hurl-OIF0UEfX.js","assets/csv-Dx-8-gkx.js","assets/hxml-Dcm88srW.js","assets/haxe-C8oCnwJJ.js","assets/jinja-2mjIAN_z.js","assets/jison-Ciw1rqtP.js","assets/julia-DL3m48KZ.js","assets/r-D6AOSU_n.js","assets/just-B-5HaJEz.js","assets/perl-ChYkJruC.js","assets/latex-DKmfapvy.js","assets/tex-B6y5Z0Oe.js","assets/liquid-Bqxp18sH.js","assets/marko-yLzCBGNR.js","assets/less-DVTAwKKz.js","assets/mdc-DSGSIXIk.js","assets/nextflow-CSgcYZcx.js","assets/nextflow-groovy-D7IRt6Pp.js","assets/nginx-BF1hRuVH.js","assets/nim-kAH67IJv.js","assets/org-DCuW6Ito.js","assets/clojure-DqKBuwfJ.js","assets/csharp-dmMxLVLW.js","assets/dart-CHZY9Xhz.js","assets/docker-IyjqRm3v.js","assets/go-rLFTqkRN.js","assets/groovy-CacY0gHj.js","assets/ini-B5eOa1yu.js","assets/make-Dixweg8N.js","assets/objective-c-D1A_Heim.js","assets/ocaml-O90oeIOV.js","assets/php-Dy0o5CHL.js","assets/vb-DOwzaHZ0.js","assets/raku-B3gFvitq.js","assets/rust-DpiIf5JO.js","assets/scala-BiFt_7mu.js","assets/zig-CMLA9XwU.js","assets/xsl-DnGCH2C6.js","assets/pug-C-vFGcyR.js","assets/qml-Bbhsm3bz.js","assets/razor-CsDTm1QE.js","assets/rst-BdEa7eTr.js","assets/cmake-Bj61d0ZC.js","assets/sas-Dq1DiCgf.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-DGy-5gMa.js","assets/soy-BZmv_HHk.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-D0cL92SE.js","assets/surrealql-B9RWrsWf.js","assets/svelte-Erfh9F_0.js","assets/templ-C1hdk1C3.js","assets/ts-tags-B8Q3bBJx.js","assets/twig-xr1-p8qn.js","assets/typst-BGU6c2s1.js","assets/bat-qdxAdBWQ.js","assets/bibtex-Ci_nEsc7.js","assets/jsonc-CYpm1nAK.js","assets/log-BNLmms1o.js","assets/powershell-QtSnmXcu.js","assets/swift-CyEgAFGc.js","assets/system-verilog-Dh5ihWbf.js","assets/verilog-B2gwz-sJ.js","assets/vue-CxnbGcMK.js","assets/vue-html-D3pkBH4b.js","assets/vue-vine-0adNns8e.js","assets/stylus-B6D30XZt.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-6NaagU1P.js","assets/html-D1Ar4Xkj.js","assets/javascript-B1pleYoe.js","assets/css-BErHy7fN.js","assets/angular-ts-D8XutLPw.js","assets/scss-dK6Y8mdp.js","assets/apl-BKJEkz6Z.js","assets/xml-RE-6RA5e.js","assets/java-CjDcLNWV.js","assets/json-CwL6i1-C.js","assets/astro-DkrGLOry.js","assets/typescript-BWvsrxJs.js","assets/postcss-BXeXVLqQ.js","assets/tsx-BVdH_4RP.js","assets/blade-BIc0yPkX.js","assets/html-derivative-CwhughXj.js","assets/sql-rY-oq1Hg.js","assets/bsl-_VjlB9mv.js","assets/sdbl-bTVj8UrX.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/chapel-COXTL8xW.js","assets/c-Ds8U4gsq.js","assets/cobol-D0VSGQqK.js","assets/coffee-DBrey7sA.js","assets/cpp-SKUDYlNR.js","assets/regexp-Bwbv2WPD.js","assets/glsl-PGMqKJzL.js","assets/crystal-CoTn_b8r.js","assets/shellscript-BrObD5cd.js","assets/edge-CACFpVrz.js","assets/elixir-aPcGiByD.js","assets/elm-DN5FfPkL.js","assets/erb-Dj675b5b.js","assets/ruby-TMvLq4yj.js","assets/haml-CiYnV6_a.js","assets/graphql-3IK2PC2Y.js","assets/jsx-DmOLIUT0.js","assets/lua-94ufuXur.js","assets/yaml-BfSzomC9.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-xMC7jr7x.js","assets/gdshader-CBce3t8t.js","assets/gdscript-DYvRD3hg.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-DepNW1h5.js","assets/glimmer-js-fCJatm6u.js","assets/glimmer-ts-YwpKoyPh.js","assets/hack-C8CJl4zQ.js","assets/handlebars-C4m4mY7m.js","assets/http-pzvpiwNw.js","assets/hurl-hkZwo5Ou.js","assets/csv-Dx-8-gkx.js","assets/hxml-Dcm88srW.js","assets/haxe-C8oCnwJJ.js","assets/jinja-erX4wFzj.js","assets/jison-CajpWJAS.js","assets/julia-DK5bpj3S.js","assets/r-CFy73Kus.js","assets/just-BtwHGit4.js","assets/perl-BEwyXv2a.js","assets/latex-Dnf1mLFf.js","assets/tex-ClrklzW1.js","assets/liquid-Bv72E2Is.js","assets/marko-BKL0CGzx.js","assets/less-DVTAwKKz.js","assets/mdc-DNhqDQoU.js","assets/nextflow-CSgcYZcx.js","assets/nextflow-groovy-D7IRt6Pp.js","assets/nginx-BcYwGlC2.js","assets/nim-CRMgcK-K.js","assets/org-DfnsnSld.js","assets/clojure-DqKBuwfJ.js","assets/csharp-dmMxLVLW.js","assets/dart-CHZY9Xhz.js","assets/docker-IyjqRm3v.js","assets/go-rLFTqkRN.js","assets/groovy-CacY0gHj.js","assets/ini-B5eOa1yu.js","assets/make-Dixweg8N.js","assets/objective-c-D1A_Heim.js","assets/ocaml-O90oeIOV.js","assets/php-CG9qDJ82.js","assets/vb-DOwzaHZ0.js","assets/raku-B3gFvitq.js","assets/rust-DpiIf5JO.js","assets/scala-BiFt_7mu.js","assets/zig-CMLA9XwU.js","assets/xsl-DzQQ-zeR.js","assets/pug-Dg3kkpP7.js","assets/qml-Vs1TgYWl.js","assets/razor-Dcng6YrP.js","assets/rst-Cul2jxkE.js","assets/cmake-Bj61d0ZC.js","assets/sas-D8HC__R6.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-gwVDz4P8.js","assets/soy-BF1mzKmn.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-DBh-WI4L.js","assets/surrealql-DxG1DYQM.js","assets/svelte-IUUmpoTZ.js","assets/templ-DSD9ChjE.js","assets/ts-tags-CiWqjPoE.js","assets/twig-bBlRyqC3.js","assets/typst-CoUU-sfH.js","assets/bat-qdxAdBWQ.js","assets/bibtex-Ci_nEsc7.js","assets/jsonc-CYpm1nAK.js","assets/log-BNLmms1o.js","assets/powershell-QtSnmXcu.js","assets/swift-CyEgAFGc.js","assets/system-verilog-Dh5ihWbf.js","assets/verilog-B2gwz-sJ.js","assets/vue-0_DBul4P.js","assets/vue-html-feH37mKg.js","assets/vue-vine-xWSVrEzZ.js","assets/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 w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(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 re(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,re(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),re(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+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+te(a,u),c+=re(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+te(a,u++),c+=re(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return re(ne(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 ie(e,t,n){if(e==null)return e;var r=[],i=0;return re(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function j(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 ae=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 oe(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ae)}catch(e){ae(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function se(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else oe(se.bind(null,e))}var ce={map:ie,forEach:function(e,t,n){ie(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ie(e,function(){t++}),t},toArray:function(e){return ie(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ce,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=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=se,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)!E.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 D(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)E.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 D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:j}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=oe,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.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,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),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 w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(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 E(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 D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),ee=Symbol.for(`react.fragment`),te=Symbol.for(`react.strict_mode`),ne=Symbol.for(`react.profiler`),re=Symbol.for(`react.consumer`),ie=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),ae=Symbol.for(`react.suspense`),oe=Symbol.for(`react.suspense_list`),se=Symbol.for(`react.memo`),ce=Symbol.for(`react.lazy`),le=Symbol.for(`react.activity`),ue=Symbol.for(`react.legacy_hidden`),de=Symbol.for(`react.memo_cache_sentinel`),M=Symbol.for(`react.view_transition`),fe=Symbol.for(`react.recoverable`),pe=Symbol.iterator;function me(e){return typeof e!=`object`||!e?null:(e=pe&&e[pe]||e[`@@iterator`],typeof e==`function`?e:null)}var he=Symbol.for(`react.client.reference`);function ge(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ee:return`Fragment`;case ne:return`Profiler`;case te:return`StrictMode`;case ae:return`Suspense`;case oe:return`SuspenseList`;case le:return`Activity`;case M:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case ie:return e.displayName||`Context`;case re:return(e._context.displayName||`Context`)+`.Consumer`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case se:return t=e.displayName||null,t===null?ge(e.type)||`Memo`:t;case ce:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}var _e=Array.isArray,ve=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},xe=[],Se=-1;function Ce(e){return{current:e}}function we(e){0>Se||(e.current=xe[Se],xe[Se]=null,Se--)}function Te(e,t){Se++,xe[Se]=e.current,e.current=t}var Ee=Ce(null),De=Ce(null),Oe=Ce(null),ke=Ce(null);function Ae(e,t){switch(Te(Oe,t),Te(De,e),Te(Ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wp(t),e=Tp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}we(Ee),Te(Ee,e)}function je(){we(Ee),we(De),we(Oe)}function Me(e){var t=e.memoizedState;t!==null&&(yh._currentValue=t.memoizedState,Te(ke,e)),t=Ee.current;var n=Tp(t,e.type);t!==n&&(Te(De,e),Te(Ee,n))}function Ne(e){De.current===e&&(we(Ee),we(De)),ke.current===e&&(we(ke),yh._currentValue=be)}var Pe,Fe;function Ie(e){if(Pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Pe=t&&t[1]||``,Fe=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+Pe+e+Fe}var Le=!1;function Re(e,t){if(!e||Le)return``;Le=!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(`
@@ -62,7 +62,7 @@ Error generating stack: `+e.message+`
62
62
 
63
63
  `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=lr,c=!si.jitless,l=c&&ur.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Vo([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Wo(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ar(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Ir(e,r,ci())))}),t)}var Go=I(`$ZodUnion`,(e,t)=>{Ra.init(e,t),Zr(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Zr(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Zr(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Zr(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Xn(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Wo(t,r,e,i)):Wo(o,r,e,i)}}),Ko=I(`$ZodIntersection`,(e,t)=>{Ra.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Jo(e,t,n)):Jo(e,i,a)}});function qo(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(dr(e)&&dr(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=qo(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=qo(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Jo(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=qo(t.value,n.value);if(!c.valid){if(Ar(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Yo=I(`$ZodEnum`,(e,t)=>{Ra.init(e,t);let n=Wn(t.entries),r=new Set(n);e._zod.values=r,Zr(e,`pattern`,e=>{let t=Wn(e.def.entries).filter(e=>pr.has(typeof e));return RegExp(t.length?`^(${t.map(e=>mr(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Xo=I(`$ZodTransform`,(e,t)=>{Ra.init(e,t),e._zod.optin=`optional`,si.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new oi(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ai;return n.value=i,n}});function Zo(e,t){return e.value=t.issues.length?void 0:t.value,e}var Qo=I(`$ZodOptional`,(e,t)=>{Ra.init(e,t),Zr(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Zr(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Zr(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Xn(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Zo(e,t)):Zo(e,r)}return t.innerType._zod.run(e,n)}}),$o=I(`$ZodExactOptional`,(e,t)=>{Qo.init(e,t),Zr(e,`values`,e=>e.def.innerType._zod.values),Zr(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),es=I(`$ZodNullable`,(e,t)=>{Ra.init(e,t),Zr(e,`optin`,e=>e.def.innerType._zod.optin),Zr(e,`optout`,e=>e.def.innerType._zod.optout),Zr(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Xn(t.source)}|null)$`):void 0}),Zr(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),ts=I(`$ZodDefault`,(e,t)=>{Ra.init(e,t),e._zod.optin=`defaulted`,Zr(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ns(e,t)):ns(r,t)}});function ns(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var rs=I(`$ZodPrefault`,(e,t)=>{Ra.init(e,t),e._zod.optin=`defaulted`,Zr(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),is=I(`$ZodNonOptional`,(e,t)=>{Ra.init(e,t),Zr(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>as(t,e)):as(i,e)}});function as(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function os(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Ir(e,r,ci()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ss=I(`$ZodCatch`,(e,t)=>{Ra.init(e,t),Zr(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Zr(e,`optout`,e=>e.def.innerType._zod.optout),Zr(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>os(e,r,t,n)):os(e,r,t,n)}}),cs=I(`$ZodPipe`,(e,t)=>{Ra.init(e,t),Zr(e,`values`,e=>e.def.in._zod.values),Zr(e,`optin`,e=>e.def.in._zod.optin),Zr(e,`optout`,e=>e.def.out._zod.optout),Zr(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ls(e,t.in,n)):ls(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ls(e,t.out,n)):ls(r,t.out,n)}});function ls(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var us=I(`$ZodReadonly`,(e,t)=>{Ra.init(e,t),Zr(e,`propValues`,e=>e.def.innerType._zod.propValues),Zr(e,`values`,e=>e.def.innerType._zod.values),Zr(e,`optin`,e=>e.def.innerType?._zod?.optin),Zr(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ds):ds(r)}});function ds(e){return e.memo||(e.value=Object.freeze(e.value)),e}var fs=I(`$ZodCustom`,(e,t)=>{va.init(e,t),Ra.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>ps(t,n,r,e));ps(i,n,r,e)}});function ps(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Vr(e))}}var ms=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},hs=`~memo`,gs=[];function _s(e){return typeof e==`object`&&!!e}function vs(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var ys=new WeakMap,bs=0,xs=1,Ss=2;function Cs(e,t,n){let r=ys.get(e);if(r!==void 0)return r?Ss:bs;if(t.has(e))return Ss;t.add(e);let i=bs,a=e=>{if(i!==Ss&&e?._zod){let r=Cs(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=bs;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?xs:o.value?._zod?Cs(o.value,t,n):bs;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=$n(c);s(e?o(e,!0):xs),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Cs(r,t,!1):xs);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),ws(e,i)}function ws(e,t){return t!==xs&&ys.set(e,t===Ss),t}function Ts(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Es,Ds=[],Os={alloc(e,t,n){let r=Es;if(!r)return n;Es=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ds.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&As(n,e.value))throw new ms;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Cs(e,new Set,!1);if(i===bs)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Ss||r?n=!0:r=!0}let l=s.value;if(!_s(l))return t(s,c);let u=c[hs];u||(u={buckets:new WeakMap,backEdges:void 0},c[hs]=u);let d;i===c?d=a:(d=Ts(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...vs(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Es=d;let p=Ds.length,m=t(s,c);Es=void 0;let h=Ds.length>p?Ds.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?vs(e.issues):gs),e)):(h&&(h.issues=m.issues.length?vs(m.issues):gs),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ks(){return Os}function As(e,t){let n=e[hs]?.backEdges;return n!==void 0&&_s(t)&&n.has(t)}var js=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Br(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${_r(e.values[0])}`:`Invalid option: expected one of ${Gn(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Gn(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Ms(){return{localeError:js()}}var Ns,Ps=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Fs(){return new Ps}(Ns=globalThis).__zod_globalRegistry??(Ns.__zod_globalRegistry=Fs());var Is=globalThis.__zod_globalRegistry;function Ls(e){return e.checks&&=[...e.checks],e}function Rs(e,t){return new e(Ls({type:`string`,...gr(t)}))}function zs(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...gr(t)})}function Bs(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...gr(t)})}function Vs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...gr(t)})}function Hs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...gr(t)})}function Us(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...gr(t)})}function Ws(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...gr(t)})}function Gs(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...gr(t)})}function Ks(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...gr(t)})}function qs(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...gr(t)})}function Js(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...gr(t)})}function Ys(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...gr(t)})}function Xs(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...gr(t)})}function Zs(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...gr(t)})}function Qs(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...gr(t)})}function $s(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...gr(t)})}function ec(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...gr(t)})}function tc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...gr(t)})}function nc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...gr(t)})}function rc(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...gr(t)})}function ic(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...gr(t)})}function ac(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...gr(t)})}function oc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...gr(t)})}function sc(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...gr(t)})}function cc(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...gr(t)})}function lc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...gr(t)})}function uc(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...gr(t)})}function dc(e,t){return new e(Ls({type:`number`,checks:[],...gr(t)}))}function fc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...gr(t)})}function pc(e,t){return new e({type:`boolean`,...gr(t)})}function mc(e){return new e({type:`unknown`})}function hc(e,t){return new e({type:`never`,...gr(t)})}function gc(e,t){return new xa({check:`less_than`,...gr(t),value:e,inclusive:!1})}function _c(e,t){return new xa({check:`less_than`,...gr(t),value:e,inclusive:!0})}function vc(e,t){return new Sa({check:`greater_than`,...gr(t),value:e,inclusive:!1})}function yc(e,t){return new Sa({check:`greater_than`,...gr(t),value:e,inclusive:!0})}function bc(e,t){return new Ca({check:`multiple_of`,...gr(t),value:e})}function xc(e,t){return new Ta({check:`max_length`,...gr(t),maximum:e})}function Sc(e,t){return new Ea({check:`min_length`,...gr(t),minimum:e})}function Cc(e,t){return new Da({check:`length_equals`,...gr(t),length:e})}function wc(e,t){return new ka({check:`string_format`,format:`regex`,...gr(t),pattern:e})}function Tc(e){return new Aa({check:`string_format`,format:`lowercase`,...gr(e)})}function Ec(e){return new ja({check:`string_format`,format:`uppercase`,...gr(e)})}function Dc(e,t){return new Ma({check:`string_format`,format:`includes`,...gr(t),includes:e})}function Oc(e,t){return new Na({check:`string_format`,format:`starts_with`,...gr(t),prefix:e})}function kc(e,t){return new Pa({check:`string_format`,format:`ends_with`,...gr(t),suffix:e})}function Ac(e){return new Fa({check:`overwrite`,tx:e})}function jc(e){return Ac(t=>t.normalize(e))}function Mc(){return Ac(e=>e.trim())}function Nc(){return Ac(e=>e.toLowerCase())}function Pc(){return Ac(e=>e.toUpperCase())}function Fc(){return Ac(e=>sr(e))}function Ic(e,t,n){return new e({type:`array`,element:t,...gr(n)})}function Lc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...gr(n)})}function Rc(e,t){let n=zc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Vr(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Vr(r))}},e(t.value,t)),t);return n}function zc(e,t){let n=new va({check:`custom`,...gr(t)});return n._zod.check=e,n}function Bc(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Qn(e,t,n[t]);return e}function Vc(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Is,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Hc(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Uc(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Uc(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Bc(o.schema,c),t.io===`input`&&$c(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Wc(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Gc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Wc(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Wc(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
64
64
 
65
- 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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Kc(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;Kc(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 qc=new Set([`type`,`properties`,`required`,`additionalProperties`]),Jc=[`oneOf`,`anyOf`];function Yc(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Xc(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!qc.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]??Yc(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Qn(n,r,e.length===1?e[0]:Xc(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=Yc(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 Zc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of qc)if(t in e)return;let n=t.filter(e=>Jc.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Xc(t);else{let e=n[0],i=Jc.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=>Xc([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Bc(e,r))}function Qc(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)):Bc(i,s),Bc(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())Kc(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)??[])Zc(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)}Bc(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,Qn(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:tl(t,`input`,e.processors),output:tl(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function $c(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 $c(r.element,n);if(r.type===`set`)return $c(r.valueType,n);if(r.type===`lazy`)return $c(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 $c(r.innerType,n);if(r.type===`intersection`)return $c(r.left,n)||$c(r.right,n);if(r.type===`record`||r.type===`map`)return $c(r.keyType,n)||$c(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:$c(r.in,n)||$c(r.out,n);if(r.type===`object`){for(let e in r.shape)if($c(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if($c(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if($c(e,n))return!0;return!!(r.rest&&$c(r.rest,n))}return!1}var el=(e,t={})=>n=>{let r=Vc({...n,processors:t});return Uc(e,r),Gc(r,e),Qc(r,e)},tl=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Vc({...i??{},target:a,io:t,processors:n});return Uc(e,o),Gc(o,e),Qc(o,e)},nl=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},rl=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},il=(e,t)=>{nl(e,`minimum`,t),rl(e,`maximum`,t)},al=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ol=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},sl=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},cl=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ll=(e,t)=>nl(e,`minimum`,t.minimum),ul=(e,t)=>rl(e,`maximum`,t.maximum),dl=e=>(t,n)=>{cl(t,n.format);let[r,i]=e[n.format];nl(t,`minimum`,r),rl(t,`maximum`,i)},fl={greater_than:(e,t)=>nl(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>rl(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>al(e,t.value),number_format:dl(yr),bigint_format:dl(br),min_length:ll,max_length:ul,length_equals:(e,t)=>il(e,t.length),min_size:ll,max_size:ul,size_equals:(e,t)=>il(e,t.size),string_format:(e,t)=>{cl(e,t.format),t.pattern&&ol(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)=>sl(e,t.mime)};function pl(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)fl[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&nl(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&nl(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&rl(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&rl(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&al(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&sl(t,i.mime);for(let e of i.patterns??[])ol(t,e);return t}var ml={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},hl=new Map([[xo,ra],[Co,ia]]),gl=e=>hl.get(e)??e,_l=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=pl(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ml[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(gl);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}))])}},vl=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=pl(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)):Hc(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}))])}},yl=(e,t,n,r)=>{n.type=`boolean`},bl=(e,t,n,r)=>{n.not={}},xl=(e,t,n,r)=>{let i=e._zod.def,a=Wn(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Sl=(e,t,n,r)=>{Hc(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Cl=(e,t,n,r)=>{Hc(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},wl=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=pl(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Uc(a.element,t,{...r,path:[...r.path,`items`]})};function Tl(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Tl(t.out):t.type===`catch`?Tl(t.innerType):e._zod.optin}var El=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Hc(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Qn(i.properties,e,Uc(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`?Tl(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=Uc(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Dl=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Uc(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ol=(e,t,n,r)=>{let i=e._zod.def,a=Uc(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Uc(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)},kl=(e,t,n,r)=>{let i=e._zod.def,a=Uc(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`}]},Al=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},jl=Symbol();function Ml(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Hc(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),jl):JSON.parse(o)}var Nl=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Ml(i.defaultValue,e,t,n,r);o!==jl&&(n.default=o)},Pl=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Ml(i.defaultValue,e,t,n,r);o!==jl&&(n._prefault=o)},Fl=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Hc(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Il=(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;Uc(o,t,r);let s=t.seen.get(e);s.ref=o},Ll=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Rl=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zl=new WeakSet([Object.prototype,Error.prototype]);function Bl(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 Vl=I(`ZodError`,(e,t)=>{hi.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);zl.has(n)||(zl.add(n),Bl(n,`format`,e=>t=>vi(e,t)),Bl(n,`flatten`,e=>t=>_i(e,t)),Bl(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Kn,2)}),Bl(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Kn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Hl=Si(Vl),Ul=Ci(Vl),Wl=wi(Vl),Gl=Ei(Vl),Kl=Mi(Vl),ql=Ni(Vl),Jl=Pi(Vl),Yl=Fi(Vl),Xl=Ii(Vl),Zl=Li(Vl),Ql=Ri(Vl),$l=zi(Vl);function eu(){si.localeError||ci(Ms())}function tu(){si.memoizer||ci({memoizer:ks()})}var nu=I(`ZodType`,(e,t)=>(eu(),Ra.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ar(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 hr(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_d(e,t))},superRefine(e,t){return this.check(vd(e,t))},overwrite(e){return this.check(Ac(e))},optional(){return $u(this)},exactOptional(){return td(this)},nullable(){return rd(this)},nullish(){return $u(rd(this))},nonoptional(e){return ld(this,e)},array(){return Vu(this)},or(e){return Gu([this,e])},and(e){return qu(this,e)},transform(e){return pd(this,Zu(e))},default(e){return ad(this,e)},prefault(e){return sd(this,e)},catch(e){return dd(this,e)},pipe(e){return pd(this,e)},readonly(){return hd(this)},describe(e){let t=this.clone();return Is.add(t,{description:e}),t},meta(...e){if(e.length===0)return Is.get(this);let t=this.clone();return Is.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 Wr(this,`~standard`,{...Va(this),jsonSchema:{input:tl(this,`input`),output:tl(this,`output`)}})},set"~standard"(e){Ur(this,`~standard`,e)},parse:function e(t,n){return Hl(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Ul(this,t,n,{callee:e})},safeParse(e,t){return Wl(this,e,t)},async safeParseAsync(e,t){return Gl(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ur(this,`spa`,e)},validate(e,t){return ki(this,e,t)},validateAsync(e,t){return ji(this,e,t)},encode:function e(t,n){return Kl(this,t,n,{callee:e})},decode:function e(t,n){return ql(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Jl(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Yl(this,t,n,{callee:e})},safeEncode(e,t){return Xl(this,e,t)},safeDecode(e,t){return Zl(this,e,t)},async safeEncodeAsync(e,t){return Ql(this,e,t)},async safeDecodeAsync(e,t){return $l(this,e,t)},toJSONSchema(e){return el(this,{})(e)},get description(){return Is.get(this)?.description},get _def(){return this._zod.def}}),ru=I(`_ZodString`,(e,t)=>{Ha.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_l(e,t,n,r)},Gr({format:e=>pl(e).format??null,minLength:e=>pl(e).minimum??null,maxLength:e=>pl(e).maximum??null},{regex(...e){return this.check(wc(...e))},includes(...e){return this.check(Dc(...e))},startsWith(...e){return this.check(Oc(...e))},endsWith(...e){return this.check(kc(...e))},min(...e){return this.check(Sc(...e))},max(...e){return this.check(xc(...e))},length(...e){return this.check(Cc(...e))},nonempty(...e){return this.check(Sc(1,...e))},lowercase(e){return this.check(Tc(e))},uppercase(e){return this.check(Ec(e))},trim(){return this.check(Mc())},normalize(...e){return this.check(jc(...e))},toLowerCase(){return this.check(Nc())},toUpperCase(){return this.check(Pc())},slugify(){return this.check(Fc())}})),iu=I(`ZodString`,(e,t)=>{Ha.init(e,t),ru.init(e,t)},{email(e){return this.check(zs(du,e))},url(e){return this.check(Gs(mu,e))},jwt(e){return this.check(oc(ku,e))},emoji(e){return this.check(Ks(hu,e))},guid(e){return this.check(Bs(fu,e))},uuid(e){return this.check(Vs(pu,e))},uuidv4(e){return this.check(Hs(pu,e))},uuidv6(e){return this.check(Us(pu,e))},uuidv7(e){return this.check(Ws(pu,e))},nanoid(e){return this.check(qs(gu,e))},cuid(e){return this.check(Js(_u,e))},cuid2(e){return this.check(Ys(vu,e))},ulid(e){return this.check(Xs(yu,e))},base64(e){return this.check(rc(Eu,e))},base64url(e){return this.check(ic(Du,e))},xid(e){return this.check(Zs(bu,e))},ksuid(e){return this.check(Qs(xu,e))},ipv4(e){return this.check($s(Su,e))},ipv6(e){return this.check(ec(Cu,e))},cidrv4(e){return this.check(tc(wu,e))},cidrv6(e){return this.check(nc(Tu,e))},e164(e){return this.check(ac(Ou,e))},datetime(e){return this.check(sc(su,e))},date(e){return this.check(cc(cu,e))},time(e){return this.check(lc(lu,e))},duration(e){return this.check(uc(uu,e))}});function au(e){return Rs(iu,e)}var ou=I(`ZodStringFormat`,(e,t)=>{Ua.init(e,t),ru.init(e,t)}),su=I(`ZodISODateTime`,(e,t)=>{co.init(e,t),ou.init(e,t)}),cu=I(`ZodISODate`,(e,t)=>{lo.init(e,t),ou.init(e,t)}),lu=I(`ZodISOTime`,(e,t)=>{uo.init(e,t),ou.init(e,t)}),uu=I(`ZodISODuration`,(e,t)=>{fo.init(e,t),ou.init(e,t)}),du=I(`ZodEmail`,(e,t)=>{Ka.init(e,t),ou.init(e,t)}),fu=I(`ZodGUID`,(e,t)=>{Wa.init(e,t),ou.init(e,t)}),pu=I(`ZodUUID`,(e,t)=>{Ga.init(e,t),ou.init(e,t)}),mu=I(`ZodURL`,(e,t)=>{eo.init(e,t),ou.init(e,t)}),hu=I(`ZodEmoji`,(e,t)=>{to.init(e,t),ou.init(e,t)}),gu=I(`ZodNanoID`,(e,t)=>{no.init(e,t),ou.init(e,t)}),_u=I(`ZodCUID`,(e,t)=>{ro.init(e,t),ou.init(e,t)}),vu=I(`ZodCUID2`,(e,t)=>{io.init(e,t),ou.init(e,t)}),yu=I(`ZodULID`,(e,t)=>{ao.init(e,t),ou.init(e,t)}),bu=I(`ZodXID`,(e,t)=>{oo.init(e,t),ou.init(e,t)}),xu=I(`ZodKSUID`,(e,t)=>{so.init(e,t),ou.init(e,t)}),Su=I(`ZodIPv4`,(e,t)=>{po.init(e,t),ou.init(e,t)}),Cu=I(`ZodIPv6`,(e,t)=>{go.init(e,t),ou.init(e,t)}),wu=I(`ZodCIDRv4`,(e,t)=>{_o.init(e,t),ou.init(e,t)}),Tu=I(`ZodCIDRv6`,(e,t)=>{yo.init(e,t),ou.init(e,t)}),Eu=I(`ZodBase64`,(e,t)=>{So.init(e,t),ou.init(e,t)}),Du=I(`ZodBase64URL`,(e,t)=>{To.init(e,t),ou.init(e,t)}),Ou=I(`ZodE164`,(e,t)=>{Eo.init(e,t),ou.init(e,t)}),ku=I(`ZodJWT`,(e,t)=>{Oo.init(e,t),ou.init(e,t)}),Au=I(`ZodNumber`,(e,t)=>{ko.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vl(e,t,n,r),e.isFinite=!0},Gr({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=pl(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=pl(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=pl(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>pl(e).format??null},{gt(e,t){return this.check(vc(e,t))},gte(e,t){return this.check(yc(e,t))},min(e,t){return this.check(yc(e,t))},lt(e,t){return this.check(gc(e,t))},lte(e,t){return this.check(_c(e,t))},max(e,t){return this.check(_c(e,t))},int(e){return this.check(Nu(e))},safe(e){return this.check(Nu(e))},positive(e){return this.check(vc(0,e))},nonnegative(e){return this.check(yc(0,e))},negative(e){return this.check(gc(0,e))},nonpositive(e){return this.check(_c(0,e))},multipleOf(e,t){return this.check(bc(e,t))},step(e,t){return this.check(bc(e,t))},finite(){return this}}));function ju(e){return dc(Au,e)}var Mu=I(`ZodNumberFormat`,(e,t)=>{Ao.init(e,t),Au.init(e,t)});function Nu(e){return fc(Mu,e)}var Pu=I(`ZodBoolean`,(e,t)=>{jo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yl(e,t,n,r)});function Fu(e){return pc(Pu,e)}var Iu=I(`ZodUnknown`,(e,t)=>{Mo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Lu(){return mc(Iu)}var Ru=I(`ZodNever`,(e,t)=>{No.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bl(e,t,n,r)});function zu(e){return hc(Ru,e)}var Bu=I(`ZodArray`,(e,t)=>{tu(),Lo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wl(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Sc(e,t))},nonempty(e){return this.check(Sc(1,e))},max(e,t){return this.check(xc(e,t))},length(e,t){return this.check(Cc(e,t))},unwrap(){return this.element}});function Vu(e,t){return Ic(Bu,e,t)}var Hu=I(`ZodObject`,(e,t)=>{tu(),Uo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>El(e,t,n,r),Qr(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Yu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ar(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ar(this._zod.def,{catchall:Lu()}))},loose(){return this.clone(ar(this._zod.def,{catchall:Lu()}))},strict(){return this.clone(ar(this._zod.def,{catchall:zu()}))},strip(){return this.clone(ar(this._zod.def,{catchall:void 0}))},extend(e){return wr(this,e)},safeExtend(e){return Er(this,e)},merge(e){return Dr(this,e)},pick(e){return xr(this,e)},omit(e){return Cr(this,e)},partial(...e){return Or(Qu,this,e[0])},exactPartial(...e){return Or(ed,this,e[0],`exactPartial`)},required(...e){return kr(cd,this,e[0])}});function Uu(e,t){return new Hu({type:`object`,shape:e,catchall:zu(),...gr(t)})}var Wu=I(`ZodUnion`,(e,t)=>{Go.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dl(e,t,n,r),e.options=t.options});function Gu(e,t){return new Wu({type:`union`,options:e,...gr(t)})}var Ku=I(`ZodIntersection`,(e,t)=>{Ko.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ol(e,t,n,r)});function qu(e,t){return new Ku({type:`intersection`,left:e,right:t})}var Ju=I(`ZodEnum`,(e,t)=>{Yo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xl(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 Ju({...t,checks:[],...gr(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 Ju({...t,checks:[],...gr(r),entries:i})}});function Yu(e,t){return new Ju({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...gr(t)})}var Xu=I(`ZodTransform`,(e,t)=>{tu(),Xo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cl(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new oi(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Vr(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(Vr(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Zu(e){return new Xu({type:`transform`,transform:e})}var Qu=I(`ZodOptional`,(e,t)=>{Qo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $u(e){return new Qu({type:`optional`,innerType:e})}var ed=I(`ZodExactOptional`,(e,t)=>{$o.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function td(e){return new ed({type:`optional`,innerType:e})}var nd=I(`ZodNullable`,(e,t)=>{es.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rd(e){return new nd({type:`nullable`,innerType:e})}var id=I(`ZodDefault`,(e,t)=>{ts.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ad(e,t){return new id({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():fr(t)}})}var od=I(`ZodPrefault`,(e,t)=>{rs.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sd(e,t){return new od({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():fr(t)}})}var cd=I(`ZodNonOptional`,(e,t)=>{is.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Al(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ld(e,t){return new cd({type:`nonoptional`,innerType:e,...gr(t)})}var ud=I(`ZodCatch`,(e,t)=>{ss.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dd(e,t){return new ud({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ei(t)})}var fd=I(`ZodPipe`,(e,t)=>{cs.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Il(e,t,n,r),e.in=t.in,e.out=t.out});function pd(e,t){return new fd({type:`pipe`,in:e,out:t})}var md=I(`ZodReadonly`,(e,t)=>{us.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ll(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hd(e){return new md({type:`readonly`,innerType:e})}var gd=I(`ZodCustom`,(e,t)=>{fs.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sl(e,t,n,r)});function _d(e,t={}){return Lc(gd,e,t)}function vd(e,t){return Rc(e,t)}var yd=Uu({theme:au().refine(e=>Un.some(t=>t.id===e)).default(Un[0].id),terminal:Uu({font:Uu({family:au().default(`FiraCode Nerd Font`),size:ju().default(14),lineHeight:ju().default(1.35),ligatures:Fu().default(!0)}).prefault({}),cursor:Uu({style:Yu([`block`,`bar`,`underline`]).default(`bar`),blink:Fu().default(!0)}).prefault({}),padding:Uu({top:ju().default(4),right:ju().default(4),bottom:ju().default(0),left:ju().default(4)}).prefault({}),scrollback:ju().default(1e3),boldIsBright:Fu().default(!0),behavior:Uu({modernizeShiftEnter:Fu().default(!0),pasteBrowserImages:Fu().default(!0),captureShortcuts:Fu().default(!0),bellFlash:Fu().default(!0),bellSound:Fu().default(!0),clickToMoveCursor:Fu().default(!0),optionAsMeta:Yu([`off`,`left`,`right`,`both`]).default(`off`),confirmCloseBusyTab:Fu().default(!0)}).prefault({})}).prefault({}),diff:Uu({split:Fu().default(!1),wrap:Fu().default(!0)}).prefault({})}),bd=`prefs`,xd=yd.parse({});function Sd(){let e=localStorage.getItem(bd);if(e===null)return structuredClone(xd);let t=yd.safeParse(JSON.parse(e));return t.success?t.data:(console.warn(`invalid stored prefs, using the defaults:\n${bi(t.error)}`),structuredClone(xd))}function Cd(e){localStorage.setItem(bd,JSON.stringify(e))}function wd(){let e=L().prefs.theme,t=Un.find(t=>t.id===e);if(t===void 0)throw Error(`unknown theme ${e}`);return t}function Td(){let e=R(e=>e.prefs.theme),t=Un.find(t=>t.id===e);if(t===void 0)throw Error(`unknown theme ${e}`);return t.codeTheme}function Ed(){let e=wd(),t=document.documentElement.style;t.setProperty(`--bg`,e.background),t.setProperty(`--text`,e.foreground),t.setProperty(`--brand`,e.palette[4]),t.setProperty(`--danger`,e.palette[1]),t.setProperty(`--green`,e.palette[2]),t.setProperty(`--yellow`,e.palette[3]),document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,e.background)}var Dd={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`},Od;function kd(e){Od=Te()(()=>e)}function Ad(e){return Od.subscribe(e)}function L(){return Od.getState()}function R(e){return De(Od,e)}function z(e){Od.setState(e)}function jd(e,t){let n=e.machines.find(e=>e.id===t);if(n===void 0)throw Error(`unknown machine ${t}`);return n}function Md(e,t,n){return e.projects.find(e=>e.machine===t&&e.id===n)}function Nd(e){return e.selection?.machine??e.machines.at(0)?.id??null}function Pd(e,t){z({machines:L().machines.map(n=>n.id===e?{...n,...t}:n)})}function Fd(e,t,n){if(n!==null)return e.find(e=>e.id===t)?.activity[n]}function Id(e){let t=e.selection;if(t!==null)return Fd(e.machines,t.machine,t.sessionId)}function Ld(e){return Id(e)?.running===!0}function Rd(e){return Ze(e.machine,e.sessionId??e.projectId)}function zd(e){z({draft:e})}function Bd(e){z({paletteOpen:e})}function Vd(e){z({settingsOpen:e,paletteOpen:!1,...e&&{settingsMachine:Nd(L()),settingsAccount:null,settingsEditedMachine:null}})}function Hd(e){z({settingsOpen:!0,settingsPage:e,settingsAccount:null,settingsEditedMachine:null,paletteOpen:!1,...!L().settingsOpen&&{settingsMachine:Nd(L())}})}function Ud(e){z({prefs:e}),Cd(e),Ed()}function Wd(e){z({error:Vn(e)})}function Gd(){z({error:null})}function Kd(e){let t=new Map;function n(t,n){L().machines.some(e=>e.id===t)&&e.apply(t,n)}async function r(r,a){let o=await e.save(r,a),s=t.get(r);s!==void 0&&(--s.writes,!(s.writes>0)&&(o===null?await i(r):n(r,o)))}async function i(r){let i=t.get(r)?.version;try{let a=await e.load(r),o=t.get(r);o!==void 0&&o.writes===0&&o.version===i&&n(r,a)}catch(e){Wd(e)}}return{update(n,i){e.set(n,i);let a=t.get(n)??{writes:0,version:0,timer:void 0};t.set(n,a),a.timer===void 0&&(a.writes+=1),a.version+=1,window.clearTimeout(a.timer),a.timer=window.setTimeout(()=>{a.timer=void 0,r(n,i)},300)},receive(e,r){(t.get(e)?.writes??0)===0&&n(e,r)}}}var qd=Kd({set:(e,t)=>Pd(e,{config:t}),save:async(e,t)=>{try{let n=await M(e,`config.save`,t);return Pd(e,{configError:null}),n}catch(t){return Pd(e,{configError:Vn(t)}),null}},load:async e=>(await M(e,`config.get`,void 0)).config,apply:(e,t)=>Pd(e,{config:t})}),Jd=Kd({set:(e,t)=>Pd(e,{composer:t}),save:async(e,t)=>{try{return await M(e,`composer.save`,t)}catch(e){return Wd(e),null}},load:e=>M(e,`composer.get`,void 0),apply:$d}),Yd=qd.update,Xd=qd.receive,Zd=Jd.update,Qd=Jd.receive;function $d(e,t){Pd(e,{composer:t});let n=L().selection;if(n===null||n.machine!==e||Fd(L().machines,e,n.sessionId)!==void 0)return;let r=(n.sessionId===null?null:Ve(Rd(n)))??tf(t,n.sessionId===null?t.provider:L().settings.provider),i=r.provider!==L().settings.provider||r.accountId!==L().settings.accountId;z({settings:r}),i&&of()}var ef={provider:`claude`,accountId:null,model:null,effort:null,mode:null,plan:!1};function tf(e,t){return e===null?{...ef,provider:t}:{provider:t,...e[t]}}function nf(e){let t={...L().settings,...e};z({settings:t});let n=L().selection;if(n===null)return;n.sessionId!==null&&He(Rd(n),t);let r=jd(L(),n.machine).composer;r!==null&&Zd(n.machine,{...r,provider:t.provider,[t.provider]:{accountId:t.accountId,model:t.model,effort:t.effort,mode:t.mode,plan:t.plan}}),e.accountId!==void 0&&of(),n.sessionId!==null&&Fd(L().machines,n.machine,n.sessionId)!==void 0&&e.accountId===void 0&&M(n.machine,`sessions.configure`,{sessionId:n.sessionId,settings:t}).catch(Wd)}function rf(e,t){if(Pd(e,{claudeAccounts:t.claudeAccounts,codexAccounts:t.codexAccounts,openCode:t.openCode}),L().selection?.machine!==e)return;let n=L().settings,r=[...[...t.claudeAccounts,...t.codexAccounts].filter(e=>e.valid).map(e=>({provider:e.provider,accountId:e.id})),...t.openCode.available?[{provider:`opencode`,accountId:null}]:[]];if(r.some(e=>e.provider===n.provider&&e.accountId===n.accountId))return;let i=r.find(e=>e.provider===n.provider),a=L().selection?.sessionId===null?r.at(0):void 0;i===void 0?a===void 0?n.accountId!==null&&nf({accountId:null}):nf({...tf(jd(L(),e).composer,a.provider),accountId:a.accountId}):nf({accountId:i.accountId})}async function af(e){try{rf(e,await M(e,`accounts.list`,void 0))}catch(e){Wd(e)}}async function of(){let e=L().selection;if(e===null)return;let{provider:t,accountId:n}=L().settings;if(t!==`opencode`&&n===null)z({capabilities:null});else try{let r=await M(e.machine,`capabilities`,{provider:t,accountId:n,projectId:e.projectId});if(L().selection?.machine!==e.machine||L().selection?.projectId!==e.projectId||L().settings.provider!==t||L().settings.accountId!==n||(z({capabilities:r}),L().settings.model!==null))return;let i=r.models.find(e=>!e.hidden&&e.value===r.defaultModel)??r.models.find(e=>!e.hidden);if(i===void 0)return;nf({model:i.value,...i.effort===null?{}:{effort:i.effort}})}catch(e){Wd(e)}}var sf={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`};function cf(e){return e.split(/[\\/]/).filter(Boolean).at(-1)??e}function lf(e){let t=Math.round((Date.now()-e)/1e3);return t<60?`now`:t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}d`}function uf(e){let t=new Date(e),n=t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`}),r=new Date,i=Math.round((new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()-new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime())/864e5);return i<=0?n:i===1?`yesterday at ${n}`:`${t.toLocaleDateString(void 0,t.getFullYear()===r.getFullYear()?{month:`numeric`,day:`numeric`}:{month:`numeric`,day:`numeric`,year:`numeric`})} ${n}`}function df(e){let t=new Date(e),n=t.getDate(),r=n%100>=11&&n%100<=13?`th`:n%10==1?`st`:n%10==2?`nd`:n%10==3?`rd`:`th`;return`${t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}, ${n}${r} ${t.toLocaleDateString(`en-US`,{month:`long`})} ${t.getFullYear()}`}function ff(e){return new Intl.NumberFormat(void 0,{notation:`compact`}).format(e)}function pf(e){let t=jd(L(),e.machine);z({selection:e,loaded:e.sessionId===null,items:[],earlier:[],before:null,partial:``,requests:[],queue:[],settings:(e.sessionId===null?null:Ve(Rd(e)))??tf(t.composer,L().sessions.find(t=>t.machine===e.machine&&t.id===e.sessionId)?.provider??t.composer?.provider??`claude`),context:null,paletteOpen:!1,unseen:L().unseen.filter(t=>e.sessionId===null||t!==Ze(e.machine,e.sessionId))}),We(),(t.claudeAccounts.length>0||t.codexAccounts.length>0||t.openCode.available)&&rf(e.machine,{claudeAccounts:t.claudeAccounts,codexAccounts:t.codexAccounts,openCode:t.openCode}),of(),e.sessionId!==null&&t.status===`online`&&M(e.machine,`sessions.open`,{projectId:e.projectId,sessionId:e.sessionId}).catch(Wd)}async function mf(e,t){let n=L().selection;if(n===null)throw Error(`no session selected`);`Notification`in window&&Notification.permission==="default"&&Notification.requestPermission(),z({sentAt:Date.now()}),await M(n.machine,`sessions.send`,{sessionId:n.sessionId,projectId:n.projectId,prompt:e,settings:L().settings,delivery:t})}function hf(e){let t=L().selection;t!==null&&t.sessionId!==null&&M(t.machine,`sessions.unqueue`,{sessionId:t.sessionId,id:e}).catch(Wd)}function gf(e){let t=L().selection;t!==null&&t.sessionId!==null&&M(t.machine,`sessions.steer`,{sessionId:t.sessionId,id:e}).catch(Wd)}function _f(){let e=L().selection;e!==null&&e.sessionId!==null&&M(e.machine,`sessions.interrupt`,{sessionId:e.sessionId}).catch(Wd)}function vf(e,t,n){M(e,`sessions.stopTask`,{sessionId:t,taskId:n}).catch(Wd)}function yf(e,t,n){let r=L().selection;r!==null&&r.sessionId!==null&&M(r.machine,`sessions.respond`,{sessionId:r.sessionId,requestId:e,decision:t,answers:n}).catch(Wd)}async function bf(e){let t=L().selection;if(t!==null&&t.sessionId!==null)try{let n=await M(t.machine,`sessions.fork`,{sessionId:t.sessionId,projectId:t.projectId,messageId:e});pf({...t,sessionId:n.sessionId})}catch(e){Wd(e)}}async function xf(){let e=L().selection,t=L().before;if(e!==null&&e.sessionId!==null&&t!==null)try{let n=await M(e.machine,`sessions.earlier`,{sessionId:e.sessionId,before:t});if(L().selection!==e||L().before!==t)return;z({earlier:[...n.items,...L().earlier],before:n.before})}catch(e){Wd(e)}}async function Sf(e,t){let n=L().selection;if(n!==null&&n.sessionId!==null)try{let r=await M(n.machine,`sessions.agent`,{sessionId:n.sessionId,projectId:n.projectId,agentId:t,parent:e});if(L().selection!==n)return;let i=new Set(r.map(e=>e.id)),a=L().items;z({items:[...a.filter(t=>t.parent!==e),...r,...a.filter(t=>t.parent===e&&!i.has(t.id))]})}catch(e){Wd(e)}}async function Cf(e,t,n){z({sessions:L().sessions.map(r=>r.machine===e&&r.id===t?{...r,...n}:r)});try{await M(e,`sessions.update`,{id:t,patch:n})}catch(e){Wd(e)}}async function wf(e,t){z({sessions:L().sessions.filter(n=>n.machine!==e||n.id!==t)}),Be(Ze(e,t));let n=L().selection;n?.machine===e&&n.sessionId===t&&pf({...n,sessionId:null});try{await M(e,`sessions.remove`,{id:t})}catch(e){Wd(e)}}var Tf=`notifications`,Ef=Promise.resolve(),Df=new Set;function Of(){return window.isSecureContext?!(`Notification`in window)||!(`serviceWorker`in navigator)?`unsupported`:Notification.permission:`insecure`}function kf(){let e=localStorage.getItem(Tf);if(e===null||e===`on`)return!0;if(e===`off`)return!1;throw Error(`unknown notification setting ${e}`)}async function Af(e){e&&Notification.permission==="default"&&await Notification.requestPermission(),localStorage.setItem(Tf,e?`on`:`off`)}async function jf(e,t){(await navigator.permissions.query({name:`notifications`})).addEventListener(`change`,t,{signal:e})}function Mf(e,t,n){if(document.hidden)for(let r of t){let t=Pf(e,r);Ff(e,r,`${t===void 0?`Agent`:sf[t.provider]} ${n}`,t?.title??`Session`,Ze(e,r))}}function Nf(e,t,n){Ff(e,t,Pf(e,t)?.title??`Session`,n,`push:${Ze(e,t)}`)}function Pf(e,t){return L().sessions.find(n=>n.machine===e&&n.id===t)}function Ff(e,t,n,r,i){if(Of()!==`granted`||!kf()||!jd(L(),e).notifier)return;let a=new Notification(n,{body:r,tag:i});a.onclick=()=>{window.focus();let n=Pf(e,t);n!==void 0&&pf({machine:e,projectId:n.projectId,sessionId:t})}}async function If(e,t,n){Of()===`granted`&&kf()&&jd(L(),n.machine).notifier&&await(await navigator.serviceWorker.ready).showNotification(e,{body:t,data:n})}function Lf(){let e=L().machines.filter(e=>de(e.id)&&!e.notifier&&!Df.has(e.id)).map(e=>e.id);if(e.length!==0){for(let t of e)Df.add(t);Rf().then(t=>Promise.all(e.map(e=>M(e,`notifications.claim`,{endpoint:t})))).catch(e=>console.error(`could not claim notifications`,e)).finally(()=>{for(let t of e)Df.delete(t)})}}async function Rf(){if(zf()!==`supported`)return null;let e=await navigator.serviceWorker.getRegistration();if(e===void 0)return null;let t=await e.pushManager.getSubscription();return t===null?null:t.endpoint}function zf(){return window.isSecureContext?!(`Notification`in window)||!(`serviceWorker`in navigator)||!(`PushManager`in window)?Bf()?`install`:`unsupported`:Notification.permission===`denied`?`denied`:`supported`:`insecure`}function Bf(){return/iPhone|iPad|iPod/.test(navigator.userAgent)||navigator.userAgent.includes(`Mac`)&&navigator.maxTouchPoints>1}async function Vf(){return await(await navigator.serviceWorker.ready).pushManager.getSubscription()!==null}async function Hf(){return Notification.permission==="default"&&await Notification.requestPermission(),Notification.permission===`granted`&&(await Gf(Kf),!0)}function Uf(){return Gf(qf)}function Wf(e){return Gf(async()=>{if(zf()!==`supported`)return;let t=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!t)return;let n=await Jf(),r=t.options.applicationServerKey;r!==null&&Xf(r)===n.publicKey?await Zf(e,t,n):await Kf()})}function Gf(e){let t=Ef.then(e);return Ef=t.catch(()=>void 0),t}async function Kf(){await qf();let e=await Jf(),t=await(await navigator.serviceWorker.ready).pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:e.publicKey});await Promise.all(Yf().map(n=>Zf(n,t,e)))}async function qf(){let e=await(await navigator.serviceWorker.ready).pushManager.getSubscription();e&&(await Promise.all(Yf().map(t=>M(t,`push.unsubscribe`,{endpoint:e.endpoint}))),await e.unsubscribe())}async function Jf(){let e=await caches.open(`offsite-worker`),t=await e.match(`/push-keys`);if(t!==void 0)return await t.json();let n=await crypto.subtle.generateKey({name:`ECDSA`,namedCurve:`P-256`},!0,[`sign`,`verify`]),r=(await crypto.subtle.exportKey(`jwk`,n.privateKey)).d;if(r===void 0)throw Error(`the browser did not export the push key`);let i={publicKey:Xf(await crypto.subtle.exportKey(`raw`,n.publicKey)),privateKey:r};return await e.put(`/push-keys`,new Response(JSON.stringify(i))),i}function Yf(){return L().machines.filter(e=>de(e.id)).map(e=>e.id)}function Xf(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}async function Zf(e,t,n){await M(e,`push.subscribe`,{subscription:t.toJSON(),...n,machine:e})}function Qf(){let e=Ke(),t=Ue(e.map(e=>e.id));kd({machines:e.map(Qe),sessions:[],projects:e.flatMap($e),prefs:Sd(),paletteOpen:!1,settingsOpen:!1,settingsPage:`General`,settingsAccount:null,settingsEditedMachine:null,settingsMachine:e.at(0)?.id??null,unseen:[],selection:t,loaded:t?.sessionId===null,items:[],earlier:[],before:null,partial:``,requests:[],queue:[],settings:(t===null||t.sessionId===null?null:Ve(Rd(t)))??ef,draft:null,context:null,capabilities:null,error:null,sentAt:0}),Ed(),ue({open:(e,t)=>{Pd(e,{via:t}),ep(e)},close:e=>{let t=L().machines.find(t=>t.id===e);t!==void 0&&t.status!==`offline`&&Pd(e,{status:`offline`,via:null,notifier:!1})},unpaired:e=>Pd(e,{status:`unpaired`,via:null,notifier:!1}),event:ip}),addEventListener(`keydown`,Lf,{capture:!0}),addEventListener(`pointerdown`,Lf,{capture:!0}),addEventListener(`storage`,e=>{e.key===`machines`&&et()});for(let t of e)ce(t.id,t.addresses);at(e),$f()}async function $f(){try{let e=Ye();e!==null&&await tt(e.address,e.code)}catch(e){Wd(e)}}async function ep(e){try{let t=await M(e,`sync`,void 0),n=L().machines.find(t=>t.id===e);if(n===void 0)return;Pd(e,{status:`online`,name:n.label??t.hostname,hostname:t.hostname,system:{defaults:t.defaults,platform:t.platform,defaultShell:t.defaultShell,defaultClaudeBaseDir:t.defaultClaudeBaseDir},activity:t.activity,providers:t.providers}),tp(e,t.projects),np(e,t.sessions),Xd(e,t.config),Qd(e,t.composer),rp(e),af(e),L().selection?.machine===e&&of()}catch(e){Wd(e)}}function tp(e,t){z({projects:[...L().projects.filter(t=>t.machine!==e),...t.map(t=>({...t,machine:e}))]}),lt()}function np(e,t){z({sessions:[...L().sessions.filter(t=>t.machine!==e),...t.map(t=>({...t,machine:e}))]})}function rp(e){let t=L().selection;t?.machine===e&&t.sessionId!==null&&M(e,`sessions.open`,{projectId:t.projectId,sessionId:t.sessionId}).catch(Wd)}function ip(e,t){let n=L(),r=n.machines.find(t=>t.id===e);if(r===void 0)return;let i=n.selection?.machine===e,a=i?n.selection?.sessionId??null:null;switch(t.type){case`activity`:{let o=r.activity,s=a!==null&&t.activity[a]?.running===!0,c=Object.keys(o).filter(e=>o[e].running&&t.activity[e]?.running!==!0),l=Object.keys(t.activity).filter(e=>t.activity[e].waiting&&o[e]?.waiting!==!0);Mf(e,c.filter(e=>o[e].prompted),`finished`),Mf(e,l,`needs your input`),Pd(e,{activity:t.activity}),z({partial:s||!i?n.partial:``,unseen:[...n.unseen,...c.filter(e=>e!==a).map(t=>Ze(e,t)).filter(e=>!n.unseen.includes(e))]});return}case`limits`:Pd(e,{claudeAccounts:r.claudeAccounts.map(e=>e.id===t.accountId?{...e,limits:t.limits}:e),codexAccounts:r.codexAccounts.map(e=>e.id===t.accountId?{...e,limits:t.limits}:e)});return;case`config`:Xd(e,t.config);return;case`composer`:Qd(e,t.composer);return;case`projects`:tp(e,t.projects);return;case`sessions`:np(e,t.sessions);return;case`accounts`:rf(e,t);return;case`providers`:Pd(e,{providers:t.providers});return;case`started`:if(n.selection===null||!i||n.selection.projectId!==t.projectId||n.selection.sessionId!==null)return;z({selection:{machine:e,projectId:t.projectId,sessionId:t.sessionId},loaded:!0,items:[],earlier:[],before:null,partial:``,requests:[],queue:[]}),We();return;case`notification`:Nf(e,t.sessionId,t.message);return;case`notifier`:Pd(e,{notifier:t.active});return}if(a!==null&&t.sessionId===a)switch(t.type){case`history`:z({loaded:!0,items:t.items,earlier:[],before:t.before,requests:t.requests,queue:t.queue,settings:t.settings??(n.settings.provider===t.provider?n.settings:tf(jd(n,e).composer,t.provider)),context:t.context,partial:t.partial}),t.settings!==null&&He(Ze(e,t.sessionId),t.settings);return;case`context`:z({context:t.context});return;case`items`:{let e=new Map(t.items.map(e=>[e.id,e]));z({items:[...n.items.map(t=>e.get(t.id)??t),...t.items.filter(e=>!n.items.some(t=>t.id===e.id))],partial:t.items.some(e=>e.kind===`assistant`&&e.parent===null)?``:n.partial});return}case`delta`:z({partial:n.partial+t.text});return;case`request`:z({requests:[...n.requests,t.request]});return;case`requestDone`:z({requests:n.requests.filter(e=>e.id!==t.requestId)});return;case`queue`:z({queue:t.queue});return;case`settings`:{let r={...t.settings,accountId:n.settings.accountId};z({settings:r}),He(Ze(e,t.sessionId),r)}}}var ap=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,op=dt,sp=(e,t)=>n=>{if(t?.variants==null)return op(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ap(t)||ap(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return op(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},cp=Object.defineProperty,lp=(e,t)=>cp(e,`name`,{value:t,configurable:!0});function up(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}lp(up,`setRef`);function dp(...e){return t=>{let n=!1,r=e.map(e=>{let r=up(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():up(e[t],null)}}}}lp(dp,`composeRefs`);function fp(...e){return v.useCallback(dp(...e),e)}lp(fp,`useComposedRefs`);var pp=Object.defineProperty,mp=(e,t)=>pp(e,`name`,{value:t,configurable:!0});function hp(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Ep(r),v.Children.forEach(r,e=>{if(Sp(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;wp(n)&&typeof Ap==`function`;)n=Ap(n._payload);a=yp(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?xp(a):void 0,l=fp(n,c);if(!a){if(r||r===0)throw Error(o?kp(e):Op(e));return r}let u=bp(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}mp(hp,`createSlot`);var gp=hp(`Slot`),_p=Symbol.for(`radix.slottable`);function vp(e){let t=mp(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=_p,t}mp(vp,`createSlottable`);var yp=mp((e,t)=>`child`in e.props?v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null:v.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function bp(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Dp(a,i))}return{...e,...n}}mp(bp,`mergeProps`);function xp(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}mp(xp,`getElementRef`);function Sp(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_p}mp(Sp,`isSlottable`);var Cp=Symbol.for(`react.lazy`);function wp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Cp&&`_payload`in e&&Tp(e._payload)}mp(wp,`isLazyComponent`);function Tp(e){return typeof e==`object`&&!!e&&`then`in e}mp(Tp,`isPromiseLike`);function Ep(e){let t=e;for(;wp(t)&&typeof Ap==`function`;)t=Ap(t._payload);return t}mp(Ep,`useUnwrappedLazy`);function Dp(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}mp(Dp,`concatAriaDescribedby`);var Op=mp(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),kp=mp(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ap=v.use,jp=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})),Mp=o(((e,t)=>{t.exports=jp()})),Np=l(h(),1),B=Mp(),Pp=Object.defineProperty,Fp=(e,t)=>Pp(e,`name`,{value:t,configurable:!0}),Ip=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=hp(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Lp(e,t){e&&Np.flushSync(()=>e.dispatchEvent(t))}Fp(Lp,`dispatchDiscreteCustomEvent`);var Rp=Object.defineProperty,zp=(e,t)=>Rp(e,`name`,{value:t,configurable:!0}),Bp=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Vp=v.forwardRef(zp(function(e,t){return(0,B.jsx)(Ip.span,{...e,ref:t,style:{...Bp,...e.style}})},`VisuallyHidden`)),Hp=Object.defineProperty,Up=(e,t)=>Hp(e,`name`,{value:t,configurable:!0});function Wp(e,t){let n=v.createContext(t);n.displayName=e+`Context`;let r=Up(e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=v.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Up(i,`useContext`),[r,i]}Up(Wp,`createContext`);function Gp(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Up(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=v.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Up(s,`useContext`),[o,s]}Up(r,`createContext`);let i=Up(()=>{let t=n.map(e=>v.createContext(e));return Up(function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Kp(i,...t)]}Up(Gp,`createContextScope`);function Kp(...e){let t=e[0];if(e.length===1)return t;let n=Up(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Up(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Up(Kp,`composeContextScopes`);var qp=globalThis?.document?v.useLayoutEffect:()=>{},Jp=Object.defineProperty,Yp=(e,t)=>Jp(e,`name`,{value:t,configurable:!0});function Xp(e){let t=e+`CollectionProvider`,[n,r]=Gp(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Yp(e=>{let{scope:t,children:n}=e,r=v.useRef(null),a=v.useRef(new Map).current;return(0,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=hp(s),l=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=fp(t,a(s,n).collectionRef);return(0,B.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=hp(u),p=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),s=fp(t,o),c=a(u,n);return v.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return v.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Yp(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Yp(Xp,`createCollection`);var Zp=new WeakMap,Qp=class e extends Map{static{Yp(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Zp.set(this,!0)}set(e,t){return Zp.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=tm(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=$p(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=$p(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return $p(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function $p(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=em(e,t);return n===-1?void 0:e[n]}Yp($p,`at`);function em(e,t){let n=e.length,r=tm(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Yp(em,`toSafeIndex`);function tm(e){return e!==e||e===0?0:Math.trunc(e)}Yp(tm,`toSafeInteger`);function nm(e){let t=e+`CollectionProvider`,[n,r]=Gp(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=Yp(({state:e,...t})=>e?(0,B.jsx)(u,{...t,state:e}):(0,B.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=Yp(e=>{let t=_();return(0,B.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=Yp(e=>{let{scope:t,children:n,state:r}=e,a=v.useRef(null),[s,c]=v.useState(null),l=fp(a,c),[u,d]=r,f=v.useRef(new Qp),p=v.useCallback(()=>{let e=f.current;return am(e)||e.sort(om),e},[]);return v.useEffect(()=>{if(!s)return;let e=sm(()=>{d(e=>{let t=e.toSorted(om);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,B.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,B.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=hp(d),p=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=fp(t,a(d,n).collectionElementRef);return(0,B.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=hp(m),g=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=v.useRef(i);rm(l.current,i)||(l.current=i);let u=l.current,d=fp(t,v.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);qp(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=v.useRef(null);return v.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new Qp(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(om)}))}),v.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new Qp(t);return n.delete(e.element),n})},[s]),(0,B.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function _(){return v.useState(new Qp)}Yp(_,`useInitCollection`);function y(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}Yp(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return Yp(b,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:_}]}Yp(nm,`createCollection`);function rm(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Yp(rm,`shallowEqual`);function im(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Yp(im,`isElementPreceding`);function am(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Yp(am,`isInDocumentOrder`);function om(e,t){return!e[1].element||!t[1].element?0:im(e[1].element,t[1].element)?-1:1}Yp(om,`sortByDocumentPosition`);function sm(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Yp(sm,`getChildListObserver`);var cm=Object.defineProperty,lm=(e,t)=>cm(e,`name`,{value:t,configurable:!0}),um=!!(typeof window<`u`&&window.document&&window.document.createElement);function V(e,t,{checkForDefaultPrevented:n=!0}={}){return lm(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}lm(V,`composeEventHandlers`);function dm(e){if(!um)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}lm(dm,`getOwnerWindow`);function fm(e){if(!um)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}lm(fm,`getOwnerDocument`);function pm(e,t=!1){let{activeElement:n}=fm(e);if(!n?.nodeName)return null;if(mm(n)&&n.contentDocument)return pm(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=fm(n).getElementById(e);if(t)return t}}return n}lm(pm,`getActiveElement`);function mm(e){return e.tagName===`IFRAME`}lm(mm,`isFrame`);var hm=Object.defineProperty,gm=(e,t)=>hm(e,`name`,{value:t,configurable:!0}),_m=v.useEffectEvent,vm=v.useInsertionEffect;function ym(e){if(typeof _m==`function`)return _m(e);let t=v.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof vm==`function`?vm(()=>{t.current=e}):qp(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}gm(ym,`useEffectEvent`);var bm=Object.defineProperty,xm=(e,t)=>bm(e,`name`,{value:t,configurable:!0}),Sm=v.useInsertionEffect||qp;function Cm({prop:e,defaultProp:t,onChange:n=xm(()=>{},`onChange`),caller:r}){let[i,a,o]=wm({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,v.useCallback(t=>{if(s){let n=Tm(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}xm(Cm,`useControllableState`);function wm({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return Sm(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}xm(wm,`useUncontrolledState`);function Tm(e){return typeof e==`function`}xm(Tm,`isFunction`);var Em=Symbol(`RADIX:SYNC_STATE`);function Dm(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=ym(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=v.useReducer((t,n)=>{if(n.type===Em)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=v.useRef(p);v.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=v.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return v.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Em,state:i})},[i,d.state,c]),[h,f]}xm(Dm,`useControllableStateReducer`);var Om=Object.defineProperty,km=(e,t)=>Om(e,`name`,{value:t,configurable:!0});function Am(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}km(Am,`useStateMachine`);var jm=km(e=>{let{present:t,children:n}=e,r=Mm(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=Pm(r.ref,Im(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null},`Presence`);function Mm(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),o=v.useRef(void 0),[s,c]=Am(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{s===`mounted`?(a.current=o.current??Fm(r.current),o.current=void 0):a.current=`none`},[s]),qp(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Fm(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),qp(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=km(a=>{let o=Fm(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=km(e=>{e.target===t&&(a.current=Fm(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:v.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Fm(t)}else r.current=null;n(e)},[])}}km(Mm,`usePresence`);function Nm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}km(Nm,`setRef`);function Pm(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Nm(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Nm(n[e],null)}}},[])}km(Pm,`useStableComposedRefs`);function Fm(e){return e?.animationName||`none`}km(Fm,`getAnimationName`);function Im(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}km(Im,`getElementRef`);var Lm=Object.defineProperty,Rm=(e,t)=>Lm(e,`name`,{value:t,configurable:!0}),zm=v.useId||(()=>void 0),Bm=0;function Vm(e){let[t,n]=v.useState(zm());return qp(()=>{e||n(e=>e??String(Bm++))},[e]),e||(t?`radix-${t}`:``)}Rm(Vm,`useId`);var Hm=Object.defineProperty,Um=(e,t)=>Hm(e,`name`,{value:t,configurable:!0}),Wm={LTR:`ltr`,RTL:`rtl`},Gm=v.createContext(void 0);function Km(e){let t=v.useContext(Gm);return e||t||Wm.LTR}Um(Km,`useDirection`);var qm=Object.defineProperty,Jm=(e,t)=>qm(e,`name`,{value:t,configurable:!0}),Ym=v.useInsertionEffect;function Xm(e){let t=v.useRef(e);return typeof Ym==`function`?Ym(()=>{t.current=e}):qp(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}Jm(Xm,`useCallbackRef`);var Zm=Object.defineProperty,Qm=(e,t)=>Zm(e,`name`,{value:t,configurable:!0}),$m=`dismissableLayer.update`,eh=`dismissableLayer.pointerDownOutside`,th=`dismissableLayer.focusOutside`,nh,rh=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ih=v.forwardRef(Qm(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(rh),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=fp(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_?g.indexOf(_):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=v.useRef(!1),w=sh(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=ch(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Xm(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return v.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(nh=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),lh(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=nh))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),lh())},[d,u]),v.useEffect(()=>{let e=Qm(()=>m({}),`handleUpdate`);return document.addEventListener($m,e),()=>document.removeEventListener($m,e)},[]),(0,B.jsx)(Ip.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:V(e.onFocusCapture,T.onFocusCapture),onBlurCapture:V(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function ah(){let e=v.useContext(rh),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Qm(ah,`useDismissableLayerSurface`);var oh=Qm(()=>!0,`IS_TRUE`);function sh(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=oh}=t,s=Xm(e),c=v.useRef(!1),l=v.useRef(!1),u=v.useRef(new Map),d=v.useRef(()=>{});return v.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Qm(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Qm(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Qm(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Qm(p,`handleInteractionBubble`);let m=Qm(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||uh(eh,s,p,{discrete:!0})};if(Qm(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Qm(()=>c.current=!0,`onPointerDownCapture`)}}Qm(sh,`usePointerDownOutside`);function ch(e,t=globalThis?.document){let n=Xm(e),r=v.useRef(!1);return v.useEffect(()=>{let e=Qm(e=>{e.target&&!r.current&&uh(th,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Qm(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Qm(()=>r.current=!1,`onBlurCapture`)}}Qm(ch,`useFocusOutside`);function lh(){let e=new CustomEvent($m);document.dispatchEvent(e)}Qm(lh,`dispatchUpdate`);function uh(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Lp(i,a):i.dispatchEvent(a)}Qm(uh,`handleAndDispatchCustomEvent`);var dh=Object.defineProperty,fh=(e,t)=>dh(e,`name`,{value:t,configurable:!0}),ph=`focusScope.autoFocusOnMount`,mh=`focusScope.autoFocusOnUnmount`,hh={bubbles:!1,cancelable:!0},gh=v.forwardRef(fh(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=v.useState(null),u=Xm(a),d=Xm(o),f=v.useRef(null),p=fp(t,l),m=v.useRef(i);v.useEffect(()=>{m.current=i});let h=v.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:Dh(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||Dh(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Dh(c)};fh(e,`handleFocusIn`),fh(t,`handleFocusOut`),fh(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),v.useEffect(()=>{if(c){Oh.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(ph,hh);c.addEventListener(ph,u),c.dispatchEvent(t),t.defaultPrevented||(xh(jh(Ch(c)),{select:!0}),document.activeElement===e&&Dh(c))}return()=>{c.removeEventListener(ph,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(mh,hh);c.addEventListener(mh,d),c.dispatchEvent(r),r.defaultPrevented||Dh(e??t.body,{select:!0}),c.removeEventListener(mh,d),Oh.remove(g)},0)}}},[c,u,d,g]);let _=v.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Sh(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Dh(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Dh(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,B.jsx)(Ip.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),_h=v.createContext(null);function vh({registry:e,children:t}){return e?(0,B.jsx)(_h.Provider,{value:e,children:t}):t}fh(vh,`FocusScopeBranchProvider`);function yh(){let[e,t]=v.useState([]);return{nodes:e,registry:v.useMemo(()=>({add:fh(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:fh(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}fh(yh,`useFocusScopeBranchRegistry`);function bh(e){let t=v.useContext(_h);v.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}fh(bh,`useFocusScopeBranch`);function xh(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Dh(r,{select:t}),document.activeElement!==n)return}fh(xh,`focusFirst`);function Sh(e){let t=Ch(e);return[wh(t,e),wh(t.reverse(),e)]}fh(Sh,`getTabbableEdges`);function Ch(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:fh(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}fh(Ch,`getTabbableCandidates`);function wh(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Th(r,{upTo:t})))return r}fh(wh,`findVisible`);function Th(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}fh(Th,`isHidden`);function Eh(e){return e.tagName===`INPUT`&&typeof e.select==`function`}fh(Eh,`isSelectableInput`);function Dh(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&Eh(e)&&t&&e.select()}}fh(Dh,`focus`);var Oh=kh();function kh(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ah(e,t),e.unshift(t)},remove(t){e=Ah(e,t),e[0]?.resume()}}}fh(kh,`createFocusScopesStack`);function Ah(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}fh(Ah,`arrayRemove`);function jh(e){return e.filter(e=>e.tagName!==`A`)}fh(jh,`removeLinks`);var Mh=Object.defineProperty,Nh=v.forwardRef(((e,t)=>Mh(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=v.useState(!1);qp(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Np.createPortal((0,B.jsx)(Ip.div,{...r,ref:t}),o):null},`Portal`)),Ph=Object.defineProperty,Fh=(e,t)=>Ph(e,`name`,{value:t,configurable:!0}),Ih=0,Lh=null;function Rh(e){return zh(),e.children}Fh(Rh,`FocusGuards`);function zh(){v.useEffect(()=>{Lh||={start:Bh(),end:Bh()};let{start:e,end:t}=Lh;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ih++,()=>{Ih===1&&(Lh?.start.remove(),Lh?.end.remove(),Lh=null),Ih=Math.max(0,Ih-1)}},[])}Fh(zh,`useFocusGuards`);function Bh(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Fh(Bh,`createFocusGuard`);var Vh=function(){return Vh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Vh.apply(this,arguments)};function Hh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Uh(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Wh=`right-scroll-bar-position`,Gh=`width-before-scroll-bar`,Kh=`with-scroll-bars-hidden`,qh=`--removed-body-scroll-bar-size`;function Jh(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Yh(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Xh=typeof window<`u`?v.useLayoutEffect:v.useEffect,Zh=new WeakMap;function Qh(e,t){var n=Yh(t||null,function(t){return e.forEach(function(e){return Jh(e,t)})});return Xh(function(){var t=Zh.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Jh(e,null)}),i.forEach(function(e){r.has(e)||Jh(e,a)})}Zh.set(n,e)},[e]),n}function $h(e){return e}function eg(e,t){t===void 0&&(t=$h);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function tg(e){e===void 0&&(e={});var t=eg(null);return t.options=Vh({async:!0,ssr:!1},e),t}var ng=function(e){var t=e.sideCar,n=Hh(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,Vh({},n))};ng.isSideCarExport=!0;function rg(e,t){return e.useMedium(t),ng}var ig=tg(),ag=function(){},og=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ag,onWheelCapture:ag,onTouchMoveCapture:ag}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,y=_===void 0?`div`:_,b=e.gapMode,x=Hh(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Qh([n,t]),w=Vh(Vh({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:ig,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),Vh(Vh({},w),{ref:C})):v.createElement(y,Vh({},w,{className:c,ref:C}),s))});og.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},og.classNames={fullWidth:Gh,zeroRight:Wh};var sg=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function cg(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=sg();return t&&e.setAttribute(`nonce`,t),e}function eee(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tee(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var lg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cg())&&(eee(t,n),tee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ug=function(){var e=lg();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dg=function(){var e=ug();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},fg={left:0,top:0,right:0,gap:0},pg=function(e){return parseInt(e||``,10)||0},mg=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[pg(n),pg(r),pg(i)]},hg=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return fg;var t=mg(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},nee=dg(),gg=`data-scroll-locked`,ree=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
65
+ 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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Kc(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;Kc(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 qc=new Set([`type`,`properties`,`required`,`additionalProperties`]),Jc=[`oneOf`,`anyOf`];function Yc(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Xc(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!qc.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]??Yc(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Qn(n,r,e.length===1?e[0]:Xc(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=Yc(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 Zc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of qc)if(t in e)return;let n=t.filter(e=>Jc.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Xc(t);else{let e=n[0],i=Jc.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=>Xc([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Bc(e,r))}function Qc(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)):Bc(i,s),Bc(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())Kc(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)??[])Zc(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)}Bc(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,Qn(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:tl(t,`input`,e.processors),output:tl(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function $c(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 $c(r.element,n);if(r.type===`set`)return $c(r.valueType,n);if(r.type===`lazy`)return $c(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 $c(r.innerType,n);if(r.type===`intersection`)return $c(r.left,n)||$c(r.right,n);if(r.type===`record`||r.type===`map`)return $c(r.keyType,n)||$c(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:$c(r.in,n)||$c(r.out,n);if(r.type===`object`){for(let e in r.shape)if($c(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if($c(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if($c(e,n))return!0;return!!(r.rest&&$c(r.rest,n))}return!1}var el=(e,t={})=>n=>{let r=Vc({...n,processors:t});return Uc(e,r),Gc(r,e),Qc(r,e)},tl=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Vc({...i??{},target:a,io:t,processors:n});return Uc(e,o),Gc(o,e),Qc(o,e)},nl=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},rl=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},il=(e,t)=>{nl(e,`minimum`,t),rl(e,`maximum`,t)},al=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ol=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},sl=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},cl=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ll=(e,t)=>nl(e,`minimum`,t.minimum),ul=(e,t)=>rl(e,`maximum`,t.maximum),dl=e=>(t,n)=>{cl(t,n.format);let[r,i]=e[n.format];nl(t,`minimum`,r),rl(t,`maximum`,i)},fl={greater_than:(e,t)=>nl(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>rl(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>al(e,t.value),number_format:dl(yr),bigint_format:dl(br),min_length:ll,max_length:ul,length_equals:(e,t)=>il(e,t.length),min_size:ll,max_size:ul,size_equals:(e,t)=>il(e,t.size),string_format:(e,t)=>{cl(e,t.format),t.pattern&&ol(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)=>sl(e,t.mime)};function pl(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)fl[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&nl(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&nl(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&rl(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&rl(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&al(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&sl(t,i.mime);for(let e of i.patterns??[])ol(t,e);return t}var ml={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},hl=new Map([[xo,ra],[Co,ia]]),gl=e=>hl.get(e)??e,_l=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=pl(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ml[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(gl);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}))])}},vl=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=pl(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)):Hc(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}))])}},yl=(e,t,n,r)=>{n.type=`boolean`},bl=(e,t,n,r)=>{n.not={}},xl=(e,t,n,r)=>{let i=e._zod.def,a=Wn(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Sl=(e,t,n,r)=>{Hc(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Cl=(e,t,n,r)=>{Hc(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},wl=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=pl(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Uc(a.element,t,{...r,path:[...r.path,`items`]})};function Tl(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Tl(t.out):t.type===`catch`?Tl(t.innerType):e._zod.optin}var El=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Hc(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Qn(i.properties,e,Uc(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`?Tl(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=Uc(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Dl=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Uc(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ol=(e,t,n,r)=>{let i=e._zod.def,a=Uc(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Uc(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)},kl=(e,t,n,r)=>{let i=e._zod.def,a=Uc(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`}]},Al=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},jl=Symbol();function Ml(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Hc(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),jl):JSON.parse(o)}var Nl=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Ml(i.defaultValue,e,t,n,r);o!==jl&&(n.default=o)},Pl=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Ml(i.defaultValue,e,t,n,r);o!==jl&&(n._prefault=o)},Fl=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Hc(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Il=(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;Uc(o,t,r);let s=t.seen.get(e);s.ref=o},Ll=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Rl=(e,t,n,r)=>{let i=e._zod.def;Uc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zl=new WeakSet([Object.prototype,Error.prototype]);function Bl(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 Vl=I(`ZodError`,(e,t)=>{hi.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);zl.has(n)||(zl.add(n),Bl(n,`format`,e=>t=>vi(e,t)),Bl(n,`flatten`,e=>t=>_i(e,t)),Bl(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Kn,2)}),Bl(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Kn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Hl=Si(Vl),Ul=Ci(Vl),Wl=wi(Vl),Gl=Ei(Vl),Kl=Mi(Vl),ql=Ni(Vl),Jl=Pi(Vl),Yl=Fi(Vl),Xl=Ii(Vl),Zl=Li(Vl),Ql=Ri(Vl),$l=zi(Vl);function eu(){si.localeError||ci(Ms())}function tu(){si.memoizer||ci({memoizer:ks()})}var nu=I(`ZodType`,(e,t)=>(eu(),Ra.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ar(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 hr(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_d(e,t))},superRefine(e,t){return this.check(vd(e,t))},overwrite(e){return this.check(Ac(e))},optional(){return $u(this)},exactOptional(){return td(this)},nullable(){return rd(this)},nullish(){return $u(rd(this))},nonoptional(e){return ld(this,e)},array(){return Vu(this)},or(e){return Gu([this,e])},and(e){return qu(this,e)},transform(e){return pd(this,Zu(e))},default(e){return ad(this,e)},prefault(e){return sd(this,e)},catch(e){return dd(this,e)},pipe(e){return pd(this,e)},readonly(){return hd(this)},describe(e){let t=this.clone();return Is.add(t,{description:e}),t},meta(...e){if(e.length===0)return Is.get(this);let t=this.clone();return Is.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 Wr(this,`~standard`,{...Va(this),jsonSchema:{input:tl(this,`input`),output:tl(this,`output`)}})},set"~standard"(e){Ur(this,`~standard`,e)},parse:function e(t,n){return Hl(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Ul(this,t,n,{callee:e})},safeParse(e,t){return Wl(this,e,t)},async safeParseAsync(e,t){return Gl(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ur(this,`spa`,e)},validate(e,t){return ki(this,e,t)},validateAsync(e,t){return ji(this,e,t)},encode:function e(t,n){return Kl(this,t,n,{callee:e})},decode:function e(t,n){return ql(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Jl(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Yl(this,t,n,{callee:e})},safeEncode(e,t){return Xl(this,e,t)},safeDecode(e,t){return Zl(this,e,t)},async safeEncodeAsync(e,t){return Ql(this,e,t)},async safeDecodeAsync(e,t){return $l(this,e,t)},toJSONSchema(e){return el(this,{})(e)},get description(){return Is.get(this)?.description},get _def(){return this._zod.def}}),ru=I(`_ZodString`,(e,t)=>{Ha.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_l(e,t,n,r)},Gr({format:e=>pl(e).format??null,minLength:e=>pl(e).minimum??null,maxLength:e=>pl(e).maximum??null},{regex(...e){return this.check(wc(...e))},includes(...e){return this.check(Dc(...e))},startsWith(...e){return this.check(Oc(...e))},endsWith(...e){return this.check(kc(...e))},min(...e){return this.check(Sc(...e))},max(...e){return this.check(xc(...e))},length(...e){return this.check(Cc(...e))},nonempty(...e){return this.check(Sc(1,...e))},lowercase(e){return this.check(Tc(e))},uppercase(e){return this.check(Ec(e))},trim(){return this.check(Mc())},normalize(...e){return this.check(jc(...e))},toLowerCase(){return this.check(Nc())},toUpperCase(){return this.check(Pc())},slugify(){return this.check(Fc())}})),iu=I(`ZodString`,(e,t)=>{Ha.init(e,t),ru.init(e,t)},{email(e){return this.check(zs(du,e))},url(e){return this.check(Gs(mu,e))},jwt(e){return this.check(oc(ku,e))},emoji(e){return this.check(Ks(hu,e))},guid(e){return this.check(Bs(fu,e))},uuid(e){return this.check(Vs(pu,e))},uuidv4(e){return this.check(Hs(pu,e))},uuidv6(e){return this.check(Us(pu,e))},uuidv7(e){return this.check(Ws(pu,e))},nanoid(e){return this.check(qs(gu,e))},cuid(e){return this.check(Js(_u,e))},cuid2(e){return this.check(Ys(vu,e))},ulid(e){return this.check(Xs(yu,e))},base64(e){return this.check(rc(Eu,e))},base64url(e){return this.check(ic(Du,e))},xid(e){return this.check(Zs(bu,e))},ksuid(e){return this.check(Qs(xu,e))},ipv4(e){return this.check($s(Su,e))},ipv6(e){return this.check(ec(Cu,e))},cidrv4(e){return this.check(tc(wu,e))},cidrv6(e){return this.check(nc(Tu,e))},e164(e){return this.check(ac(Ou,e))},datetime(e){return this.check(sc(su,e))},date(e){return this.check(cc(cu,e))},time(e){return this.check(lc(lu,e))},duration(e){return this.check(uc(uu,e))}});function au(e){return Rs(iu,e)}var ou=I(`ZodStringFormat`,(e,t)=>{Ua.init(e,t),ru.init(e,t)}),su=I(`ZodISODateTime`,(e,t)=>{co.init(e,t),ou.init(e,t)}),cu=I(`ZodISODate`,(e,t)=>{lo.init(e,t),ou.init(e,t)}),lu=I(`ZodISOTime`,(e,t)=>{uo.init(e,t),ou.init(e,t)}),uu=I(`ZodISODuration`,(e,t)=>{fo.init(e,t),ou.init(e,t)}),du=I(`ZodEmail`,(e,t)=>{Ka.init(e,t),ou.init(e,t)}),fu=I(`ZodGUID`,(e,t)=>{Wa.init(e,t),ou.init(e,t)}),pu=I(`ZodUUID`,(e,t)=>{Ga.init(e,t),ou.init(e,t)}),mu=I(`ZodURL`,(e,t)=>{eo.init(e,t),ou.init(e,t)}),hu=I(`ZodEmoji`,(e,t)=>{to.init(e,t),ou.init(e,t)}),gu=I(`ZodNanoID`,(e,t)=>{no.init(e,t),ou.init(e,t)}),_u=I(`ZodCUID`,(e,t)=>{ro.init(e,t),ou.init(e,t)}),vu=I(`ZodCUID2`,(e,t)=>{io.init(e,t),ou.init(e,t)}),yu=I(`ZodULID`,(e,t)=>{ao.init(e,t),ou.init(e,t)}),bu=I(`ZodXID`,(e,t)=>{oo.init(e,t),ou.init(e,t)}),xu=I(`ZodKSUID`,(e,t)=>{so.init(e,t),ou.init(e,t)}),Su=I(`ZodIPv4`,(e,t)=>{po.init(e,t),ou.init(e,t)}),Cu=I(`ZodIPv6`,(e,t)=>{go.init(e,t),ou.init(e,t)}),wu=I(`ZodCIDRv4`,(e,t)=>{_o.init(e,t),ou.init(e,t)}),Tu=I(`ZodCIDRv6`,(e,t)=>{yo.init(e,t),ou.init(e,t)}),Eu=I(`ZodBase64`,(e,t)=>{So.init(e,t),ou.init(e,t)}),Du=I(`ZodBase64URL`,(e,t)=>{To.init(e,t),ou.init(e,t)}),Ou=I(`ZodE164`,(e,t)=>{Eo.init(e,t),ou.init(e,t)}),ku=I(`ZodJWT`,(e,t)=>{Oo.init(e,t),ou.init(e,t)}),Au=I(`ZodNumber`,(e,t)=>{ko.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vl(e,t,n,r),e.isFinite=!0},Gr({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=pl(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=pl(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=pl(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>pl(e).format??null},{gt(e,t){return this.check(vc(e,t))},gte(e,t){return this.check(yc(e,t))},min(e,t){return this.check(yc(e,t))},lt(e,t){return this.check(gc(e,t))},lte(e,t){return this.check(_c(e,t))},max(e,t){return this.check(_c(e,t))},int(e){return this.check(Nu(e))},safe(e){return this.check(Nu(e))},positive(e){return this.check(vc(0,e))},nonnegative(e){return this.check(yc(0,e))},negative(e){return this.check(gc(0,e))},nonpositive(e){return this.check(_c(0,e))},multipleOf(e,t){return this.check(bc(e,t))},step(e,t){return this.check(bc(e,t))},finite(){return this}}));function ju(e){return dc(Au,e)}var Mu=I(`ZodNumberFormat`,(e,t)=>{Ao.init(e,t),Au.init(e,t)});function Nu(e){return fc(Mu,e)}var Pu=I(`ZodBoolean`,(e,t)=>{jo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yl(e,t,n,r)});function Fu(e){return pc(Pu,e)}var Iu=I(`ZodUnknown`,(e,t)=>{Mo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Lu(){return mc(Iu)}var Ru=I(`ZodNever`,(e,t)=>{No.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bl(e,t,n,r)});function zu(e){return hc(Ru,e)}var Bu=I(`ZodArray`,(e,t)=>{tu(),Lo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wl(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Sc(e,t))},nonempty(e){return this.check(Sc(1,e))},max(e,t){return this.check(xc(e,t))},length(e,t){return this.check(Cc(e,t))},unwrap(){return this.element}});function Vu(e,t){return Ic(Bu,e,t)}var Hu=I(`ZodObject`,(e,t)=>{tu(),Uo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>El(e,t,n,r),Qr(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Yu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ar(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ar(this._zod.def,{catchall:Lu()}))},loose(){return this.clone(ar(this._zod.def,{catchall:Lu()}))},strict(){return this.clone(ar(this._zod.def,{catchall:zu()}))},strip(){return this.clone(ar(this._zod.def,{catchall:void 0}))},extend(e){return wr(this,e)},safeExtend(e){return Er(this,e)},merge(e){return Dr(this,e)},pick(e){return xr(this,e)},omit(e){return Cr(this,e)},partial(...e){return Or(Qu,this,e[0])},exactPartial(...e){return Or(ed,this,e[0],`exactPartial`)},required(...e){return kr(cd,this,e[0])}});function Uu(e,t){return new Hu({type:`object`,shape:e,catchall:zu(),...gr(t)})}var Wu=I(`ZodUnion`,(e,t)=>{Go.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dl(e,t,n,r),e.options=t.options});function Gu(e,t){return new Wu({type:`union`,options:e,...gr(t)})}var Ku=I(`ZodIntersection`,(e,t)=>{Ko.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ol(e,t,n,r)});function qu(e,t){return new Ku({type:`intersection`,left:e,right:t})}var Ju=I(`ZodEnum`,(e,t)=>{Yo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xl(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 Ju({...t,checks:[],...gr(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 Ju({...t,checks:[],...gr(r),entries:i})}});function Yu(e,t){return new Ju({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...gr(t)})}var Xu=I(`ZodTransform`,(e,t)=>{tu(),Xo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cl(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new oi(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Vr(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(Vr(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Zu(e){return new Xu({type:`transform`,transform:e})}var Qu=I(`ZodOptional`,(e,t)=>{Qo.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $u(e){return new Qu({type:`optional`,innerType:e})}var ed=I(`ZodExactOptional`,(e,t)=>{$o.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function td(e){return new ed({type:`optional`,innerType:e})}var nd=I(`ZodNullable`,(e,t)=>{es.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rd(e){return new nd({type:`nullable`,innerType:e})}var id=I(`ZodDefault`,(e,t)=>{ts.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ad(e,t){return new id({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():fr(t)}})}var od=I(`ZodPrefault`,(e,t)=>{rs.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sd(e,t){return new od({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():fr(t)}})}var cd=I(`ZodNonOptional`,(e,t)=>{is.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Al(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ld(e,t){return new cd({type:`nonoptional`,innerType:e,...gr(t)})}var ud=I(`ZodCatch`,(e,t)=>{ss.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dd(e,t){return new ud({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ei(t)})}var fd=I(`ZodPipe`,(e,t)=>{cs.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Il(e,t,n,r),e.in=t.in,e.out=t.out});function pd(e,t){return new fd({type:`pipe`,in:e,out:t})}var md=I(`ZodReadonly`,(e,t)=>{us.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ll(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hd(e){return new md({type:`readonly`,innerType:e})}var gd=I(`ZodCustom`,(e,t)=>{fs.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sl(e,t,n,r)});function _d(e,t={}){return Lc(gd,e,t)}function vd(e,t){return Rc(e,t)}var yd=Uu({theme:au().refine(e=>Un.some(t=>t.id===e)).default(Un[0].id),terminal:Uu({font:Uu({family:au().default(`FiraCode Nerd Font`),size:ju().default(14),lineHeight:ju().default(1.35),ligatures:Fu().default(!0)}).prefault({}),cursor:Uu({style:Yu([`block`,`bar`,`underline`]).default(`bar`),blink:Fu().default(!0)}).prefault({}),padding:Uu({top:ju().default(4),right:ju().default(4),bottom:ju().default(0),left:ju().default(4)}).prefault({}),scrollback:ju().default(1e3),boldIsBright:Fu().default(!0),behavior:Uu({modernizeShiftEnter:Fu().default(!0),pasteBrowserImages:Fu().default(!0),captureShortcuts:Fu().default(!0),bellFlash:Fu().default(!0),bellSound:Fu().default(!0),clickToMoveCursor:Fu().default(!0),optionAsMeta:Yu([`off`,`left`,`right`,`both`]).default(`off`),confirmCloseBusyTab:Fu().default(!0)}).prefault({})}).prefault({}),diff:Uu({split:Fu().default(!1),wrap:Fu().default(!0)}).prefault({})}),bd=`prefs`,xd=yd.parse({});function Sd(){let e=localStorage.getItem(bd);if(e===null)return structuredClone(xd);let t=yd.safeParse(JSON.parse(e));return t.success?t.data:(console.warn(`invalid stored prefs, using the defaults:\n${bi(t.error)}`),structuredClone(xd))}function Cd(e){localStorage.setItem(bd,JSON.stringify(e))}function wd(){let e=L().prefs.theme,t=Un.find(t=>t.id===e);if(t===void 0)throw Error(`unknown theme ${e}`);return t}function Td(){let e=R(e=>e.prefs.theme),t=Un.find(t=>t.id===e);if(t===void 0)throw Error(`unknown theme ${e}`);return t.codeTheme}function Ed(){let e=wd(),t=document.documentElement.style;t.setProperty(`--bg`,e.background),t.setProperty(`--text`,e.foreground),t.setProperty(`--brand`,e.palette[4]),t.setProperty(`--danger`,e.palette[1]),t.setProperty(`--green`,e.palette[2]),t.setProperty(`--yellow`,e.palette[3]),document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,e.background)}var Dd={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`},Od;function kd(e){Od=Te()(()=>e)}function Ad(e){return Od.subscribe(e)}function L(){return Od.getState()}function R(e){return De(Od,e)}function z(e){Od.setState(e)}function jd(e,t){let n=e.machines.find(e=>e.id===t);if(n===void 0)throw Error(`unknown machine ${t}`);return n}function Md(e,t,n){return e.projects.find(e=>e.machine===t&&e.id===n)}function Nd(e){return e.selection?.machine??e.machines.at(0)?.id??null}function Pd(e,t){z({machines:L().machines.map(n=>n.id===e?{...n,...t}:n)})}function Fd(e,t,n){if(n!==null)return e.find(e=>e.id===t)?.activity[n]}function Id(e){let t=e.selection;if(t!==null)return Fd(e.machines,t.machine,t.sessionId)}function Ld(e){return Id(e)?.running===!0}function Rd(e){return Ze(e.machine,e.sessionId??e.projectId)}function zd(e){z({draft:e})}function Bd(e){z({paletteOpen:e})}function Vd(e){z({settingsOpen:e,paletteOpen:!1,...e&&{settingsMachine:Nd(L()),settingsAccount:null,settingsEditedMachine:null}})}function Hd(e){z({settingsOpen:!0,settingsPage:e,settingsAccount:null,settingsEditedMachine:null,paletteOpen:!1,...!L().settingsOpen&&{settingsMachine:Nd(L())}})}function Ud(e){z({prefs:e}),Cd(e),Ed()}function Wd(e){z({error:Vn(e)})}function Gd(){z({error:null})}function Kd(e){let t=new Map;function n(t,n){L().machines.some(e=>e.id===t)&&e.apply(t,n)}async function r(r,a){let o=await e.save(r,a),s=t.get(r);s!==void 0&&(--s.writes,!(s.writes>0)&&(o===null?await i(r):n(r,o)))}async function i(r){let i=t.get(r)?.version;try{let a=await e.load(r),o=t.get(r);o!==void 0&&o.writes===0&&o.version===i&&n(r,a)}catch(e){Wd(e)}}return{update(n,i){e.set(n,i);let a=t.get(n)??{writes:0,version:0,timer:void 0};t.set(n,a),a.timer===void 0&&(a.writes+=1),a.version+=1,window.clearTimeout(a.timer),a.timer=window.setTimeout(()=>{a.timer=void 0,r(n,i)},300)},receive(e,r){(t.get(e)?.writes??0)===0&&n(e,r)}}}var qd=Kd({set:(e,t)=>Pd(e,{config:t}),save:async(e,t)=>{try{let n=await M(e,`config.save`,t);return Pd(e,{configError:null}),n}catch(t){return Pd(e,{configError:Vn(t)}),null}},load:async e=>(await M(e,`config.get`,void 0)).config,apply:(e,t)=>Pd(e,{config:t})}),Jd=Kd({set:(e,t)=>Pd(e,{composer:t}),save:async(e,t)=>{try{return await M(e,`composer.save`,t)}catch(e){return Wd(e),null}},load:e=>M(e,`composer.get`,void 0),apply:$d}),Yd=qd.update,Xd=qd.receive,Zd=Jd.update,Qd=Jd.receive;function $d(e,t){Pd(e,{composer:t});let n=L().selection;if(n===null||n.machine!==e||Fd(L().machines,e,n.sessionId)!==void 0)return;let r=(n.sessionId===null?null:Ve(Rd(n)))??tf(t,n.sessionId===null?t.provider:L().settings.provider),i=r.provider!==L().settings.provider||r.accountId!==L().settings.accountId;z({settings:r}),i&&of()}var ef={provider:`claude`,accountId:null,model:null,effort:null,mode:null,plan:!1};function tf(e,t){return e===null?{...ef,provider:t}:{provider:t,...e[t]}}function nf(e){let t={...L().settings,...e};z({settings:t});let n=L().selection;if(n===null)return;n.sessionId!==null&&He(Rd(n),t);let r=jd(L(),n.machine).composer;r!==null&&Zd(n.machine,{...r,provider:t.provider,[t.provider]:{accountId:t.accountId,model:t.model,effort:t.effort,mode:t.mode,plan:t.plan}}),e.accountId!==void 0&&of(),n.sessionId!==null&&Fd(L().machines,n.machine,n.sessionId)!==void 0&&e.accountId===void 0&&M(n.machine,`sessions.configure`,{sessionId:n.sessionId,settings:t}).catch(Wd)}function rf(e,t){if(Pd(e,{claudeAccounts:t.claudeAccounts,codexAccounts:t.codexAccounts,openCode:t.openCode}),L().selection?.machine!==e)return;let n=L().settings,r=[...[...t.claudeAccounts,...t.codexAccounts].filter(e=>e.valid).map(e=>({provider:e.provider,accountId:e.id})),...t.openCode.available?[{provider:`opencode`,accountId:null}]:[]];if(r.some(e=>e.provider===n.provider&&e.accountId===n.accountId))return;let i=r.find(e=>e.provider===n.provider),a=L().selection?.sessionId===null?r.at(0):void 0;i===void 0?a===void 0?n.accountId!==null&&nf({accountId:null}):nf({...tf(jd(L(),e).composer,a.provider),accountId:a.accountId}):nf({accountId:i.accountId})}async function af(e){try{rf(e,await M(e,`accounts.list`,void 0))}catch(e){Wd(e)}}async function of(){let e=L().selection;if(e===null)return;let{provider:t,accountId:n}=L().settings;if(t!==`opencode`&&n===null)z({capabilities:null});else try{let r=await M(e.machine,`capabilities`,{provider:t,accountId:n,projectId:e.projectId});if(L().selection?.machine!==e.machine||L().selection?.projectId!==e.projectId||L().settings.provider!==t||L().settings.accountId!==n)return;z({capabilities:r});let i=L().settings;if(i.model!==null){let e=r.models.find(e=>e.value===i.model)?.effort;i.provider!==`opencode`&&i.effort===null&&e!=null&&nf({effort:e});return}let a=r.models.find(e=>!e.hidden&&e.value===r.defaultModel)??r.models.find(e=>!e.hidden);if(a===void 0)return;nf({model:a.value,...a.effort===null?{}:{effort:a.effort}})}catch(e){Wd(e)}}var sf={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`};function cf(e){return e.split(/[\\/]/).filter(Boolean).at(-1)??e}function lf(e){let t=Math.round((Date.now()-e)/1e3);return t<60?`now`:t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}d`}function uf(e){let t=new Date(e),n=t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`}),r=new Date,i=Math.round((new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()-new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime())/864e5);return i<=0?n:i===1?`yesterday at ${n}`:`${t.toLocaleDateString(void 0,t.getFullYear()===r.getFullYear()?{month:`numeric`,day:`numeric`}:{month:`numeric`,day:`numeric`,year:`numeric`})} ${n}`}function df(e){let t=new Date(e),n=t.getDate(),r=n%100>=11&&n%100<=13?`th`:n%10==1?`st`:n%10==2?`nd`:n%10==3?`rd`:`th`;return`${t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}, ${n}${r} ${t.toLocaleDateString(`en-US`,{month:`long`})} ${t.getFullYear()}`}function ff(e){return new Intl.NumberFormat(void 0,{notation:`compact`}).format(e)}function pf(e){let t=jd(L(),e.machine);z({selection:e,loaded:e.sessionId===null,items:[],earlier:[],before:null,partial:``,requests:[],queue:[],settings:(e.sessionId===null?null:Ve(Rd(e)))??tf(t.composer,L().sessions.find(t=>t.machine===e.machine&&t.id===e.sessionId)?.provider??t.composer?.provider??`claude`),context:null,paletteOpen:!1,unseen:L().unseen.filter(t=>e.sessionId===null||t!==Ze(e.machine,e.sessionId))}),We(),(t.claudeAccounts.length>0||t.codexAccounts.length>0||t.openCode.available)&&rf(e.machine,{claudeAccounts:t.claudeAccounts,codexAccounts:t.codexAccounts,openCode:t.openCode}),of(),e.sessionId!==null&&t.status===`online`&&M(e.machine,`sessions.open`,{projectId:e.projectId,sessionId:e.sessionId}).catch(Wd)}async function mf(e,t){let n=L().selection;if(n===null)throw Error(`no session selected`);`Notification`in window&&Notification.permission==="default"&&Notification.requestPermission(),z({sentAt:Date.now()}),await M(n.machine,`sessions.send`,{sessionId:n.sessionId,projectId:n.projectId,prompt:e,settings:L().settings,delivery:t})}function hf(e){let t=L().selection;t!==null&&t.sessionId!==null&&M(t.machine,`sessions.unqueue`,{sessionId:t.sessionId,id:e}).catch(Wd)}function gf(e){let t=L().selection;t!==null&&t.sessionId!==null&&M(t.machine,`sessions.steer`,{sessionId:t.sessionId,id:e}).catch(Wd)}function _f(){let e=L().selection;e!==null&&e.sessionId!==null&&M(e.machine,`sessions.interrupt`,{sessionId:e.sessionId}).catch(Wd)}function vf(e,t,n){M(e,`sessions.stopTask`,{sessionId:t,taskId:n}).catch(Wd)}function yf(e,t,n){let r=L().selection;r!==null&&r.sessionId!==null&&M(r.machine,`sessions.respond`,{sessionId:r.sessionId,requestId:e,decision:t,answers:n}).catch(Wd)}async function bf(e){let t=L().selection;if(t!==null&&t.sessionId!==null)try{let n=await M(t.machine,`sessions.fork`,{sessionId:t.sessionId,projectId:t.projectId,messageId:e});pf({...t,sessionId:n.sessionId})}catch(e){Wd(e)}}async function xf(){let e=L().selection,t=L().before;if(e!==null&&e.sessionId!==null&&t!==null)try{let n=await M(e.machine,`sessions.earlier`,{sessionId:e.sessionId,before:t});if(L().selection!==e||L().before!==t)return;z({earlier:[...n.items,...L().earlier],before:n.before})}catch(e){Wd(e)}}async function Sf(e,t){let n=L().selection;if(n!==null&&n.sessionId!==null)try{let r=await M(n.machine,`sessions.agent`,{sessionId:n.sessionId,projectId:n.projectId,agentId:t,parent:e});if(L().selection!==n)return;let i=new Set(r.map(e=>e.id)),a=L().items;z({items:[...a.filter(t=>t.parent!==e),...r,...a.filter(t=>t.parent===e&&!i.has(t.id))]})}catch(e){Wd(e)}}async function Cf(e,t,n){z({sessions:L().sessions.map(r=>r.machine===e&&r.id===t?{...r,...n}:r)});try{await M(e,`sessions.update`,{id:t,patch:n})}catch(e){Wd(e)}}async function wf(e,t){z({sessions:L().sessions.filter(n=>n.machine!==e||n.id!==t)}),Be(Ze(e,t));let n=L().selection;n?.machine===e&&n.sessionId===t&&pf({...n,sessionId:null});try{await M(e,`sessions.remove`,{id:t})}catch(e){Wd(e)}}var Tf=`notifications`,Ef=Promise.resolve(),Df=new Set;function Of(){return window.isSecureContext?!(`Notification`in window)||!(`serviceWorker`in navigator)?`unsupported`:Notification.permission:`insecure`}function kf(){let e=localStorage.getItem(Tf);if(e===null||e===`on`)return!0;if(e===`off`)return!1;throw Error(`unknown notification setting ${e}`)}async function Af(e){e&&Notification.permission==="default"&&await Notification.requestPermission(),localStorage.setItem(Tf,e?`on`:`off`)}async function jf(e,t){(await navigator.permissions.query({name:`notifications`})).addEventListener(`change`,t,{signal:e})}function Mf(e,t,n){if(document.hidden)for(let r of t){let t=Pf(e,r);Ff(e,r,`${t===void 0?`Agent`:sf[t.provider]} ${n}`,t?.title??`Session`,Ze(e,r))}}function Nf(e,t,n){Ff(e,t,Pf(e,t)?.title??`Session`,n,`push:${Ze(e,t)}`)}function Pf(e,t){return L().sessions.find(n=>n.machine===e&&n.id===t)}function Ff(e,t,n,r,i){if(Of()!==`granted`||!kf()||!jd(L(),e).notifier)return;let a=new Notification(n,{body:r,tag:i});a.onclick=()=>{window.focus();let n=Pf(e,t);n!==void 0&&pf({machine:e,projectId:n.projectId,sessionId:t})}}async function If(e,t,n){Of()===`granted`&&kf()&&jd(L(),n.machine).notifier&&await(await navigator.serviceWorker.ready).showNotification(e,{body:t,data:n})}function Lf(){let e=L().machines.filter(e=>de(e.id)&&!e.notifier&&!Df.has(e.id)).map(e=>e.id);if(e.length!==0){for(let t of e)Df.add(t);Rf().then(t=>Promise.all(e.map(e=>M(e,`notifications.claim`,{endpoint:t})))).catch(e=>console.error(`could not claim notifications`,e)).finally(()=>{for(let t of e)Df.delete(t)})}}async function Rf(){if(zf()!==`supported`)return null;let e=await navigator.serviceWorker.getRegistration();if(e===void 0)return null;let t=await e.pushManager.getSubscription();return t===null?null:t.endpoint}function zf(){return window.isSecureContext?!(`Notification`in window)||!(`serviceWorker`in navigator)||!(`PushManager`in window)?Bf()?`install`:`unsupported`:Notification.permission===`denied`?`denied`:`supported`:`insecure`}function Bf(){return/iPhone|iPad|iPod/.test(navigator.userAgent)||navigator.userAgent.includes(`Mac`)&&navigator.maxTouchPoints>1}async function Vf(){return await(await navigator.serviceWorker.ready).pushManager.getSubscription()!==null}async function Hf(){return Notification.permission==="default"&&await Notification.requestPermission(),Notification.permission===`granted`&&(await Gf(Kf),!0)}function Uf(){return Gf(qf)}function Wf(e){return Gf(async()=>{if(zf()!==`supported`)return;let t=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!t)return;let n=await Jf(),r=t.options.applicationServerKey;r!==null&&Xf(r)===n.publicKey?await Zf(e,t,n):await Kf()})}function Gf(e){let t=Ef.then(e);return Ef=t.catch(()=>void 0),t}async function Kf(){await qf();let e=await Jf(),t=await(await navigator.serviceWorker.ready).pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:e.publicKey});await Promise.all(Yf().map(n=>Zf(n,t,e)))}async function qf(){let e=await(await navigator.serviceWorker.ready).pushManager.getSubscription();e&&(await Promise.all(Yf().map(t=>M(t,`push.unsubscribe`,{endpoint:e.endpoint}))),await e.unsubscribe())}async function Jf(){let e=await caches.open(`offsite-worker`),t=await e.match(`/push-keys`);if(t!==void 0)return await t.json();let n=await crypto.subtle.generateKey({name:`ECDSA`,namedCurve:`P-256`},!0,[`sign`,`verify`]),r=(await crypto.subtle.exportKey(`jwk`,n.privateKey)).d;if(r===void 0)throw Error(`the browser did not export the push key`);let i={publicKey:Xf(await crypto.subtle.exportKey(`raw`,n.publicKey)),privateKey:r};return await e.put(`/push-keys`,new Response(JSON.stringify(i))),i}function Yf(){return L().machines.filter(e=>de(e.id)).map(e=>e.id)}function Xf(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}async function Zf(e,t,n){await M(e,`push.subscribe`,{subscription:t.toJSON(),...n,machine:e})}function Qf(){let e=Ke(),t=Ue(e.map(e=>e.id));kd({machines:e.map(Qe),sessions:[],projects:e.flatMap($e),prefs:Sd(),paletteOpen:!1,settingsOpen:!1,settingsPage:`General`,settingsAccount:null,settingsEditedMachine:null,settingsMachine:e.at(0)?.id??null,unseen:[],selection:t,loaded:t?.sessionId===null,items:[],earlier:[],before:null,partial:``,requests:[],queue:[],settings:(t===null||t.sessionId===null?null:Ve(Rd(t)))??ef,draft:null,context:null,capabilities:null,error:null,sentAt:0}),Ed(),ue({open:(e,t)=>{Pd(e,{via:t}),ep(e)},close:e=>{let t=L().machines.find(t=>t.id===e);t!==void 0&&t.status!==`offline`&&Pd(e,{status:`offline`,via:null,notifier:!1})},unpaired:e=>Pd(e,{status:`unpaired`,via:null,notifier:!1}),event:ip}),addEventListener(`keydown`,Lf,{capture:!0}),addEventListener(`pointerdown`,Lf,{capture:!0}),addEventListener(`storage`,e=>{e.key===`machines`&&et()});for(let t of e)ce(t.id,t.addresses);at(e),$f()}async function $f(){try{let e=Ye();e!==null&&await tt(e.address,e.code)}catch(e){Wd(e)}}async function ep(e){try{let t=await M(e,`sync`,void 0),n=L().machines.find(t=>t.id===e);if(n===void 0)return;Pd(e,{status:`online`,name:n.label??t.hostname,hostname:t.hostname,system:{defaults:t.defaults,platform:t.platform,defaultShell:t.defaultShell,defaultClaudeBaseDir:t.defaultClaudeBaseDir},activity:t.activity,providers:t.providers}),tp(e,t.projects),np(e,t.sessions),Xd(e,t.config),Qd(e,t.composer),rp(e),af(e),L().selection?.machine===e&&of()}catch(e){Wd(e)}}function tp(e,t){z({projects:[...L().projects.filter(t=>t.machine!==e),...t.map(t=>({...t,machine:e}))]}),lt()}function np(e,t){z({sessions:[...L().sessions.filter(t=>t.machine!==e),...t.map(t=>({...t,machine:e}))]})}function rp(e){let t=L().selection;t?.machine===e&&t.sessionId!==null&&M(e,`sessions.open`,{projectId:t.projectId,sessionId:t.sessionId}).catch(Wd)}function ip(e,t){let n=L(),r=n.machines.find(t=>t.id===e);if(r===void 0)return;let i=n.selection?.machine===e,a=i?n.selection?.sessionId??null:null;switch(t.type){case`activity`:{let o=r.activity,s=a!==null&&t.activity[a]?.running===!0,c=Object.keys(o).filter(e=>o[e].running&&t.activity[e]?.running!==!0),l=Object.keys(t.activity).filter(e=>t.activity[e].waiting&&o[e]?.waiting!==!0);Mf(e,c.filter(e=>o[e].prompted),`finished`),Mf(e,l,`needs your input`),Pd(e,{activity:t.activity}),z({partial:s||!i?n.partial:``,unseen:[...n.unseen,...c.filter(e=>e!==a).map(t=>Ze(e,t)).filter(e=>!n.unseen.includes(e))]});return}case`limits`:Pd(e,{claudeAccounts:r.claudeAccounts.map(e=>e.id===t.accountId?{...e,limits:t.limits}:e),codexAccounts:r.codexAccounts.map(e=>e.id===t.accountId?{...e,limits:t.limits}:e)});return;case`config`:Xd(e,t.config);return;case`composer`:Qd(e,t.composer);return;case`projects`:tp(e,t.projects);return;case`sessions`:np(e,t.sessions);return;case`accounts`:rf(e,t);return;case`providers`:Pd(e,{providers:t.providers});return;case`started`:if(n.selection===null||!i||n.selection.projectId!==t.projectId||n.selection.sessionId!==null)return;z({selection:{machine:e,projectId:t.projectId,sessionId:t.sessionId},loaded:!0,items:[],earlier:[],before:null,partial:``,requests:[],queue:[]}),We();return;case`notification`:Nf(e,t.sessionId,t.message);return;case`notifier`:Pd(e,{notifier:t.active});return}if(a!==null&&t.sessionId===a)switch(t.type){case`history`:z({loaded:!0,items:t.items,earlier:[],before:t.before,requests:t.requests,queue:t.queue,settings:t.settings??(n.settings.provider===t.provider?n.settings:tf(jd(n,e).composer,t.provider)),context:t.context,partial:t.partial}),t.settings!==null&&He(Ze(e,t.sessionId),t.settings);return;case`context`:z({context:t.context});return;case`items`:{let e=new Map(t.items.map(e=>[e.id,e]));z({items:[...n.items.map(t=>e.get(t.id)??t),...t.items.filter(e=>!n.items.some(t=>t.id===e.id))],partial:t.items.some(e=>e.kind===`assistant`&&e.parent===null)?``:n.partial});return}case`delta`:z({partial:n.partial+t.text});return;case`request`:z({requests:[...n.requests,t.request]});return;case`requestDone`:z({requests:n.requests.filter(e=>e.id!==t.requestId)});return;case`queue`:z({queue:t.queue});return;case`settings`:{let r={...t.settings,accountId:n.settings.accountId};z({settings:r}),He(Ze(e,t.sessionId),r)}}}var ap=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,op=dt,sp=(e,t)=>n=>{if(t?.variants==null)return op(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ap(t)||ap(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return op(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},cp=Object.defineProperty,lp=(e,t)=>cp(e,`name`,{value:t,configurable:!0});function up(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}lp(up,`setRef`);function dp(...e){return t=>{let n=!1,r=e.map(e=>{let r=up(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():up(e[t],null)}}}}lp(dp,`composeRefs`);function fp(...e){return v.useCallback(dp(...e),e)}lp(fp,`useComposedRefs`);var pp=Object.defineProperty,mp=(e,t)=>pp(e,`name`,{value:t,configurable:!0});function hp(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Ep(r),v.Children.forEach(r,e=>{if(Sp(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;wp(n)&&typeof Ap==`function`;)n=Ap(n._payload);a=yp(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?xp(a):void 0,l=fp(n,c);if(!a){if(r||r===0)throw Error(o?kp(e):Op(e));return r}let u=bp(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}mp(hp,`createSlot`);var gp=hp(`Slot`),_p=Symbol.for(`radix.slottable`);function vp(e){let t=mp(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=_p,t}mp(vp,`createSlottable`);var yp=mp((e,t)=>`child`in e.props?v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null:v.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function bp(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Dp(a,i))}return{...e,...n}}mp(bp,`mergeProps`);function xp(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}mp(xp,`getElementRef`);function Sp(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_p}mp(Sp,`isSlottable`);var Cp=Symbol.for(`react.lazy`);function wp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Cp&&`_payload`in e&&Tp(e._payload)}mp(wp,`isLazyComponent`);function Tp(e){return typeof e==`object`&&!!e&&`then`in e}mp(Tp,`isPromiseLike`);function Ep(e){let t=e;for(;wp(t)&&typeof Ap==`function`;)t=Ap(t._payload);return t}mp(Ep,`useUnwrappedLazy`);function Dp(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}mp(Dp,`concatAriaDescribedby`);var Op=mp(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),kp=mp(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ap=v.use,jp=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})),Mp=o(((e,t)=>{t.exports=jp()})),Np=l(h(),1),B=Mp(),Pp=Object.defineProperty,Fp=(e,t)=>Pp(e,`name`,{value:t,configurable:!0}),Ip=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=hp(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Lp(e,t){e&&Np.flushSync(()=>e.dispatchEvent(t))}Fp(Lp,`dispatchDiscreteCustomEvent`);var Rp=Object.defineProperty,zp=(e,t)=>Rp(e,`name`,{value:t,configurable:!0}),Bp=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Vp=v.forwardRef(zp(function(e,t){return(0,B.jsx)(Ip.span,{...e,ref:t,style:{...Bp,...e.style}})},`VisuallyHidden`)),Hp=Object.defineProperty,Up=(e,t)=>Hp(e,`name`,{value:t,configurable:!0});function Wp(e,t){let n=v.createContext(t);n.displayName=e+`Context`;let r=Up(e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=v.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Up(i,`useContext`),[r,i]}Up(Wp,`createContext`);function Gp(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Up(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=v.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Up(s,`useContext`),[o,s]}Up(r,`createContext`);let i=Up(()=>{let t=n.map(e=>v.createContext(e));return Up(function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Kp(i,...t)]}Up(Gp,`createContextScope`);function Kp(...e){let t=e[0];if(e.length===1)return t;let n=Up(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Up(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Up(Kp,`composeContextScopes`);var qp=globalThis?.document?v.useLayoutEffect:()=>{},Jp=Object.defineProperty,Yp=(e,t)=>Jp(e,`name`,{value:t,configurable:!0});function Xp(e){let t=e+`CollectionProvider`,[n,r]=Gp(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Yp(e=>{let{scope:t,children:n}=e,r=v.useRef(null),a=v.useRef(new Map).current;return(0,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=hp(s),l=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=fp(t,a(s,n).collectionRef);return(0,B.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=hp(u),p=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),s=fp(t,o),c=a(u,n);return v.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return v.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Yp(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Yp(Xp,`createCollection`);var Zp=new WeakMap,Qp=class e extends Map{static{Yp(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Zp.set(this,!0)}set(e,t){return Zp.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=tm(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=$p(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=$p(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return $p(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function $p(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=em(e,t);return n===-1?void 0:e[n]}Yp($p,`at`);function em(e,t){let n=e.length,r=tm(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Yp(em,`toSafeIndex`);function tm(e){return e!==e||e===0?0:Math.trunc(e)}Yp(tm,`toSafeInteger`);function nm(e){let t=e+`CollectionProvider`,[n,r]=Gp(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=Yp(({state:e,...t})=>e?(0,B.jsx)(u,{...t,state:e}):(0,B.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=Yp(e=>{let t=_();return(0,B.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=Yp(e=>{let{scope:t,children:n,state:r}=e,a=v.useRef(null),[s,c]=v.useState(null),l=fp(a,c),[u,d]=r,f=v.useRef(new Qp),p=v.useCallback(()=>{let e=f.current;return am(e)||e.sort(om),e},[]);return v.useEffect(()=>{if(!s)return;let e=sm(()=>{d(e=>{let t=e.toSorted(om);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,B.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,B.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=hp(d),p=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=fp(t,a(d,n).collectionElementRef);return(0,B.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=hp(m),g=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=v.useRef(i);rm(l.current,i)||(l.current=i);let u=l.current,d=fp(t,v.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);qp(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=v.useRef(null);return v.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new Qp(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(om)}))}),v.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new Qp(t);return n.delete(e.element),n})},[s]),(0,B.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function _(){return v.useState(new Qp)}Yp(_,`useInitCollection`);function y(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}Yp(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return Yp(b,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:_}]}Yp(nm,`createCollection`);function rm(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Yp(rm,`shallowEqual`);function im(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Yp(im,`isElementPreceding`);function am(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Yp(am,`isInDocumentOrder`);function om(e,t){return!e[1].element||!t[1].element?0:im(e[1].element,t[1].element)?-1:1}Yp(om,`sortByDocumentPosition`);function sm(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Yp(sm,`getChildListObserver`);var cm=Object.defineProperty,lm=(e,t)=>cm(e,`name`,{value:t,configurable:!0}),um=!!(typeof window<`u`&&window.document&&window.document.createElement);function V(e,t,{checkForDefaultPrevented:n=!0}={}){return lm(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}lm(V,`composeEventHandlers`);function dm(e){if(!um)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}lm(dm,`getOwnerWindow`);function fm(e){if(!um)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}lm(fm,`getOwnerDocument`);function pm(e,t=!1){let{activeElement:n}=fm(e);if(!n?.nodeName)return null;if(mm(n)&&n.contentDocument)return pm(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=fm(n).getElementById(e);if(t)return t}}return n}lm(pm,`getActiveElement`);function mm(e){return e.tagName===`IFRAME`}lm(mm,`isFrame`);var hm=Object.defineProperty,gm=(e,t)=>hm(e,`name`,{value:t,configurable:!0}),_m=v.useEffectEvent,vm=v.useInsertionEffect;function ym(e){if(typeof _m==`function`)return _m(e);let t=v.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof vm==`function`?vm(()=>{t.current=e}):qp(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}gm(ym,`useEffectEvent`);var bm=Object.defineProperty,xm=(e,t)=>bm(e,`name`,{value:t,configurable:!0}),Sm=v.useInsertionEffect||qp;function Cm({prop:e,defaultProp:t,onChange:n=xm(()=>{},`onChange`),caller:r}){let[i,a,o]=wm({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,v.useCallback(t=>{if(s){let n=Tm(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}xm(Cm,`useControllableState`);function wm({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return Sm(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}xm(wm,`useUncontrolledState`);function Tm(e){return typeof e==`function`}xm(Tm,`isFunction`);var Em=Symbol(`RADIX:SYNC_STATE`);function Dm(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=ym(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=v.useReducer((t,n)=>{if(n.type===Em)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=v.useRef(p);v.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=v.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return v.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Em,state:i})},[i,d.state,c]),[h,f]}xm(Dm,`useControllableStateReducer`);var Om=Object.defineProperty,km=(e,t)=>Om(e,`name`,{value:t,configurable:!0});function Am(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}km(Am,`useStateMachine`);var jm=km(e=>{let{present:t,children:n}=e,r=Mm(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=Pm(r.ref,Im(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null},`Presence`);function Mm(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),o=v.useRef(void 0),[s,c]=Am(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{s===`mounted`?(a.current=o.current??Fm(r.current),o.current=void 0):a.current=`none`},[s]),qp(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Fm(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),qp(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=km(a=>{let o=Fm(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=km(e=>{e.target===t&&(a.current=Fm(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:v.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Fm(t)}else r.current=null;n(e)},[])}}km(Mm,`usePresence`);function Nm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}km(Nm,`setRef`);function Pm(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Nm(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Nm(n[e],null)}}},[])}km(Pm,`useStableComposedRefs`);function Fm(e){return e?.animationName||`none`}km(Fm,`getAnimationName`);function Im(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}km(Im,`getElementRef`);var Lm=Object.defineProperty,Rm=(e,t)=>Lm(e,`name`,{value:t,configurable:!0}),zm=v.useId||(()=>void 0),Bm=0;function Vm(e){let[t,n]=v.useState(zm());return qp(()=>{e||n(e=>e??String(Bm++))},[e]),e||(t?`radix-${t}`:``)}Rm(Vm,`useId`);var Hm=Object.defineProperty,Um=(e,t)=>Hm(e,`name`,{value:t,configurable:!0}),Wm={LTR:`ltr`,RTL:`rtl`},Gm=v.createContext(void 0);function Km(e){let t=v.useContext(Gm);return e||t||Wm.LTR}Um(Km,`useDirection`);var qm=Object.defineProperty,Jm=(e,t)=>qm(e,`name`,{value:t,configurable:!0}),Ym=v.useInsertionEffect;function Xm(e){let t=v.useRef(e);return typeof Ym==`function`?Ym(()=>{t.current=e}):qp(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}Jm(Xm,`useCallbackRef`);var Zm=Object.defineProperty,Qm=(e,t)=>Zm(e,`name`,{value:t,configurable:!0}),$m=`dismissableLayer.update`,eh=`dismissableLayer.pointerDownOutside`,th=`dismissableLayer.focusOutside`,nh,rh=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ih=v.forwardRef(Qm(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(rh),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=fp(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_?g.indexOf(_):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=v.useRef(!1),w=sh(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=ch(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Xm(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return v.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(nh=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),lh(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=nh))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),lh())},[d,u]),v.useEffect(()=>{let e=Qm(()=>m({}),`handleUpdate`);return document.addEventListener($m,e),()=>document.removeEventListener($m,e)},[]),(0,B.jsx)(Ip.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:V(e.onFocusCapture,T.onFocusCapture),onBlurCapture:V(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function ah(){let e=v.useContext(rh),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Qm(ah,`useDismissableLayerSurface`);var oh=Qm(()=>!0,`IS_TRUE`);function sh(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=oh}=t,s=Xm(e),c=v.useRef(!1),l=v.useRef(!1),u=v.useRef(new Map),d=v.useRef(()=>{});return v.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Qm(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Qm(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Qm(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Qm(p,`handleInteractionBubble`);let m=Qm(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||uh(eh,s,p,{discrete:!0})};if(Qm(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Qm(()=>c.current=!0,`onPointerDownCapture`)}}Qm(sh,`usePointerDownOutside`);function ch(e,t=globalThis?.document){let n=Xm(e),r=v.useRef(!1);return v.useEffect(()=>{let e=Qm(e=>{e.target&&!r.current&&uh(th,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Qm(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Qm(()=>r.current=!1,`onBlurCapture`)}}Qm(ch,`useFocusOutside`);function lh(){let e=new CustomEvent($m);document.dispatchEvent(e)}Qm(lh,`dispatchUpdate`);function uh(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Lp(i,a):i.dispatchEvent(a)}Qm(uh,`handleAndDispatchCustomEvent`);var dh=Object.defineProperty,fh=(e,t)=>dh(e,`name`,{value:t,configurable:!0}),ph=`focusScope.autoFocusOnMount`,mh=`focusScope.autoFocusOnUnmount`,hh={bubbles:!1,cancelable:!0},gh=v.forwardRef(fh(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=v.useState(null),u=Xm(a),d=Xm(o),f=v.useRef(null),p=fp(t,l),m=v.useRef(i);v.useEffect(()=>{m.current=i});let h=v.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:Dh(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||Dh(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Dh(c)};fh(e,`handleFocusIn`),fh(t,`handleFocusOut`),fh(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),v.useEffect(()=>{if(c){Oh.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(ph,hh);c.addEventListener(ph,u),c.dispatchEvent(t),t.defaultPrevented||(xh(jh(Ch(c)),{select:!0}),document.activeElement===e&&Dh(c))}return()=>{c.removeEventListener(ph,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(mh,hh);c.addEventListener(mh,d),c.dispatchEvent(r),r.defaultPrevented||Dh(e??t.body,{select:!0}),c.removeEventListener(mh,d),Oh.remove(g)},0)}}},[c,u,d,g]);let _=v.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Sh(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Dh(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Dh(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,B.jsx)(Ip.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),_h=v.createContext(null);function vh({registry:e,children:t}){return e?(0,B.jsx)(_h.Provider,{value:e,children:t}):t}fh(vh,`FocusScopeBranchProvider`);function yh(){let[e,t]=v.useState([]);return{nodes:e,registry:v.useMemo(()=>({add:fh(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:fh(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}fh(yh,`useFocusScopeBranchRegistry`);function bh(e){let t=v.useContext(_h);v.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}fh(bh,`useFocusScopeBranch`);function xh(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Dh(r,{select:t}),document.activeElement!==n)return}fh(xh,`focusFirst`);function Sh(e){let t=Ch(e);return[wh(t,e),wh(t.reverse(),e)]}fh(Sh,`getTabbableEdges`);function Ch(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:fh(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}fh(Ch,`getTabbableCandidates`);function wh(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Th(r,{upTo:t})))return r}fh(wh,`findVisible`);function Th(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}fh(Th,`isHidden`);function Eh(e){return e.tagName===`INPUT`&&typeof e.select==`function`}fh(Eh,`isSelectableInput`);function Dh(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&Eh(e)&&t&&e.select()}}fh(Dh,`focus`);var Oh=kh();function kh(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ah(e,t),e.unshift(t)},remove(t){e=Ah(e,t),e[0]?.resume()}}}fh(kh,`createFocusScopesStack`);function Ah(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}fh(Ah,`arrayRemove`);function jh(e){return e.filter(e=>e.tagName!==`A`)}fh(jh,`removeLinks`);var Mh=Object.defineProperty,Nh=v.forwardRef(((e,t)=>Mh(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=v.useState(!1);qp(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Np.createPortal((0,B.jsx)(Ip.div,{...r,ref:t}),o):null},`Portal`)),Ph=Object.defineProperty,Fh=(e,t)=>Ph(e,`name`,{value:t,configurable:!0}),Ih=0,Lh=null;function Rh(e){return zh(),e.children}Fh(Rh,`FocusGuards`);function zh(){v.useEffect(()=>{Lh||={start:Bh(),end:Bh()};let{start:e,end:t}=Lh;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ih++,()=>{Ih===1&&(Lh?.start.remove(),Lh?.end.remove(),Lh=null),Ih=Math.max(0,Ih-1)}},[])}Fh(zh,`useFocusGuards`);function Bh(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Fh(Bh,`createFocusGuard`);var Vh=function(){return Vh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Vh.apply(this,arguments)};function Hh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Uh(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Wh=`right-scroll-bar-position`,Gh=`width-before-scroll-bar`,Kh=`with-scroll-bars-hidden`,qh=`--removed-body-scroll-bar-size`;function Jh(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Yh(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Xh=typeof window<`u`?v.useLayoutEffect:v.useEffect,Zh=new WeakMap;function Qh(e,t){var n=Yh(t||null,function(t){return e.forEach(function(e){return Jh(e,t)})});return Xh(function(){var t=Zh.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Jh(e,null)}),i.forEach(function(e){r.has(e)||Jh(e,a)})}Zh.set(n,e)},[e]),n}function $h(e){return e}function eg(e,t){t===void 0&&(t=$h);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function tg(e){e===void 0&&(e={});var t=eg(null);return t.options=Vh({async:!0,ssr:!1},e),t}var ng=function(e){var t=e.sideCar,n=Hh(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,Vh({},n))};ng.isSideCarExport=!0;function rg(e,t){return e.useMedium(t),ng}var ig=tg(),ag=function(){},og=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ag,onWheelCapture:ag,onTouchMoveCapture:ag}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,y=_===void 0?`div`:_,b=e.gapMode,x=Hh(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Qh([n,t]),w=Vh(Vh({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:ig,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),Vh(Vh({},w),{ref:C})):v.createElement(y,Vh({},w,{className:c,ref:C}),s))});og.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},og.classNames={fullWidth:Gh,zeroRight:Wh};var sg=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function cg(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=sg();return t&&e.setAttribute(`nonce`,t),e}function eee(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tee(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var lg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cg())&&(eee(t,n),tee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ug=function(){var e=lg();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dg=function(){var e=ug();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},fg={left:0,top:0,right:0,gap:0},pg=function(e){return parseInt(e||``,10)||0},mg=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[pg(n),pg(r),pg(i)]},hg=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return fg;var t=mg(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},nee=dg(),gg=`data-scroll-locked`,ree=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
66
66
  .${Kh} {
67
67
  overflow: hidden ${r};
68
68
  padding-right: ${s}px ${r};
@@ -381,7 +381,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
381
381
  `),n=e.split(`
382
382
  `).map(e=>e+`
383
383
  `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function qB(e){let t=e.item;switch(t.kind){case`file_change`:return(0,B.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.diffs.map((e,t)=>(0,B.jsx)($B,{before:e.before,after:e.after},t))});case`todo_list`:return(0,B.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm`,children:t.steps.map((e,t)=>(0,B.jsxs)(`li`,{className:F(`text-secondary-label`,e.status===`completed`&&`text-muted-foreground line-through`,e.status===`running`&&`text-foreground`),children:[e.status===`completed`?`☑`:`☐`,` `,e.text]},t))});case`plan`:return(0,B.jsx)(lB,{text:t.plan});case`tool`:return YB(t.name)===`other`?(0,B.jsx)(QB,{text:JSON.stringify(t.input,null,2)}):null;default:return null}}function JB(e,t){switch(e.kind){case`command`:return e.command;case`file_change`:return tV(e.path,t);case`web_search`:return e.url??e.query??``;case`subagent`:return e.description;case`skill`:return e.skill;case`tool`:{let n=YB(e.name);return n===`read`?tV(XB(e.input),t):n===`search`?eV(e.input.pattern):``}default:return``}}function YB(e){switch(e.toLowerCase()){case`read`:return`read`;case`grep`:case`glob`:return`search`;default:return`other`}}function XB(e){return[e.file_path,e.filePath,e.path].map(eV).find(e=>e!==``)??``}function ZB(e){let t=0,n=0;for(let r of e.diffs)for(let e of IB(r.before,r.after))e.added&&(t+=e.count),e.removed&&(n+=e.count);return{added:t,removed:n}}function QB(e){return(0,B.jsx)(`pre`,{className:`text-foreground/80 text-2xs max-h-64 overflow-auto font-mono leading-relaxed whitespace-pre-wrap`,children:e.text})}function $B(e){return(0,B.jsx)(`pre`,{className:`border-border/60 text-2xs max-h-80 overflow-auto rounded-md border font-mono leading-relaxed`,children:IB(e.before,e.after).flatMap((e,t)=>e.value.replace(/\n$/,``).split(`
384
- `).map((n,r)=>(0,B.jsxs)(`div`,{className:F(`px-2 whitespace-pre-wrap`,e.added&&`bg-diff-addition/10 text-diff-addition`,e.removed&&`bg-diff-deletion/10 text-diff-deletion`,!e.added&&!e.removed&&`text-muted-foreground`),children:[e.added?`+`:e.removed?`-`:` `,` `,n]},`${t}:${r}`)))})}function eV(e){return typeof e==`string`?e:``}function tV(e,t){return e.startsWith(t+`/`)?e.slice(t.length+1):e}var nV=`(Recommended)`;function rV(e){let t=e.options.map(e=>e.label).filter(e=>e.endsWith(nV));return e.multiSelect?t:t.slice(0,1)}function iV(e){return(0,B.jsxs)(`span`,{className:F(`mt-0.5 grid size-4 shrink-0 place-items-center border transition-colors`,e.multi?`rounded`:`rounded-full`,e.selected&&`border-primary bg-primary text-primary-foreground`,e.suggested&&`border-primary border-dashed`,!e.selected&&!e.suggested&&`border-muted-foreground/40`),children:[e.selected&&e.multi&&(0,B.jsx)(U,{icon:KD,strokeWidth:3,className:`size-3`}),e.selected&&!e.multi&&(0,B.jsx)(`span`,{className:`bg-primary-foreground size-1.5 rounded-full`})]})}var aV=`composer-glass relative mx-auto -mb-[calc(1rem+1px)] w-[calc(100%-2.75rem)] rounded-t-2xl border border-b-0 px-1 pt-1 pb-[calc(1rem+1px+0.25rem)] text-xs/4`;function oV(e){let t=e.request;if(t.kind===`question`)return(0,B.jsx)(sV,{machine:e.machine,request:t});let n=t.kind===`plan`,r=n?``:JB(t.item,e.cwd);return(0,B.jsx)(`div`,{className:F(aV,`border-warning/28 bg-linear-to-b from-warning/8 to-warning/8`),children:(0,B.jsxs)(`div`,{className:`grid grid-cols-[1.5rem_minmax(0,1fr)_auto] items-start gap-x-2 gap-y-3 px-1 py-1`,children:[(0,B.jsx)(`span`,{className:`text-warning flex justify-center pt-0.5`,children:(0,B.jsx)(U,{icon:ok,className:`size-4`})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col items-start gap-1`,children:[(0,B.jsxs)(`span`,{className:`text-muted-foreground text-2xs flex w-full min-w-0 items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-warning shrink-0 font-medium`,children:n?`Ready to code?`:t.title}),e.count>1&&(0,B.jsxs)(`span`,{className:`ml-auto shrink-0 tabular-nums`,children:[`1/`,e.count]})]}),r!==``&&(0,B.jsx)(`span`,{className:`text-foreground block max-h-20 w-full min-w-0 overflow-auto font-mono text-xs whitespace-pre`,children:r})]}),(0,B.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,B.jsx)(H,{size:`xs`,variant:`outline`,onClick:()=>yf(t.id,`deny`,null),children:n?`Keep planning`:`Decline`}),t.kind===`approval`&&t.canAlwaysAllow&&(0,B.jsx)(H,{size:`xs`,variant:`outline`,onClick:()=>yf(t.id,`always`,null),children:`Always`}),(0,B.jsx)(H,{size:`xs`,onClick:()=>yf(t.id,`allow`,null),children:n?`Approve plan`:`Approve`})]}),n&&(0,B.jsx)(`div`,{className:`col-span-3 max-h-60 overflow-auto px-1 empty:hidden`,children:(0,B.jsx)(lB,{text:t.plan})}),t.kind===`approval`&&t.item.kind!==`command`&&(0,B.jsx)(`div`,{className:`col-span-3 max-h-60 overflow-auto px-1 empty:hidden`,children:(0,B.jsx)(qB,{item:t.item})})]})})}function sV(e){let t=e.request.questions,[n,r]=(0,v.useState)(0),[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)({}),[c,l]=(0,v.useState)(0),u=Object.fromEntries(t.map(e=>[e.question,[...i[e.question]??[],o[e.question]?.trim()??``].filter(e=>e!==``)])),d=Object.fromEntries(t.map(e=>[e.question,(u[e.question].length>0?u[e.question]:rV(e)).join(`, `)])),f=t[n];function p(e,c){let l=i[e.question]??[];e.multiSelect?a({...i,[e.question]:l.includes(c)?l.filter(e=>e!==c):[...l,c]}):(a({...i,[e.question]:[c]}),s({...o,[e.question]:``}),n<t.length-1&&r(n+1))}function m(e,t){s({...o,[e.question]:t}),!e.multiSelect&&t.trim()!==``&&a({...i,[e.question]:[]})}async function h(t,n){for(let r of n){l(e=>e+1);try{let n=await SE(e.machine,r);s(e=>{let r=e[t.question]??``;return{...e,[t.question]:`${r}${/(^|\s)$/.test(r)?``:` `}${n}`}}),t.multiSelect||a(e=>({...e,[t.question]:[]}))}catch(e){Wd(e)}finally{l(e=>e-1)}}}return(0,B.jsx)(`div`,{className:`composer-glass shadow-composer relative z-10 rounded-3xl border border-(--composer-outline)`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-2 p-2.5`,children:[(0,B.jsxs)(`div`,{role:`tabpanel`,className:`flex min-w-0 flex-col gap-2`,children:[(0,B.jsxs)(`div`,{className:`mb-1 flex items-start gap-1.5 pt-1 pr-1 pl-1.5`,children:[(0,B.jsx)(`span`,{className:`bg-primary/18 text-primary grid size-6 shrink-0 place-items-center rounded-md`,children:(0,B.jsx)(U,{icon:RO,className:`size-4`})}),(0,B.jsx)(`p`,{className:`text-foreground min-w-0 flex-1 pt-0.5 text-[15px] leading-5 font-medium`,children:f.question}),(0,B.jsx)(H,{size:`icon-xs`,variant:`ghost`,"aria-label":`Skip questions`,title:`Skip questions`,onClick:()=>yf(e.request.id,`deny`,null),children:(0,B.jsx)(U,{icon:xk})})]}),(0,B.jsxs)(`div`,{role:f.multiSelect?`group`:`radiogroup`,"aria-label":f.question,className:`flex max-h-[min(18rem,32dvh)] flex-col gap-0.5 overflow-y-auto`,children:[f.options.map(e=>{let t=i[f.question]?.includes(e.label)===!0,n=u[f.question].length===0&&rV(f).includes(e.label),r=e.label.endsWith(nV);return(0,B.jsxs)(`button`,{role:f.multiSelect?`checkbox`:`radio`,"aria-checked":t,className:F(`flex cursor-pointer items-start gap-2.5 rounded-lg px-2.5 py-2 text-left transition-colors`,t?`bg-muted/70`:`hover:bg-muted/40`),onClick:()=>p(f,e.label),children:[(0,B.jsx)(iV,{multi:f.multiSelect,selected:t,suggested:n}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:`text-foreground text-sm`,children:r?e.label.slice(0,-13).trim():e.label}),r&&(0,B.jsx)(`span`,{className:`text-muted-foreground/70 text-[11px]`,children:`Recommended`})]}),e.description!==``&&(0,B.jsx)(`span`,{className:`text-secondary-label mt-0.5 block text-xs leading-4`,children:e.description})]})]},e.label)}),(0,B.jsxs)(`label`,{className:F(`flex cursor-text items-start gap-2.5 rounded-lg px-2.5 py-2 transition-colors`,(o[f.question]??``).trim()===``?`focus-within:bg-muted/40 hover:bg-muted/40`:`bg-muted/70`),children:[(0,B.jsx)(iV,{multi:f.multiSelect,selected:(o[f.question]??``).trim()!==``,suggested:!1}),(0,B.jsx)(`textarea`,{value:o[f.question]??``,rows:1,onChange:e=>m(f,e.target.value),onPaste:e=>{let t=e.clipboardData.getData(`text/plain`);if(t!==``){e.preventDefault(),document.execCommand(`insertText`,!1,t);return}let n=[...e.clipboardData.files];n.length!==0&&(e.preventDefault(),h(f,n))},onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),h(f,[...e.dataTransfer.files])},placeholder:`Something else…`,className:`placeholder:text-placeholder/75 [field-sizing:content] max-h-40 min-w-0 flex-1 resize-none bg-transparent text-sm leading-5 outline-none`})]})]})]},f.question),(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[t.length>1&&(0,B.jsx)(`div`,{role:`tablist`,className:`flex min-w-0 [scrollbar-width:none] gap-1 overflow-x-auto`,children:t.map((e,t)=>(0,B.jsxs)(`button`,{role:`tab`,"aria-selected":t===n,className:F(`flex h-6 shrink-0 cursor-pointer items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors`,t===n?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`),onClick:()=>r(t),children:[u[e.question].length>0&&(0,B.jsx)(U,{icon:qD,"aria-label":`Answered`,className:`text-success size-3.5`}),u[e.question].length===0&&d[e.question]!==``&&(0,B.jsx)(U,{icon:$D,"aria-label":`Using the recommended answer`,className:`text-primary size-3.5`}),d[e.question]===``&&(0,B.jsx)(U,{icon:SO,"aria-label":`Not answered`,className:`text-muted-foreground size-3.5`}),e.header]},e.question))}),(0,B.jsxs)(`div`,{className:`ml-auto flex shrink-0 gap-1.5 pr-1`,children:[n<t.length-1&&(0,B.jsx)(H,{size:`xs`,variant:`outline`,onClick:()=>r(n+1),children:`Next`}),(0,B.jsx)(H,{size:`xs`,disabled:c>0,onClick:()=>yf(e.request.id,`allow`,Object.fromEntries(Object.entries(d).filter(([,e])=>e!==``))),children:`Submit`})]})]})]})})}function cV({...e}){return(0,B.jsx)(jx,{"data-slot":`popover`,...e})}function lV({...e}){return(0,B.jsx)(Nx,{"data-slot":`popover-trigger`,...e})}function uV({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,B.jsx)(Lx,{children:(0,B.jsx)(zx,{"data-slot":`popover-content`,sideOffset:n,align:t,className:F(`z-50 origin-(--radix-popover-content-transform-origin) overflow-hidden rounded-lg dropdown-glass text-popover-foreground shadow-[0_16px_40px_-18px_rgb(0_0_0/55%)] outline-none dark:shadow-[0_18px_44px_-18px_rgb(0_0_0/80%)] duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}var dV=`relative inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap rounded-(--control-radius) border border-transparent outline-none hover:bg-accent data-[state=open]:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-64 [&_svg]:pointer-events-none [&_svg]:shrink-0`,fV=`h-7 gap-1.5 px-2.5 text-sm font-medium text-secondary-label hover:text-foreground [&_svg:not([class*=text-])]:text-muted-foreground [&_svg:not([class*=size-])]:size-4`;function pV(){let e=R(e=>e.settings),t=R(e=>e.capabilities)?.models.find(t=>t.value===e.model);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(mV,{}),(0,B.jsx)(`span`,{className:`bg-border mx-0.5 hidden h-4 w-px shrink-0 sm:block`}),t!==void 0&&t.efforts.length>0&&(0,B.jsx)(hV,{title:`Effort`,trigger:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(U,{icon:VD}),(0,B.jsx)(`span`,{className:`capitalize`,children:e.effort??`Default`})]}),value:e.effort??`default`,options:[{value:`default`,label:`Default`},...t.efforts.map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))],onChange:e=>nf({effort:e==="default"?null:e})})]})}function mV(){let e=R(e=>e.settings),t=R(e=>e.selection),n=R(e=>e.machines.find(t=>t.id===e.selection?.machine)),r=[...[...n?.claudeAccounts??[],...n?.codexAccounts??[]].filter(e=>e.valid).map(e=>({key:e.id,provider:e.provider,accountId:e.id,name:e.name,plan:e.plan,error:e.error})),...n?.openCode.available===!0?[{key:`opencode`,provider:`opencode`,accountId:null,name:`OpenCode`,plan:null,error:null}]:[]].filter(n=>t?.sessionId===null||n.provider===e.provider),i=e.provider===`opencode`?`opencode`:e.accountId,a=R(e=>e.capabilities),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(i),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)({}),m=(0,v.useRef)(null),h=a?.models.find(t=>t.value===e.model)?.name??e.model??`Choose a model`,g=r.find(e=>e.key===i),_=c===null?[]:c===i?a?.models??null:f[c]??null,y=r.find(e=>e.key===c)?.provider,b=(_??[]).filter(e=>!e.hidden),x=b.length>=5,S=x?u.trim().toLowerCase():``,C=b.filter(e=>`${e.name} ${e.description}`.toLowerCase().includes(S));function w(e){if(s(e),e&&(l(i),d(``),t!==null))for(let e of r)e.key!==i&&e.error===null&&M(t.machine,`capabilities`,{provider:e.provider,accountId:e.accountId,projectId:t.projectId}).then(t=>p(n=>({...n,[e.key]:t.models})),Wd)}function T(n,i){let a=r.find(e=>e.key===n);if(a===void 0||t===null)return;let o=a.provider,c={accountId:a.accountId,model:i.value,...i.effort===null?{}:{effort:i.effort}};o===e.provider?nf(c):nf({...tf(jd(L(),t.machine).composer,o),...c}),s(!1)}return(0,B.jsxs)(cV,{open:o,onOpenChange:w,children:[(0,B.jsx)(lV,{asChild:!0,children:(0,B.jsxs)(`button`,{className:F(dV,fV),title:g===void 0?`Model`:`${g.name} · ${h}`,children:[(0,B.jsx)(sA,{provider:e.provider,className:`size-4`}),(0,B.jsx)(`span`,{className:`max-w-40 truncate`,children:h}),r.length>1&&g!==void 0&&(0,B.jsx)(`span`,{className:`text-muted-foreground max-w-28 truncate font-normal`,children:g.name}),(0,B.jsx)(U,{icon:JD,strokeWidth:2.25,className:`text-icon-muted size-3.5`})]})}),(0,B.jsxs)(uV,{side:`top`,className:`flex max-h-86.5 w-screen max-w-90 flex-row`,onOpenAutoFocus:e=>{e.preventDefault(),m.current?.focus()},onCloseAutoFocus:e=>{e.preventDefault(),document.querySelector(`[data-composer]`)?.focus()},children:[r.length>1&&(0,B.jsxs)(`div`,{className:`bg-muted/30 flex w-11 shrink-0 [scrollbar-width:none] flex-col gap-1 overflow-y-auto p-1`,children:[r.map(e=>(0,B.jsxs)(`div`,{className:`relative w-full`,children:[e.key===c&&(0,B.jsx)(`div`,{className:`bg-primary pointer-events-none absolute top-1/2 -right-1 z-10 h-5 w-0.75 -translate-y-1/2 rounded-l-full`}),(0,B.jsx)($z,{side:`left`,label:e.error===null?[e.name,e.plan].filter(e=>e!==null).join(` · `):`${e.name} — ${e.error}`,children:(0,B.jsxs)(`button`,{className:F(`hover:bg-foreground/10 focus-visible:bg-foreground/10 relative flex aspect-square w-full cursor-pointer items-center justify-center rounded-md transition-colors focus-visible:outline-none`,e.error!==null&&`cursor-not-allowed opacity-50 hover:bg-transparent`),"aria-label":e.name,"aria-pressed":e.key===c,"aria-disabled":e.error!==null,onClick:()=>{e.error===null&&l(e.key)},children:[(0,B.jsx)(sA,{provider:e.provider,className:`size-5`}),(0,B.jsx)(`span`,{className:`bg-card text-muted-foreground text-3xs pointer-events-none absolute right-0.5 bottom-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full border px-0.5 leading-none font-semibold shadow-sm`,children:e.name.charAt(0).toUpperCase()})]})})]},e.key)),(0,B.jsx)($z,{side:`left`,label:`Manage accounts`,children:(0,B.jsx)(`button`,{className:`text-muted-foreground hover:bg-foreground/10 hover:text-foreground focus-visible:bg-foreground/10 mt-auto flex aspect-square w-full shrink-0 cursor-pointer items-center justify-center rounded-md transition-colors focus-visible:outline-none`,"aria-label":`Manage accounts`,onClick:()=>{s(!1),Hd(Dd[e.provider])},children:(0,B.jsx)(U,{icon:bk,className:`size-4.5`})})})]}),(0,B.jsxs)(`div`,{className:F(`bg-muted/40 flex min-h-0 min-w-0 flex-1 flex-col`,r.length>1&&`border-border/70 border-l`),children:[x&&(0,B.jsx)(`div`,{className:`shrink-0 px-3 pt-2.5`,children:(0,B.jsxs)(`div`,{className:`border-border/70 focus-within:border-ring relative border-b pb-1.5 transition-colors`,children:[(0,B.jsx)(U,{icon:rk,className:`text-muted-foreground/55 pointer-events-none absolute top-1.5 left-0 size-4`}),(0,B.jsx)(`input`,{ref:m,value:u,placeholder:`Search models...`,className:`placeholder:text-muted-foreground/70 h-6.5 w-full bg-transparent ps-5 text-sm outline-none`,onChange:e=>d(e.target.value),onKeyDown:e=>{if(e.key!==`Enter`||c===null)return;let t=C.at(0);t!==void 0&&(e.preventDefault(),T(c,t))}})]})}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-1.5`,children:C.length===0?(0,B.jsx)(`p`,{className:`text-muted-foreground p-2 text-center text-sm`,children:_===null?`Loading models…`:`No models found`}):C.map(t=>(0,B.jsx)(`button`,{className:F(`hover:bg-accent hover:text-accent-foreground mb-0.5 flex min-h-8 w-full cursor-pointer flex-col justify-center rounded-sm px-2 py-1.5 text-left`,c===i&&t.value===e.model&&`text-foreground bg-foreground/[0.08]`),onClick:()=>{c!==null&&T(c,t)},children:(0,B.jsxs)(`span`,{className:`truncate text-sm leading-snug font-medium`,children:[t.name,y===`opencode`&&(0,B.jsx)(`span`,{className:`text-muted-foreground ml-2 text-xs font-normal`,children:t.description})]})},t.value))})]})]})]})}function hV(e){return(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsxs)(`button`,{className:F(dV,fV),title:e.title,children:[e.trigger,(0,B.jsx)(U,{icon:JD,strokeWidth:2.25,className:`text-icon-muted size-3.5`})]})}),(0,B.jsxs)(pA,{className:`w-72`,side:`top`,align:`start`,onCloseAutoFocus:e=>{e.preventDefault(),document.querySelector(`[data-composer]`)?.focus()},children:[(0,B.jsx)(vA,{children:e.title}),(0,B.jsx)(gA,{value:e.value,onValueChange:e.onChange,children:e.options.map(e=>(0,B.jsx)(_A,{value:e.value,children:e.label},e.value))})]})]})}function gV(){let e=R(e=>e.queue);return(0,B.jsx)(`div`,{className:`composer-glass relative mx-auto -mb-[calc(1rem+1px)] w-[calc(100%-2.75rem)] rounded-t-2xl border border-b-0 border-(--composer-outline) px-1 pt-1 pb-[calc(1rem+1px+0.25rem)] text-xs/4`,children:e.map(e=>(0,B.jsxs)(`div`,{className:`grid min-h-6 grid-cols-[1.5rem_minmax(0,1fr)_auto_auto] items-center gap-x-1`,children:[(0,B.jsx)(U,{icon:PO,className:`text-muted-foreground mx-auto size-3`}),(0,B.jsx)(`span`,{className:`text-secondary-label truncate`,children:e.prompt.text===``?`${e.prompt.images.length} image(s)`:e.prompt.text}),(0,B.jsx)(H,{variant:`ghost-muted`,size:`icon-xs`,title:`Send now`,onClick:()=>gf(e.id),children:(0,B.jsx)(U,{icon:zD})}),(0,B.jsx)(H,{variant:`ghost-muted`,size:`icon-xs`,title:`Remove from queue`,onClick:()=>hf(e.id),children:(0,B.jsx)(U,{icon:xk})})]},e.id))})}var _V=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`],vV=5242880;function yV(){let e=R(e=>e.selection),t=R(e=>e.loaded),n=R(e=>e.items.length===0&&e.partial===``),r=R(e=>e.requests),i=R(e=>e.queue),a=R(e=>e.draft),o=R(e=>e.capabilities),s=R(e=>e.settings.provider===`opencode`?e.machines.find(t=>t.id===e.selection?.machine)?.openCode.available!==!0:e.settings.accountId===null),[c,l]=(0,v.useState)(0),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(0),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)([]),y=(0,v.useRef)(null),b=(0,v.useRef)(null),x=e?.machine??``,S=e?.projectId??``,C=R(e=>Md(e,x,S)),w=R(e=>e.projects),T=R(e=>e.machines),E=R(e=>jd(e,x).status),D=R(e=>jd(e,x).config?.delivery??null),O=Ze(x,e?.sessionId??S),k=Re(O),A=k.text,ee=k.images,[te,ne]=(0,v.useState)(A.length),re=R(Ld),ie=t&&n&&!re,j=r.at(0);(0,v.useEffect)(()=>{let e=y.current;e!==null&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))},[e]),(0,v.useEffect)(()=>{a!==null&&(ze(O,e=>({...e,text:a})),ne(a.length),zd(null),y.current?.focus())},[a,O]),(0,v.useEffect)(()=>{E===`online`&&M(x,`files.list`,{projectId:S}).then(_,Wd)},[x,S,E]);let ae=A.slice(0,te),oe=/^\/\S*$/.exec(ae)?.[0]??/(?:^|\s)(@\S*)$/.exec(ae)?.[1]??null,se=oe?.slice(1).toLowerCase()??``,ce=oe===null||m?[]:oe.startsWith(`/`)?(o?.commands??[]).filter(e=>e.name.toLowerCase().includes(se)).sort((e,t)=>Number(!e.name.toLowerCase().startsWith(se))-Number(!t.name.toLowerCase().startsWith(se))).map(e=>({key:e.name,label:`/${e.name}${e.hint===``?``:` ${e.hint}`}`,description:e.description,insert:`/${e.name}`})):g.filter(e=>e.toLowerCase().includes(se)).slice(0,50).map(e=>({key:e,label:e,description:``,insert:`@${e}`})),le=Math.min(f,ce.length-1),ue=A.trim()===``&&ee.length===0||c>0||u||s;function de(e,t){ze(O,t=>({...t,text:e})),ne(t),p(0),h(!1)}function fe(e){if(oe===null)return;let t=te-oe.length,n=t+e.insert.length+1;de(`${A.slice(0,t)}${e.insert} ${A.slice(te)}`,n),requestAnimationFrame(()=>y.current?.setSelectionRange(n,n))}async function pe(e){if(!ue){d(!0);try{if(D===null)throw Error(`This machine is not connected`);await mf({text:A.trim(),images:ee},e?D===`queue`?`steer`:`queue`:D),ze(O,e=>({...e,text:``,images:[]})),ne(0)}catch(e){Wd(e)}finally{d(!1)}}}function me(){let e=L().settings,t=TA(e.provider,L().capabilities);t.length!==0&&nf({mode:t[(t.findIndex(t=>t.value===e.mode)+1)%t.length].value})}async function he(e){for(let t of e)if(_V.includes(t.type)&&t.size<=vV){let e=await CE(t);ze(O,n=>({...n,images:[...n.images,{mediaType:t.type,data:e}]}))}else{l(e=>e+1);try{let e=await SE(x,t);ze(O,t=>({...t,text:`${t.text}${/(^|\s)$/.test(t.text)?``:` `}@${e} `}))}catch(e){Wd(e)}finally{l(e=>e-1)}}}return(0,B.jsx)(`div`,{className:F(`pointer-events-none z-20`,ie?`absolute inset-0 flex items-center`:`relative shrink-0 before:absolute before:right-(--app-scrollbar-width) before:bottom-full before:left-0 before:h-8 before:bg-linear-to-t before:from-background before:to-transparent`),children:(0,B.jsx)(`div`,{className:F(`w-full px-3 sm:px-12`,ie&&`pb-3 sm:pb-4`),children:(0,B.jsxs)(`div`,{className:`pointer-events-auto relative z-10 mx-auto w-full max-w-(--chat-content-max-width)`,children:[ie&&(0,B.jsx)(`div`,{className:`absolute inset-x-0 bottom-full pb-4`,children:(0,B.jsxs)(`h1`,{className:`text-foreground w-full text-center text-2xl font-normal tracking-tight sm:text-3xl`,children:[`What should we build in`,` `,e?.sessionId===null?(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsxs)(`button`,{className:`border-muted-foreground/35 hover:border-foreground/60 inline-flex max-w-64 cursor-pointer border-b border-dotted align-bottom outline-none`,title:C?.path,children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:C?.name}),`?`]})}),(0,B.jsx)(pA,{className:`max-h-80 w-64`,onCloseAutoFocus:e=>{e.preventDefault(),y.current?.focus()},children:(0,B.jsx)(gA,{value:Ze(x,S),children:[...w].sort((e,t)=>T.findIndex(t=>t.id===e.machine)-T.findIndex(e=>e.id===t.machine)||e.name.localeCompare(t.name)).map(e=>(0,B.jsxs)(_A,{value:Ze(e.machine,e.id),title:e.path,onSelect:()=>pf({machine:e.machine,projectId:e.id,sessionId:null}),children:[(0,B.jsx)(aA,{machine:e.machine,projectId:e.id,className:`size-4 shrink-0 [&>img]:rounded-[4px] [&>svg]:rounded-[4px]`}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.name,T.length>1&&(0,B.jsx)(`span`,{className:`text-muted-foreground ml-1.5 text-xs`,children:T.find(t=>t.id===e.machine)?.name})]})]},Ze(e.machine,e.id)))})})]}):(0,B.jsx)(`span`,{className:`border-muted-foreground/35 inline-block max-w-64 truncate border-b border-dotted align-bottom`,title:C?.path,children:C?.name}),e?.sessionId!==null&&`?`]})}),i.length>0&&ce.length===0&&(0,B.jsx)(gV,{}),j!==void 0&&ce.length===0&&(0,B.jsx)(oV,{request:j,machine:x,cwd:C?.path??``,count:r.length},j.id),ce.length>0&&(0,B.jsx)(CA,{items:ce,active:le,onHover:p,onPick:fe}),(0,B.jsxs)(`div`,{className:F(`composer-glass shadow-composer relative z-10 border border-(--composer-outline) dark:shadow-none`,ie?`rounded-3xl`:`rounded-t-3xl border-b-0`,j?.kind===`question`&&`hidden`),onMouseDown:e=>{e.target instanceof Element&&e.currentTarget.contains(e.target)&&(e.target.closest(`button, a, input, textarea`)||(e.preventDefault(),y.current?.focus()))},onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),he([...e.dataTransfer.files])},children:[(0,B.jsxs)(`div`,{className:`px-3 pt-3.5 pb-2 sm:px-4 sm:pt-4`,children:[ee.length>0&&(0,B.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-2`,children:ee.map((e,t)=>(0,B.jsxs)(`div`,{className:`border-border/80 bg-background relative size-16 overflow-hidden rounded-lg border`,children:[(0,B.jsx)(`img`,{src:`data:${e.mediaType};base64,${e.data}`,alt:``,className:`size-full object-cover`}),(0,B.jsx)(`button`,{className:`absolute top-1 right-1 grid size-5 cursor-pointer place-items-center rounded-full bg-black/60 text-white`,title:`Remove image`,onClick:()=>ze(O,e=>({...e,images:e.images.filter((e,n)=>n!==t)})),children:(0,B.jsx)(U,{icon:xk,className:`size-3`})})]},t))}),(0,B.jsx)(`textarea`,{ref:y,"data-composer":!0,rows:1,spellCheck:!1,autoCorrect:`off`,"data-gramm":`false`,"data-gramm_editor":`false`,"data-enable-grammarly":`false`,"data-lt-active":`false`,value:A,onChange:e=>de(e.target.value,e.target.selectionStart),onSelect:e=>ne(e.currentTarget.selectionStart),onPaste:e=>{let t=e.clipboardData.getData(`text/plain`);if(t!==``){e.preventDefault(),document.execCommand(`insertText`,!1,t);return}let n=[...e.clipboardData.files];n.length!==0&&(e.preventDefault(),he(n))},onKeyDown:e=>{if(!e.nativeEvent.isComposing){if(ce.length>0){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;p((le+t+ce.length)%ce.length);return}if(e.key===`Enter`&&!e.shiftKey||e.key===`Tab`){e.preventDefault(),fe(ce[le]);return}if(e.key===`Escape`){e.preventDefault(),h(!0);return}}if(e.key===`Enter`&&!e.shiftKey)e.preventDefault(),pe(e.metaKey||e.ctrlKey);else if(e.key===`Tab`&&e.shiftKey)e.preventDefault(),me();else if(e.key===`ArrowUp`&&A===``){let t=bV(L().items);if(t===null)return;e.preventDefault(),de(t,t.length)}else e.key===`Escape`&&re&&_f()}},placeholder:s?`Add an account in Settings to start`:re&&D===`steer`?`Steer the agent… (${Bn}+Enter to queue)`:re?`Queue a follow-up… (${Bn}+Enter to send now)`:`Ask anything, @tag files/folders, or / for commands`,className:`placeholder:text-placeholder/75 block [field-sizing:content] max-h-52 min-h-19.5 w-full resize-none bg-transparent text-sm leading-relaxed outline-none`})]}),(0,B.jsxs)(`div`,{className:F(`flex min-w-0 items-center justify-between gap-2 px-3 sm:px-4`,ie?`pb-3 sm:pb-4`:`pb-2.5 sm:pb-3.5`),children:[(0,B.jsx)(`div`,{className:`-m-1 -ms-3.5 flex min-w-0 flex-1 [scrollbar-width:none] items-center gap-1 overflow-x-auto p-1 ps-3.5`,children:(0,B.jsx)(pV,{})}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,B.jsx)(`input`,{ref:b,type:`file`,multiple:!0,hidden:!0,onChange:e=>{he([...e.target.files??[]]),e.target.value=``}}),c>0&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Uploading…`}),(0,B.jsx)(EA,{}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,title:`Attach files`,"aria-label":`Attach files`,onClick:()=>b.current?.click(),children:(0,B.jsx)(U,{icon:JO})}),re&&ue?(0,B.jsx)(`button`,{className:`bg-destructive/90 shadow-destructive/24 hover:bg-destructive flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-white shadow-xs transition-colors`,title:`Stop (Esc)`,"aria-label":`Stop generation`,onClick:_f,children:(0,B.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`currentColor`,"aria-hidden":`true`,children:(0,B.jsx)(`rect`,{x:`2`,y:`2`,width:`8`,height:`8`,rx:`1.5`})})}):(0,B.jsx)(`button`,{className:`bg-message-action text-message-action-foreground shadow-message-action/24 hover:bg-message-action-hover relative flex size-9 items-center justify-center overflow-hidden rounded-full shadow-xs transition-all duration-150 hover:scale-105 enabled:cursor-pointer disabled:pointer-events-none disabled:opacity-64 disabled:shadow-none`,title:re&&D===`steer`?`Send now (Enter) · Queue (${Bn}+Enter)`:re?`Queue (Enter) · Send now (${Bn}+Enter)`:`Send (Enter)`,"aria-label":`Send message`,disabled:ue,onClick:e=>void pe(e.metaKey||e.ctrlKey),children:(0,B.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M7 11.5V2.5M7 2.5L3 6.5M7 2.5L11 6.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]})]})]})]})})})}function bV(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.kind===`user`&&n.parent===null&&n.format===`text`&&n.text!==``)return n.text}return null}function xV({className:e,type:t,...n}){return(0,B.jsx)(`input`,{type:t,"data-slot":`input`,className:F(`h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function SV(e){let t=(0,v.useRef)(e);return(0,v.useInsertionEffect)(()=>void(t.current=e)),(0,v.useCallback)((...e)=>t.current(...e),[])}var CV=(0,v.createContext)(void 0);function wV(){return(0,v.useContext)(CV)}var TV={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},EV={display:`contents`};function DV(){return null}var OV=`diffs-container`,kV=/(?=^From [a-f0-9]+ .+$)/m,AV=/(?=^diff --git)/gm,jV=/(?<=\n)/,MV=/^(---|\+\+\+)\s+([^\t\r\n]+)/,NV=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,PV=`header-prefix`,FV=`header-filename-suffix`,IV=`header-metadata`,LV=`header-custom`,RV={dark:`pierre-dark`,light:`pierre-light`},zV=`data-theme-css`,BV=`data-unsafe-css`,VV=`data-diffs-scrollbar-measure`,HV=`--diffs-scrollbar-gutter-measured`,UV=1e5,WV={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...WV});var GV=Object.freeze({fromStart:0,fromEnd:0}),KV={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},qV={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function JV(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function YV({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function XV(e,t){return e-(t===0?0:1)}function ZV(e,t){return XV(e,t)+t}function QV(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:$V(n,e.startContentIndex)}}function $V(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function eH({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d,getAnnotationSlotName:f=JV}){let p=n?.(e),m=r?.(e),h=i?.(e),g=a?.(e);return(0,B.jsxs)(B.Fragment,{children:[p==null?(0,B.jsxs)(B.Fragment,{children:[m!=null&&(0,B.jsx)(`div`,{slot:`header-prefix`,children:m}),h!=null&&(0,B.jsx)(`div`,{slot:`header-filename-suffix`,children:h}),g!=null&&(0,B.jsx)(`div`,{slot:`header-metadata`,children:g})]}):(0,B.jsx)(`div`,{slot:LV,children:p}),o!=null&&l?.map((e,t)=>(0,B.jsx)(`div`,{slot:f(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=tH(t,e);return(0,B.jsx)(`div`,{slot:n,style:EV,children:c(t,d)},n)}),s!=null&&(0,B.jsx)(`div`,{slot:`gutter-utility-slot`,style:TV,children:s(u)})]})}function tH(e,t){let n=QV(e,t);return n==null?void 0:YV({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function nH({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,lineAnnotations:o,renderGutterUtility:s,getHoveredLine:c,getAnnotationSlotName:l=JV}){let u=t?.(e),d=n?.(e),f=r?.(e),p=i?.(e);return(0,B.jsxs)(B.Fragment,{children:[u==null?(0,B.jsxs)(B.Fragment,{children:[d!=null&&(0,B.jsx)(`div`,{slot:`header-prefix`,children:d}),f!=null&&(0,B.jsx)(`div`,{slot:`header-filename-suffix`,children:f}),p!=null&&(0,B.jsx)(`div`,{slot:`header-metadata`,children:p})]}):(0,B.jsx)(`div`,{slot:LV,children:u}),a!=null&&o?.map((e,t)=>(0,B.jsx)(`div`,{slot:l(e),children:a(e)},t)),s!=null&&(0,B.jsx)(`div`,{slot:`gutter-utility-slot`,style:TV,children:s(c)})]})}var rH=new Map,iH=new Map,aH=new Map,oH=new Set;function sH(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!oH.has(t))return!1;return!0}function cH(e=RV){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var lH=new Set;function uH(e){let t=[],n=new Set;for(let r of dH(e.themes)){let e=mH(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return uH({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return uH({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function dH(e){return fH(e)?[e]:e}function fH(e){return mH(e)||pH(e)}function pH(e){return typeof e.name==`string`&&typeof e.load==`function`}function mH(e){return typeof e.getThemes==`function`}function hH(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var gH=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},_H=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},vH=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function yH(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new gH(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new _H(i));let c=r,l=s().then(e=>{let a=hH(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new vH(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var bH=yH();function xH(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=bH.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,bH.getResolvedTheme(n)??bH.seedResolvedTheme(n,e);lH.has(n)||(lH.add(n),t.loadThemeSync(e))}}function SH(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(oH.has(n.name))continue;let e=rH.get(n.name);e??(e=n,rH.set(n.name,e));let r=e.data.find(t=>t.name===e.name||t.aliases?.includes(e.name)===!0);if(r==null)throw Error(`attachResolvedLanguages: No returned grammar declares "${e.name}" as its name or an alias.`);t.loadLanguageSync(e.data);try{t.getLanguage(e.name)}catch{throw Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${e.name}". Load the alias first or give the grammar a unique name.`)}oH.add(e.name)}}function CH(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var wH=Object.defineProperty,TH=Object.getOwnPropertyDescriptor,EH=Object.getOwnPropertyNames,DH=Object.prototype.hasOwnProperty,OH=(e,t)=>{let n={};for(var r in e)wH(n,r,{get:e[r],enumerable:!0});return t||wH(n,Symbol.toStringTag,{value:`Module`}),n},kH=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=EH(t),a=0,o=i.length,s;a<o;a++)s=i[a],!DH.call(e,s)&&s!==n&&wH(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=TH(t,s))||r.enumerable});return e},AH=(e,t,n)=>(kH(e,t,`default`),n&&kH(n,t,`default`)),jH=[{id:`abap`,name:`ABAP`,import:(()=>$(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>$(()=>import(`./actionscript-3-Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>$(()=>import(`./ada-X3Y2mlq2.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>$(()=>import(`./ahk-DwADkxyd.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>$(()=>import(`./ahk2-_6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>$(()=>import(`./angular-html-CtL9u31h.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>$(()=>import(`./angular-ts-D4IFBcAh.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>$(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>$(()=>import(`./apex-KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>$(()=>import(`./apl-CqnJhScR.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>$(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>$(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>$(()=>import(`./asciidoc-SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>$(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>$(()=>import(`./astro-Dn1_avL_.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>$(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>$(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>$(()=>import(`./bat-qdxAdBWQ.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>$(()=>import(`./beancount-C2IN4Vk8.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>$(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>$(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>$(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>$(()=>import(`./bird2-CYIUgYqB.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>$(()=>import(`./blade-BKSa6Bs3.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>$(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>$(()=>import(`./c-C8sbMt_8.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>$(()=>import(`./c3-D0apG41V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>$(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>$(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>$(()=>import(`./chapel-BWxXvR2-.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>$(()=>import(`./clarity-CtfBBspg.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>$(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>$(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>$(()=>import(`./cobol-DNoVp--S.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>$(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>$(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>$(()=>import(`./coffee-m1P3e2U1.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>$(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>$(()=>import(`./coq-CGaSfhwR.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>$(()=>import(`./cpp-CDvshXRJ.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>$(()=>import(`./crystal-C4b65AQe.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>$(()=>import(`./csharp-dmMxLVLW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>$(()=>import(`./css-CqQV9eEE.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>$(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>$(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>$(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>$(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>$(()=>import(`./dart-CHZY9Xhz.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>$(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>$(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>$(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>$(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>$(()=>import(`./dotenv-CuH5my32.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>$(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>$(()=>import(`./edge-CEdbZQ1U.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>$(()=>import(`./elixir-CYDX6OgA.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>$(()=>import(`./elm-10RuU89D.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>$(()=>import(`./emacs-lisp-DR2vtWaj.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>$(()=>import(`./erb-BiMfBUaM.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>$(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>$(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>$(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>$(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>$(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>$(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>$(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>$(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>$(()=>import(`./gdscript-DYvRD3hg.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>$(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>$(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>$(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>$(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>$(()=>import(`./git-rebase-D4Se-3SO.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>$(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>$(()=>import(`./glimmer-js-sKOVTqrH.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>$(()=>import(`./glimmer-ts-DWMGXcHA.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>$(()=>import(`./glsl-6ltM2JGZ.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>$(()=>import(`./gn-CAXYAgV-.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>$(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>$(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>$(()=>import(`./graphql-DwyBbitO.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>$(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>$(()=>import(`./hack-DKDbxv34.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>$(()=>import(`./haml-Bsfivw5f.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>$(()=>import(`./handlebars-B3HW0h8N.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>$(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>$(()=>import(`./haxe-C8oCnwJJ.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>$(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>$(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>$(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>$(()=>import(`./html-D9EhGmAq.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>$(()=>import(`./html-derivative-Cs1eIi3k.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>$(()=>import(`./http-BG4vxnc2.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>$(()=>import(`./hurl-OIF0UEfX.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>$(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>$(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>$(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>$(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>$(()=>import(`./java-2iLSH1xc.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>$(()=>import(`./javascript-Di7CdqTh.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>$(()=>import(`./jinja-2mjIAN_z.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>$(()=>import(`./jison-Ciw1rqtP.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>$(()=>import(`./json-D7Dp9EFU.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>$(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>$(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>$(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>$(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>$(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>$(()=>import(`./jsx-WEelr3xJ.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>$(()=>import(`./julia-DL3m48KZ.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>$(()=>import(`./just-B-5HaJEz.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])))},{id:`kdl`,name:`KDL`,import:(()=>$(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>$(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>$(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>$(()=>import(`./latex-DKmfapvy.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>$(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>$(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>$(()=>import(`./liquid-Bqxp18sH.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>$(()=>import(`./llvm-DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>$(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>$(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>$(()=>import(`./lua-BSLGBVbN.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>$(()=>import(`./luau-VGWVLoqX.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>$(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>$(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>$(()=>import(`./marko-yLzCBGNR.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>$(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>$(()=>import(`./mdc-DSGSIXIk.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>$(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>$(()=>import(`./mermaid-BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>$(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>$(()=>import(`./mojo-fg40_ntQ.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>$(()=>import(`./moonbit-D9W784E_.js`),[]))},{id:`move`,name:`Move`,import:(()=>$(()=>import(`./move-BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>$(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>$(()=>import(`./nextflow-CSgcYZcx.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>$(()=>import(`./nextflow-groovy-D7IRt6Pp.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>$(()=>import(`./nginx-BF1hRuVH.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>$(()=>import(`./nim-kAH67IJv.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>$(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>$(()=>import(`./nsis-CjNLYCLg.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>$(()=>import(`./nushell--0fT3PI1.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>$(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>$(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>$(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>$(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>$(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>$(()=>import(`./org-DCuW6Ito.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])))},{id:`pascal`,name:`Pascal`,import:(()=>$(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>$(()=>import(`./perl-ChYkJruC.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>$(()=>import(`./php-Dy0o5CHL.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>$(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>$(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>$(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>$(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>$(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>$(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>$(()=>import(`./powershell-QtSnmXcu.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>$(()=>import(`./prisma-DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>$(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>$(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>$(()=>import(`./pug-C-vFGcyR.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>$(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>$(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>$(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>$(()=>import(`./qml-Bbhsm3bz.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>$(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>$(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>$(()=>import(`./r-D6AOSU_n.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>$(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>$(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>$(()=>import(`./razor-CsDTm1QE.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>$(()=>import(`./rbs-C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>$(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>$(()=>import(`./regexp-Cxw4Sy2X.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>$(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>$(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>$(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>$(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>$(()=>import(`./rst-BdEa7eTr.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])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>$(()=>import(`./ruby-CrX6uYJq.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>$(()=>import(`./rust-DpiIf5JO.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>$(()=>import(`./sas-Dq1DiCgf.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>$(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>$(()=>import(`./scala-BiFt_7mu.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>$(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>$(()=>import(`./scss-Cq-_Yezx.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>$(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>$(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>$(()=>import(`./shellscript-N1TdW_Vo.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>$(()=>import(`./shellsession-DGy-5gMa.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>$(()=>import(`./smalltalk-BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>$(()=>import(`./smithy-Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>$(()=>import(`./solidity-Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>$(()=>import(`./soy-BZmv_HHk.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>$(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>$(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>$(()=>import(`./sql-B0TfXN6P.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>$(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>$(()=>import(`./stata-D0cL92SE.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>$(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>$(()=>import(`./surrealql-B9RWrsWf.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>$(()=>import(`./svelte-Erfh9F_0.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>$(()=>import(`./swift-CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>$(()=>import(`./system-verilog-Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>$(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>$(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>$(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>$(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>$(()=>import(`./templ-C1hdk1C3.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>$(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>$(()=>import(`./tex-B6y5Z0Oe.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>$(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>$(()=>import(`./ts-tags-B8Q3bBJx.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>$(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>$(()=>import(`./tsx-CA2zlxVX.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>$(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>$(()=>import(`./twig-xr1-p8qn.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])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>$(()=>import(`./typescript-Bdd7ljtG.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>$(()=>import(`./typespec-BGhR2SqG.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>$(()=>import(`./typst-BGU6c2s1.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])))},{id:`v`,name:`V`,import:(()=>$(()=>import(`./v-DBj4K9d_.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>$(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>$(()=>import(`./vb-DOwzaHZ0.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>$(()=>import(`./verilog-B2gwz-sJ.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>$(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>$(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>$(()=>import(`./vue-CxnbGcMK.js`),__vite__mapDeps([121,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>$(()=>import(`./vue-html-D3pkBH4b.js`),__vite__mapDeps([122,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>$(()=>import(`./vue-vine-0adNns8e.js`),__vite__mapDeps([123,2,3,5,12,70,124])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>$(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>$(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>$(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>$(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>$(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>$(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>$(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>$(()=>import(`./xml-Bf5yulh9.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>$(()=>import(`./xsl-DnGCH2C6.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>$(()=>import(`./yaml-ALFPjwWA.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>$(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>$(()=>import(`./zig-CMLA9XwU.js`),[]))}],MH=Object.fromEntries(jH.map(e=>[e.id,e.import])),NH=Object.fromEntries(jH.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),PH={...MH,...NH},FH=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>$(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>$(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>$(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>$(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>$(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>$(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>$(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>$(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>$(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>$(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>$(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>$(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>$(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>$(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>$(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>$(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>$(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>$(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>$(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>$(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>$(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>$(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>$(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>$(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>$(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>$(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>$(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>$(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>$(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>$(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>$(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>$(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>$(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>$(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>$(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>$(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>$(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>$(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>$(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>$(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>$(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>$(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>$(()=>import(`./monokai-BscAjiQZ.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>$(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>$(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>$(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>$(()=>import(`./one-dark-pro-C6YyR8OD.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>$(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>$(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>$(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>$(()=>import(`./red-CYlAq2b0.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>$(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>$(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>$(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>$(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>$(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>$(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>$(()=>import(`./solarized-dark-b97czJOk.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>$(()=>import(`./solarized-light-DFPxpIYQ.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>$(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>$(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>$(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>$(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>$(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>$(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),IH=s({createOnigurumaEngine:()=>uU,getDefaultWasmLoader:()=>lU,loadWasm:()=>rU,setDefaultWasmLoader:()=>cU}),LH=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function RH(){return 2147483648}function zH(){return typeof performance<`u`?performance.now():Date.now()}var BH=(e,t)=>e+(t-e%t)%t;async function VH(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=RH();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,BH(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:zH,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 HH=Object.defineProperty,UH=(e,t,n)=>t in e?HH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WH=(e,t,n)=>UH(e,typeof t==`symbol`?t:t+``,n),GH=null;function KH(e){throw new LH(e.UTF8ToString(e.getLastOnigError()))}var qH=class e{constructor(t){WH(this,`utf16Length`),WH(this,`utf8Length`),WH(this,`utf16Value`),WH(this,`utf8Value`),WH(this,`utf16OffsetToUtf8`),WH(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}},JH=class e{constructor(t){if(WH(this,`id`,++e.LAST_ID),WH(this,`_onigBinding`),WH(this,`content`),WH(this,`utf16Length`),WH(this,`utf8Length`),WH(this,`utf16OffsetToUtf8`),WH(this,`utf8OffsetToUtf16`),WH(this,`ptr`),!GH)throw new LH(`Must invoke loadWasm first.`);this._onigBinding=GH,this.content=t;let n=new qH(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=GH.omalloc(1e4),e._sharedPtrInUse=!0,GH.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(GH)}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)}};WH(JH,`LAST_ID`,0),WH(JH,`_sharedPtr`,0),WH(JH,`_sharedPtrInUse`,!1);var YH=JH,XH=class{constructor(e){if(WH(this,`_onigBinding`),WH(this,`_ptr`),!GH)throw new LH(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new qH(e[r]);t[r]=i.createString(GH),n[r]=i.utf8Length}let r=GH.omalloc(4*e.length);GH.HEAPU32.set(t,r/4);let i=GH.omalloc(4*e.length);GH.HEAPU32.set(n,i/4);let a=GH.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)GH.ofree(t[n]);GH.ofree(i),GH.ofree(r),a===0&&KH(GH),this._onigBinding=GH,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 YH(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 ZH(e){return typeof e.instantiator==`function`}function QH(e){return typeof e.default==`function`}function $H(e){return e.data!==void 0}function eU(e){return typeof Response<`u`&&e instanceof Response}function tU(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 nU;function rU(e){if(nU)return nU;async function t(){GH=await VH(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),ZH(n)?n=await n.instantiator(t):QH(n)?n=await n.default(t):($H(n)&&(n=n.data),eU(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await aU(n)(t):await oU(n)(t):tU(n)||n instanceof WebAssembly.Module?n=await iU(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await iU(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return nU=t(),nU}function iU(e){return t=>WebAssembly.instantiate(e,t)}function aU(e){return t=>WebAssembly.instantiateStreaming(e,t)}function oU(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var sU;function cU(e){sU=e}function lU(){return sU}async function uU(e){return e&&await rU(e),{createScanner(e){return new XH(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new YH(e)}}}var dU=OH({});AH(dU,IH);var fU=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function pU(e){return mU(e)}function mU(e){return Array.isArray(e)?hU(e):e instanceof RegExp?e:typeof e==`object`?gU(e):e}function hU(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=mU(e[n]);return t}function gU(e){let t={};for(let n in e)t[n]=mU(e[n]);return t}function _U(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function vU(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?vU(e.substring(0,e.length-1)):e.substr(~t+1)}var yU=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,bU=class{static hasCaptures(e){return e!==null&&(yU.lastIndex=0,yU.test(e))}static replaceCaptures(e,t,n){return e.replace(yU,(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 xU(e,t){return e<t?-1:+(e>t)}function SU(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=xU(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function CU(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 wU(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var TU=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}},EU=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(jU(e),t)}static createFromParsedTheme(e,t){return PU(e,t)}_cachedMatchRoot=new TU(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=>OU(e.parent,t.parentScopes));return n?new AU(n.fontStyle,n.foreground,n.background):null}},DU=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 OU(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&&!kU(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function kU(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var AU=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function jU(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`&&CU(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&CU(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 MU(l,u,e,o,s,c)}}return n}var MU=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}},NU=(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))(NU||{});function PU(e,t){e.sort((e,t)=>{let n=xU(e.scope,t.scope);return n!==0||(n=SU(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 FU(t),o=new AU(n,a.getId(r),a.getId(i)),s=new RU(new LU(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 EU(a,o,s)}var FU=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)}},IU=Object.freeze([]),LU=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||IU,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)}},RU=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(),LU.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);else{for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(SU(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 LU(e,t,n,r,i))}}},zU=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=VU(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 BU(e){return e}function VU(e){return e}function HU(e,t){let n=[],r=WU(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(UU(i)){let e=[];do e.push(i),i=r.next();while(UU(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 UU(e){return!!e&&!!e.match(/[\w\.:]+/)}function WU(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 GU(e){typeof e.dispose==`function`&&e.dispose()}var KU=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},qU=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},JU=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))}},YU=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new KU(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new JU;for(let n of e)XU(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof KU){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 XU(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 KU?QU({baseGrammar:a,selfGrammar:i},r):ZU(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 KU(e))}function ZU(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];$U([r],t,n)}}function QU(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&$U(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&$U(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function $U(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?_U({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&$U(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=aW(i);switch(a.kind){case 0:QU({...t,selfGrammar:t.baseGrammar},n);break;case 1:QU(t,n);break;case 2:ZU(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?ZU(a.ruleName,i,n):QU(i,n)}else a.kind===4?n.add(new qU(a.scopeName,a.ruleName)):n.add(new KU(a.scopeName))}}}var eW=class{kind=0},tW=class{kind=1},nW=class{constructor(e){this.ruleName=e}kind=2},rW=class{constructor(e){this.scopeName=e}kind=3},iW=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function aW(e){if(e===`$base`)return new eW;if(e===`$self`)return new tW;let t=e.indexOf(`#`);return t===-1?new rW(e):t===0?new nW(e.substring(1)):new iW(e.substring(0,t),e.substring(t+1))}var oW=/\\(\d+)/,sW=/\\(\d+)/g,cW=-1,lW=-2;function uW(e){return e}function dW(e){return e}var fW=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=bU.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=bU.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${vU(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:bU.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:bU.replaceCaptures(this._contentName,e,t)}},pW=class extends fW{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!`)}},mW=class extends fW{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new yW(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 bW,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},hW=class extends fW{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 bW,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},gW=class extends fW{_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 yW(i,this.id),this.beginCaptures=a,this._end=new yW(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 bW;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}},_W=class extends fW{_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 yW(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new yW(o,lW),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 bW;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 bW,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},vW=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new pW(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new mW(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=_U({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new hW(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new _W(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 gW(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=aW(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 hW||e instanceof gW||e instanceof _W)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},yW=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`&&oW.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 sW.lastIndex=0,this.source.replace(sW,(e,t)=>wU(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}},bW=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 xW(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 xW(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},xW=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(`
384
+ `).map((n,r)=>(0,B.jsxs)(`div`,{className:F(`px-2 whitespace-pre-wrap`,e.added&&`bg-diff-addition/10 text-diff-addition`,e.removed&&`bg-diff-deletion/10 text-diff-deletion`,!e.added&&!e.removed&&`text-muted-foreground`),children:[e.added?`+`:e.removed?`-`:` `,` `,n]},`${t}:${r}`)))})}function eV(e){return typeof e==`string`?e:``}function tV(e,t){return e.startsWith(t+`/`)?e.slice(t.length+1):e}var nV=`(Recommended)`;function rV(e){let t=e.options.map(e=>e.label).filter(e=>e.endsWith(nV));return e.multiSelect?t:t.slice(0,1)}function iV(e){return(0,B.jsxs)(`span`,{className:F(`mt-0.5 grid size-4 shrink-0 place-items-center border transition-colors`,e.multi?`rounded`:`rounded-full`,e.selected&&`border-primary bg-primary text-primary-foreground`,e.suggested&&`border-primary border-dashed`,!e.selected&&!e.suggested&&`border-muted-foreground/40`),children:[e.selected&&e.multi&&(0,B.jsx)(U,{icon:KD,strokeWidth:3,className:`size-3`}),e.selected&&!e.multi&&(0,B.jsx)(`span`,{className:`bg-primary-foreground size-1.5 rounded-full`})]})}var aV=`composer-glass relative mx-auto -mb-[calc(1rem+1px)] w-[calc(100%-2.75rem)] rounded-t-2xl border border-b-0 px-1 pt-1 pb-[calc(1rem+1px+0.25rem)] text-xs/4`;function oV(e){let t=e.request;if(t.kind===`question`)return(0,B.jsx)(sV,{machine:e.machine,request:t});let n=t.kind===`plan`,r=n?``:JB(t.item,e.cwd);return(0,B.jsx)(`div`,{className:F(aV,`border-warning/28 bg-linear-to-b from-warning/8 to-warning/8`),children:(0,B.jsxs)(`div`,{className:`grid grid-cols-[1.5rem_minmax(0,1fr)_auto] items-start gap-x-2 gap-y-3 px-1 py-1`,children:[(0,B.jsx)(`span`,{className:`text-warning flex justify-center pt-0.5`,children:(0,B.jsx)(U,{icon:ok,className:`size-4`})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col items-start gap-1`,children:[(0,B.jsxs)(`span`,{className:`text-muted-foreground text-2xs flex w-full min-w-0 items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-warning shrink-0 font-medium`,children:n?`Ready to code?`:t.title}),e.count>1&&(0,B.jsxs)(`span`,{className:`ml-auto shrink-0 tabular-nums`,children:[`1/`,e.count]})]}),r!==``&&(0,B.jsx)(`span`,{className:`text-foreground block max-h-20 w-full min-w-0 overflow-auto font-mono text-xs whitespace-pre`,children:r})]}),(0,B.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,B.jsx)(H,{size:`xs`,variant:`outline`,onClick:()=>yf(t.id,`deny`,null),children:n?`Keep planning`:`Decline`}),t.kind===`approval`&&t.canAlwaysAllow&&(0,B.jsx)(H,{size:`xs`,variant:`outline`,onClick:()=>yf(t.id,`always`,null),children:`Always`}),(0,B.jsx)(H,{size:`xs`,onClick:()=>yf(t.id,`allow`,null),children:n?`Approve plan`:`Approve`})]}),n&&(0,B.jsx)(`div`,{className:`col-span-3 max-h-60 overflow-auto px-1 empty:hidden`,children:(0,B.jsx)(lB,{text:t.plan})}),t.kind===`approval`&&t.item.kind!==`command`&&(0,B.jsx)(`div`,{className:`col-span-3 max-h-60 overflow-auto px-1 empty:hidden`,children:(0,B.jsx)(qB,{item:t.item})})]})})}function sV(e){let t=e.request.questions,[n,r]=(0,v.useState)(0),[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)({}),[c,l]=(0,v.useState)(0),u=Object.fromEntries(t.map(e=>[e.question,[...i[e.question]??[],o[e.question]?.trim()??``].filter(e=>e!==``)])),d=Object.fromEntries(t.map(e=>[e.question,(u[e.question].length>0?u[e.question]:rV(e)).join(`, `)])),f=t[n];function p(e,c){let l=i[e.question]??[];e.multiSelect?a({...i,[e.question]:l.includes(c)?l.filter(e=>e!==c):[...l,c]}):(a({...i,[e.question]:[c]}),s({...o,[e.question]:``}),n<t.length-1&&r(n+1))}function m(e,t){s({...o,[e.question]:t}),!e.multiSelect&&t.trim()!==``&&a({...i,[e.question]:[]})}async function h(t,n){for(let r of n){l(e=>e+1);try{let n=await SE(e.machine,r);s(e=>{let r=e[t.question]??``;return{...e,[t.question]:`${r}${/(^|\s)$/.test(r)?``:` `}${n}`}}),t.multiSelect||a(e=>({...e,[t.question]:[]}))}catch(e){Wd(e)}finally{l(e=>e-1)}}}return(0,B.jsx)(`div`,{className:`composer-glass shadow-composer relative z-10 rounded-3xl border border-(--composer-outline)`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-2 p-2.5`,children:[(0,B.jsxs)(`div`,{role:`tabpanel`,className:`flex min-w-0 flex-col gap-2`,children:[(0,B.jsxs)(`div`,{className:`mb-1 flex items-start gap-1.5 pt-1 pr-1 pl-1.5`,children:[(0,B.jsx)(`span`,{className:`bg-primary/18 text-primary grid size-6 shrink-0 place-items-center rounded-md`,children:(0,B.jsx)(U,{icon:RO,className:`size-4`})}),(0,B.jsx)(`p`,{className:`text-foreground min-w-0 flex-1 pt-0.5 text-[15px] leading-5 font-medium`,children:f.question}),(0,B.jsx)(H,{size:`icon-xs`,variant:`ghost`,"aria-label":`Skip questions`,title:`Skip questions`,onClick:()=>yf(e.request.id,`deny`,null),children:(0,B.jsx)(U,{icon:xk})})]}),(0,B.jsxs)(`div`,{role:f.multiSelect?`group`:`radiogroup`,"aria-label":f.question,className:`flex max-h-[min(18rem,32dvh)] flex-col gap-0.5 overflow-y-auto`,children:[f.options.map(e=>{let t=i[f.question]?.includes(e.label)===!0,n=u[f.question].length===0&&rV(f).includes(e.label),r=e.label.endsWith(nV);return(0,B.jsxs)(`button`,{role:f.multiSelect?`checkbox`:`radio`,"aria-checked":t,className:F(`flex cursor-pointer items-start gap-2.5 rounded-lg px-2.5 py-2 text-left transition-colors`,t?`bg-muted/70`:`hover:bg-muted/40`),onClick:()=>p(f,e.label),children:[(0,B.jsx)(iV,{multi:f.multiSelect,selected:t,suggested:n}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:`text-foreground text-sm`,children:r?e.label.slice(0,-13).trim():e.label}),r&&(0,B.jsx)(`span`,{className:`text-muted-foreground/70 text-[11px]`,children:`Recommended`})]}),e.description!==``&&(0,B.jsx)(`span`,{className:`text-secondary-label mt-0.5 block text-xs leading-4`,children:e.description})]})]},e.label)}),(0,B.jsxs)(`label`,{className:F(`flex cursor-text items-start gap-2.5 rounded-lg px-2.5 py-2 transition-colors`,(o[f.question]??``).trim()===``?`focus-within:bg-muted/40 hover:bg-muted/40`:`bg-muted/70`),children:[(0,B.jsx)(iV,{multi:f.multiSelect,selected:(o[f.question]??``).trim()!==``,suggested:!1}),(0,B.jsx)(`textarea`,{value:o[f.question]??``,rows:1,onChange:e=>m(f,e.target.value),onPaste:e=>{let t=e.clipboardData.getData(`text/plain`);if(t!==``){e.preventDefault(),document.execCommand(`insertText`,!1,t);return}let n=[...e.clipboardData.files];n.length!==0&&(e.preventDefault(),h(f,n))},onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),h(f,[...e.dataTransfer.files])},placeholder:`Something else…`,className:`placeholder:text-placeholder/75 [field-sizing:content] max-h-40 min-w-0 flex-1 resize-none bg-transparent text-sm leading-5 outline-none`})]})]})]},f.question),(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[t.length>1&&(0,B.jsx)(`div`,{role:`tablist`,className:`flex min-w-0 [scrollbar-width:none] gap-1 overflow-x-auto`,children:t.map((e,t)=>(0,B.jsxs)(`button`,{role:`tab`,"aria-selected":t===n,className:F(`flex h-6 shrink-0 cursor-pointer items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors`,t===n?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`),onClick:()=>r(t),children:[u[e.question].length>0&&(0,B.jsx)(U,{icon:qD,"aria-label":`Answered`,className:`text-success size-3.5`}),u[e.question].length===0&&d[e.question]!==``&&(0,B.jsx)(U,{icon:$D,"aria-label":`Using the recommended answer`,className:`text-primary size-3.5`}),d[e.question]===``&&(0,B.jsx)(U,{icon:SO,"aria-label":`Not answered`,className:`text-muted-foreground size-3.5`}),e.header]},e.question))}),(0,B.jsxs)(`div`,{className:`ml-auto flex shrink-0 gap-1.5 pr-1`,children:[n<t.length-1&&(0,B.jsx)(H,{size:`xs`,variant:`outline`,onClick:()=>r(n+1),children:`Next`}),(0,B.jsx)(H,{size:`xs`,disabled:c>0,onClick:()=>yf(e.request.id,`allow`,Object.fromEntries(Object.entries(d).filter(([,e])=>e!==``))),children:`Submit`})]})]})]})})}function cV({...e}){return(0,B.jsx)(jx,{"data-slot":`popover`,...e})}function lV({...e}){return(0,B.jsx)(Nx,{"data-slot":`popover-trigger`,...e})}function uV({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,B.jsx)(Lx,{children:(0,B.jsx)(zx,{"data-slot":`popover-content`,sideOffset:n,align:t,className:F(`z-50 origin-(--radix-popover-content-transform-origin) overflow-hidden rounded-lg dropdown-glass text-popover-foreground shadow-[0_16px_40px_-18px_rgb(0_0_0/55%)] outline-none dark:shadow-[0_18px_44px_-18px_rgb(0_0_0/80%)] duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}var dV=`relative inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap rounded-(--control-radius) border border-transparent outline-none hover:bg-accent data-[state=open]:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-64 [&_svg]:pointer-events-none [&_svg]:shrink-0`,fV=`h-7 gap-1.5 px-2.5 text-sm font-medium text-secondary-label hover:text-foreground [&_svg:not([class*=text-])]:text-muted-foreground [&_svg:not([class*=size-])]:size-4`;function pV(){let e=R(e=>e.settings),t=R(e=>e.capabilities)?.models.find(t=>t.value===e.model);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(mV,{}),(0,B.jsx)(`span`,{className:`bg-border mx-0.5 hidden h-4 w-px shrink-0 sm:block`}),t!==void 0&&t.efforts.length>0&&(0,B.jsx)(hV,{title:`Effort`,trigger:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(U,{icon:VD}),(0,B.jsx)(`span`,{className:`capitalize`,children:e.effort??`Default`})]}),value:e.effort??`default`,options:[...e.provider===`opencode`?[{value:`default`,label:`Default`}]:[],...t.efforts.map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))],onChange:e=>nf({effort:e==="default"?null:e})})]})}function mV(){let e=R(e=>e.settings),t=R(e=>e.selection),n=R(e=>e.machines.find(t=>t.id===e.selection?.machine)),r=[...[...n?.claudeAccounts??[],...n?.codexAccounts??[]].filter(e=>e.valid).map(e=>({key:e.id,provider:e.provider,accountId:e.id,name:e.name,plan:e.plan,error:e.error})),...n?.openCode.available===!0?[{key:`opencode`,provider:`opencode`,accountId:null,name:`OpenCode`,plan:null,error:null}]:[]].filter(n=>t?.sessionId===null||n.provider===e.provider),i=e.provider===`opencode`?`opencode`:e.accountId,a=R(e=>e.capabilities),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(i),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)({}),m=(0,v.useRef)(null),h=a?.models.find(t=>t.value===e.model)?.name??e.model??`Choose a model`,g=r.find(e=>e.key===i),_=c===null?[]:c===i?a?.models??null:f[c]??null,y=r.find(e=>e.key===c)?.provider,b=(_??[]).filter(e=>!e.hidden),x=b.length>=5,S=x?u.trim().toLowerCase():``,C=b.filter(e=>`${e.name} ${e.description}`.toLowerCase().includes(S));function w(e){if(s(e),e&&(l(i),d(``),t!==null))for(let e of r)e.key!==i&&e.error===null&&M(t.machine,`capabilities`,{provider:e.provider,accountId:e.accountId,projectId:t.projectId}).then(t=>p(n=>({...n,[e.key]:t.models})),Wd)}function T(n,i){let a=r.find(e=>e.key===n);if(a===void 0||t===null)return;let o=a.provider,c={accountId:a.accountId,model:i.value,...i.effort===null?{}:{effort:i.effort}};o===e.provider?nf(c):nf({...tf(jd(L(),t.machine).composer,o),...c}),s(!1)}return(0,B.jsxs)(cV,{open:o,onOpenChange:w,children:[(0,B.jsx)(lV,{asChild:!0,children:(0,B.jsxs)(`button`,{className:F(dV,fV),title:g===void 0?`Model`:`${g.name} · ${h}`,children:[(0,B.jsx)(sA,{provider:e.provider,className:`size-4`}),(0,B.jsx)(`span`,{className:`max-w-40 truncate`,children:h}),r.length>1&&g!==void 0&&(0,B.jsx)(`span`,{className:`text-muted-foreground max-w-28 truncate font-normal`,children:g.name}),(0,B.jsx)(U,{icon:JD,strokeWidth:2.25,className:`text-icon-muted size-3.5`})]})}),(0,B.jsxs)(uV,{side:`top`,className:`flex max-h-86.5 w-screen max-w-90 flex-row`,onOpenAutoFocus:e=>{e.preventDefault(),m.current?.focus()},onCloseAutoFocus:e=>{e.preventDefault(),document.querySelector(`[data-composer]`)?.focus()},children:[r.length>1&&(0,B.jsxs)(`div`,{className:`bg-muted/30 flex w-11 shrink-0 [scrollbar-width:none] flex-col gap-1 overflow-y-auto p-1`,children:[r.map(e=>(0,B.jsxs)(`div`,{className:`relative w-full`,children:[e.key===c&&(0,B.jsx)(`div`,{className:`bg-primary pointer-events-none absolute top-1/2 -right-1 z-10 h-5 w-0.75 -translate-y-1/2 rounded-l-full`}),(0,B.jsx)($z,{side:`left`,label:e.error===null?[e.name,e.plan].filter(e=>e!==null).join(` · `):`${e.name} — ${e.error}`,children:(0,B.jsxs)(`button`,{className:F(`hover:bg-foreground/10 focus-visible:bg-foreground/10 relative flex aspect-square w-full cursor-pointer items-center justify-center rounded-md transition-colors focus-visible:outline-none`,e.error!==null&&`cursor-not-allowed opacity-50 hover:bg-transparent`),"aria-label":e.name,"aria-pressed":e.key===c,"aria-disabled":e.error!==null,onClick:()=>{e.error===null&&l(e.key)},children:[(0,B.jsx)(sA,{provider:e.provider,className:`size-5`}),(0,B.jsx)(`span`,{className:`bg-card text-muted-foreground text-3xs pointer-events-none absolute right-0.5 bottom-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full border px-0.5 leading-none font-semibold shadow-sm`,children:e.name.charAt(0).toUpperCase()})]})})]},e.key)),(0,B.jsx)($z,{side:`left`,label:`Manage accounts`,children:(0,B.jsx)(`button`,{className:`text-muted-foreground hover:bg-foreground/10 hover:text-foreground focus-visible:bg-foreground/10 mt-auto flex aspect-square w-full shrink-0 cursor-pointer items-center justify-center rounded-md transition-colors focus-visible:outline-none`,"aria-label":`Manage accounts`,onClick:()=>{s(!1),Hd(Dd[e.provider])},children:(0,B.jsx)(U,{icon:bk,className:`size-4.5`})})})]}),(0,B.jsxs)(`div`,{className:F(`bg-muted/40 flex min-h-0 min-w-0 flex-1 flex-col`,r.length>1&&`border-border/70 border-l`),children:[x&&(0,B.jsx)(`div`,{className:`shrink-0 px-3 pt-2.5`,children:(0,B.jsxs)(`div`,{className:`border-border/70 focus-within:border-ring relative border-b pb-1.5 transition-colors`,children:[(0,B.jsx)(U,{icon:rk,className:`text-muted-foreground/55 pointer-events-none absolute top-1.5 left-0 size-4`}),(0,B.jsx)(`input`,{ref:m,value:u,placeholder:`Search models...`,className:`placeholder:text-muted-foreground/70 h-6.5 w-full bg-transparent ps-5 text-sm outline-none`,onChange:e=>d(e.target.value),onKeyDown:e=>{if(e.key!==`Enter`||c===null)return;let t=C.at(0);t!==void 0&&(e.preventDefault(),T(c,t))}})]})}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-1.5`,children:C.length===0?(0,B.jsx)(`p`,{className:`text-muted-foreground p-2 text-center text-sm`,children:_===null?`Loading models…`:`No models found`}):C.map(t=>(0,B.jsx)(`button`,{className:F(`hover:bg-accent hover:text-accent-foreground mb-0.5 flex min-h-8 w-full cursor-pointer flex-col justify-center rounded-sm px-2 py-1.5 text-left`,c===i&&t.value===e.model&&`text-foreground bg-foreground/[0.08]`),onClick:()=>{c!==null&&T(c,t)},children:(0,B.jsxs)(`span`,{className:`truncate text-sm leading-snug font-medium`,children:[t.name,y===`opencode`&&(0,B.jsx)(`span`,{className:`text-muted-foreground ml-2 text-xs font-normal`,children:t.description})]})},t.value))})]})]})]})}function hV(e){return(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsxs)(`button`,{className:F(dV,fV),title:e.title,children:[e.trigger,(0,B.jsx)(U,{icon:JD,strokeWidth:2.25,className:`text-icon-muted size-3.5`})]})}),(0,B.jsxs)(pA,{className:`w-72`,side:`top`,align:`start`,onCloseAutoFocus:e=>{e.preventDefault(),document.querySelector(`[data-composer]`)?.focus()},children:[(0,B.jsx)(vA,{children:e.title}),(0,B.jsx)(gA,{value:e.value,onValueChange:e.onChange,children:e.options.map(e=>(0,B.jsx)(_A,{value:e.value,children:e.label},e.value))})]})]})}function gV(){let e=R(e=>e.queue);return(0,B.jsx)(`div`,{className:`composer-glass relative mx-auto -mb-[calc(1rem+1px)] w-[calc(100%-2.75rem)] rounded-t-2xl border border-b-0 border-(--composer-outline) px-1 pt-1 pb-[calc(1rem+1px+0.25rem)] text-xs/4`,children:e.map(e=>(0,B.jsxs)(`div`,{className:`grid min-h-6 grid-cols-[1.5rem_minmax(0,1fr)_auto_auto] items-center gap-x-1`,children:[(0,B.jsx)(U,{icon:PO,className:`text-muted-foreground mx-auto size-3`}),(0,B.jsx)(`span`,{className:`text-secondary-label truncate`,children:e.prompt.text===``?`${e.prompt.images.length} image(s)`:e.prompt.text}),(0,B.jsx)(H,{variant:`ghost-muted`,size:`icon-xs`,title:`Send now`,onClick:()=>gf(e.id),children:(0,B.jsx)(U,{icon:zD})}),(0,B.jsx)(H,{variant:`ghost-muted`,size:`icon-xs`,title:`Remove from queue`,onClick:()=>hf(e.id),children:(0,B.jsx)(U,{icon:xk})})]},e.id))})}var _V=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`],vV=5242880;function yV(){let e=R(e=>e.selection),t=R(e=>e.loaded),n=R(e=>e.items.length===0&&e.partial===``),r=R(e=>e.requests),i=R(e=>e.queue),a=R(e=>e.draft),o=R(e=>e.capabilities),s=R(e=>e.settings.provider===`opencode`?e.machines.find(t=>t.id===e.selection?.machine)?.openCode.available!==!0:e.settings.accountId===null),[c,l]=(0,v.useState)(0),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(0),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)([]),y=(0,v.useRef)(null),b=(0,v.useRef)(null),x=e?.machine??``,S=e?.projectId??``,C=R(e=>Md(e,x,S)),w=R(e=>e.projects),T=R(e=>e.machines),E=R(e=>jd(e,x).status),D=R(e=>jd(e,x).config?.delivery??null),O=Ze(x,e?.sessionId??S),k=Re(O),A=k.text,ee=k.images,[te,ne]=(0,v.useState)(A.length),re=R(Ld),ie=t&&n&&!re,j=r.at(0);(0,v.useEffect)(()=>{let e=y.current;e!==null&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))},[e]),(0,v.useEffect)(()=>{a!==null&&(ze(O,e=>({...e,text:a})),ne(a.length),zd(null),y.current?.focus())},[a,O]),(0,v.useEffect)(()=>{E===`online`&&M(x,`files.list`,{projectId:S}).then(_,Wd)},[x,S,E]);let ae=A.slice(0,te),oe=/^\/\S*$/.exec(ae)?.[0]??/(?:^|\s)(@\S*)$/.exec(ae)?.[1]??null,se=oe?.slice(1).toLowerCase()??``,ce=oe===null||m?[]:oe.startsWith(`/`)?(o?.commands??[]).filter(e=>e.name.toLowerCase().includes(se)).sort((e,t)=>Number(!e.name.toLowerCase().startsWith(se))-Number(!t.name.toLowerCase().startsWith(se))).map(e=>({key:e.name,label:`/${e.name}${e.hint===``?``:` ${e.hint}`}`,description:e.description,insert:`/${e.name}`})):g.filter(e=>e.toLowerCase().includes(se)).slice(0,50).map(e=>({key:e,label:e,description:``,insert:`@${e}`})),le=Math.min(f,ce.length-1),ue=A.trim()===``&&ee.length===0||c>0||u||s;function de(e,t){ze(O,t=>({...t,text:e})),ne(t),p(0),h(!1)}function fe(e){if(oe===null)return;let t=te-oe.length,n=t+e.insert.length+1;de(`${A.slice(0,t)}${e.insert} ${A.slice(te)}`,n),requestAnimationFrame(()=>y.current?.setSelectionRange(n,n))}async function pe(e){if(!ue){d(!0);try{if(D===null)throw Error(`This machine is not connected`);await mf({text:A.trim(),images:ee},e?D===`queue`?`steer`:`queue`:D),ze(O,e=>({...e,text:``,images:[]})),ne(0)}catch(e){Wd(e)}finally{d(!1)}}}function me(){let e=L().settings,t=TA(e.provider,L().capabilities);t.length!==0&&nf({mode:t[(t.findIndex(t=>t.value===e.mode)+1)%t.length].value})}async function he(e){for(let t of e)if(_V.includes(t.type)&&t.size<=vV){let e=await CE(t);ze(O,n=>({...n,images:[...n.images,{mediaType:t.type,data:e}]}))}else{l(e=>e+1);try{let e=await SE(x,t);ze(O,t=>({...t,text:`${t.text}${/(^|\s)$/.test(t.text)?``:` `}@${e} `}))}catch(e){Wd(e)}finally{l(e=>e-1)}}}return(0,B.jsx)(`div`,{className:F(`pointer-events-none z-20`,ie?`absolute inset-0 flex items-center`:`relative shrink-0 before:absolute before:right-(--app-scrollbar-width) before:bottom-full before:left-0 before:h-8 before:bg-linear-to-t before:from-background before:to-transparent`),children:(0,B.jsx)(`div`,{className:F(`w-full px-3 sm:px-12`,ie&&`pb-3 sm:pb-4`),children:(0,B.jsxs)(`div`,{className:`pointer-events-auto relative z-10 mx-auto w-full max-w-(--chat-content-max-width)`,children:[ie&&(0,B.jsx)(`div`,{className:`absolute inset-x-0 bottom-full pb-4`,children:(0,B.jsxs)(`h1`,{className:`text-foreground w-full text-center text-2xl font-normal tracking-tight sm:text-3xl`,children:[`What should we build in`,` `,e?.sessionId===null?(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsxs)(`button`,{className:`border-muted-foreground/35 hover:border-foreground/60 inline-flex max-w-64 cursor-pointer border-b border-dotted align-bottom outline-none`,title:C?.path,children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:C?.name}),`?`]})}),(0,B.jsx)(pA,{className:`max-h-80 w-64`,onCloseAutoFocus:e=>{e.preventDefault(),y.current?.focus()},children:(0,B.jsx)(gA,{value:Ze(x,S),children:[...w].sort((e,t)=>T.findIndex(t=>t.id===e.machine)-T.findIndex(e=>e.id===t.machine)||e.name.localeCompare(t.name)).map(e=>(0,B.jsxs)(_A,{value:Ze(e.machine,e.id),title:e.path,onSelect:()=>pf({machine:e.machine,projectId:e.id,sessionId:null}),children:[(0,B.jsx)(aA,{machine:e.machine,projectId:e.id,className:`size-4 shrink-0 [&>img]:rounded-[4px] [&>svg]:rounded-[4px]`}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.name,T.length>1&&(0,B.jsx)(`span`,{className:`text-muted-foreground ml-1.5 text-xs`,children:T.find(t=>t.id===e.machine)?.name})]})]},Ze(e.machine,e.id)))})})]}):(0,B.jsx)(`span`,{className:`border-muted-foreground/35 inline-block max-w-64 truncate border-b border-dotted align-bottom`,title:C?.path,children:C?.name}),e?.sessionId!==null&&`?`]})}),i.length>0&&ce.length===0&&(0,B.jsx)(gV,{}),j!==void 0&&ce.length===0&&(0,B.jsx)(oV,{request:j,machine:x,cwd:C?.path??``,count:r.length},j.id),ce.length>0&&(0,B.jsx)(CA,{items:ce,active:le,onHover:p,onPick:fe}),(0,B.jsxs)(`div`,{className:F(`composer-glass shadow-composer relative z-10 border border-(--composer-outline) dark:shadow-none`,ie?`rounded-3xl`:`rounded-t-3xl border-b-0`,j?.kind===`question`&&`hidden`),onMouseDown:e=>{e.target instanceof Element&&e.currentTarget.contains(e.target)&&(e.target.closest(`button, a, input, textarea`)||(e.preventDefault(),y.current?.focus()))},onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),he([...e.dataTransfer.files])},children:[(0,B.jsxs)(`div`,{className:`px-3 pt-3.5 pb-2 sm:px-4 sm:pt-4`,children:[ee.length>0&&(0,B.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-2`,children:ee.map((e,t)=>(0,B.jsxs)(`div`,{className:`border-border/80 bg-background relative size-16 overflow-hidden rounded-lg border`,children:[(0,B.jsx)(`img`,{src:`data:${e.mediaType};base64,${e.data}`,alt:``,className:`size-full object-cover`}),(0,B.jsx)(`button`,{className:`absolute top-1 right-1 grid size-5 cursor-pointer place-items-center rounded-full bg-black/60 text-white`,title:`Remove image`,onClick:()=>ze(O,e=>({...e,images:e.images.filter((e,n)=>n!==t)})),children:(0,B.jsx)(U,{icon:xk,className:`size-3`})})]},t))}),(0,B.jsx)(`textarea`,{ref:y,"data-composer":!0,rows:1,spellCheck:!1,autoCorrect:`off`,"data-gramm":`false`,"data-gramm_editor":`false`,"data-enable-grammarly":`false`,"data-lt-active":`false`,value:A,onChange:e=>de(e.target.value,e.target.selectionStart),onSelect:e=>ne(e.currentTarget.selectionStart),onPaste:e=>{let t=e.clipboardData.getData(`text/plain`);if(t!==``){e.preventDefault(),document.execCommand(`insertText`,!1,t);return}let n=[...e.clipboardData.files];n.length!==0&&(e.preventDefault(),he(n))},onKeyDown:e=>{if(!e.nativeEvent.isComposing){if(ce.length>0){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;p((le+t+ce.length)%ce.length);return}if(e.key===`Enter`&&!e.shiftKey||e.key===`Tab`){e.preventDefault(),fe(ce[le]);return}if(e.key===`Escape`){e.preventDefault(),h(!0);return}}if(e.key===`Enter`&&!e.shiftKey)e.preventDefault(),pe(e.metaKey||e.ctrlKey);else if(e.key===`Tab`&&e.shiftKey)e.preventDefault(),me();else if(e.key===`ArrowUp`&&A===``){let t=bV(L().items);if(t===null)return;e.preventDefault(),de(t,t.length)}else e.key===`Escape`&&re&&_f()}},placeholder:s?`Add an account in Settings to start`:re&&D===`steer`?`Steer the agent… (${Bn}+Enter to queue)`:re?`Queue a follow-up… (${Bn}+Enter to send now)`:`Ask anything, @tag files/folders, or / for commands`,className:`placeholder:text-placeholder/75 block [field-sizing:content] max-h-52 min-h-19.5 w-full resize-none bg-transparent text-sm leading-relaxed outline-none`})]}),(0,B.jsxs)(`div`,{className:F(`flex min-w-0 items-center justify-between gap-2 px-3 sm:px-4`,ie?`pb-3 sm:pb-4`:`pb-2.5 sm:pb-3.5`),children:[(0,B.jsx)(`div`,{className:`-m-1 -ms-3.5 flex min-w-0 flex-1 [scrollbar-width:none] items-center gap-1 overflow-x-auto p-1 ps-3.5`,children:(0,B.jsx)(pV,{})}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,B.jsx)(`input`,{ref:b,type:`file`,multiple:!0,hidden:!0,onChange:e=>{he([...e.target.files??[]]),e.target.value=``}}),c>0&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Uploading…`}),(0,B.jsx)(EA,{}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,title:`Attach files`,"aria-label":`Attach files`,onClick:()=>b.current?.click(),children:(0,B.jsx)(U,{icon:JO})}),re&&ue?(0,B.jsx)(`button`,{className:`bg-destructive/90 shadow-destructive/24 hover:bg-destructive flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-white shadow-xs transition-colors`,title:`Stop (Esc)`,"aria-label":`Stop generation`,onClick:_f,children:(0,B.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`currentColor`,"aria-hidden":`true`,children:(0,B.jsx)(`rect`,{x:`2`,y:`2`,width:`8`,height:`8`,rx:`1.5`})})}):(0,B.jsx)(`button`,{className:`bg-message-action text-message-action-foreground shadow-message-action/24 hover:bg-message-action-hover relative flex size-9 items-center justify-center overflow-hidden rounded-full shadow-xs transition-all duration-150 hover:scale-105 enabled:cursor-pointer disabled:pointer-events-none disabled:opacity-64 disabled:shadow-none`,title:re&&D===`steer`?`Send now (Enter) · Queue (${Bn}+Enter)`:re?`Queue (Enter) · Send now (${Bn}+Enter)`:`Send (Enter)`,"aria-label":`Send message`,disabled:ue,onClick:e=>void pe(e.metaKey||e.ctrlKey),children:(0,B.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M7 11.5V2.5M7 2.5L3 6.5M7 2.5L11 6.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]})]})]})]})})})}function bV(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.kind===`user`&&n.parent===null&&n.format===`text`&&n.text!==``)return n.text}return null}function xV({className:e,type:t,...n}){return(0,B.jsx)(`input`,{type:t,"data-slot":`input`,className:F(`h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function SV(e){let t=(0,v.useRef)(e);return(0,v.useInsertionEffect)(()=>void(t.current=e)),(0,v.useCallback)((...e)=>t.current(...e),[])}var CV=(0,v.createContext)(void 0);function wV(){return(0,v.useContext)(CV)}var TV={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},EV={display:`contents`};function DV(){return null}var OV=`diffs-container`,kV=/(?=^From [a-f0-9]+ .+$)/m,AV=/(?=^diff --git)/gm,jV=/(?<=\n)/,MV=/^(---|\+\+\+)\s+([^\t\r\n]+)/,NV=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,PV=`header-prefix`,FV=`header-filename-suffix`,IV=`header-metadata`,LV=`header-custom`,RV={dark:`pierre-dark`,light:`pierre-light`},zV=`data-theme-css`,BV=`data-unsafe-css`,VV=`data-diffs-scrollbar-measure`,HV=`--diffs-scrollbar-gutter-measured`,UV=1e5,WV={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...WV});var GV=Object.freeze({fromStart:0,fromEnd:0}),KV={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},qV={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function JV(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function YV({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function XV(e,t){return e-(t===0?0:1)}function ZV(e,t){return XV(e,t)+t}function QV(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:$V(n,e.startContentIndex)}}function $V(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function eH({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d,getAnnotationSlotName:f=JV}){let p=n?.(e),m=r?.(e),h=i?.(e),g=a?.(e);return(0,B.jsxs)(B.Fragment,{children:[p==null?(0,B.jsxs)(B.Fragment,{children:[m!=null&&(0,B.jsx)(`div`,{slot:`header-prefix`,children:m}),h!=null&&(0,B.jsx)(`div`,{slot:`header-filename-suffix`,children:h}),g!=null&&(0,B.jsx)(`div`,{slot:`header-metadata`,children:g})]}):(0,B.jsx)(`div`,{slot:LV,children:p}),o!=null&&l?.map((e,t)=>(0,B.jsx)(`div`,{slot:f(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=tH(t,e);return(0,B.jsx)(`div`,{slot:n,style:EV,children:c(t,d)},n)}),s!=null&&(0,B.jsx)(`div`,{slot:`gutter-utility-slot`,style:TV,children:s(u)})]})}function tH(e,t){let n=QV(e,t);return n==null?void 0:YV({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function nH({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,lineAnnotations:o,renderGutterUtility:s,getHoveredLine:c,getAnnotationSlotName:l=JV}){let u=t?.(e),d=n?.(e),f=r?.(e),p=i?.(e);return(0,B.jsxs)(B.Fragment,{children:[u==null?(0,B.jsxs)(B.Fragment,{children:[d!=null&&(0,B.jsx)(`div`,{slot:`header-prefix`,children:d}),f!=null&&(0,B.jsx)(`div`,{slot:`header-filename-suffix`,children:f}),p!=null&&(0,B.jsx)(`div`,{slot:`header-metadata`,children:p})]}):(0,B.jsx)(`div`,{slot:LV,children:u}),a!=null&&o?.map((e,t)=>(0,B.jsx)(`div`,{slot:l(e),children:a(e)},t)),s!=null&&(0,B.jsx)(`div`,{slot:`gutter-utility-slot`,style:TV,children:s(c)})]})}var rH=new Map,iH=new Map,aH=new Map,oH=new Set;function sH(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!oH.has(t))return!1;return!0}function cH(e=RV){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var lH=new Set;function uH(e){let t=[],n=new Set;for(let r of dH(e.themes)){let e=mH(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return uH({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return uH({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function dH(e){return fH(e)?[e]:e}function fH(e){return mH(e)||pH(e)}function pH(e){return typeof e.name==`string`&&typeof e.load==`function`}function mH(e){return typeof e.getThemes==`function`}function hH(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var gH=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},_H=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},vH=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function yH(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new gH(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new _H(i));let c=r,l=s().then(e=>{let a=hH(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new vH(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var bH=yH();function xH(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=bH.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,bH.getResolvedTheme(n)??bH.seedResolvedTheme(n,e);lH.has(n)||(lH.add(n),t.loadThemeSync(e))}}function SH(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(oH.has(n.name))continue;let e=rH.get(n.name);e??(e=n,rH.set(n.name,e));let r=e.data.find(t=>t.name===e.name||t.aliases?.includes(e.name)===!0);if(r==null)throw Error(`attachResolvedLanguages: No returned grammar declares "${e.name}" as its name or an alias.`);t.loadLanguageSync(e.data);try{t.getLanguage(e.name)}catch{throw Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${e.name}". Load the alias first or give the grammar a unique name.`)}oH.add(e.name)}}function CH(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var wH=Object.defineProperty,TH=Object.getOwnPropertyDescriptor,EH=Object.getOwnPropertyNames,DH=Object.prototype.hasOwnProperty,OH=(e,t)=>{let n={};for(var r in e)wH(n,r,{get:e[r],enumerable:!0});return t||wH(n,Symbol.toStringTag,{value:`Module`}),n},kH=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=EH(t),a=0,o=i.length,s;a<o;a++)s=i[a],!DH.call(e,s)&&s!==n&&wH(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=TH(t,s))||r.enumerable});return e},AH=(e,t,n)=>(kH(e,t,`default`),n&&kH(n,t,`default`)),jH=[{id:`abap`,name:`ABAP`,import:(()=>$(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>$(()=>import(`./actionscript-3-Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>$(()=>import(`./ada-X3Y2mlq2.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>$(()=>import(`./ahk-DwADkxyd.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>$(()=>import(`./ahk2-_6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>$(()=>import(`./angular-html-6NaagU1P.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>$(()=>import(`./angular-ts-D8XutLPw.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>$(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>$(()=>import(`./apex-KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>$(()=>import(`./apl-BKJEkz6Z.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>$(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>$(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>$(()=>import(`./asciidoc-SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>$(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>$(()=>import(`./astro-DkrGLOry.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>$(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>$(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>$(()=>import(`./bat-qdxAdBWQ.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>$(()=>import(`./beancount-C2IN4Vk8.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>$(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>$(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>$(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>$(()=>import(`./bird2-CYIUgYqB.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>$(()=>import(`./blade-BIc0yPkX.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>$(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>$(()=>import(`./c-Ds8U4gsq.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>$(()=>import(`./c3-D0apG41V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>$(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>$(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>$(()=>import(`./chapel-COXTL8xW.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>$(()=>import(`./clarity-CtfBBspg.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>$(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>$(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>$(()=>import(`./cobol-D0VSGQqK.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>$(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>$(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>$(()=>import(`./coffee-DBrey7sA.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>$(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>$(()=>import(`./coq-CGaSfhwR.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>$(()=>import(`./cpp-SKUDYlNR.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>$(()=>import(`./crystal-CoTn_b8r.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>$(()=>import(`./csharp-dmMxLVLW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>$(()=>import(`./css-BErHy7fN.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>$(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>$(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>$(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>$(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>$(()=>import(`./dart-CHZY9Xhz.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>$(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>$(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>$(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>$(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>$(()=>import(`./dotenv-CuH5my32.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>$(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>$(()=>import(`./edge-CACFpVrz.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>$(()=>import(`./elixir-aPcGiByD.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>$(()=>import(`./elm-DN5FfPkL.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>$(()=>import(`./emacs-lisp-DR2vtWaj.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>$(()=>import(`./erb-Dj675b5b.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>$(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>$(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>$(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>$(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>$(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>$(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>$(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>$(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>$(()=>import(`./gdscript-DYvRD3hg.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>$(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>$(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>$(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>$(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>$(()=>import(`./git-rebase-DepNW1h5.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>$(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>$(()=>import(`./glimmer-js-fCJatm6u.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>$(()=>import(`./glimmer-ts-YwpKoyPh.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>$(()=>import(`./glsl-PGMqKJzL.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>$(()=>import(`./gn-CAXYAgV-.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>$(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>$(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>$(()=>import(`./graphql-3IK2PC2Y.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>$(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>$(()=>import(`./hack-C8CJl4zQ.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>$(()=>import(`./haml-CiYnV6_a.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>$(()=>import(`./handlebars-C4m4mY7m.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>$(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>$(()=>import(`./haxe-C8oCnwJJ.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>$(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>$(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>$(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>$(()=>import(`./html-D1Ar4Xkj.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>$(()=>import(`./html-derivative-CwhughXj.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>$(()=>import(`./http-pzvpiwNw.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>$(()=>import(`./hurl-hkZwo5Ou.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>$(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>$(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>$(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>$(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>$(()=>import(`./java-CjDcLNWV.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>$(()=>import(`./javascript-B1pleYoe.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>$(()=>import(`./jinja-erX4wFzj.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>$(()=>import(`./jison-CajpWJAS.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>$(()=>import(`./json-CwL6i1-C.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>$(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>$(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>$(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>$(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>$(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>$(()=>import(`./jsx-DmOLIUT0.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>$(()=>import(`./julia-DK5bpj3S.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>$(()=>import(`./just-BtwHGit4.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])))},{id:`kdl`,name:`KDL`,import:(()=>$(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>$(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>$(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>$(()=>import(`./latex-Dnf1mLFf.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>$(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>$(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>$(()=>import(`./liquid-Bv72E2Is.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>$(()=>import(`./llvm-DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>$(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>$(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>$(()=>import(`./lua-94ufuXur.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>$(()=>import(`./luau-VGWVLoqX.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>$(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>$(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>$(()=>import(`./marko-BKL0CGzx.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>$(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>$(()=>import(`./mdc-DNhqDQoU.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>$(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>$(()=>import(`./mermaid-BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>$(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>$(()=>import(`./mojo-fg40_ntQ.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>$(()=>import(`./moonbit-D9W784E_.js`),[]))},{id:`move`,name:`Move`,import:(()=>$(()=>import(`./move-BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>$(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>$(()=>import(`./nextflow-CSgcYZcx.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>$(()=>import(`./nextflow-groovy-D7IRt6Pp.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>$(()=>import(`./nginx-BcYwGlC2.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>$(()=>import(`./nim-CRMgcK-K.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>$(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>$(()=>import(`./nsis-CjNLYCLg.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>$(()=>import(`./nushell--0fT3PI1.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>$(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>$(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>$(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>$(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>$(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>$(()=>import(`./org-DfnsnSld.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])))},{id:`pascal`,name:`Pascal`,import:(()=>$(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>$(()=>import(`./perl-BEwyXv2a.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>$(()=>import(`./php-CG9qDJ82.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>$(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>$(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>$(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>$(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>$(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>$(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>$(()=>import(`./powershell-QtSnmXcu.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>$(()=>import(`./prisma-DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>$(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>$(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>$(()=>import(`./pug-Dg3kkpP7.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>$(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>$(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>$(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>$(()=>import(`./qml-Vs1TgYWl.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>$(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>$(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>$(()=>import(`./r-CFy73Kus.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>$(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>$(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>$(()=>import(`./razor-Dcng6YrP.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>$(()=>import(`./rbs-C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>$(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>$(()=>import(`./regexp-Bwbv2WPD.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>$(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>$(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>$(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>$(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>$(()=>import(`./rst-Cul2jxkE.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])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>$(()=>import(`./ruby-TMvLq4yj.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>$(()=>import(`./rust-DpiIf5JO.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>$(()=>import(`./sas-D8HC__R6.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>$(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>$(()=>import(`./scala-BiFt_7mu.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>$(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>$(()=>import(`./scss-dK6Y8mdp.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>$(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>$(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>$(()=>import(`./shellscript-BrObD5cd.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>$(()=>import(`./shellsession-gwVDz4P8.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>$(()=>import(`./smalltalk-BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>$(()=>import(`./smithy-Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>$(()=>import(`./solidity-Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>$(()=>import(`./soy-BF1mzKmn.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>$(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>$(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>$(()=>import(`./sql-rY-oq1Hg.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>$(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>$(()=>import(`./stata-DBh-WI4L.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>$(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>$(()=>import(`./surrealql-DxG1DYQM.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>$(()=>import(`./svelte-IUUmpoTZ.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>$(()=>import(`./swift-CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>$(()=>import(`./system-verilog-Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>$(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>$(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>$(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>$(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>$(()=>import(`./templ-DSD9ChjE.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>$(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>$(()=>import(`./tex-ClrklzW1.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>$(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>$(()=>import(`./ts-tags-CiWqjPoE.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>$(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>$(()=>import(`./tsx-BVdH_4RP.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>$(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>$(()=>import(`./twig-bBlRyqC3.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])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>$(()=>import(`./typescript-BWvsrxJs.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>$(()=>import(`./typespec-BGhR2SqG.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>$(()=>import(`./typst-CoUU-sfH.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])))},{id:`v`,name:`V`,import:(()=>$(()=>import(`./v-DBj4K9d_.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>$(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>$(()=>import(`./vb-DOwzaHZ0.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>$(()=>import(`./verilog-B2gwz-sJ.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>$(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>$(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>$(()=>import(`./vue-0_DBul4P.js`),__vite__mapDeps([121,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>$(()=>import(`./vue-html-feH37mKg.js`),__vite__mapDeps([122,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>$(()=>import(`./vue-vine-xWSVrEzZ.js`),__vite__mapDeps([123,2,3,5,12,70,124])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>$(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>$(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>$(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>$(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>$(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>$(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>$(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>$(()=>import(`./xml-RE-6RA5e.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>$(()=>import(`./xsl-DzQQ-zeR.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>$(()=>import(`./yaml-BfSzomC9.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>$(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>$(()=>import(`./zig-CMLA9XwU.js`),[]))}],MH=Object.fromEntries(jH.map(e=>[e.id,e.import])),NH=Object.fromEntries(jH.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),PH={...MH,...NH},FH=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>$(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>$(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>$(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>$(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>$(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>$(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>$(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>$(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>$(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>$(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>$(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>$(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>$(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>$(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>$(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>$(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>$(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>$(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>$(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>$(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>$(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>$(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>$(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>$(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>$(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>$(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>$(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>$(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>$(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>$(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>$(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>$(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>$(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>$(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>$(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>$(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>$(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>$(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>$(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>$(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>$(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>$(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>$(()=>import(`./monokai-BscAjiQZ.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>$(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>$(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>$(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>$(()=>import(`./one-dark-pro-C6YyR8OD.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>$(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>$(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>$(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>$(()=>import(`./red-CYlAq2b0.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>$(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>$(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>$(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>$(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>$(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>$(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>$(()=>import(`./solarized-dark-b97czJOk.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>$(()=>import(`./solarized-light-DFPxpIYQ.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>$(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>$(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>$(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>$(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>$(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>$(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),IH=s({createOnigurumaEngine:()=>uU,getDefaultWasmLoader:()=>lU,loadWasm:()=>rU,setDefaultWasmLoader:()=>cU}),LH=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function RH(){return 2147483648}function zH(){return typeof performance<`u`?performance.now():Date.now()}var BH=(e,t)=>e+(t-e%t)%t;async function VH(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=RH();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,BH(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:zH,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 HH=Object.defineProperty,UH=(e,t,n)=>t in e?HH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WH=(e,t,n)=>UH(e,typeof t==`symbol`?t:t+``,n),GH=null;function KH(e){throw new LH(e.UTF8ToString(e.getLastOnigError()))}var qH=class e{constructor(t){WH(this,`utf16Length`),WH(this,`utf8Length`),WH(this,`utf16Value`),WH(this,`utf8Value`),WH(this,`utf16OffsetToUtf8`),WH(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}},JH=class e{constructor(t){if(WH(this,`id`,++e.LAST_ID),WH(this,`_onigBinding`),WH(this,`content`),WH(this,`utf16Length`),WH(this,`utf8Length`),WH(this,`utf16OffsetToUtf8`),WH(this,`utf8OffsetToUtf16`),WH(this,`ptr`),!GH)throw new LH(`Must invoke loadWasm first.`);this._onigBinding=GH,this.content=t;let n=new qH(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=GH.omalloc(1e4),e._sharedPtrInUse=!0,GH.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(GH)}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)}};WH(JH,`LAST_ID`,0),WH(JH,`_sharedPtr`,0),WH(JH,`_sharedPtrInUse`,!1);var YH=JH,XH=class{constructor(e){if(WH(this,`_onigBinding`),WH(this,`_ptr`),!GH)throw new LH(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new qH(e[r]);t[r]=i.createString(GH),n[r]=i.utf8Length}let r=GH.omalloc(4*e.length);GH.HEAPU32.set(t,r/4);let i=GH.omalloc(4*e.length);GH.HEAPU32.set(n,i/4);let a=GH.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)GH.ofree(t[n]);GH.ofree(i),GH.ofree(r),a===0&&KH(GH),this._onigBinding=GH,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 YH(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 ZH(e){return typeof e.instantiator==`function`}function QH(e){return typeof e.default==`function`}function $H(e){return e.data!==void 0}function eU(e){return typeof Response<`u`&&e instanceof Response}function tU(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 nU;function rU(e){if(nU)return nU;async function t(){GH=await VH(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),ZH(n)?n=await n.instantiator(t):QH(n)?n=await n.default(t):($H(n)&&(n=n.data),eU(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await aU(n)(t):await oU(n)(t):tU(n)||n instanceof WebAssembly.Module?n=await iU(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await iU(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return nU=t(),nU}function iU(e){return t=>WebAssembly.instantiate(e,t)}function aU(e){return t=>WebAssembly.instantiateStreaming(e,t)}function oU(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var sU;function cU(e){sU=e}function lU(){return sU}async function uU(e){return e&&await rU(e),{createScanner(e){return new XH(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new YH(e)}}}var dU=OH({});AH(dU,IH);var fU=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function pU(e){return mU(e)}function mU(e){return Array.isArray(e)?hU(e):e instanceof RegExp?e:typeof e==`object`?gU(e):e}function hU(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=mU(e[n]);return t}function gU(e){let t={};for(let n in e)t[n]=mU(e[n]);return t}function _U(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function vU(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?vU(e.substring(0,e.length-1)):e.substr(~t+1)}var yU=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,bU=class{static hasCaptures(e){return e!==null&&(yU.lastIndex=0,yU.test(e))}static replaceCaptures(e,t,n){return e.replace(yU,(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 xU(e,t){return e<t?-1:+(e>t)}function SU(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=xU(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function CU(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 wU(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var TU=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}},EU=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(jU(e),t)}static createFromParsedTheme(e,t){return PU(e,t)}_cachedMatchRoot=new TU(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=>OU(e.parent,t.parentScopes));return n?new AU(n.fontStyle,n.foreground,n.background):null}},DU=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 OU(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&&!kU(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function kU(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var AU=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function jU(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`&&CU(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&CU(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 MU(l,u,e,o,s,c)}}return n}var MU=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}},NU=(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))(NU||{});function PU(e,t){e.sort((e,t)=>{let n=xU(e.scope,t.scope);return n!==0||(n=SU(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 FU(t),o=new AU(n,a.getId(r),a.getId(i)),s=new RU(new LU(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 EU(a,o,s)}var FU=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)}},IU=Object.freeze([]),LU=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||IU,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)}},RU=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(),LU.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);else{for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(SU(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 LU(e,t,n,r,i))}}},zU=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=VU(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 BU(e){return e}function VU(e){return e}function HU(e,t){let n=[],r=WU(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(UU(i)){let e=[];do e.push(i),i=r.next();while(UU(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 UU(e){return!!e&&!!e.match(/[\w\.:]+/)}function WU(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 GU(e){typeof e.dispose==`function`&&e.dispose()}var KU=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},qU=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},JU=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))}},YU=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new KU(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new JU;for(let n of e)XU(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof KU){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 XU(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 KU?QU({baseGrammar:a,selfGrammar:i},r):ZU(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 KU(e))}function ZU(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];$U([r],t,n)}}function QU(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&$U(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&$U(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function $U(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?_U({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&$U(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=aW(i);switch(a.kind){case 0:QU({...t,selfGrammar:t.baseGrammar},n);break;case 1:QU(t,n);break;case 2:ZU(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?ZU(a.ruleName,i,n):QU(i,n)}else a.kind===4?n.add(new qU(a.scopeName,a.ruleName)):n.add(new KU(a.scopeName))}}}var eW=class{kind=0},tW=class{kind=1},nW=class{constructor(e){this.ruleName=e}kind=2},rW=class{constructor(e){this.scopeName=e}kind=3},iW=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function aW(e){if(e===`$base`)return new eW;if(e===`$self`)return new tW;let t=e.indexOf(`#`);return t===-1?new rW(e):t===0?new nW(e.substring(1)):new iW(e.substring(0,t),e.substring(t+1))}var oW=/\\(\d+)/,sW=/\\(\d+)/g,cW=-1,lW=-2;function uW(e){return e}function dW(e){return e}var fW=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=bU.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=bU.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${vU(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:bU.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:bU.replaceCaptures(this._contentName,e,t)}},pW=class extends fW{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!`)}},mW=class extends fW{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new yW(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 bW,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},hW=class extends fW{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 bW,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},gW=class extends fW{_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 yW(i,this.id),this.beginCaptures=a,this._end=new yW(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 bW;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}},_W=class extends fW{_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 yW(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new yW(o,lW),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 bW;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 bW,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},vW=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new pW(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new mW(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=_U({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new hW(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new _W(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 gW(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=aW(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 hW||e instanceof gW||e instanceof _W)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},yW=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`&&oW.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 sW.lastIndex=0,this.source.replace(sW,(e,t)=>wU(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}},bW=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 xW(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 xW(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},xW=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(`
385
385
  `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},SW=class{constructor(e,t){this.languageId=e,this.tokenType=t}},CW=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new SW(e,8),this._embeddedLanguagesMatcher=new wW(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 SW(0,0);_getBasicScopeAttributes=new TU(e=>new SW(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/},wW=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])=>wU(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 TW=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function EW(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=DW(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 TW(i,!0);f()}return new TW(i,!1);function f(){let o=OW(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===cW){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),NW(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 gW){let r=o;NW(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 _W){let r=o;NW(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(NW(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 DW(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 _W&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=MW(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==lW){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),NW(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 OW(e,t,n,r,i,a){let o=kW(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=AW(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 kW(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=jW(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 AW(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}=jW(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 jW(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function MW(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function NW(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));EW(e,p,n&&d.start===0,d.start,f,i,!1,0),GU(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 PW(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var PW=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function FW(e,t,n,r,i,a,o,s){return new zW(e,t,n,r,i,a,o,s)}function IW(e,t,n,r,i){let a=HU(t,LW),o=vW.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 LW(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(RW(t[r],e))return n=r+1,!0;return!1})}function RW(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 zW=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new CW(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=BW(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=HU(e,LW);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)IW(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&&IW(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(uW(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[dW(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]=BW(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=vW.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===HW.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=zU.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?VW.createRootAndLookUpScopeName(a,r,this):VW.createRoot(`unknown`,r),t=new HW(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
386
386
  `;let a=this.createOnigString(e),o=a.content.length,s=new WW(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=EW(this,a,i,0,t,s,!0,r);return GU(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function BW(e,t){return e=pU(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 VW=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=DU.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new DU(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new DU(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),zU.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}},HW=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)?VW.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:dW(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=VW.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,uW(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,VW.fromExtension(r,n.contentNameScopesList))}},UW=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):HU(e,LW).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>HU(e,LW).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}},WW=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=zU.set(n,0,BU(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=zU.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}},GW=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,FW(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},KW=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new GW(EU.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(EU.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 UW(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new YU(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)}},qW=HW.NULL;function JW(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 YW(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function XW(e){return Array.isArray(e)?e:[e]}async function ZW(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function QW(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function $W(e){return e===`ansi`||QW(e)}function eG(e){return e===`none`}function tG(e){return eG(e)}var nG=/(\r?\n)/g;function rG(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(nG),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 iG={light:`#333333`,dark:`#bbbbbb`},aG={light:`#fffffe`,dark:`#1e1e1e`},oG=`__shiki_resolved`;function sG(e){if(e?.[oG])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`?iG.light:iG.dark,n||=t.type===`light`?aG.light:aG.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,oG,{enumerable:!1,writable:!1,value:!0}),t}async function cG(e){return[...new Set((await Promise.all(e.filter(e=>!$W(e)).map(async e=>await ZW(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function lG(e){return(await Promise.all(e.map(async e=>tG(e)?null:sG(await ZW(e))))).filter(e=>!!e)}function uG(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 fU(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var dG=class extends KW{_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=sG(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=EU.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=uG(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 fU(`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))}},fG=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}},pG=0;function mG(e){pG+=1,e.warnings!==!1&&pG>=10&&pG%10==0&&console.warn(`[Shiki] ${pG} 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 fU("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(sG),i=new dG(new fG(e.engine,n),r,n,e.langAlias),a;function o(t){return uG(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new fU(`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 fU(`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 cG(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await lG(e))}function g(){if(t)throw new fU(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--pG)}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 hG(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([lG(e.themes||[]),cG(e.langs||[]),e.engine]);return mG({...e,themes:t,langs:n,engine:r})}var gG=new WeakMap;function _G(e,t){gG.set(e,t)}function vG(e){return gG.get(e)}var yG=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(XW(n).map(e=>[e,qW])),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 bG(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function bG(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 xG(e,t){if(!(e instanceof yG))throw new fU(`Invalid grammar state`);return e.getInternalStack(t)}var SG=/,/,CG=/ /;function wG(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(QW(e.resolveLangAlias(n.lang||`text`))||eG(r))return rG(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 fU(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new fU(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return EG(t,o,i,a,n)}function TG(...e){if(e.length===2)return vG(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(QW(i)||eG(a))throw new fU(`Plain language does not have grammar state`);if(i===`ansi`)throw new fU(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new yG(DG(n,c,o,s,r).stateStack,c.name,o.name)}function EG(e,t,n,r,i){let a=DG(e,t,n,r,i),o=new yG(a.stateStack,t.name,n.name);return _G(a.tokens,o),a.tokens}function DG(e,t,n,r,i){let a=JW(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=rG(e),u=i.grammarState?xG(i.grammarState,n.name)??qW:i.grammarContextCode==null?qW:DG(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=YW(r[zU.getForeground(s)],a),u=zU.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=zU.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(SG).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(CG))})}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`?OG(t.scopes):kG(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function OG(e){return e.map(e=>({scopeName:e}))}function kG(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:MG(e,i,t.slice(0,r))}}return n}function AG(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function jG(e,t,n){if(!AG(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)AG(e[r],n[i])&&--r,--i;return r===-1}function MG(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(jG(e,t,n)){r.push(a);break}return r}function NG(e,t,n,r=wG){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:vG(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=PG(...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 yG(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&_G(s,c),s}function PG(...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 FG=/["&'<>`]/g,IG=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,LG=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,RG=/[|\\{}()[\]^$+*?.]/g,zG=new WeakMap;function BG(e,t){return e=e.replace(t.subset?VG(t.subset):FG,r),t.subset||t.escapeOnly?e:e.replace(IG,n).replace(LG,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 VG(e){let t=zG.get(e);return t||(t=HG(e),zG.set(e,t)),t}function HG(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(RG,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var UG=/[\dA-Fa-f]/;function WG(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!UG.test(String.fromCharCode(t))?r:r+`;`}var GG=/\d/;function KG(e,t,n){let r=`&#`+String(e);return n&&t&&!GG.test(String.fromCharCode(t))?r:r+`;`}var qG=`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(`.`),JG={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:`€`},YG=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],XG={}.hasOwnProperty,ZG={},QG;for(QG in JG)XG.call(JG,QG)&&(ZG[JG[QG]]=QG);var $G=/[^\dA-Za-z]/;function eK(e,t,n,r){let i=String.fromCharCode(e);if(XG.call(ZG,i)){let e=ZG[i],a=`&`+e;return n&&qG.includes(e)&&!YG.includes(e)&&(!r||t&&t!==61&&$G.test(String.fromCharCode(t)))?a:a+`;`}return``}function tK(e,t,n){let r=WG(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=eK(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=KG(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function nK(e,t){return BG(e,Object.assign({format:tK},t))}var rK=/^>|^->|<!--|-->|--!>|<!-$/g,iK=[`>`],aK=[`<`,`>`];function oK(e,t,n,r){return r.settings.bogusComments?`<?`+nK(e.value,Object.assign({},r.settings.characterReferences,{subset:iK}))+`>`:`<!--`+e.value.replace(rK,i)+`-->`;function i(e){return nK(e,Object.assign({},r.settings.characterReferences,{subset:aK}))}}function sK(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var cK=dK(1),lK=dK(-1),uK=[];function dK(e){return t;function t(t,n,r){let i=t?t.children:uK,a=(n||0)+e,o=i[a];if(!r)for(;o&&PA(o);)a+=e,o=i[a];return o}}var fK={}.hasOwnProperty;function pK(e){return t;function t(t,n,r){return fK.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var mK=pK({body:_K,caption:hK,colgroup:hK,dd:xK,dt:bK,head:hK,html:gK,li:yK,optgroup:CK,option:wK,p:vK,rp:SK,rt:SK,tbody:EK,td:kK,tfoot:DK,th:kK,thead:TK,tr:OK});function hK(e,t,n){let r=cK(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&PA(r.value.charAt(0)))}function gK(e,t,n){let r=cK(n,t);return!r||r.type!==`comment`}function _K(e,t,n){let r=cK(n,t);return!r||r.type!==`comment`}function vK(e,t,n){let r=cK(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 yK(e,t,n){let r=cK(n,t);return!r||r.type===`element`&&r.tagName===`li`}function bK(e,t,n){let r=cK(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function xK(e,t,n){let r=cK(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function SK(e,t,n){let r=cK(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function CK(e,t,n){let r=cK(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function wK(e,t,n){let r=cK(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function TK(e,t,n){let r=cK(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function EK(e,t,n){let r=cK(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function DK(e,t,n){return!cK(n,t)}function OK(e,t,n){let r=cK(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function kK(e,t,n){let r=cK(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var AK=pK({body:NK,colgroup:PK,head:MK,html:jK,tbody:FK});function jK(e){let t=cK(e,-1);return!t||t.type!==`comment`}function MK(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 NK(e){let t=cK(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&PA(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function PK(e,t,n){let r=lK(n,t),i=cK(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&mK(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function FK(e,t,n){let r=lK(n,t),i=cK(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&mK(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var IK={name:[[`
387
387
  \f\r &/=>`.split(``),`
@@ -1194,10 +1194,10 @@ diff --git`)}function K1(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
1194
1194
  transition: none;
1195
1195
  }
1196
1196
  }
1197
- `},renderHeaderPrefix:()=>(0,B.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground flex size-5 cursor-pointer items-center justify-center`,"aria-label":t?`Expand file`:`Collapse file`,onClick:()=>f(t?u.filter(t=>t!==e.name):[...u,e.name]),children:(0,B.jsx)(U,{icon:t?YD:JD,className:`size-3.5`})})},e.name)})]})]})}function Hhe(e,t,n){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{if(t===null||n)return;let r=!0;M(e,`git.status`,{projectId:t}).then(n=>{r&&i({key:Ze(e,t),status:n})},Wd);function a(){o(e=>e+1)}return window.addEventListener(`focus`,a),()=>{r=!1,window.removeEventListener(`focus`,a)}},[e,t,n,a]),{status:r!==null&&t!==null&&r.key===Ze(e,t)?r.status:null,setStatus:n=>i(t===null?null:{key:Ze(e,t),status:n}),refresh:()=>o(e=>e+1)}}function Uhe(e){let t=e.status,[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(!1),o=t.upstream===null||t.ahead>0;async function s(t){a(!0);try{await t()}catch(e){Wd(e)}finally{a(!1),e.onRefresh()}}function c(){s(async()=>{e.onStatus(await M(e.machine,`git.push`,{projectId:e.projectId}))})}function l(){s(async()=>{let t=await M(e.machine,`git.pullRequest`,{projectId:e.projectId});window.open(t.url,`_blank`,`noopener`)})}let u=t.changed>0?{label:`Commit`,icon:(0,B.jsx)(U,{icon:gO}),run:()=>r(!0)}:o?{label:`Push`,icon:(0,B.jsx)(U,{icon:tO}),run:c}:{label:`Create PR`,icon:(0,B.jsx)(U,{icon:yO}),run:l};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex w-fit`,children:[(0,B.jsxs)(H,{variant:`outline`,size:`xs`,className:`rounded-e-none border-e-0`,disabled:i,onClick:u.run,children:[u.icon,(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:u.label})]}),(0,B.jsx)(`div`,{className:`bg-input dark:bg-input/32 w-px`}),(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,size:`icon-xs`,className:`rounded-s-none border-s-0`,disabled:i,"aria-label":`Git actions`,children:(0,B.jsx)(U,{icon:JD,className:`size-4`})})}),(0,B.jsxs)(pA,{align:`end`,className:`w-56`,children:[(0,B.jsx)(vA,{children:t.upstream??`No upstream branch`}),(0,B.jsxs)(mA,{disabled:t.changed===0,onSelect:()=>r(!0),children:[(0,B.jsx)(U,{icon:gO}),`Commit `,t.changed,` `,t.changed===1?`change`:`changes`,`…`]}),(0,B.jsxs)(mA,{disabled:!o,onSelect:c,children:[(0,B.jsx)(U,{icon:tO}),`Push`,t.ahead>0&&(0,B.jsxs)(`span`,{className:`text-muted-foreground ml-auto text-xs tabular-nums`,children:[`↑`,t.ahead]})]}),(0,B.jsx)(yA,{}),(0,B.jsxs)(mA,{onSelect:l,children:[(0,B.jsx)(U,{icon:yO}),`Create pull request`]})]})]})]}),(0,B.jsx)(Whe,{machine:e.machine,projectId:e.projectId,open:n,onClose:()=>r(!1),onDone:t=>{e.onStatus(t),r(!1)}})]})}function Whe(e){let t=R(t=>Md(t,e.machine,e.projectId)?.path),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null);async function c(t,i){a(t),s(null);try{if(t===`generate`){let t=await M(e.machine,`git.message`,{projectId:e.projectId});r(t.message);return}let a=await M(e.machine,`git.commit`,{projectId:e.projectId,message:n});r(``),e.onDone(i?await M(e.machine,`git.push`,{projectId:e.projectId}):a)}catch(e){s(Vn(e))}finally{a(null)}}return(0,B.jsx)(Y0,{open:e.open,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`sm:max-w-lg`,children:[(0,B.jsxs)(Q0,{children:[(0,B.jsx)(e2,{children:`Commit changes`}),(0,B.jsxs)(t2,{children:[`Stages every change in `,t,` and commits it.`]})]}),(0,B.jsx)(`textarea`,{value:n,onChange:e=>r(e.target.value),placeholder:`Commit message`,rows:5,className:`bg-background focus:border-ring/60 w-full resize-none rounded-lg border px-3 py-2 font-mono text-xs outline-none`}),o!==null&&(0,B.jsx)(`p`,{className:`text-destructive text-xs whitespace-pre-wrap`,children:o}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsxs)(H,{variant:`outline`,size:`sm`,disabled:i!==null,onClick:()=>void c(`generate`,!1),children:[(0,B.jsx)(U,{icon:uk}),i===`generate`?`Writing…`:`Write message`]}),(0,B.jsx)(`span`,{className:`flex-1`}),(0,B.jsx)(H,{variant:`outline`,size:`sm`,disabled:i!==null||n.trim()===``,onClick:()=>void c(`commit`,!0),children:`Commit and push`}),(0,B.jsx)(H,{size:`sm`,disabled:i!==null||n.trim()===``,onClick:()=>void c(`commit`,!1),children:`Commit`})]})]})})}function a2({...e}){return(0,B.jsx)(xee,{"data-slot":`alert-dialog`,...e})}function o2({...e}){return(0,B.jsx)(See,{"data-slot":`alert-dialog-trigger`,...e})}function Ghe({...e}){return(0,B.jsx)(Cee,{"data-slot":`alert-dialog-portal`,...e})}function Khe({className:e,...t}){return(0,B.jsx)(wee,{"data-slot":`alert-dialog-overlay`,className:F(`fixed inset-0 z-50 bg-background/80 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function s2({className:e,size:t=`default`,...n}){return(0,B.jsxs)(Ghe,{children:[(0,B.jsx)(Khe,{}),(0,B.jsx)(Dee,{"data-slot":`alert-dialog-content`,"data-size":t,className:F(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function c2({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:F(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function l2({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:F(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function u2({className:e,...t}){return(0,B.jsx)(Oee,{"data-slot":`alert-dialog-title`,className:F(`text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function d2({className:e,...t}){return(0,B.jsx)(kee,{"data-slot":`alert-dialog-description`,className:F(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function f2({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,B.jsx)(H,{variant:t,size:n,asChild:!0,children:(0,B.jsx)(Aee,{"data-slot":`alert-dialog-action`,className:F(e),...r})})}function p2({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,B.jsx)(H,{variant:t,size:n,asChild:!0,children:(0,B.jsx)(__,{"data-slot":`alert-dialog-cancel`,className:F(e),...r})})}function m2({...e}){return(0,B.jsx)(lS,{"data-slot":`select`,...e})}function h2({...e}){return(0,B.jsx)(pS,{"data-slot":`select-value`,...e})}function g2({className:e,size:t=`default`,children:n,...r}){return(0,B.jsxs)(dS,{"data-slot":`select-trigger`,"data-size":t,className:F(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,B.jsx)(mS,{asChild:!0,children:(0,B.jsx)(U,{icon:vk,className:`text-muted-foreground pointer-events-none size-4`})})]})}function _2({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,B.jsx)(_S,{children:(0,B.jsxs)(yS,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:F(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,B.jsx)(qhe,{}),(0,B.jsx)(jS,{"data-position":n,className:F(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,B.jsx)(Jhe,{})]})})}function v2({className:e,children:t,...n}){return(0,B.jsxs)(FS,{"data-slot":`select-item`,className:F(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,B.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,B.jsx)(zS,{children:(0,B.jsx)(U,{icon:KD,className:`pointer-events-none`})})}),(0,B.jsx)(LS,{children:t})]})}function qhe({className:e,...t}){return(0,B.jsx)(VS,{"data-slot":`select-scroll-up-button`,className:F(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,B.jsx)(U,{icon:XD})})}function Jhe({className:e,...t}){return(0,B.jsx)(US,{"data-slot":`select-scroll-down-button`,className:F(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,B.jsx)(U,{icon:JD})})}function y2({className:e,size:t=`default`,...n}){return(0,B.jsx)(sC,{"data-slot":`switch`,"data-size":t,className:F(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,B.jsx)(lC,{"data-slot":`switch-thumb`,className:`bg-background dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0`})})}function b2(e){return(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`h2`,{className:`text-muted-foreground mb-2 px-1 text-xs font-medium`,children:[e.title,e.note&&(0,B.jsxs)(`span`,{className:`font-normal`,children:[` · `,e.note]})]}),(0,B.jsx)(`div`,{className:`divide-y overflow-hidden rounded-xl border`,children:e.children})]})}function x2(e){return(0,B.jsxs)(`label`,{className:`flex min-h-13 items-center justify-between gap-4 px-4 py-2.5`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),(0,B.jsx)(`div`,{className:`shrink-0`,children:e.children})]})}function S2(e){let[t,n]=(0,v.useState)(e.value);function r(){t!==e.value&&(e.valid&&!e.valid(t)?n(e.value):e.onCommit(t))}return(0,B.jsx)(xV,{className:F(`w-56`,e.className),type:e.type,min:e.type===`number`?0:void 0,step:e.step,placeholder:e.placeholder,value:t,onChange:e=>n(e.target.value),onBlur:r,onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}})}function C2(e){return(0,B.jsx)(S2,{type:`number`,className:`w-24`,step:e.step??1,value:String(e.value),valid:e=>e!==``&&Number(e)>=0,onCommit:t=>e.onCommit(Number(t))},e.value)}function Yhe(e){let t=e.prefs;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(b2,{title:`Appearance`,children:(0,B.jsx)(x2,{label:`Theme`,children:(0,B.jsxs)(m2,{value:t.theme,onValueChange:e=>Ud({...t,theme:e}),children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsx)(_2,{children:Un.map(e=>(0,B.jsx)(v2,{value:e.id,children:e.name},e.id))})]})})}),(0,B.jsx)(Xhe,{}),(0,B.jsx)(H,{variant:`outline`,onClick:e.onRestore,children:`Restore browser defaults`})]})}function Xhe(){let[e,t]=(0,v.useState)(`idle`),[n,r]=(0,v.useState)(null);async function i(){t(`checking`),r(null);try{let e=`serviceWorker`in navigator?await navigator.serviceWorker.getRegistration():void 0;if(e===void 0){location.reload();return}await e.update(),t(e.installing===null&&e.waiting===null?`current`:`updating`)}catch(e){console.error(`could not check for updates`,e),r(Vn(e)),t(`idle`)}}return(0,B.jsx)(b2,{title:`App`,children:(0,B.jsx)(x2,{label:`Load the newest version of OffSite in this browser`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[n!==null&&(0,B.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Could not check: `,n]}),e===`current`&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Up to date`}),e===`updating`&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Updating, the page reloads when it's ready`}),(0,B.jsx)(H,{size:`sm`,variant:`outline`,disabled:e===`checking`||e===`updating`,onClick:()=>void i(),children:`Check for updates`})]})})})}function Zhe(e){for(let t=0;t<e.length;t++){let n=e[t];if(!n.startsWith(`-`)&&!n.startsWith(`+`))return!1;let r=n.startsWith(`-`),i=n.slice(1);if(i===``||i===`-`)return!1;if(i.startsWith(`-`)){if(!w2(i.slice(1),r))return!1}else for(let n=0;n<i.length;n++){let a=i[n];if(a===`o`){let a=i.slice(n+1);if(a===``){if(t++,t===e.length)return!1;a=e[t]}if(!w2(a,r))return!1;break}if(a===`b`||a===`c`||r&&`dfnprvx`.includes(a)||!r&&a===`i`)return!1}}return!0}function w2(e,t){let n=e.toLowerCase().replace(/[-_]/g,``),r=t;return n.startsWith(`no`)&&(n=n.slice(2),r=!t),[`rcs`,`globalrcs`,`interactive`,`exec`].includes(n)?r:![`privileged`,`restricted`,`sourcetrace`,`verbose`,`xtrace`].includes(n)||!r}function Qhe(e,t,n){if(t===`windows`)return`Not available on Windows`;if(e!==null&&/[\n"'\\$`;&|<>()*?[\]{}#!]/.test(e))return`Not available for commands with shell syntax`;let r=e===null?[n]:e.split(/[ \t]/).filter(e=>e!==``);if(r.length===0)return`Available for bash, zsh and fish`;let i=r[0],a=i.split(`/`).pop(),o=r.slice(1);return a===`bash`?t===`macos`&&(i===`/bin/bash`||!i.includes(`/`))?`Needs a newer bash than the one macOS includes`:o.every(e=>[`-l`,`--login`,`-i`].includes(e))?null:`Not available with these bash options`:a===`zsh`?Zhe(o)?null:`Not available with these zsh options`:a===`fish`?o.every(e=>{if(e.startsWith(`--`)){let t=e.slice(2).split(`=`)[0];return t===``||![`command`,`no-config`,`no-execute`].some(e=>e.startsWith(t))}return!(e.startsWith(`-`)&&/[cNn]/.test(e))})?null:`Not available with these fish options`:`Available for bash, zsh and fish`}var T2=[1,2,3,5,10,15,30,60];function $he(e){let t=e.config,n=t.autoResolve;function r(r){Yd(e.machine,{...t,autoResolve:{...n,...r}})}return(0,B.jsxs)(b2,{title:`Agents`,children:[(0,B.jsx)(x2,{label:`Send while working`,children:(0,B.jsxs)(m2,{value:t.delivery,onValueChange:n=>{if(n!==`queue`&&n!==`steer`)throw Error(`Unknown delivery ${n}`);Yd(e.machine,{...t,delivery:n})},children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`queue`,children:`Queue messages`}),(0,B.jsx)(v2,{value:`steer`,children:`Steer the agent`})]})]})}),(0,B.jsx)(x2,{label:`Auto-submit questions`,children:(0,B.jsx)(E2,{value:n.questions,onChange:e=>r({questions:e})})}),(0,B.jsx)(x2,{label:`Auto-resolve permissions`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n.permissions!==null&&(0,B.jsxs)(m2,{value:n.permissionDecision,onValueChange:e=>{if(e!==`allow`&&e!==`deny`)throw Error(`Unknown decision ${e}`);r({permissionDecision:e})},children:[(0,B.jsx)(g2,{className:`w-24`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`allow`,children:`Allow`}),(0,B.jsx)(v2,{value:`deny`,children:`Deny`})]})]}),(0,B.jsx)(E2,{value:n.permissions,onChange:e=>r({permissions:e})})]})})]})}function E2(e){let t=e.value===null||T2.includes(e.value)?T2:[...T2,e.value].sort((e,t)=>e-t);return(0,B.jsxs)(m2,{value:e.value===null?`off`:String(e.value),onValueChange:t=>e.onChange(t===`off`?null:Number(t)),children:[(0,B.jsx)(g2,{className:`w-40`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`off`,children:`Off`}),t.map(e=>(0,B.jsx)(v2,{value:String(e),children:e===60?`After 1 hour`:`After ${e} ${e===1?`minute`:`minutes`}`},e))]})]})}function ege(e){let t=e.config.commitMessage,[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(t.provider===null)return;let n=!0;return r(null),a(null),M(e.machine,`capabilities`,{provider:t.provider,accountId:t.accountId,projectId:null}).then(e=>{n&&r(e.models)},e=>{n&&a(Vn(e))}),()=>{n=!1}},[e.machine,t.provider,t.accountId]);function o(t){Yd(e.machine,{...e.config,commitMessage:t})}function s(t){if(t===`off`){o({provider:null,accountId:null,model:null});return}if(t===`opencode`){o({provider:`opencode`,accountId:null,model:null});return}let n=[...e.claudeAccounts,...e.codexAccounts].find(e=>e.id===t);if(n===void 0)throw Error(`That account was removed`);o({provider:n.provider,accountId:n.id,model:null})}return(0,B.jsxs)(b2,{title:`Commit messages`,children:[(0,B.jsx)(x2,{label:`Account`,children:(0,B.jsxs)(m2,{value:t.provider===null?`off`:t.provider===`opencode`?`opencode`:t.accountId??`off`,onValueChange:s,children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`off`,children:`Off`}),[...e.claudeAccounts,...e.codexAccounts].map(e=>(0,B.jsxs)(v2,{value:e.id,disabled:!e.valid,children:[(0,B.jsx)(sA,{provider:e.provider,className:`size-4`}),`${sf[e.provider]} · ${e.name}`]},e.id)),e.openCode.available&&(0,B.jsxs)(v2,{value:`opencode`,children:[(0,B.jsx)(sA,{provider:`opencode`,className:`size-4`}),sf.opencode]})]})]})}),t.provider!==null&&(0,B.jsx)(x2,{label:`Model`,children:(0,B.jsxs)(m2,{value:t.model??void 0,disabled:n===null,onValueChange:e=>o({...t,model:e}),children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{placeholder:i===null?n===null?`Loading…`:`Choose a model`:`Unavailable`})}),(0,B.jsx)(_2,{children:(n??[]).filter(e=>!e.hidden||e.value===t.model).map(e=>(0,B.jsx)(v2,{value:e.value,children:e.name},e.value))})]})}),i!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-4 py-3 text-xs`,children:i})]})}var tge={zsh:`M11.415 5.038a.58.58 0 0 0-.543.197L.135 18.021a.58.58 0 0 0 .071.814.58.58 0 0 0 .815-.07L11.757 5.979a.58.58 0 0 0-.07-.815.6.6 0 0 0-.272-.126m-8.113.317a3.133 3.133 0 0 0-3.12 3.12 3.13 3.13 0 0 0 3.12 3.119A3.133 3.133 0 0 0 6.42 8.475a3.13 3.13 0 0 0-3.119-3.119m0 1.806a1.3 1.3 0 0 1 1.314 1.313 1.3 1.3 0 0 1-1.314 1.312A1.3 1.3 0 0 1 1.99 8.475a1.3 1.3 0 0 1 1.312-1.314m5.253 5.253a3.13 3.13 0 0 0-3.119 3.119 3.13 3.13 0 0 0 3.12 3.118 3.133 3.133 0 0 0 3.118-3.12 3.133 3.133 0 0 0-3.119-3.118m0 1.805a1.3 1.3 0 0 1 1.313 1.314c0 .735-.577 1.312-1.312 1.312a1.3 1.3 0 0 1-1.314-1.312 1.3 1.3 0 0 1 1.313-1.314m7.201 3.276a.58.58 0 0 0-.578.578.58.58 0 0 0 .578.578h7.666a.58.58 0 0 0 .579-.578.58.58 0 0 0-.579-.578Z`,bash:`M21.038,4.9l-7.577-4.498C13.009,0.134,12.505,0,12,0c-0.505,0-1.009,0.134-1.462,0.403L2.961,4.9 C2.057,5.437,1.5,6.429,1.5,7.503v8.995c0,1.073,0.557,2.066,1.462,2.603l7.577,4.497C10.991,23.866,11.495,24,12,24 c0.505,0,1.009-0.134,1.461-0.402l7.577-4.497c0.904-0.537,1.462-1.529,1.462-2.603V7.503C22.5,6.429,21.943,5.437,21.038,4.9z M15.17,18.946l0.013,0.646c0.001,0.078-0.05,0.167-0.111,0.198l-0.383,0.22c-0.061,0.031-0.111-0.007-0.112-0.085L14.57,19.29 c-0.328,0.136-0.66,0.169-0.872,0.084c-0.04-0.016-0.057-0.075-0.041-0.142l0.139-0.584c0.011-0.046,0.036-0.092,0.069-0.121 c0.012-0.011,0.024-0.02,0.036-0.026c0.022-0.011,0.043-0.014,0.062-0.006c0.229,0.077,0.521,0.041,0.802-0.101 c0.357-0.181,0.596-0.545,0.592-0.907c-0.003-0.328-0.181-0.465-0.613-0.468c-0.55,0.001-1.064-0.107-1.072-0.917 c-0.007-0.667,0.34-1.361,0.889-1.8l-0.007-0.652c-0.001-0.08,0.048-0.168,0.111-0.2l0.37-0.236 c0.061-0.031,0.111,0.007,0.112,0.087l0.006,0.653c0.273-0.109,0.511-0.138,0.726-0.088c0.047,0.012,0.067,0.076,0.048,0.151 l-0.144,0.578c-0.011,0.044-0.036,0.088-0.065,0.116c-0.012,0.012-0.025,0.021-0.038,0.028c-0.019,0.01-0.038,0.013-0.057,0.009 c-0.098-0.022-0.332-0.073-0.699,0.113c-0.385,0.195-0.52,0.53-0.517,0.778c0.003,0.297,0.155,0.387,0.681,0.396 c0.7,0.012,1.003,0.318,1.01,1.023C16.105,17.747,15.736,18.491,15.17,18.946z M19.143,17.859c0,0.06-0.008,0.116-0.058,0.145 l-1.916,1.164c-0.05,0.029-0.09,0.004-0.09-0.056v-0.494c0-0.06,0.037-0.093,0.087-0.122l1.887-1.129 c0.05-0.029,0.09-0.004,0.09,0.056V17.859z M20.459,6.797l-7.168,4.427c-0.894,0.523-1.553,1.109-1.553,2.187v8.833 c0,0.645,0.26,1.063,0.66,1.184c-0.131,0.023-0.264,0.039-0.398,0.039c-0.42,0-0.833-0.114-1.197-0.33L3.226,18.64 c-0.741-0.44-1.201-1.261-1.201-2.142V7.503c0-0.881,0.46-1.702,1.201-2.142l7.577-4.498c0.363-0.216,0.777-0.33,1.197-0.33 c0.419,0,0.833,0.114,1.197,0.33l7.577,4.498c0.624,0.371,1.046,1.013,1.164,1.732C21.686,6.557,21.12,6.411,20.459,6.797z`,fish:`m19.164 9.228-3.016 2.688v.527l3.016 2.688v-1.228l-1.936-1.723 1.936-1.724V9.228m-6.658.046v1.208l1.905 1.696-1.905 1.695v1.209l2.968-2.645v-.518l-2.968-2.645M9.781 7.847a6.519 6.519 0 0 0-2.038-.335c-.672 0-1.349.112-2.03.335a9.23 9.23 0 0 0-2.088 1.017v.723c.69-.4 1.377-.7 2.06-.897a7.388 7.388 0 0 1 2.058-.296c.684 0 1.368.098 2.052.296a9.452 9.452 0 0 1 2.075.897v-.723a9.229 9.229 0 0 0-2.09-1.017m.014 7.78a7.371 7.371 0 0 1-2.052.296 7.388 7.388 0 0 1-2.057-.296 9.18 9.18 0 0 1-2.061-.897v.723a9.228 9.228 0 0 0 2.088 1.017 6.492 6.492 0 0 0 2.03.335c.678 0 1.357-.112 2.038-.335a9.227 9.227 0 0 0 2.089-1.017v-.723c-.7.4-1.391.7-2.075.897m.602-11.23h-.51L7.28 6.92h1.19l1.672-1.62 1.671 1.62h1.191l-2.607-2.525m-2.965 13.68v-.824H6.427v.825l.786 1.527h.614l-.395-1.527M4.127 10.95v1.216H5.13V10.95H4.127m-1.16-1.695L0 11.901v.518l2.967 2.645v-1.208L1.063 12.16l1.904-1.695V9.256m20.68 3.28c-.235-.3-.574-.509-1.017-.626.395-.103.696-.278.902-.525.206-.247.31-.556.31-.926 0-.546-.197-.984-.59-1.314-.393-.33-.919-.495-1.575-.495-.22 0-.473.025-.758.073-.284.048-.61.12-.974.217v.84c.314-.12.613-.21.9-.27a4.05 4.05 0 0 1 .832-.091c.403 0 .714.093.933.278.218.185.328.451.328.798 0 .328-.118.584-.353.768-.235.184-.562.276-.98.276h-.697v.75h.696c.458 0 .821.116 1.09.346.268.23.402.542.402.934 0 .425-.134.75-.402.976-.269.226-.653.339-1.153.339a3.55 3.55 0 0 1-.89-.117 4.395 4.395 0 0 1-.91-.358v.909a6.1 6.1 0 0 0 .95.249c.323.057.639.085.95.085.738 0 1.315-.177 1.733-.53.417-.355.626-.842.626-1.463 0-.449-.118-.823-.353-1.123`,powershell:`M23.181 2.974c.568 0 .923.463.792 1.035l-3.659 15.982c-.13.572-.697 1.035-1.265 1.035H.819c-.568 0-.923-.463-.792-1.035L3.686 4.009c.13-.572.697-1.035 1.265-1.035zm-8.375 9.346c.251-.394.227-.905-.09-1.243L9.122 5.125c-.38-.404-1.037-.407-1.466-.003-.429.402-.468 1.056-.088 1.46l4.662 4.96v.11l-7.42 5.374c-.45.327-.533.977-.187 1.453.346.476.991.597 1.44.27l8.229-5.91c.28-.196.438-.365.514-.52zm-2.796 4.399a.928.928 0 00-.934.923c0 .51.418.923.934.923h4.433a.928.928 0 00.934-.923.928.928 0 00-.934-.923z`,cmd:`M8.165 6V3h7.665v3H8.165zm-.5-3H1c-.55 0-1 .45-1 1v2h7.665V3zM23 3h-6.67v3H24V4c0-.55-.45-1-1-1zM0 6.5h24V20c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V6.5zM11.5 18c0 .3.2.5.5.5h8c.3 0 .5-.2.5-.5v-1.5c0-.3-.2-.5-.5-.5h-8c-.3 0-.5.2-.5.5V18zm-5.2-4.55l-3.1 3.1c-.25.25-.25.6 0 .8l.9.9c.25.25.6.25.8 0l4.4-4.4a.52.52 0 0 0 0-.8l-4.4-4.4c-.2-.2-.6-.2-.8 0l-.9.9c-.25.2-.25.55 0 .8l3.1 3.1z`},D2={zsh:`zsh`,bash:`bash`,fish:`fish`,pwsh:`powershell`,powershell:`powershell`,cmd:`cmd`},nge={macos:[`zsh`,`bash`,`fish`,`pwsh`],linux:[`bash`,`zsh`,`fish`,`pwsh`],windows:[`pwsh`,`powershell`,`cmd`]};function rge(e){let t=e.trim().split(/[\\/]/).pop()?.toLowerCase().replace(/\.exe$/,``);return t===void 0?void 0:D2[t]}function ige(e){return e.replace(/[\\/][^\\/]*$/,``)}function O2(e){return(0,B.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-4 flex-none`,fill:`currentColor`,children:(0,B.jsx)(`path`,{d:tge[e.logo]})})}function age(e){let[t,n]=(0,v.useState)(e.value??``),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),s=rge(t),c=e.platform===e.device,l=c?r:nge[e.platform].map(e=>({name:e,path:null}));(0,v.useEffect)(()=>{c&&M(e.machine,`terminal.shells`,void 0).then(i,e=>o(Vn(e)))},[e.machine,c]);function u(t){n(t),t!==(e.value??``)&&e.onCommit(t===``?null:t)}return(0,B.jsxs)(`div`,{className:`relative w-56`,children:[s&&(0,B.jsx)(`span`,{className:`text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2`,children:(0,B.jsx)(O2,{logo:s})}),(0,B.jsx)(xV,{className:s?`pr-9 pl-8`:`pr-9`,placeholder:`System default`,value:t,onChange:e=>n(e.target.value),onBlur:()=>u(t),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}}),(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsx)(H,{variant:`ghost`,size:`icon-xs`,"aria-label":`Known shells`,className:`text-muted-foreground absolute top-1/2 right-1.5 -translate-y-1/2`,children:(0,B.jsx)(U,{icon:FD})})}),(0,B.jsxs)(pA,{align:`end`,className:`w-72`,children:[a&&(0,B.jsx)(`p`,{className:`text-destructive px-2 py-1.5 text-xs`,children:a}),l?.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground px-2 py-1.5 text-xs`,children:`No known shells found`}),l?.map(e=>(0,B.jsxs)(mA,{onSelect:()=>u(e.path??e.name),children:[(0,B.jsx)(O2,{logo:D2[e.name]}),e.name,e.path!==null&&(0,B.jsx)(`span`,{className:`text-muted-foreground ml-auto min-w-0 truncate pl-3 text-xs [direction:rtl]`,title:e.path,children:(0,B.jsx)(`bdi`,{children:ige(e.path)})})]},e.path??e.name)),(0,B.jsx)(yA,{}),(0,B.jsx)(mA,{onSelect:()=>u(``),children:`System default`})]})]})]})}function oge(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(sge,{machine:e.machine,config:e.config,platform:e.platform,defaultShell:e.defaultShell},e.machine),(0,B.jsx)($he,{machine:e.machine,config:e.config}),(0,B.jsx)(ege,{machine:e.machine,config:e.config,claudeAccounts:e.claudeAccounts,codexAccounts:e.codexAccounts,openCode:e.openCode},`git-${e.machine}`),(0,B.jsx)(H,{variant:`outline`,onClick:e.onRestore,children:`Restore machine defaults`})]})}function sge(e){let t=e.config.terminal,[n,r]=(0,v.useState)(e.platform),i=Qhe(t.shell[e.platform],e.platform,e.defaultShell);function a(t){Yd(e.machine,{...e.config,terminal:t})}return(0,B.jsxs)(b2,{title:`Shell`,note:`Applies to new terminals`,children:[(0,B.jsx)(x2,{label:`Platform`,children:(0,B.jsxs)(m2,{value:n,onValueChange:e=>r(e),children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsx)(_2,{children:VE.map(t=>(0,B.jsxs)(v2,{value:t.value,children:[t.label,t.value===e.platform&&(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`(this machine)`})]},t.value))})]})}),(0,B.jsx)(x2,{label:`Command`,children:(0,B.jsx)(age,{machine:e.machine,platform:n,device:e.platform,value:t.shell[n],onCommit:e=>a({...t,shell:{...t.shell,[n]:e}})},`${e.machine}-${n}-command`)}),(0,B.jsx)(x2,{label:(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Shell integration`,(0,B.jsx)($z,{label:(0,B.jsxs)(`div`,{children:[`Tells the terminal where prompts and commands start and end.`,(0,B.jsxs)(`ul`,{className:`mt-1 list-disc pl-4`,children:[(0,B.jsx)(`li`,{children:`Click in the command line to move the cursor`}),(0,B.jsx)(`li`,{children:`Ignore clipboard reads once the command that asked has finished`})]})]}),children:(0,B.jsx)(`span`,{onClick:e=>e.preventDefault(),children:(0,B.jsx)(U,{icon:OO,"aria-label":`About shell integration`,className:`text-muted-foreground size-3.5`})})})]}),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i!==null&&(0,B.jsx)(`span`,{className:`text-muted-foreground max-w-32 text-right text-xs sm:max-w-none`,children:i}),(0,B.jsx)(y2,{checked:i===null&&t.behavior.shellIntegration,disabled:i!==null,onCheckedChange:e=>a({...t,behavior:{...t.behavior,shellIntegration:e}})})]})}),(0,B.jsx)(cge,{identity:t.behavior.terminalIdentity,onChange:e=>a({...t,behavior:{...t.behavior,terminalIdentity:e}})})]})}function cge(e){return(0,B.jsx)(x2,{label:`Report the terminal as`,children:(0,B.jsxs)(m2,{value:e.identity,onValueChange:e.onChange,children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`offsite`,children:`OffSite`}),(0,B.jsx)(v2,{value:`ghostty`,children:`Ghostty`}),(0,B.jsx)(v2,{value:`iterm2`,children:`iTerm2`})]})]})})}var k2=(0,v.createContext)({});function A2(e){let t=(0,v.useRef)(null);return t.current===null&&(t.current=e()),t.current}var j2=typeof window<`u`?v.useLayoutEffect:v.useEffect,M2=(0,v.createContext)(null);function N2(e,t){e.indexOf(t)===-1&&e.push(t)}function P2(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function F2([...e],t,n){let r=t<0?e.length+t:t;if(r>=0&&r<e.length){let r=n<0?e.length+n:n,[i]=e.splice(t,1);e.splice(r,0,i)}return e}var I2=(e,t,n)=>n>t?t:n<e?e:n,L2={},R2=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),z2=e=>typeof e==`object`&&!!e,B2=e=>/^0[^.\s]+$/u.test(e);function V2(e){let t;return()=>(t===void 0&&(t=e()),t)}var H2=e=>e,U2=(...e)=>e.reduce((e,t)=>n=>t(e(n))),W2=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},G2=class{constructor(){this.subscriptions=[]}add(e){return N2(this.subscriptions,e),()=>this.remove(e)}remove(e){P2(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},K2=e=>e*1e3,q2=e=>e/1e3,J2=(e,t)=>t?1e3/t*e:0,Y2=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function X2(e,t,n,r){return e===t&&n===r?H2:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=Y2(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(Y2(s+1e-7,e,n)-i-r)}return Y2(s,t,r)}}var Z2=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Q2=e=>t=>1-e(1-t),$2=X2(.33,1.53,.69,.99),e4=Q2($2),t4=Z2(e4),n4=e=>e>=1?1:(e*=2)<1?.5*e4(e):.5*(2-2**(-10*(e-1))),r4=e=>1-Math.sin(Math.acos(e)),i4=Q2(r4),a4=Z2(r4),lge=X2(.42,0,1,1),uge=X2(0,0,.58,1),o4=X2(.42,0,.58,1),dge=e=>Array.isArray(e)&&typeof e[0]!=`number`,s4=e=>Array.isArray(e)&&typeof e[0]==`number`,c4={linear:H2,easeIn:lge,easeInOut:o4,easeOut:uge,circIn:r4,circInOut:a4,circOut:i4,backIn:e4,backInOut:t4,backOut:$2,anticipate:n4},fge=e=>typeof e==`string`,l4=e=>{if(s4(e)){e.length;let[t,n,r,i]=e;return X2(t,n,r,i)}return fge(e)?(c4[e],`${e}`,c4[e]):e},u4={delta:0,timestamp:0,isProcessing:!1},d4;function pge(){d4=void 0}var f4={now:()=>(d4===void 0&&f4.set(u4.isProcessing||L2.useManualTiming?u4.timestamp:performance.now()),d4),set:e=>{d4=e,queueMicrotask(pge)}},p4=e=>Math.round(e*1e5)/1e5,m4=e=>t=>typeof t==`string`&&t.startsWith(e),h4=m4(`--`),mge=m4(`var(--`),g4=e=>mge(e)?hge.test(e.split(`/*`)[0].trim()):!1,hge=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _4(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var v4={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},y4={...v4,transform:e=>I2(0,1,e)},b4={...v4,default:1},x4=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gge(e){return e==null}var _ge=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,S4=(e,t)=>n=>!!(typeof n==`string`&&_ge.test(n)&&n.startsWith(e)||t&&!gge(n)&&Object.prototype.hasOwnProperty.call(n,t)),C4=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(x4);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},vge=e=>I2(0,255,e),w4={...v4,transform:e=>Math.round(vge(e))},T4={test:S4(`rgb`,`red`),parse:C4(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+w4.transform(e)+`, `+w4.transform(t)+`, `+w4.transform(n)+`, `+p4(y4.transform(r))+`)`};function yge(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var E4={test:S4(`#`),parse:yge,transform:T4.transform},D4=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),O4=D4(`deg`),k4=D4(`%`),A4=D4(`px`),bge=D4(`vh`),xge=D4(`vw`),j4={...k4,parse:e=>k4.parse(e)/100,transform:e=>k4.transform(e*100)},M4={test:S4(`hsl`,`hue`),parse:C4(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+k4.transform(p4(t))+`, `+k4.transform(p4(n))+`, `+p4(y4.transform(r))+`)`},N4={test:e=>T4.test(e)||E4.test(e)||M4.test(e),parse:e=>T4.test(e)?T4.parse(e):M4.test(e)?M4.parse(e):E4.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?T4.transform(e):M4.transform(e),getAnimatableNone:e=>{let t=N4.parse(e);return t.alpha=0,N4.transform(t)}},Sge=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,P4=new RegExp(x4.source),F4=new RegExp(Sge.source,`i`);function Cge(e){return isNaN(e)&&typeof e==`string`&&(P4.test(e)||F4.test(e))}var I4=`number`,L4=`color`,wge=`var`,Tge=`var(`,R4="${}",Ege=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function Dge(e){let t=e.toString();return P4.test(t)||F4.test(t)}function z4(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Ege,e=>(N4.test(e)?(r.color.push(a),i.push(L4),n.push(N4.parse(e))):e.startsWith(Tge)?(r.var.push(a),i.push(wge),n.push(e)):(r.number.push(a),i.push(I4),n.push(parseFloat(e))),++a,R4)).split(R4),indexes:r,types:i}}function Oge(e){return z4(e).values}function B4({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===I4?p4(r[a]):e===L4?N4.transform(r[a]):r[a]}return i}}function kge(e){return B4(z4(e))}var Age=e=>typeof e==`number`?0:N4.test(e)?N4.getAnimatableNone(e):e,jge=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Age(e);function Mge(e){let t=z4(e);return B4(t)(t.values.map((e,n)=>jge(e,t.split[n])))}var V4={test:Cge,parse:Oge,createTransformer:kge,getAnimatableNone:Mge};function H4(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Nge({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=H4(s,r,e+1/3),a=H4(s,r,e),o=H4(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function U4(e,t){return n=>n>0?t:e}var W4=(e,t,n)=>e+(t-e)*n,G4=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Pge=[E4,T4,M4],Fge=e=>Pge.find(t=>t.test(e));function K4(e){let t=Fge(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===M4&&(n=Nge(n)),n}var q4=(e,t)=>{let n=K4(e),r=K4(t);if(!n||!r)return U4(e,t);let i={...n};return e=>(i.red=G4(n.red,r.red,e),i.green=G4(n.green,r.green,e),i.blue=G4(n.blue,r.blue,e),i.alpha=W4(n.alpha,r.alpha,e),T4.transform(i))},J4=new Set([`none`,`hidden`]);function Ige(e,t){return J4.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Lge(e,t){return n=>W4(e,t,n)}function Y4(e){return typeof e==`number`?Lge:typeof e==`string`?g4(e)?U4:N4.test(e)?q4:Bge:Array.isArray(e)?X4:typeof e==`object`?N4.test(e)?q4:Rge:U4}function X4(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Y4(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Rge(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Y4(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function zge(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Bge=(e,t)=>{let n=V4.createTransformer(t),r=z4(e),i=z4(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?J4.has(e)&&!i.values.length||J4.has(t)&&!r.values.length?Ige(e,t):U2(X4(zge(r,i),i.values),n):(`${e}${t}`,U4(e,t))},Z4=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Vge(e,t){let n=Z4.exec(e);if(!n)return;let r=Z4.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>p4(W4(a,o,e))+i}function Q4(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return W4(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Vge(e,t);if(n)return n}return Y4(e)(e,t)}var $4=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Hge(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Uge=40;function e3(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=$4.reduce((e,t)=>(e[t]=Hge(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=L2.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,Uge),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:$4.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<$4.length;t++)o[$4[t]].cancel(e)},state:n,steps:o}}var{schedule:t3,cancel:n3,steps:r3}=e3(typeof requestAnimationFrame<`u`?requestAnimationFrame:H2,!0,u4),i3=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>t3.update(t,e),stop:()=>n3(t),now:()=>u4.isProcessing?u4.timestamp:f4.now()}},a3=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},o3=2e4;function s3(e,t=50,n=o3,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function Wge(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(s3(o),o3);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:q2(s)}}var c3={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},l3=e=>e<0?1/Math.max(1+e,c3.minDamping):Math.max(1-e,c3.minDamping);function u3(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return f3(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function d3(e,t){return e*Math.sqrt(1-t*t)}var Gge=12;function f3(e,t,n){let r=n;for(let n=1;n<Gge;n++)r-=e(r)/t(r);return r}var p3=.001;function Kge({duration:e=c3.duration,bounce:t=c3.bounce}){let n,r;c3.maxDuration;let i=l3(t);e=I2(c3.minDuration,c3.maxDuration,q2(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=d3(t,i),o=Math.exp(-r);return p3-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=d3(t*t,i);return(-n(t)+p3>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=f3(n,r,a),s=o*u3(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:K2(e)}}var m3=(e,t)=>(t?e>=0:e>0)&&e<1/0;function h3(e,t){if(m3(e,t))return e}function qge(e){let t=h3(e.stiffness),n=h3(e.damping,!0),r=h3(e.mass),i={...e,stiffness:t??c3.stiffness,damping:n??c3.damping,mass:r??c3.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=l3(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*u3(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Kge(i)),i.isResolvedFromDuration=!0;(!m3(i.stiffness)||!m3(i.damping,!0))&&(i.stiffness=c3.stiffness,i.damping=c3.damping)}return i}function g3(e=c3.visualDuration,t=c3.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=qge({...n}),f=e=>d?0:-q2(e),p=s/(2*Math.sqrt(o*c)),m=q2(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?c3.restSpeed.granular:c3.restSpeed.default),g.restDelta=n.restDelta||(e?c3.restDelta.granular:c3.restDelta.default)};_();let v,y,b;if(p<1){let e=d3(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>K2(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=K2(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(s3(S),o3),t=a3(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}g3.applyToOptions=e=>{let t=Wge(e,100,g3);return e.ease=t.ease,e.duration=K2(t.duration),e.type=`keyframes`,e};function _3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=g3({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Jge(e,t,n){let r=[],i=n||L2.mix||Q4,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=U2(Array.isArray(t)?t[n]||H2:t,a)),r.push(a)}return r}function v3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Jge(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=W2(e[r],e[r+1],n);return s[r](i)};return n?t=>l(I2(e[0],e[a-1],t)):l}function Yge(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=W2(0,t,r);e.push(W4(n,1,i))}}function y3(e){let t=[0];return Yge(t,e.length-1),t}function Xge(e,t){return e.map(e=>e*t)}function Zge(e,t){return e.map(()=>t||o4).splice(0,e.length-1)}function b3({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=dge(r)?r.map(l4):l4(r)||o4,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(L2.mix||Q4)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?I2(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=v3(Xge(n&&n.length===t.length?n:y3(t),e),t,{ease:Array.isArray(i)?i:Zge(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Qge=5;function $ge(e,t,n){let r=Math.max(t-Qge,0);return J2(n-e(r),t-r)}function e_e(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):$ge(t=>e.next(t).value,t,e.next(t).value)}var t_e=e=>e!==null;function x3(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(t_e),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var n_e={decay:_3,inertia:_3,tween:b3,keyframes:b3,spring:g3};function S3(e){typeof e.type==`string`&&(e.type=n_e[e.type])}var r_e=40,C3=(e,t)=>t-e>r_e&&!L2.useManualTiming?t:e;function w3(e,t){return{kind:e,animation:t,timestamp:f4.now(),frameTimestamp:u4.timestamp,frameIsProcessing:u4.isProcessing}}function T3(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...w3(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function i_e(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...w3(`layout-animation-start`,e),node:t})}catch{}}var E3=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},a_e=e=>e/100,D3=e=>Math.round(e*1e4)/1e4,O3=class extends E3{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==f4.now()&&this.tick(f4.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),T3(this,this.options)}initAnimation(){let{options:e}=this;S3(e);let{type:t=b3,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||b3;s!==b3&&typeof o[0]!=`number`&&(this.mixKeyframes=U2(a_e,Q4(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=s3(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=C3(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;!d&&i!==null&&(p=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==_3&&(f.value=x3(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??D3((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==_3?x3(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=I2(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}then(e,t){return this.finished.then(e,t)}get duration(){return q2(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+q2(e)}get time(){return q2(this.currentTime)}set time(e){e=K2(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return e_e(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(f4.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=q2(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=i3,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(f4.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},o_e=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function s_e(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(x4)||[];if(!r)return e;let i=n.replace(r,``),a=+!!o_e.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var c_e=/\b([a-z-]*)\(.*?\)/gu,k3={...V4,getAnimatableNone:e=>{let t=e.match(c_e);return t?t.map(s_e).join(` `):e}},A3={...V4,getAnimatableNone:e=>{let t=V4.parse(e);return V4.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},j3={...v4,transform:Math.round},M3={borderWidth:A4,borderTopWidth:A4,borderRightWidth:A4,borderBottomWidth:A4,borderLeftWidth:A4,borderRadius:A4,borderTopLeftRadius:A4,borderTopRightRadius:A4,borderBottomRightRadius:A4,borderBottomLeftRadius:A4,width:A4,maxWidth:A4,height:A4,maxHeight:A4,top:A4,right:A4,bottom:A4,left:A4,inset:A4,insetBlock:A4,insetBlockStart:A4,insetBlockEnd:A4,insetInline:A4,insetInlineStart:A4,insetInlineEnd:A4,padding:A4,paddingTop:A4,paddingRight:A4,paddingBottom:A4,paddingLeft:A4,paddingBlock:A4,paddingBlockStart:A4,paddingBlockEnd:A4,paddingInline:A4,paddingInlineStart:A4,paddingInlineEnd:A4,margin:A4,marginTop:A4,marginRight:A4,marginBottom:A4,marginLeft:A4,marginBlock:A4,marginBlockStart:A4,marginBlockEnd:A4,marginInline:A4,marginInlineStart:A4,marginInlineEnd:A4,fontSize:A4,backgroundPositionX:A4,backgroundPositionY:A4,rotate:O4,pathRotation:O4,rotateX:O4,rotateY:O4,rotateZ:O4,scale:b4,scaleX:b4,scaleY:b4,scaleZ:b4,skew:O4,skewX:O4,skewY:O4,distance:A4,translateX:A4,translateY:A4,translateZ:A4,x:A4,y:A4,z:A4,perspective:A4,transformPerspective:A4,opacity:y4,originX:j4,originY:j4,originZ:A4,zIndex:j3,fillOpacity:y4,strokeOpacity:y4,numOctaves:j3},l_e={...M3,color:N4,backgroundColor:N4,outlineColor:N4,fill:N4,stroke:N4,borderColor:N4,borderTopColor:N4,borderRightColor:N4,borderBottomColor:N4,borderLeftColor:N4,filter:k3,WebkitFilter:k3,mask:A3,WebkitMask:A3},N3=e=>l_e[e],u_e=new Set([k3,A3]);function P3(e,t){let n=N3(e);return u_e.has(n)||(n=V4),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function d_e(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var F3=e=>e*180/Math.PI,I3=e=>L3(F3(Math.atan2(e[1],e[0]))),f_e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:I3,rotateZ:I3,skewX:e=>F3(Math.atan(e[1])),skewY:e=>F3(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},L3=e=>(e%=360,e<0&&(e+=360),e),R3=I3,z3=e=>Math.hypot(e[0],e[1]),B3=e=>Math.hypot(e[4],e[5]),p_e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:z3,scaleY:B3,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(z3(e)+B3(e))/2,rotateX:e=>L3(F3(Math.atan2(e[6],e[5]))),rotateY:e=>L3(F3(Math.atan2(-e[2],e[0]))),rotateZ:R3,rotate:R3,skewX:e=>F3(Math.atan(e[4])),skewY:e=>F3(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function V3(e){return+!!e.includes(`scale`)}function H3(e,t){if(!e||e===`none`)return V3(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=p_e,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=f_e,i=t}if(!i)return V3(t);let a=r[t],o=i[1].split(`,`).map(h_e);return typeof a==`function`?a(o):o[a]}var m_e=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return H3(n,t)};function h_e(e){return parseFloat(e.trim())}var U3=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],W3=new Set([...U3,`pathRotation`]),G3=e=>e===v4||e===A4,g_e=new Set([`x`,`y`,`z`]),__e=U3.filter(e=>!g_e.has(e));function v_e(e){let t=[];return __e.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var y_e=new Set([`bottom`,`right`]);function K3(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var q3={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>K3(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>K3(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>H3(e,`x`),y:({transform:e})=>H3(e,`y`)};q3.translateX=q3.x,q3.translateY=q3.y;var J3=new Set,Y3=!1,X3=!1,Z3=!1;function Q3(){if(X3){let e=[],t=new Set,n=new Set;J3.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),y_e.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=v_e(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}X3=!1,Y3=!1,J3.forEach(e=>e.complete(Z3)),J3.clear()}function $3(){J3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(X3=!0)})}function b_e(){Z3=!0,$3(),Q3(),Z3=!1}function x_e(e,t,n){if(typeof e==`string`){if(R2(e)||B2(e))return parseFloat(e);if(!V4.test(e)&&V4.test(n))return P3(t,n)}return e??void 0}var e6=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(J3.add(this),Y3||(Y3=!0,t3.read($3),t3.resolveKeyframes(Q3))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=x_e(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}d_e(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),J3.delete(this)}cancel(){this.state===`scheduled`&&(J3.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},S_e=e=>e.startsWith(`--`);function t6(e,t,n){S_e(t)?e.style.setProperty(t,n):e.style[t]=n}var C_e={};function n6(e,t){let n=V2(e);return()=>C_e[t]??n()}var w_e=n6(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),r6=n6(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),i6=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,a6={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:i6([0,.65,.55,1]),circOut:i6([.55,0,1,.45]),backIn:i6([.31,.01,.66,-.59]),backOut:i6([.33,1.53,.69,.99])};function o6(e,t){if(e)return typeof e==`function`?r6()?a3(e,t):`ease-out`:s4(e)?i6(e):Array.isArray(e)?e.map(e=>o6(e,t)||a6.easeOut):a6[e]}function T_e(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=o6(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function s6(e){return typeof e==`function`&&`applyToOptions`in e}function E_e({type:e,...t}){return s6(e)&&r6()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var c6=class extends E3{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=E_e(e);this.animation=T_e(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=x3(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),t6(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},T3(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return q2(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+q2(e)}get time(){return q2(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=K2(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&w_e()?(this.animation.timeline=e,t?.(this.animation),H2):n(this)}},l6={anticipate:n4,backInOut:t4,circInOut:a4};function D_e(e){return e in l6}function O_e(e){typeof e.ease==`string`&&D_e(e.ease)&&(e.ease=l6[e.ease])}var k_e=class extends c6{constructor(e){O_e(e),S3(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(f4.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new O3({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?I2(0,10,a):0,s=this.sample(a);n&&r&&t6(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},u6=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(V4.test(e)||e===`0`)&&!e.startsWith(`url(`));function A_e(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function j_e(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=u6(i,t),s=u6(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):A_e(e)||(n===`spring`||s6(n))&&r}function d6(e){e.duration=0,e.type=`keyframes`}var f6=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),M_e=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function N_e(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&M_e.test(e[t]))return!0;return!1}var p6=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),m6=V2(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function P_e(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(f6.has(n)||p6.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return m6()&&(f6.has(n)||p6.has(n)&&N_e(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var h6=(e,t)=>t&&typeof e==`number`?t.transform(e):e,g6={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},F_e=U3.length;function _6(e,t,n){let r=``,i=!0;for(let a=0;a<F_e;a++){let o=U3[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=h6(s,M3[o]);if(!c){i=!1;let t=g6[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${h6(a,M3.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}var v6=new WeakMap,I_e=200,y6=.001,L_e=.1,R_e=.001,z_e=100,B_e=e=>/^(linear|ease(In|Out|InOut))$/.test(e),b6=(e,t)=>e-t,x6=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(W4(e,t,i/n));return r},S6=e=>e.motionValue.owner,C6=e=>v6.get(e),w6=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),V_e=({name:e,motionValue:t})=>e&&U3.includes(e)&&t?.owner?.current instanceof HTMLElement&&m6()&&r6();function H_e(e){let t=S6(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(w6(t,`transform`)||`none`)===`none`&&!w6(t,`pathRotation`)&&!t.projection?.isProjecting()}var U_e=class extends O3{constructor(e){let t=S6(e).current,{driver:n=i3}=e,r=H_e(e);e.driver=e=>{let r=n(e);return{js:r,now:r.now,start:(e=!0)=>{let n=C6(t);!n||n.isJS?r.start(e):n.schedule(!1,!e)},stop:()=>{r.stop();let e=C6(t);e?.schedule(!e.isFinishing)}}},super(e),this.canAccelerate=r;let{stop:i}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),i()}}get group(){return C6(S6(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(f4.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=s4(n)?i6(n):B_e(n)&&a6[n];if(o&&!i&&!r&&e.length===2&&t===b3&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||b3)===b3?u||y3(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=f4.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||W_e(S6(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(f4.now())}get time(){return this.isAccelerated()?q2(I2(0,this.totalDuration,this.at(f4.now())-(this.options.delay||0))):super.time}set time(e){super.time=e}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function W_e(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,d=-1/0,f=e=>{for(let t of n)if(t.name===e)return!0},p=(t,n)=>{let o={};for(let s of t===void 0?U3:a){let a=r.get(s),c=t===void 0?w6(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},m=(e,t)=>{let n=``,r=p(e,t);for(let e in r)n+=(g6[e]||e)+`(`+h6(r[e],M3[e])+`) `;return n||`none`},h=(e=p())=>{t.style.transform=_6(e,{})},g=(e=!0)=>{e&&h(),s.forEach(({animation:e})=>e.cancel()),s=[]},_=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=f4.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),E.schedule(!1)}),e.oncancel=()=>s.includes(r)&&E.demote(),s.push(r)},v=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},y=(e,t,n,r)=>{let i=Math.min(I_e,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=x6(t,n,i).concat(r).sort(b6),o=e=>W2(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e[e.length-1]-n,i=e.map(e=>r?(e-n)/r:e-n);if(!r){if(i.some(e=>!(Math.abs(e)<=y6)))return}else if(!s)s=i,c=e=>(t.numberAt(e)-n)/r;else if(i.some((e,t)=>!(Math.abs(e-s[t])<=y6)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=y6))return`linear`;let l=[],u=(e,t=c(e))=>l.push(D3(t)+` `+D3(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&v(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},b=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?R_e:L_e))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...v(e=>r.numberAt(e),t,n));i.push(n)}},s=x6(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(b6))e>c&&o(c,e,0),c=e;return i.sort(b6)},x=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},S=(e,n,r,i={fill:`both`},a,o)=>{let s=e.flatMap(e=>e.boundaries(n,r)),c=o||y(e,n,r,s),l=c?[n,r]:b(e,n,r,s),u=l.map(e=>m(e,a)),d={transform:u};return c||(d.offset=l.map(e=>W2(n,r,e))),u.every(e=>e===u[0])&&(h(p(n,a)),d=null),t.animate(d,{...i,duration:r-n,easing:c||`linear`})},C=c=>{let l=c,u=0,d=0,f=[],p=[],m=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[t,n]=e.timing(),i=t===1/0;if(o.set(e,[e.at(c),e.speed,i]),i)e.sync();else{if(e.speed<0)return;if(n){if(u){let e=(t-d)/n;if(Math.abs(n-u)>1||Math.abs(e-Math.round(e))*u>1)return}else u=n,d=t;p.push(e)}else m.add(t);f.push(e),l=Math.max(l,t)}}i={},a=U3.filter(t=>{if(r.has(t))return!0;let n=i[t]=w6(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),g(!1);let h=!u&&x(f);try{if(h&&h[1]>c){let[e,t,n]=h;_(S(f,e,t,void 0,void 0,n),e-c,t-e)}else l>c&&(_(S(f,c,l),0,l-c),m.forEach(e=>e<l-1&&_(t.animate(null,{duration:e-c}),0,e-c)));if(u){let e=d+Math.floor((l-d)/u)*u;_(S(p,e,e+u,{iterations:1/0,iterationStart:(l-e)/u,fill:`forwards`},l),l-c)}}catch{return}return s.length||g(),!0},w=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r?(n.playbackRate=r,n.startTime=e-o/r):(n.pause(),n.currentTime=o)}return!0},T=()=>{let r=f4.now();if(E.isJS||(E.isFinishing=!0,n.forEach(t=>{let[n,a]=t.timing();t.state===`running`&&t.speed>0&&!a&&n<=r+1&&(t.complete(),i[t.name]=w6(e,t.name),o.has(t)||(c=!0))}),E.isFinishing=!1),l=!1,n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),!n.size){v6.delete(t),E.isJS||g();return}for(let e of n)if(!e.canAccelerate)return E.demote(!0);E.isJS&&(E.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let a=c,s=u;if(c=u=!1,a||!w(r)){if(s){if(r-d<z_e)return E.demote();d=r}if(!C(r))return E.demote()}},E={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){c||=e,u||=!!t,l||(l=!0,u4.isProcessing?t3.render(T,!1,!0):queueMicrotask(T))},check(){if(!E.isJS){for(let t in i)if(w6(e,t)!==i[t]&&!f(t))return E.schedule(!0,!0)}},demote(e){E.isJS||(n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),E.isJS=!0,o=new Map,g(),n.forEach(e=>e.state===`running`&&e.js?.start()))}};return v6.set(t,E),E}var G_e=class extends E3{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=f4.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||e6;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=f4.now();let u=!0;j_e(e,i,a,o)||(u=!1,(L2.instantAnimations||!s)&&l?.(x3(e,n,t)),e[0]=e[e.length-1],d6(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&P_e(n),p=!f&&V_e(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=C3(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new k_e(n)}catch{m=new O3(n)}}else m=p?new U_e(n):new O3(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),b_e()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function T6(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var E6=30,K_e=e=>!isNaN(parseFloat(e)),D6={current:void 0},q_e=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=f4.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=f4.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=K_e(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new G2)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new G2,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){t3.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){D6.current&&D6.current.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=f4.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>E6)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,E6);return J2(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function O6(e,t){return new q_e(e,t)}function k6(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function A6(e,t){let n=e?.[t]??e?.default??e;return n===e?n:k6(n,e)}var J_e={type:`spring`,stiffness:500,damping:25,restSpeed:10},Y_e=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),X_e={type:`keyframes`,duration:.8},Z_e={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Q_e=(e,{keyframes:t})=>t.length>2?X_e:W3.has(e)?e.startsWith(`scale`)?Y_e(t[1]):J_e:Z_e,$_e=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function eve(e){for(let t in e)if(!$_e.has(t))return!0;return!1}var j6=(e,t,n,r={},i,a)=>o=>{let s=A6(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=K2(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};eve(s)||Object.assign(u,Q_e(e,u)),u.duration&&=K2(u.duration),u.repeatDelay&&=K2(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(d6(u),u.delay===0&&(d=!0)),(L2.instantAnimations||L2.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,d6(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=x3(u.keyframes,s);if(e!==void 0){t3.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new O3(u):new G_e(u)},tve=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function nve(e){let t=tve.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function M6(e,t,n=1){`${e}`;let[r,i]=nve(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return R2(e)?parseFloat(e):e}return g4(i)?M6(i,t,n+1):i}function rve(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function N6(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...rve(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function P6(e,t,n){return N6(e.getProps(),t,n,e)}var F6=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,I6=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...U3]),ive=e=>Array.isArray(e);function ave(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,O6(n))}function ove(e){return ive(e)?e[e.length-1]||0:e}function sve(e,t){let{transitionEnd:n={},transition:r={},...i}=P6(e,t)||{};i={...i,...n};for(let t in i)ave(e,t,ove(i[t]))}var L6=e=>!!(e&&e.getVelocity);function cve(e){return!!(L6(e)&&e.add)}function R6(e,t){let n=e.getValue(`willChange`);if(cve(n))return n.add(t);if(!n&&L2.WillChange){let n=new L2.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function z6(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var B6=`data-`+z6(`framerAppearId`);function V6(e){return e.props[B6]}var lve=typeof window<`u`;function uve({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function H6(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?k6(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&uve(f,t))continue;let o={delay:n,...A6(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){t3.update(()=>r.set(i));continue}let p=!1;if(lve&&window.MotionHandoffAnimation){let n=V6(e);if(n){let e=window.MotionHandoffAnimation(n,t,t3);e!==null&&(o.startTime=e,p=!0)}}R6(e,t);let m=l??e.shouldReduceMotion;r.start(j6(t,r,i,m&&I6.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>t3.update(()=>{o&&sve(e,o)});d.length?Promise.all(d).then(t):t()}return d}function U6(e,t,n={}){let r=P6(e,t,F6(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?H6(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(U6(e,t,{...n,delay:r+(typeof o==`function`?0:o)+T6(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function dve(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>U6(e,t,n))):typeof t==`string`?U6(e,t,n):Promise.all(H6(e,P6(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var fve={test:e=>e===`auto`,parse:e=>e},pve=e=>t=>t.test(e),mve=[v4,A4,k4,O4,xge,bge,fve],W6=e=>mve.find(pve(e));function hve(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||B2(e)}var gve=new Set([`auto`,`none`,`0`]);function _ve(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!gve.has(t)&&Dge(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=P3(n,i))}var vve=class extends e6{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(_4(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),g4(r))){let i=M6(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!I6.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=W6(r),o=W6(i);if(_4(r)!==_4(i)&&q3[n])this.needsMeasurement=!0;else if(a!==o){if(G3(a)&&G3(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else q3[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||hve(e[t]))&&n.push(t);n.length&&_ve(e,n,t)}measure(){let{element:e,name:t}=this;return q3[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},G6=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function yve(e){return z2(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function K6(e){return z2(e)&&`ownerSVGElement`in e}function q6(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function J6(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(W3.has(e))o=!0;else if(h4(e))i[e]=n;else{let t=h6(n,M3[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=_6(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var bve={offset:`stroke-dashoffset`,array:`stroke-dasharray`},xve={offset:`strokeDashoffset`,array:`strokeDasharray`};function Sve(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?bve:xve;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Y6=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function X6(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(J6(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Y6)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Sve(d,i,a,o,!1)}function Z6({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Cve({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function wve(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Q6(e){return e===void 0||e===1}function $6({scale:e,scaleX:t,scaleY:n}){return!Q6(e)||!Q6(t)||!Q6(n)}function e8(e){return $6(e)||t8(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function t8(e){return n8(e.x)||n8(e.y)}function n8(e){return e&&e!==`0%`}function r8(e,t,n){return n+t*(e-n)}function i8(e,t,n,r,i){return i!==void 0&&(e=r8(e,i,r)),r8(e,n,r)+t}function a8(e,t=0,n=1,r,i){e.min=i8(e.min,t,n,r,i),e.max=i8(e.max,t,n,r,i)}function o8(e,{x:t,y:n}){a8(e.x,t.translate,t.scale,t.originPoint),a8(e.y,n.translate,n.scale,n.originPoint)}var s8=.999999999999,c8=1.0000000000001;function Tve(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(l8(e.x,-a.scroll.offset.x),l8(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,o8(e,o)),r&&e8(a.latestValues)&&f8(e,a.latestValues,a.layout?.layoutBox))}t.x<c8&&t.x>s8&&(t.x=1),t.y<c8&&t.y>s8&&(t.y=1)}function l8(e,t){e.min+=t,e.max+=t}function u8(e,t,n,r,i=.5){a8(e,t,n,W4(e.min,e.max,i),r)}function d8(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function f8(e,t,n){let r=n??e;u8(e.x,d8(t.x,r.x),t.scaleX,t.scale,t.originX),u8(e.y,d8(t.y,r.y),t.scaleY,t.scale,t.originY)}function p8(e,t){return Z6(wve(e.getBoundingClientRect(),t))}function Eve(e,t,n){let r=p8(e,n),{scroll:i}=t;return i&&(l8(r.x,i.offset.x),l8(r.y,i.offset.y)),r}var{schedule:m8,cancel:Dve}=e3(queueMicrotask,!1),h8={x:!1,y:!1};function g8(){return h8.x||h8.y}function Ove(e){return e===`x`||e===`y`?h8[e]?null:(h8[e]=!0,()=>{h8[e]=!1}):h8.x||h8.y?null:(h8.x=h8.y=!0,()=>{h8.x=h8.y=!1})}function _8(e,t){let n=q6(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function kve(e){return!(e.pointerType===`touch`||g8())}function Ave(e,t,n={}){let[r,i,a]=_8(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!kve(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var v8=(e,t)=>t?e===t||v8(e,t.parentElement):!1,y8=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,jve=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Mve(e){return jve.has(e.tagName)||e.isContentEditable===!0}var Nve=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Pve(e){return Nve.has(e.tagName)||e.isContentEditable===!0}var b8=new WeakSet;function x8(e){return t=>{t.key===`Enter`&&e(t)}}function S8(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Fve=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=x8(()=>{if(b8.has(n))return;S8(n,`down`);let e=x8(()=>{S8(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>S8(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function C8(e){return y8(e)&&!g8()}var w8=new WeakSet;function Ive(e,t,n={}){let[r,i,a]=_8(e,n),o=e=>{let r=e.currentTarget;if(!C8(e)||w8.has(e))return;b8.add(r),n.stopPropagation&&w8.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),b8.has(r)&&b8.delete(r),C8(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||v8(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),yve(e)&&(e.addEventListener(`focus`,e=>Fve(e,i)),!Mve(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var T8=new WeakMap,E8,D8=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:K6(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Lve=D8(`inline`,`width`,`offsetWidth`),Rve=D8(`block`,`height`,`offsetHeight`);function zve({target:e,borderBoxSize:t}){T8.get(e)?.forEach(n=>{n(e,{get width(){return Lve(e,t)},get height(){return Rve(e,t)}})})}function Bve(e){e.forEach(zve)}function Vve(){typeof ResizeObserver<`u`&&(E8=new ResizeObserver(Bve))}function Hve(e,t){E8||Vve();let n=q6(e);return n.forEach(e=>{let n=T8.get(e);n||(n=new Set,T8.set(e,n)),n.add(t),E8?.observe(e)}),()=>{n.forEach(e=>{let n=T8.get(e);n?.delete(t),n?.size||E8?.unobserve(e)})}}var O8=new Set,k8;function Uve(){k8=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};O8.forEach(t=>t(e))},window.addEventListener(`resize`,k8)}function Wve(e){return O8.add(e),k8||Uve(),()=>{O8.delete(e),!O8.size&&typeof k8==`function`&&(window.removeEventListener(`resize`,k8),k8=void 0)}}function A8(e,t){return typeof e==`function`?Wve(e):Hve(e,t)}var j8={value:null,addProjectionMetrics:null};function Gve(e){return K6(e)&&e.tagName===`svg`}function Kve(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=v3(i,a,o);return t?s(r):s}var M8=e=>typeof e==`number`?e:parseFloat(e),N8=()=>({translate:0,scale:1,origin:0,originPoint:0}),P8=()=>({x:N8(),y:N8()}),F8=()=>({min:0,max:0}),I8=()=>({x:F8(),y:F8()}),qve=new WeakMap;function L8(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function R8(e){return typeof e==`string`||Array.isArray(e)}var z8=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],B8=[`initial`,...z8];function V8(e){if(L8(e.animate))return!0;for(let t=0;t<B8.length;t++)if(R8(e[B8[t]]))return!0;return!1}function H8(e){return!!(V8(e)||e.variants)}function Jve(e,t,n){for(let r in t){let i=t[r],a=n[r];if(L6(i))e.addValue(r,i);else if(L6(a))e.addValue(r,O6(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,O6(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var U8={current:null},W8={current:!1},Yve=typeof window<`u`;function Xve(){if(W8.current=!0,Yve){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>U8.current=e.matches;e.addEventListener(`change`,t),t()}else U8.current=!1}}var G8=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],K8={};function q8(e){K8=e}function Zve(){return K8}var Qve=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=e6,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=f4.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,t3.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=V8(t),this.isVariantNode=H8(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&L6(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,qve.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(W8.current||Xve(),this.shouldReduceMotion=U8.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),n3(this.notifyUpdate),n3(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&f6.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new c6({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:K2(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=W3.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&t3.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),v6.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in K8){let t=K8[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):I8()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&v6.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<G8.length;t++){let n=G8[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Jve(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=O6(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(R2(n)||B2(n))?n=parseFloat(n):typeof n!=`number`&&!V4.test(n)&&V4.test(t)&&(n=P3(e,t)),this.setBaseTarget(e,L6(n)?n.get():n)),L6(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new G2),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){m8.render(this.render)}},J8=class extends Qve{constructor(){super(...arguments),this.KeyframeResolver=vve}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;L6(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Y8=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function X8(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var Z8={};function Q8(e,{layout:t,layoutId:n}){return W3.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Z8[e]||e===`opacity`)}function $8(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(L6(r[t])||i&&L6(i[t])||Q8(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function $ve(e){return window.getComputedStyle(e)}var eye=class extends J8{constructor(){super(...arguments),this.type=`html`,this.renderInstance=X8}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(W3.has(t))return this.projection?.isProjecting?V3(t):m_e(e,t);{let n=$ve(e),r=(h4(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return p8(e,t)}build(e,t,n){J6(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return $8(e,t,n)}},e5=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),t5=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function tye(e,t,n,r){X8(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(e5.has(n)?n:z6(n),t.attrs[n])}function n5(e,t,n){let r=$8(e,t,n);for(let n in e)if(n!==`children`&&(L6(e[n])||L6(t[n]))){let t=U3.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var nye=class extends J8{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=I8}getBaseTargetFromProps(e,t){return W3.has(t)?super.getBaseTargetFromProps(e,t)??V3(t):e[t]}getDefaultValue(e){return W3.has(e)?this.latestValues[e]??V3(e):void 0}readValueFromInstance(e,t){if(W3.has(t)){let e=N3(t);return e&&e.default||0}if(Y6.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=e5.has(t)?t:z6(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return n5(e,t,n)}build(e,t,n){X6(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){tye(e,t,n,r)}mount(e){this.isSVGTag=t5(e.tagName),super.mount(e)}};function r5(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var rye=[...z8].reverse();function iye(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>dve(e,t,n))),n=i5(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(rye.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?R8(g)||g===!1?g:void 0:h,v=R8(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||L8(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=aye(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=P6(e,n,F6(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!r5(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=P6(s,n)?.transition?.delayChildren;r.delay=T6(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&P6(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!L6(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=i5(),i=!0}}}function aye(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!r5(t,e):!1}function i5(){let e={};for(let t of z8)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function a5(e,t){e.min=t.min,e.max=t.max}function o5(e,t){a5(e.x,t.x),a5(e.y,t.y)}function s5(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var oye=.9999,sye=1.0001,cye=-.01,lye=.01;function c5(e){return e.max-e.min}function uye(e,t,n){return Math.abs(e-t)<=n}function l5(e,t,n,r=.5){e.origin=r,e.originPoint=W4(t.min,t.max,e.origin),e.scale=c5(n)/c5(t),e.translate=W4(n.min,n.max,e.origin)-e.originPoint,(e.scale>=oye&&e.scale<=sye||isNaN(e.scale))&&(e.scale=1),(e.translate>=cye&&e.translate<=lye||isNaN(e.translate))&&(e.translate=0)}function u5(e,t,n,r){l5(e.x,t.x,n.x,r?r.originX:void 0),l5(e.y,t.y,n.y,r?r.originY:void 0)}function d5(e,t,n,r=0){e.min=(r?W4(n.min,n.max,r):n.min)+t.min,e.max=e.min+c5(t)}function dye(e,t,n,r){d5(e.x,t.x,n.x,r?.x),d5(e.y,t.y,n.y,r?.y)}function f5(e,t,n,r=0){let i=r?W4(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+c5(t)}function p5(e,t,n,r){f5(e.x,t.x,n.x,r?.x),f5(e.y,t.y,n.y,r?.y)}function m5(e,t,n,r,i){return e-=t,e=r8(e,1/n,r),i!==void 0&&(e=r8(e,1/i,r)),e}function fye(e,t=0,n=1,r=.5,i,a=e,o=e){if(k4.test(t)&&(t=parseFloat(t),t=W4(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=W4(a.min,a.max,r);e===a&&(s-=t),e.min=m5(e.min,t,n,s,i),e.max=m5(e.max,t,n,s,i)}function h5(e,t,[n,r,i],a,o){fye(e,t[n],t[r],t[i],t.scale,a,o)}var pye=[`x`,`scaleX`,`originX`],mye=[`y`,`scaleY`,`originY`];function g5(e,t,n,r){h5(e.x,t,pye,n?n.x:void 0,r?r.x:void 0),h5(e.y,t,mye,n?n.y:void 0,r?r.y:void 0)}function _5(e){return e.translate===0&&e.scale===1}function v5(e){return _5(e.x)&&_5(e.y)}function y5(e,t){return e.min===t.min&&e.max===t.max}function hye(e,t){return y5(e.x,t.x)&&y5(e.y,t.y)}function b5(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function x5(e,t){return b5(e.x,t.x)&&b5(e.y,t.y)}function S5(e){return c5(e.x)/c5(e.y)}function C5(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function w5(e){return[e(`x`),e(`y`)]}function T5(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var E5={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(A4.test(e))e=parseFloat(e);else return e}return`${T5(e,t.target.x)}% ${T5(e,t.target.y)}%`}},gye={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=V4.parse(e);if(i.length>5)return r;let a=V4.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=W4(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function _ye(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var vye=G6.length,D5=e=>typeof e==`number`||A4.test(e);function yye(e,t,n,r,i,a){i?(e.opacity=W4(0,n.opacity??1,bye(r)),e.opacityExit=W4(t.opacity??1,0,xye(r))):a&&(e.opacity=W4(t.opacity??1,n.opacity??1,r));for(let i=0;i<vye;i++){let a=G6[i],o=O5(t,a),s=O5(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||D5(o)===D5(s)?(e[a]=Math.max(W4(M8(o),M8(s),r),0),(k4.test(s)||k4.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=W4(t.rotate||0,n.rotate||0,r))}function O5(e,t){return e[t]===void 0?e.borderRadius:e[t]}var bye=k5(0,.5,i4),xye=k5(.5,.95,H2);function k5(e,t,n){return r=>r<e?0:r>t?1:n(W2(e,t,r))}function Sye(e,t,n){let r=L6(e)?e:O6(e);return r.start(j6(``,r,t,n)),r.animation}function A5(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Cye=(e,t)=>e.depth-t.depth,wye=class{constructor(){this.children=[],this.isDirty=!1}add(e){N2(this.children,e),this.isDirty=!0}remove(e){P2(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Cye),this.isDirty=!1,this.children.forEach(e)}};function Tye(e,t){let n=f4.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(n3(r),e(a-t))};return t3.setup(r,!0),()=>n3(r)}function j5(e){return L6(e)?e.get():e}var Eye=class{constructor(){this.members=[]}add(e){N2(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(P2(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(P2(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Dye={borderRadius:{...E5,applyTo:[...G6]},borderTopLeftRadius:E5,borderTopRightRadius:E5,borderBottomLeftRadius:E5,borderBottomRightRadius:E5,boxShadow:gye},M5={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Z8,{...Dye,...Z8});var N5={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},P5=[``,`X`,`Y`,`Z`],Oye=1e3,kye=0;function F5(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var I5=({instance:e})=>e&&v6.get(e)?.demote();function L5(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=V6(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,t3,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&L5(r)}function R5({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=kye++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,j8.value&&(N5.nodes=N5.calculatedTargetDeltas=N5.calculatedProjections=0),this.nodes.forEach(Mye),this.nodes.forEach(Bye),this.nodes.forEach(Vye),this.nodes.forEach(Nye),j8.addProjectionMetrics&&j8.addProjectionMetrics(N5)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new wye)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new G2),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=K6(t)&&!Gve(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;t3.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Tye(i,250),M5.hasAnimatedSinceResize&&(M5.hasAnimatedSinceResize=!1,this.nodes.forEach(V5)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Kye,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!x5(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...A6(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||V5(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),n3(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Hye),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&L5(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;I5(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,I5(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Fye),this.nodes.forEach(z5);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(B5);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Lye),this.nodes.forEach(Rye),this.nodes.forEach(zye),this.nodes.forEach(Aye),this.nodes.forEach(jye)):this.nodes.forEach(B5),this.clearAllSnapshots();let e=f4.now();u4.delta=I2(0,1e3/60,e-u4.timestamp),u4.timestamp=e,u4.isProcessing=!0,r3.update.process(u4),r3.preRender.process(u4),r3.render.process(u4),u4.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,m8.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Pye),this.sharedNodes.forEach(Uye)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,t3.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){t3.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!c5(this.snapshot.measuredBox.x)&&!c5(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=I8(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&I5(this);let t=this.projectionDelta&&!v5(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||e8(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),qye(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return I8();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Jye))){let{scroll:e}=this.root;e&&(l8(t.x,e.offset.x),l8(t.y,e.offset.y))}return t}removeElementScroll(e){let t=I8();if(o5(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&o5(t,e),l8(t.x,i.offset.x),l8(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||I8();o5(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(l8(r.x,-n.scroll.offset.x),l8(r.y,-n.scroll.offset.y)),e8(n.latestValues)&&f8(r,n.latestValues,n.layout?.layoutBox)}return e8(this.latestValues)&&f8(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=I8();o5(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!e8(n.latestValues))continue;let r;n.instance&&($6(n.latestValues)&&n.updateSnapshot(),r=I8(),o5(r,n.measurePageBox())),g5(t,n.latestValues,n.snapshot?.layoutBox,r)}return e8(this.latestValues)&&g5(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==u4.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=u4.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=I8(),this.targetWithTransforms=I8()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),dye(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):o5(this.target,this.layout.layoutBox),o8(this.target,this.targetDelta)):o5(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),j8.value&&N5.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||$6(this.parent.latestValues)||t8(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=I8(),this.relativeTargetOrigin=I8(),p5(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),o5(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===u4.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;o5(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Tve(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=I8());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(s5(this.prevProjectionDelta.x,this.projectionDelta.x),s5(this.prevProjectionDelta.y,this.projectionDelta.y)),u5(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!C5(this.projectionDelta.x,this.prevProjectionDelta.x)||!C5(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),j8.value&&N5.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=P8(),this.projectionDelta=P8(),this.projectionDeltaWithTransform=P8()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=P8();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=I8(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Gye));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=W4(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=W4(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(H5(o.x,e.x,n),H5(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(p5(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Wye(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&hye(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=I8(),o5(f,this.relativeTarget)),c&&(this.animationValues=a,yye(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(n3(this.pendingAnimation),void 0),this.pendingAnimation=t3.update(()=>{M5.hasAnimatedSinceResize=!0,this.motionValue||=O6(0),this.motionValue.jump(0,!1),this.currentAnimation=Sye(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),i_e(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Oye),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&q5(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||I8();let t=c5(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=c5(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}o5(t,i),f8(t,r),u5(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Eye),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&F5(`z`,e,r,this.animationValues);for(let t=0;t<P5.length;t++)F5(`rotate${P5[t]}`,e,r,this.animationValues),F5(`skew${P5[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=j5(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=j5(t?.pointerEvents)||``),this.hasProjected&&!e8(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=_ye(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Z8){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Z8[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?j5(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(z5),this.root.sharedNodes.clear()}}}function Aye(e){e.updateLayout(),Iye(e)}function jye(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)w5(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=c5(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;a5(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else q5(i,t.layoutBox,n)&&w5(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=c5(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=P8();u5(o,n,t.layoutBox);let s=P8();a?u5(s,e.applyTransform(r,!0),t.measuredBox):u5(s,n,t.layoutBox);let c=!v5(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=I8();p5(s,t.layoutBox,i.layoutBox,o);let c=I8();p5(c,n,a.layoutBox,o),x5(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Mye(e){j8.value&&N5.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Nye(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Pye(e){e.clearSnapshot()}function z5(e){e.clearMeasurements()}function Fye(e){e.isLayoutDirty=!0,e.updateLayout()}function B5(e){e.isLayoutDirty=!1}function Iye(e){let{snapshot:t,dragAncestor:n}=e,r=n?.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;w5(e=>l8(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function Lye(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Rye(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function zye(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function V5(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Bye(e){e.resolveTargetDelta()}function Vye(e){e.calcProjection()}function Hye(e){e.resetSkewAndRotation()}function Uye(e){e.removeLeadSnapshot()}function H5(e,t,n){e.translate=W4(t.translate,0,n),e.scale=W4(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function U5(e,t,n,r){e.min=W4(t.min,n.min,r),e.max=W4(t.max,n.max,r)}function Wye(e,t,n,r){U5(e.x,t.x,n.x,r),U5(e.y,t.y,n.y,r)}function Gye(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Kye={duration:.45,ease:[.4,0,.1,1]},W5=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),G5=W5(`applewebkit/`)&&!W5(`chrome/`)?Math.round:H2;function K5(e){e.min=G5(e.min),e.max=G5(e.max)}function qye(e){K5(e.x),K5(e.y)}function q5(e,t,n){return e===`position`||e===`preserve-aspect`&&!uye(S5(t),S5(n),.2)}function Jye(e){return e!==e.root&&e.scroll?.wasRoot}var Yye=R5({attachResizeListener:(e,t)=>A5(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),J5={current:void 0},Y5=R5({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!J5.current){let e=new Yye({});e.mount(window),e.setOptions({layoutScroll:!0}),J5.current=e}return J5.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),X5=(0,v.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Xye(e=!0){let t=(0,v.useContext)(M2);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,v.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Z5=(0,v.createContext)({strict:!1}),Q5={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},$5=!1;function Zye(){if($5)return;let e={};for(let t in Q5)e[t]={isEnabled:e=>Q5[t].some(t=>!!e[t])};q8(e),$5=!0}function e7(){return Zye(),Zve()}function Qye(e){let t=e7();for(let n in e)t[n]={...t[n],...e[n]};q8(t)}var t7=(0,v.createContext)({});function $ye(e,t){if(V8(e)){let{initial:t,animate:n}=e;return{initial:t===!1||R8(t)?t:void 0,animate:R8(n)?n:void 0}}return e.inherit===!1?{}:t}function ebe(e){let{initial:t,animate:n}=$ye(e,(0,v.useContext)(t7));return(0,v.useMemo)(()=>({initial:t,animate:n}),[n7(t),n7(n)])}function n7(e){return Array.isArray(e)?e.join(` `):e}var r7=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function i7(e,t,n){for(let r in t)!L6(t[r])&&!Q8(r,n)&&(e[r]=t[r])}function tbe({transformTemplate:e},t){return(0,v.useMemo)(()=>{let n=r7();return J6(n,t,e),Object.assign({},n.vars,n.style)},[t])}function nbe(e,t){let n=e.style||{},r={};return i7(r,n,e),Object.assign(r,tbe(e,t)),r}function rbe(e,t){let n={},r=nbe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var a7=()=>({...r7(),attrs:{}});function ibe(e,t,n,r){let i=(0,v.useMemo)(()=>{let n=a7();return X6(n,t,t5(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};i7(t,e.style,e),i.style={...t,...i.style}}return i}var o7=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function s7(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||o7.has(e)}function abe(e,t){return e.startsWith(`on`)?!s7(e):t?.(e)??!s7(e)}function obe(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(L6(e[a])||(abe(a,r)||n===!0&&s7(a)||!t&&!s7(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var sbe=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function c7(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(sbe.indexOf(e)>-1||/[A-Z]/u.test(e))}function cbe(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??c7(e)?ibe:rbe)(t,r,i,e),l=obe(t,typeof e==`string`,a,s),u=e===v.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,v.useMemo)(()=>L6(d)?d.get():d,[d]);return(0,v.createElement)(e,{...u,children:f})}function lbe({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:ube(n,r,i,e),renderState:t()}}function ube(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=j5(a[e]);let{initial:o,animate:s}=e,c=V8(e),l=H8(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!L8(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=N6(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var l7=e=>(t,n)=>{let r=(0,v.useContext)(t7),i=(0,v.useContext)(M2),a=()=>lbe(e,t,r,i);return n?a():A2(a)},dbe=l7({scrapeMotionValuesFromProps:$8,createRenderState:r7}),fbe=l7({scrapeMotionValuesFromProps:n5,createRenderState:a7}),pbe=Symbol.for(`motionComponentSymbol`);function mbe(e,t,n){let r=(0,v.useRef)(n);(0,v.useInsertionEffect)(()=>{r.current=n});let i=(0,v.useRef)(null);return(0,v.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var u7=(0,v.createContext)({});function d7(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function hbe(e,t,n,r,i,a){let{visualElement:o}=(0,v.useContext)(t7),s=(0,v.useContext)(Z5),c=(0,v.useContext)(M2),l=(0,v.useContext)(X5),u=l.reducedMotion,d=l.skipAnimations,f=(0,v.useRef)(null),p=(0,v.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,v.useContext)(u7);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&gbe(f.current,n,i,h);let g=(0,v.useRef)(!1);(0,v.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[B6],y=(0,v.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return j2(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),j2(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),(0,v.useEffect)(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function gbe(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:f7(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&d7(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function f7(e){if(e)return e.options.allowProjection===!1?f7(e.parent):e.projection}function p7(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Qye(r);let a=n?n===`svg`:c7(e),o=a?fbe:dbe;function s(n,s){let c,l={...(0,v.useContext)(X5),...n,layoutId:_be(n)},{isStatic:u,isValidProp:d}=l,f=ebe(n),p=o(n,u);if(!u&&typeof window<`u`){vbe(l,r);let t=ybe(l);c=t.MeasureLayout,f.visualElement=hbe(e,p,l,i,t.ProjectionNode,a)}return(0,B.jsxs)(t7.Provider,{value:f,children:[c&&f.visualElement?(0,B.jsx)(c,{visualElement:f.visualElement,...l}):null,cbe(e,n,mbe(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,v.forwardRef)(s);return c[pbe]=e,c}function _be({layoutId:e}){let t=(0,v.useContext)(k2).id;return t&&e!==void 0?t+`-`+e:e}function vbe(e,t){(0,v.useContext)(Z5).strict}function ybe(e){let{drag:t,layout:n}=e7();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function bbe(e,t){if(typeof Proxy>`u`)return p7;let n=new Map,r=(n,r)=>p7(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,p7(a,void 0,e,t)),n.get(a))})}var xbe=(e,t)=>t.isSVG??c7(e)?new nye(t):new eye(t,{allowProjection:e!==v.Fragment}),Sbe=class extends Y8{constructor(e){super(e),e.animationState||=iye(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();L8(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Cbe=0,wbe={animation:{Feature:Sbe},exit:{Feature:class extends Y8{constructor(){super(...arguments),this.id=Cbe++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=P6(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function m7(e){return{point:{x:e.pageX,y:e.pageY}}}var Tbe=e=>t=>y8(t)&&e(t,m7(t));function h7(e,t,n,r){return A5(e,t,Tbe(n),r)}var g7=({current:e})=>e?e.ownerDocument.defaultView:null,_7=(e,t)=>Math.abs(e-t);function Ebe(e,t){let n=_7(e.x,t.x),r=_7(e.y,t.y);return Math.sqrt(n**2+r**2)}var v7=new Set([`auto`,`scroll`]),y7=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=b7(this.lastRawMoveEventInfo,this.transformPagePoint));let e=S7(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Ebe(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:f4.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=b7(t,this.transformPagePoint),this.hasPendingMove=!0,t3.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=S7(e.type===`pointercancel`?this.lastMoveEventInfo:b7(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!y8(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=b7(m7(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=u4;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,S7(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=U2(h7(this.contextWindow,`pointermove`,this.handlePointerMove,d),h7(this.contextWindow,`pointerup`,this.handlePointerUp,d),h7(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(v7.has(e.overflowX)||v7.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),t3.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),n3(this.updatePoint)}};function b7(e,t){return t?{point:t(e.point)}:e}function x7(e,t){return{x:e.x-t.x,y:e.y-t.y}}function S7({point:e},t){return{point:e,delta:x7(e,C7(t)),offset:x7(e,Dbe(t)),velocity:Obe(t,.1)}}function Dbe(e){return e[0]}function C7(e){return e[e.length-1]}function Obe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=C7(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>K2(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>K2(t)*2&&(r=e[1]);let a=q2(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function kbe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?W4(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?W4(n,e,r.max):Math.min(e,n)),e}function w7(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Abe(e,{top:t,left:n,bottom:r,right:i}){return{x:w7(e.x,n,i),y:w7(e.y,t,r)}}function T7(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function jbe(e,t){return{x:T7(e.x,t.x),y:T7(e.y,t.y)}}function Mbe(e,t){let n=.5,r=c5(e),i=c5(t);return i>r?n=W2(t.min,t.max-r,e.min):r>i&&(n=W2(e.min,e.max-i,t.min)),I2(0,1,n)}function Nbe(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var E7=.35;function Pbe(e=E7){return e===!1?e=0:e===!0&&(e=E7),{x:D7(e,`left`,`right`),y:D7(e,`top`,`bottom`)}}function D7(e,t,n){return{min:O7(e,t),max:O7(e,n)}}function O7(e,t){return typeof e==`number`?e:e[t]||0}var Fbe=new WeakMap,Ibe=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=I8(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ove(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),w5(e=>{let t=this.getAxisMotionValue(e).get()||0;if(k4.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=c5(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&t3.update(()=>i(e,t),!1,!0),R6(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;r&&this.currentDirection===null?(this.currentDirection=Rbe(o),this.currentDirection!==null&&i&&i(this.currentDirection)):(this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&t3.update(()=>a(e,t),!1,!0))},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new y7(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:g7(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&t3.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!A7(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=kbe(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&d7(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?Abe(n.layoutBox,e):!1,this.elastic=Pbe(t),r!==this.constraints&&!d7(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&w5(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Nbe(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!d7(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Eve(n,r.root,this.visualElement.getTransformPagePoint()),a=jbe(r.layout.layoutBox,i);if(t){let e=t(Cve(a));this.hasMutatedConstraints=!!e,e&&(a=Z6(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=w5(o=>{if(!A7(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return R6(this.visualElement,e),n.start(j6(e,n,0,t,this.visualElement,!1))}stopAnimation(){w5(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();w5(e=>{if(!A7(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-W4(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!d7(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};w5(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Mbe({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),w5(t=>{let n=this.getAxisMotionValue(t);if(!A7(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(W4(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Fbe.set(this.visualElement,this);let e=this.visualElement.current,t=h7(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Pve(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();d7(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Lbe(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),t3.read(r);let o=A5(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(w5(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=E7,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function k7(e){let t=!0;return()=>{t?t=!1:e()}}function Lbe(e,t,n){let r=A8(e,k7(n)),i=A8(t,k7(n));return()=>{r(),i()}}function A7(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Rbe(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var zbe=class extends Y8{constructor(e){super(e),this.removeGroupControls=H2,this.removeListeners=H2,this.controls=new Ibe(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||H2}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},j7=e=>(t,n)=>{e&&t3.update(()=>e(t,n),!1,!0)},Bbe=class extends Y8{constructor(){super(...arguments),this.removePointerDownListener=H2}onPointerDown(e){this.session=new y7(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:g7(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:j7(e),onStart:j7(t),onMove:j7(n),onEnd:(e,t)=>{delete this.session,r&&t3.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=h7(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},M7=!1,Vbe=class extends v.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),M7&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),M5.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a&&(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),M7=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||t3.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),m8.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;M7=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function N7(e){let[t,n]=Xye(),r=(0,v.useContext)(k2);return(0,B.jsx)(Vbe,{...e,layoutGroup:r,switchLayoutGroup:(0,v.useContext)(u7),isPresent:t,safeToRemove:n})}var Hbe={pan:{Feature:Bbe},drag:{Feature:zbe,ProjectionNode:Y5,MeasureLayout:N7}};function P7(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&t3.postRender(()=>i(t,m7(t)))}var Ube=class extends Y8{mount(){let{current:e}=this.node;e&&(this.unmount=Ave(e,(e,t)=>(P7(this.node,t,`Start`),e=>P7(this.node,e,`End`))))}unmount(){}},Wbe=class extends Y8{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=U2(A5(this.node.current,`focus`,()=>this.onFocus()),A5(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function F7(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&t3.postRender(()=>i(t,m7(t)))}var Gbe=class extends Y8{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Ive(e,(e,t)=>(F7(this.node,t,`Start`),(e,{success:t})=>F7(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},I7=new WeakMap,L7=new WeakMap,Kbe=e=>{let t=I7.get(e.target);t&&t(e)},qbe=e=>{e.forEach(Kbe)};function Jbe({root:e,...t}){let n=e||document;L7.has(n)||L7.set(n,{});let r=L7.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(qbe,{root:e,...t})),r[i]}function Ybe(e,t,n){let r=Jbe(t);return I7.set(e,n),r.observe(e),()=>{I7.delete(e),r.unobserve(e)}}var Xbe={some:0,all:1},Zbe=class extends Y8{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Xbe[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Ybe(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Qbe(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Qbe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var $be={inView:{Feature:Zbe},tap:{Feature:Gbe},focus:{Feature:Wbe},hover:{Feature:Ube}},exe={layout:{ProjectionNode:Y5,MeasureLayout:N7}},R7=bbe({...wbe,...$be,...Hbe,...exe},xbe);function z7(e){let t=A2(()=>O6(e)),{isStatic:n}=(0,v.useContext)(X5);if(n){let[,n]=(0,v.useState)(e);(0,v.useEffect)(()=>t.on(`change`,n),[])}return t}function B7(e,t){let n=z7(t()),r=()=>n.set(t());return r(),j2(()=>{let t=()=>t3.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return r(),()=>{n.forEach(e=>e()),n3(r)}}),n}function txe(e){D6.current=[],e();let t=B7(D6.current,e);return D6.current=void 0,t}function V7(e,t,n,r){if(typeof e==`function`)return txe(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return nxe(e,t,n,r);let i=typeof t==`function`?t:Kve(t,n,r),a=Array.isArray(e)?H7(e,i):H7([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function H7(e,t){let n=A2(()=>[]);return B7(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function nxe(e,t,n,r){let i=A2(()=>Object.keys(n)),a=A2(()=>({}));for(let o of i)a[o]=V7(e,t,n[o],r);return a}var rxe=class{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,t){this.componentControls.forEach(n=>{n.start(e.nativeEvent||e,t)})}cancel(){this.componentControls.forEach(e=>{e.cancel()})}stop(){this.componentControls.forEach(e=>{e.stop()})}},ixe=()=>new rxe;function axe(){return A2(ixe)}var U7=(0,v.createContext)(null);function oxe(e,t,n,r,i,a=`ltr`){let o=e.findIndex(e=>e.value===t);if(o===-1)return e;if(i===`xy`){let{layout:t}=e[o],r={x:W4(t.x.min,t.x.max,.5)+n.x,y:W4(t.y.min,t.y.max,.5)+n.y},i=sxe(e),s=i.find(t=>t.items.includes(e[o])),c=i.reduce((e,t)=>W7(r.y,t)<W7(r.y,e)?t:e);if(c!==s)return cxe(e,o,r.x,c,a);let l=G7(r,t),u=-1,d=l;return e.forEach((e,t)=>{if(t===o)return;let n=G7(r,e.layout);n<d&&(u=t,d=n)}),u===-1?e:F2(e,o,o+Math.sign(u-o))}if(!r[i])return e;let s=r[i]>0?1:-1,c=e[o+s];if(!c)return e;let l=e[o].layout[i],u=c.layout[i],d=W4(u.min,u.max,.5);return s===1&&l.max+n[i]>d||s===-1&&l.min+n[i]<d?F2(e,o,o+s):e}function sxe(e){let t=[];return e.forEach(e=>{let{min:n,max:r}=e.layout.y,i=t[t.length-1];!i||n>=i.max||r<=i.min?t.push({items:[e],min:n,max:r}):(i.items.push(e),i.min=Math.min(i.min,n),i.max=Math.max(i.max,r))}),t}function W7(e,t){return e<t.min?t.min-e:e>t.max?e-t.max:0}function cxe(e,t,n,r,i){let a=e.filter((e,n)=>n!==t),o=r.items.find(e=>{let t=W4(e.layout.x.min,e.layout.x.max,.5);return i===`ltr`?n<t:n>t}),s=o?a.indexOf(o):a.indexOf(r.items[r.items.length-1])+1,c=[...a];return c.splice(s,0,e[t]),c.every((t,n)=>t===e[n])?e:c}function G7(e,t){let n=Math.max(t.x.min-e.x,0,e.x-t.x.max),r=Math.max(t.y.min-e.y,0,e.y-t.y.max);return n*n+r*r}var K7=(e,t)=>e.max<=t.min||t.max<=e.min;function lxe(e){let t=!1,n=!1;for(let r=0;r<e.length;r++)for(let i=r+1;i<e.length;i++)if(t||=K7(e[r].x,e[i].x),n||=K7(e[r].y,e[i].y),t&&n)return`xy`;return t?`x`:`y`}function uxe({children:e,as:t=`ul`,axis:n,onReorder:r,values:i,onPointerDownCapture:a,onClickCapture:o,...s},c){let l=A2(()=>R7[t]),u=(0,v.useRef)(new Map),[d,f]=(0,v.useState)(`y`),p=(0,v.useRef)(!1),m=(0,v.useRef)(!1),h=(0,v.useRef)(null),g=n||d,_=new Set(i);u.current.forEach((e,t)=>{_.has(t)||u.current.delete(t)});let y={axis:g,groupRef:h,hasReordered:m,registerItem:(e,t)=>{if(u.current.set(e,t),!n){let e=lxe(i.flatMap(e=>{let t=u.current.get(e);return t?[t]:[]}));e!==d&&f(e)}},updateOrder:(e,t,n)=>{if(p.current)return;let a=i.flatMap(e=>{let t=u.current.get(e);return t?[{value:e,layout:t}]:[]}),o=h.current?.ownerDocument.defaultView?.getComputedStyle(h.current).direction===`rtl`?`rtl`:`ltr`,s=oxe(a,e,t,n,g,o);if(a!==s){p.current=!0,m.current=!0;let e=[...i],t=a.map(({value:e})=>i.indexOf(e));s.forEach(({value:n},r)=>{e[t[r]]=n}),r(e)}}};(0,v.useEffect)(()=>{p.current=!1},[i]);let b=e=>{h.current=e,typeof c==`function`?c(e):c&&(c.current=e)},x={overflowAnchor:`none`,...s.style};return(0,B.jsx)(l,{...s,style:x,ref:b,onPointerDownCapture:e=>{m.current=!1,a?.(e)},onClickCapture:e=>{m.current&&e.detail&&(m.current=!1,e.stopPropagation(),e.preventDefault()),o?.(e)},ignoreStrict:!0,children:(0,B.jsx)(U7.Provider,{value:y,children:e})})}var dxe=(0,v.forwardRef)(uxe),q7=50,fxe=25,pxe=new Set([`auto`,`scroll`]),J7=new WeakMap,Y7=new WeakMap,X7=null;function mxe(){if(X7){let e=Z7(X7,`y`);e&&(Y7.delete(e),J7.delete(e));let t=Z7(X7,`x`);t&&t!==e&&(Y7.delete(t),J7.delete(t)),X7=null}}function hxe(e,t){let n=getComputedStyle(e),r=t===`x`?n.overflowX:n.overflowY,i=e===document.body||e===document.documentElement;return pxe.has(r)||i}function Z7(e,t){let n=e?.parentElement;for(;n;){if(hxe(n,t))return n;n=n.parentElement}return null}function gxe(e,t,n){let r=t.getBoundingClientRect(),i=n===`x`?Math.max(0,r.left):Math.max(0,r.top),a=n===`x`?Math.min(window.innerWidth,r.right):Math.min(window.innerHeight,r.bottom),o=e-i,s=a-e;if(o<q7){let e=1-o/q7;return{amount:-25*e*e,edge:`start`}}if(s<q7){let e=1-s/q7;return{amount:fxe*e*e,edge:`end`}}return{amount:0,edge:null}}function _xe(e,t,n,r){if(!e)return;X7=e;let i=Z7(e,n);if(!i)return;let{amount:a,edge:o}=gxe(t-(n===`x`?window.scrollX:window.scrollY),i,n);if(o===null){Y7.delete(i),J7.delete(i);return}let s=Y7.get(i),c=i===document.body||i===document.documentElement;if(s!==o){if(!(o===`start`&&r<0||o===`end`&&r>0))return;Y7.set(i,o);let e=n===`x`?i.scrollWidth-(c?window.innerWidth:i.clientWidth):i.scrollHeight-(c?window.innerHeight:i.clientHeight);J7.set(i,e)}if(a>0){let e=J7.get(i);if((n===`x`?c?window.scrollX:i.scrollLeft:c?window.scrollY:i.scrollTop)>=e)return}n===`x`?c?window.scrollBy({left:a}):i.scrollLeft+=a:c?window.scrollBy({top:a}):i.scrollTop+=a}function Q7(e,t=0){return L6(e)?e:z7(t)}function vxe({children:e,style:t={},value:n,as:r=`li`,onDrag:i,onDragEnd:a,layout:o=!0,...s},c){let l=A2(()=>R7[r]),u=(0,v.useContext)(U7),d={x:Q7(t.x),y:Q7(t.y)},f=V7([d.x,d.y],([e,t])=>e||t?1:`unset`),{axis:p,registerItem:m,updateOrder:h,groupRef:g,hasReordered:_}=u;return(0,B.jsx)(l,{drag:p===`xy`||p,...s,dragSnapToOrigin:!0,style:{...t,x:d.x,y:d.y,zIndex:f},layout:o,onDrag:(e,t)=>{let{velocity:r,point:a}=t,o={x:d.x.get(),y:d.y.get()};h(n,o,r);let s=p===`xy`?Math.abs(r.x)>Math.abs(r.y)?`x`:`y`:p;_xe(g.current,a[s],s,r[s]),i&&i(e,t)},onDragEnd:(e,t)=>{_.current=!1,mxe(),a&&a(e,t)},onLayoutMeasure:e=>{m(n,e)},ref:c,ignoreStrict:!0,children:e})}var yxe=(0,v.forwardRef)(vxe);function $7(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(null);return(0,B.jsxs)(`form`,{className:`grid`,onSubmit:async n=>{n.preventDefault(),u(null);try{if(t)await tt(Xe(a).address,s.trim()===``?null:s.trim());else{let e=Xe(r);await tt(e.address,e.code)}e.onAdded?.()}catch(e){u(Vn(e))}},children:[(0,B.jsxs)(`div`,{className:F(`grid gap-2`,e.fieldsClassName),children:[t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(xV,{"aria-label":`Server URL`,placeholder:`Server URL, e.g. http://127.0.0.1:47841`,spellCheck:!1,autoComplete:`off`,value:a,onChange:e=>o(e.target.value)}),(0,B.jsx)(xV,{"aria-label":`Pairing code`,placeholder:`Pairing code, empty if auth is off`,spellCheck:!1,autoComplete:`off`,value:s,onChange:e=>c(e.target.value)})]}):(0,B.jsx)(xV,{"aria-label":`Pairing link`,placeholder:`Pairing link`,spellCheck:!1,autoComplete:`off`,value:r,onChange:e=>i(e.target.value)}),l!==null&&(0,B.jsx)(`p`,{className:`text-destructive text-sm break-all`,children:l}),(0,B.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground w-fit cursor-pointer text-xs`,onClick:()=>{n(!t),u(null)},children:t?`Paste a pairing link instead`:`Enter the server URL and code separately`})]}),e.actions(t?a.trim()!==``:r.trim()!==``)]})}function e9(e){return(0,B.jsx)(Y0,{open:!0,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`gap-0 overflow-hidden p-0 sm:max-w-md`,children:[(0,B.jsxs)(Q0,{className:`gap-1 px-6 pt-4 pr-12`,children:[(0,B.jsx)(e2,{className:`text-base`,children:`Add machine`}),(0,B.jsx)(t2,{children:`Paste the pairing link that OffSite printed when it started.`})]}),(0,B.jsx)($7,{fieldsClassName:`p-6`,onAdded:e.onClose,actions:t=>(0,B.jsxs)($0,{className:`bg-muted/40 border-t px-6 py-4`,children:[(0,B.jsx)(H,{type:`button`,variant:`outline`,onClick:e.onClose,children:`Cancel`}),(0,B.jsx)(H,{type:`submit`,disabled:!t,children:`Add machine`})]})})]})})}var bxe={connecting:`Connecting…`,online:`Online`,offline:`Offline`,unpaired:`Needs pairing`};function xxe(){let e=R(e=>e.machines),t=R(e=>e.machines.find(t=>t.id===e.settingsEditedMachine)),[n,r]=(0,v.useState)(!1);return t===void 0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(b2,{title:`Machines`,note:`This browser connects to each one directly. The list stays in this browser`,children:e.map(e=>(0,B.jsxs)(`div`,{className:`flex min-h-13 items-center gap-4 px-4 py-2.5`,children:[(0,B.jsx)(U,{icon:rA[e.icon],className:`text-muted-foreground size-5 shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.name}),e.addresses.map(e=>(0,B.jsx)(`p`,{className:`text-muted-foreground truncate font-mono text-xs`,children:e},e)),e.providers.filter(e=>e.state===`error`).map(e=>(0,B.jsxs)(`p`,{className:`text-destructive truncate text-xs`,title:e.error??void 0,children:[sf[e.provider],` threads: `,e.error]},e.provider))]}),(0,B.jsxs)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:[bxe[e.status],e.status===`online`&&e.via!==null&&e.via!==e.addresses[0]&&` · via ${new URL(e.via).host}`]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,B.jsx)(H,{size:`icon-sm`,variant:`ghost`,title:`Reconnect, trying the first address first`,onClick:()=>ot(e.id),children:(0,B.jsx)(U,{icon:ek})}),(0,B.jsx)(H,{size:`icon-sm`,variant:`ghost-muted`,title:`Open machine`,onClick:()=>z({settingsEditedMachine:e.id}),children:(0,B.jsx)(U,{icon:LD})})]})]},e.id))}),(0,B.jsx)(`div`,{className:`flex gap-2`,children:(0,B.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>r(!0),children:`Add machine…`})}),n&&(0,B.jsx)(e9,{onClose:()=>r(!1)})]}):(0,B.jsx)(Sxe,{machine:t})}function Sxe(e){let t=e.machine,[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),u=c??t.addresses,d=(0,v.useRef)(null);(0,v.useEffect)(()=>{n&&d.current?.focus()},[n]);function f(e){s(null);try{return it(t.id,{addresses:[...new Set(e.map(e=>Xe(e).address))]}),!0}catch(e){return s(Vn(e)),!1}}async function p(e){s(null);let n=e.trim();if(n===``)return!0;try{let e=n.includes(`#`)?Xe(n).code:n;if(e===null)throw Error(`That link has no pairing code`);return await nt(t.id,e),!0}catch(e){return s(Vn(e)),!1}}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(b2,{title:`Machine`,children:[(0,B.jsx)(x2,{label:`Name`,children:(0,B.jsx)(S2,{value:t.label??``,placeholder:t.hostname,onCommit:e=>it(t.id,{label:e.trim()===``?null:e.trim()})},t.label)}),(0,B.jsxs)(`div`,{className:`flex min-h-13 items-center justify-between gap-4 px-4 py-2.5`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium`,children:`Icon`}),(0,B.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1`,children:Object.entries(rA).map(e=>(0,B.jsx)(H,{size:`icon-sm`,variant:e[0]===t.icon?`default`:`ghost`,title:e[0],"aria-pressed":e[0]===t.icon,onClick:()=>it(t.id,{icon:e[0]}),children:(0,B.jsx)(U,{icon:e[1]})},e[0]))})]})]}),(0,B.jsx)(b2,{title:`Pairing`,children:(0,B.jsxs)(`div`,{className:`flex min-h-13 items-center justify-between gap-4 px-4 py-2.5`,children:[t.pairedAt!==null&&t.status!==`unpaired`&&(0,B.jsx)(`span`,{className:`text-sm`,children:t.pairedAt===null?`Paired`:`Paired ${df(t.pairedAt)}`}),(t.pairedAt===null||t.status===`unpaired`)&&(0,B.jsxs)(`form`,{className:`flex flex-1 items-center gap-3`,onSubmit:async e=>{e.preventDefault(),await p(i)&&a(``)},children:[(0,B.jsx)(xV,{className:`flex-1 font-mono`,placeholder:`Pairing link or code`,spellCheck:!1,autoComplete:`off`,value:i,onChange:e=>a(e.target.value)}),(0,B.jsxs)(H,{type:`submit`,variant:`outline`,className:`px-4`,disabled:i.trim()===``,children:[(0,B.jsx)(U,{icon:NO}),`Pair`]})]})]})}),(0,B.jsxs)(b2,{title:`Addresses`,note:`OffSite tries them in order whenever it reconnects`,children:[(0,B.jsx)(dxe,{as:`div`,axis:`y`,className:`divide-y`,values:u,onReorder:l,children:u.map((e,t)=>(0,B.jsxs)(Cxe,{address:e,onDragEnd:()=>{c!==null&&f(c),l(null)},children:[(0,B.jsx)(S2,{className:`flex-1 font-mono`,value:e,onCommit:e=>f(u.map((n,r)=>r===t?e:n))}),(0,B.jsx)(H,{size:`icon-sm`,variant:`ghost`,title:`Remove address`,disabled:u.length===1,onClick:()=>f(u.filter((e,n)=>n!==t)),children:(0,B.jsx)(U,{icon:cO})})]},e))}),n&&(0,B.jsx)(`div`,{className:`px-4 py-2.5`,children:(0,B.jsx)(xV,{ref:d,className:`font-mono`,placeholder:`http://192.168.1.10:47841`,spellCheck:!1,autoComplete:`off`,onBlur:e=>{let n=e.target.value.trim();(n===``||f([...t.addresses,n]))&&r(!1)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}})}),!n&&(0,B.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:bg-muted/50 hover:text-foreground flex w-full items-center gap-2 px-4 py-3 text-sm transition-colors`,onClick:()=>r(!0),children:[(0,B.jsx)(U,{icon:MD,className:`size-4`}),`Add address`]})]}),o!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-1 text-xs break-all`,children:o}),(0,B.jsxs)(a2,{children:[(0,B.jsx)(o2,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`text-destructive`,children:`Remove machine`})}),(0,B.jsxs)(s2,{children:[(0,B.jsxs)(c2,{children:[(0,B.jsxs)(u2,{children:[`Remove `,t.name,`?`]}),(0,B.jsx)(d2,{children:`This browser forgets the machine. The machine and its threads stay untouched.`})]}),(0,B.jsxs)(l2,{children:[(0,B.jsx)(p2,{children:`Cancel`}),(0,B.jsx)(f2,{variant:`destructive`,onClick:()=>{z({settingsEditedMachine:null}),st(t.id)},children:`Remove machine`})]})]})]})]})}function Cxe(e){let t=axe();return(0,B.jsxs)(yxe,{as:`div`,value:e.address,dragListener:!1,dragControls:t,onDragEnd:e.onDragEnd,className:`bg-background relative flex items-center gap-3 px-4 py-2.5`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground hover:text-foreground cursor-grab touch-none active:cursor-grabbing`,title:`Drag to reorder`,onPointerDown:e=>t.start(e),children:(0,B.jsx)(U,{icon:lO,className:`size-4`})}),e.children]})}var t9=new Map([[`denied`,`Blocked in the browser's site settings`],[`insecure`,`Needs https or localhost`],[`install`,`Add OffSite to the Home Screen first`],[`unsupported`,`Not supported in this browser`]]);function wxe(e){let t=e.prefs.terminal,n=t.behavior;function r(r){Ud({...e.prefs,terminal:{...t,behavior:{...n,...r}}})}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(b2,{title:`Notifications`,children:[(0,B.jsx)(x2,{label:`Desktop notifications on this device`,children:(0,B.jsx)(Txe,{})}),(0,B.jsx)(x2,{label:`Push terminal alerts when no OffSite page is open`,children:(0,B.jsx)(Exe,{})})]}),(0,B.jsxs)(b2,{title:`Terminal bell`,children:[(0,B.jsx)(x2,{label:`Flash the screen on bell`,children:(0,B.jsx)(y2,{checked:n.bellFlash,onCheckedChange:e=>r({bellFlash:e})})}),(0,B.jsx)(x2,{label:`Play a sound on bell`,children:(0,B.jsx)(y2,{checked:n.bellSound,onCheckedChange:e=>r({bellSound:e})})})]})]})}function Txe(){let[e,t]=(0,v.useState)(Of),[n,r]=(0,v.useState)(kf);(0,v.useEffect)(()=>{let e=Of();if(e===`insecure`||e===`unsupported`)return;let n=new AbortController;return jf(n.signal,()=>t(Of())).catch(e=>console.error(`could not watch the notification permission`,e)),()=>n.abort()},[]);async function i(e){await Af(e),r(e),t(Of())}return(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[t9.has(e)&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t9.get(e)}),(0,B.jsx)(y2,{checked:e===`granted`&&n,disabled:e!==`granted`&&e!=="default",onCheckedChange:e=>void i(e)})]})}function Exe(){let[e,t]=(0,v.useState)(zf),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(()=>zf()===`supported`),[o,s]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(zf()!==`supported`)return;let e=!0;async function t(){try{let t=await Vf();e&&r(t)}catch(e){console.error(`could not read the push subscription`,e)}e&&a(!1)}return t(),()=>{e=!1}},[]);async function c(e){a(!0),s(null);try{e?r(await Hf()):(await Uf(),r(!1))}catch(e){console.error(`could not change push notifications`,e),s(Vn(e))}t(zf()),a(!1)}return(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[o!==null&&(0,B.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Could not update: `,o]}),t9.has(e)&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t9.get(e)}),(0,B.jsx)(y2,{checked:e===`supported`&&n,disabled:e!==`supported`||i,onCheckedChange:e=>void c(e)})]})}var Dxe={five_hour:`5h`,seven_day:`Week`,seven_day_opus:`Week (Opus)`,seven_day_sonnet:`Week (Sonnet)`};function Oxe(e){return Dxe[e.window]??e.window}function kxe(e){let t=e.account,[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),c=n===null?null:n.models;(0,v.useEffect)(()=>{let n=!0;return r(null),a(null),M(e.machine,`capabilities`,{provider:t.provider,accountId:t.id,projectId:null}).then(e=>{n&&r(e)},e=>{n&&a(Vn(e))}),()=>{n=!1}},[e.machine,t.provider,t.id,t.configDir]);async function l(n){s(null);try{await M(e.machine,`accounts.update`,{id:t.id,name:t.name,configDir:t.configDir,enabled:t.enabled,hiddenModels:t.hiddenModels,...n})}catch(e){s(Vn(e))}}async function u(){s(null);try{await M(e.machine,`accounts.remove`,{id:t.id}),z({settingsAccount:null})}catch(e){s(Vn(e))}}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(b2,{title:`Account`,children:[(0,B.jsx)(x2,{label:`Name`,children:(0,B.jsx)(S2,{value:t.name,valid:e=>e.trim()!==``,onCommit:e=>void l({name:e})},t.name)}),(0,B.jsx)(x2,{label:`Config directory`,children:(0,B.jsx)(S2,{className:`w-72 font-mono`,value:t.configDir,valid:e=>e.trim()!==``,onCommit:e=>void l({configDir:e})},t.configDir)})]}),o!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-1 text-xs`,children:o}),(0,B.jsxs)(b2,{title:`Models`,note:`Overrides the provider settings`,children:[i!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-4 py-3 text-xs`,children:i}),i===null&&c===null&&(0,B.jsx)(`p`,{className:`text-muted-foreground px-4 py-3 text-xs`,children:`Loading…`}),(c??[]).map(n=>{let r=e.settings[n.value]?.hidden??n.deprecated,i=t.hiddenModels[n.value],a=i??r;return(0,B.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3 px-4 py-1.5`,children:[(0,B.jsx)(`span`,{className:F(`min-w-0 flex-1 truncate text-sm`,a&&`text-muted-foreground`),children:n.name}),i!==void 0&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Override`}),(0,B.jsx)(y2,{size:`sm`,checked:!a,onCheckedChange:e=>{let i={...t.hiddenModels};!e===r?delete i[n.value]:i[n.value]=!e,l({hiddenModels:i})},"aria-label":`Show ${n.name}`})]},n.value)})]}),(0,B.jsxs)(a2,{children:[(0,B.jsx)(o2,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`text-destructive`,children:`Remove account`})}),(0,B.jsxs)(s2,{children:[(0,B.jsxs)(c2,{children:[(0,B.jsxs)(u2,{children:[`Remove `,t.name,`?`]}),(0,B.jsx)(d2,{children:`OffSite stops using this account. Its config directory and sessions stay untouched.`})]}),(0,B.jsxs)(l2,{children:[(0,B.jsx)(p2,{children:`Cancel`}),(0,B.jsx)(f2,{variant:`destructive`,onClick:()=>void u(),children:`Remove account`})]})]})]})]})}function Axe(e){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null);async function l(){o(!0),c(null);try{await M(e.machine,`accounts.add`,{provider:e.provider,name:t,configDir:r}),z({settingsAccount:null})}catch(e){c(Vn(e)),o(!1)}}return(0,B.jsxs)(`form`,{className:`space-y-5`,onSubmit:e=>{e.preventDefault(),l()},children:[(0,B.jsxs)(b2,{title:`Account`,children:[(0,B.jsx)(x2,{label:`Name`,children:(0,B.jsx)(xV,{className:`w-56`,value:t,onChange:e=>n(e.target.value),placeholder:`Work`})}),(0,B.jsx)(x2,{label:`Config directory`,children:(0,B.jsx)(xV,{className:`w-72 font-mono`,value:r,onChange:e=>i(e.target.value),placeholder:e.provider===`claude`?`~/.claude-work`:`~/.codex-work`})})]}),s!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-1 text-xs`,children:s}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{type:`button`,variant:`ghost`,onClick:()=>z({settingsAccount:null}),children:`Cancel`}),(0,B.jsx)(H,{type:`submit`,disabled:a||t.trim()===``||r.trim()===``,children:`Add account`})]})]})}function jxe(e){let t=e.config,n=t.enabledProviders[e.provider],r=e.provider===`claude`?e.claudeAccounts:e.provider===`codex`?e.codexAccounts:[],i=r.find(e=>e.valid),a=t.claudeBaseDir[e.platform]??e.defaultClaudeBaseDir;if(e.selected===`new`){if(e.provider===`opencode`)throw Error(`OpenCode accounts cannot be added`);return(0,B.jsx)(Axe,{machine:e.machine,provider:e.provider})}if(e.selected!==null){let n=r.find(t=>t.id===e.selected);return n===void 0?(0,B.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`This account no longer exists.`}):(0,B.jsx)(kxe,{machine:e.machine,settings:t.models[e.provider],account:n})}return(0,B.jsxs)(B.Fragment,{children:[e.provider===`claude`&&(0,B.jsx)(`div`,{className:`divide-y overflow-hidden rounded-xl border`,children:(0,B.jsx)(x2,{label:`Base directory`,children:(0,B.jsx)(S2,{className:`w-72 font-mono`,value:a,valid:e=>e.trim()!==``,onCommit:n=>Yd(e.machine,{...t,claudeBaseDir:{...t.claudeBaseDir,[e.platform]:n}})},a)})}),(0,B.jsxs)(`div`,{className:F(`space-y-5 transition-opacity`,!n&&`opacity-50`),children:[e.provider!==`opencode`&&(0,B.jsx)(b2,{title:`Accounts`,children:(0,B.jsx)(Mxe,{machine:e.machine,accounts:r})}),n&&e.provider===`opencode`&&e.openCode.available&&(0,B.jsx)(n9,{machine:e.machine,config:t,composer:e.composer,provider:e.provider,accountId:null}),n&&e.provider!==`opencode`&&i!==void 0&&(0,B.jsx)(n9,{machine:e.machine,config:t,composer:e.composer,provider:e.provider,accountId:i.id})]})]})}function n9(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=e.config.models[e.provider],o=t===null?null:t.models,s=e.composer[e.provider],c=s.model??(t===null?null:t.defaultModel);(0,v.useEffect)(()=>{let t=!0;return n(null),i(null),M(e.machine,`capabilities`,{provider:e.provider,accountId:e.accountId,projectId:null}).then(e=>{t&&n(e)},e=>{t&&i(Vn(e))}),()=>{t=!1}},[e.machine,e.provider,e.accountId]);function l(t,n){Yd(e.machine,{...e.config,models:{...e.config.models,[e.provider]:{...a,[t]:n}}})}return(0,B.jsxs)(b2,{title:`Models`,children:[o!==null&&(0,B.jsx)(x2,{label:`Default model`,children:(0,B.jsxs)(m2,{value:c??void 0,onValueChange:t=>{let n=a[t]?.effort??null;Zd(e.machine,{...e.composer,[e.provider]:{...s,model:t,...n===null?{}:{effort:n}}})},children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{placeholder:`Choose a model`})}),(0,B.jsx)(_2,{children:o.filter(e=>!(a[e.value]?.hidden??e.deprecated)||e.value===c).map(e=>(0,B.jsx)(v2,{value:e.value,children:e.name},e.value))})]})}),r!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-4 py-3 text-xs`,children:r}),r===null&&o===null&&(0,B.jsx)(`p`,{className:`text-muted-foreground px-4 py-3 text-xs`,children:`Loading…`}),(o??[]).map(t=>{let n=a[t.value]??{hidden:t.deprecated,effort:t.effort};return(0,B.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3 px-4 py-1.5`,children:[(0,B.jsxs)(`div`,{className:F(`min-w-0 flex-1 truncate text-sm`,n.hidden&&`text-muted-foreground`),children:[t.name,e.provider===`opencode`&&(0,B.jsx)(`span`,{className:`text-muted-foreground ml-2 text-xs`,children:t.description})]}),t.efforts.length>0&&(0,B.jsxs)(m2,{value:n.effort??void 0,onValueChange:e=>l(t.value,{...n,effort:e}),children:[(0,B.jsx)(g2,{size:`sm`,className:`w-28`,children:(0,B.jsx)(h2,{placeholder:`Effort`})}),(0,B.jsx)(_2,{children:t.efforts.map(e=>(0,B.jsx)(v2,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,B.jsx)(y2,{size:`sm`,checked:!n.hidden,onCheckedChange:e=>l(t.value,{...n,hidden:!e}),"aria-label":`Show ${t.name}`})]},t.value)})]})}function Mxe(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(null);async function a(e){n(!0),i(null);try{await e()}catch(e){i(Vn(e))}finally{n(!1)}}return(0,B.jsxs)(B.Fragment,{children:[e.accounts.map(n=>(0,B.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,B.jsxs)(`div`,{className:F(`min-w-0 flex-1`,!n.enabled&&`opacity-50`),children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(`span`,{className:F(`size-2 shrink-0 rounded-full`,!n.enabled&&`bg-muted-foreground/40`,n.enabled&&n.error!==null&&`bg-destructive`,n.enabled&&n.error===null&&!n.linked&&`bg-warning`,n.enabled&&n.error===null&&n.linked&&`bg-success`)}),(0,B.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n.name}),n.plan!==null&&(0,B.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:n.plan})]}),n.error!==null&&(0,B.jsx)(`p`,{className:`text-destructive mt-1 truncate pl-4 text-xs`,children:n.error}),n.error===null&&!n.linked&&(0,B.jsx)(`p`,{className:`text-warning mt-1 truncate pl-4 text-xs`,children:`Not linked to shared threads · hidden in the composer`}),n.error===null&&n.linked&&n.limits.length>0&&(0,B.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-x-5 gap-y-1.5 pl-4`,children:n.limits.map(e=>(0,B.jsx)(Nxe,{limit:e},e.window))})]}),(0,B.jsx)(y2,{size:`sm`,checked:n.enabled,disabled:t,onCheckedChange:t=>void a(()=>M(e.machine,`accounts.update`,{id:n.id,name:n.name,configDir:n.configDir,enabled:t,hiddenModels:n.hiddenModels})),"aria-label":`Enable ${n.name}`}),(0,B.jsx)(H,{size:`icon-sm`,variant:`ghost-muted`,title:`Open account`,onClick:()=>z({settingsAccount:n.id}),children:(0,B.jsx)(U,{icon:LD})})]},n.id)),(0,B.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:bg-muted/50 hover:text-foreground flex w-full items-center gap-2 px-4 py-3 text-sm transition-colors`,onClick:()=>z({settingsAccount:`new`}),children:[(0,B.jsx)(U,{icon:MD,className:`size-4`}),`Add account`]}),r!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-4 py-3 text-xs`,children:r})]})}function Nxe(e){let t=e.limit,n=t.rejected?100:t.utilization===null?null:Math.min(100,Math.round(t.utilization*100));return n===null?null:(0,B.jsx)($z,{label:t.resetsAt===null?`Reset time unknown`:`Resets ${df(t.resetsAt*1e3)}`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:Oxe(t)}),(0,B.jsx)(`div`,{className:`bg-foreground/10 h-1 w-16 overflow-hidden rounded-full`,children:(0,B.jsx)(`div`,{className:F(`h-full rounded-full`,t.rejected&&`bg-destructive`,!t.rejected&&n>=80&&`bg-warning`,!t.rejected&&n<80&&`bg-foreground/50`),style:{width:`${n}%`}})}),(0,B.jsxs)(`span`,{className:F(`tabular-nums`,t.rejected&&`text-destructive`,!t.rejected&&`text-muted-foreground`),children:[n,`%`]})]})})}var r9=zn?`⌘`:`Ctrl+Shift`,Pxe=[[`Enter`,`Send, or queue or steer while the agent works`],[`${Bn}+Enter`,`Send the other way while the agent works`],[`Shift+Enter`,`New line`],[`↑`,`Recall your last message`],[`Shift+Tab`,`Cycle permission mode`],[`Esc`,`Stop the agent`],[`/`,`Slash commands`],[`@`,`Mention a file`],[`${Bn}+K`,`Search sessions and actions`],[`${Bn}+N or ${Bn}+T`,`New thread`],[zn?"⌘+`, Ctrl+` or ⌘+J":"Ctrl+` or Ctrl+J",`Toggle the terminal`],[`${Bn}+B`,`Toggle the sidebar`],[`${r9}+T`,`New terminal tab, in the terminal`],[`${r9}+W`,`Close the terminal tab`],[`${r9}+F`,`Find in the terminal`],[`Ctrl+Tab`,`Next terminal tab`],[`Ctrl+Shift+Tab`,`Previous terminal tab`]];function Fxe(){return(0,B.jsx)(b2,{title:`Keyboard shortcuts`,children:Pxe.map(([e,t])=>(0,B.jsx)(x2,{label:t,children:(0,B.jsx)(`kbd`,{className:`bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-sans text-xs`,children:e})},e))})}function Ixe(e){let t=e.prefs.terminal,[n,r]=(0,v.useState)(!BE.some(e=>e.family===t.font.family));function i(t){Ud({...e.prefs,terminal:t})}function a(e,n){i({...t,[e]:{...t[e],...n}})}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(b2,{title:`Font`,children:[(0,B.jsx)(x2,{label:`Family`,children:(0,B.jsxs)(m2,{value:n?`custom`:t.font.family,onValueChange:e=>{r(e===`custom`),e!==`custom`&&a(`font`,{family:e})},children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[BE.map(e=>(0,B.jsx)(v2,{value:e.family,children:e.label},e.family)),(0,B.jsx)(v2,{value:`custom`,children:`Custom`})]})]})}),n&&(0,B.jsx)(x2,{label:`Custom family`,children:(0,B.jsx)(S2,{placeholder:`Installed font name`,value:t.font.family,onCommit:e=>a(`font`,{family:e})})}),(0,B.jsx)(x2,{label:`Size`,children:(0,B.jsx)(C2,{value:t.font.size,step:.5,onCommit:e=>a(`font`,{size:e})})}),(0,B.jsx)(x2,{label:`Line height`,children:(0,B.jsx)(C2,{value:t.font.lineHeight,step:.05,onCommit:e=>a(`font`,{lineHeight:e})})}),(0,B.jsx)(x2,{label:`Ligatures`,children:(0,B.jsx)(y2,{checked:t.font.ligatures,onCheckedChange:e=>a(`font`,{ligatures:e})})}),(0,B.jsx)(x2,{label:`Bold text in bright colors`,children:(0,B.jsx)(y2,{checked:t.boldIsBright,onCheckedChange:e=>i({...t,boldIsBright:e})})})]}),(0,B.jsxs)(b2,{title:`Cursor`,children:[(0,B.jsx)(x2,{label:`Style`,children:(0,B.jsxs)(m2,{value:t.cursor.style,onValueChange:e=>a(`cursor`,{style:e}),children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`block`,children:`Block`}),(0,B.jsx)(v2,{value:`bar`,children:`Bar`}),(0,B.jsx)(v2,{value:`underline`,children:`Underline`})]})]})}),(0,B.jsx)(x2,{label:`Blink`,children:(0,B.jsx)(y2,{checked:t.cursor.blink,onCheckedChange:e=>a(`cursor`,{blink:e})})})]}),(0,B.jsx)(Lxe,{behavior:t.behavior,onChange:e=>a(`behavior`,e)}),(0,B.jsx)(Rxe,{behavior:t.behavior,onChange:e=>a(`behavior`,e)}),(0,B.jsxs)(b2,{title:`Layout`,children:[[`top`,`right`,`bottom`,`left`].map(e=>(0,B.jsx)(x2,{label:`Padding ${e}`,children:(0,B.jsx)(C2,{value:t.padding[e],onCommit:t=>a(`padding`,{[e]:t})})},e)),(0,B.jsx)(x2,{label:`Scrollback lines`,children:(0,B.jsx)(C2,{value:t.scrollback,step:1e3,onCommit:e=>i({...t,scrollback:e})})})]})]})}function Lxe(e){return(0,B.jsxs)(b2,{title:`Behavior`,children:[(0,B.jsx)(x2,{label:`Modernize Shift+Enter`,children:(0,B.jsx)(y2,{checked:e.behavior.modernizeShiftEnter,onCheckedChange:t=>e.onChange({modernizeShiftEnter:t})})}),(0,B.jsx)(x2,{label:`${NE.linux.label} (${NE.windows.label} on Windows machines) pastes images from the browser clipboard`,children:(0,B.jsx)(y2,{checked:e.behavior.pasteBrowserImages,onCheckedChange:t=>e.onChange({pasteBrowserImages:t})})}),(0,B.jsx)(x2,{label:`Capture browser shortcuts`,children:(0,B.jsx)(y2,{checked:e.behavior.captureShortcuts,onCheckedChange:t=>e.onChange({captureShortcuts:t})})}),(0,B.jsx)(x2,{label:`Click moves the cursor in the command line`,children:(0,B.jsx)(y2,{checked:e.behavior.clickToMoveCursor,onCheckedChange:t=>e.onChange({clickToMoveCursor:t})})}),(0,B.jsx)(x2,{label:`Ask before closing a tab that is running a program`,children:(0,B.jsx)(y2,{checked:e.behavior.confirmCloseBusyTab,onCheckedChange:t=>e.onChange({confirmCloseBusyTab:t})})})]})}function Rxe(e){return zn?(0,B.jsx)(b2,{title:`Mac keys`,note:`Meta keeps that Option key from typing @, | and other symbols. Safari and Firefox use US key positions`,children:(0,B.jsx)(x2,{label:`Use Option as Meta`,children:(0,B.jsxs)(m2,{value:e.behavior.optionAsMeta,onValueChange:t=>e.onChange({optionAsMeta:t}),children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`off`,children:`Off`}),(0,B.jsx)(v2,{value:`left`,children:`Left Option`}),(0,B.jsx)(v2,{value:`right`,children:`Right Option`}),(0,B.jsx)(v2,{value:`both`,children:`Both Options`})]})]})})}):null}var zxe=[`General`,`Terminal`,`Notifications`,`Shortcuts`,`Machines`],i9=[`Machine`,`Claude`,`Codex`,`OpenCode`];function Bxe(){let e=R(e=>e.settingsOpen),t=R(e=>e.prefs),n=R(e=>e.machines),r=R(e=>e.settingsMachine===null?null:jd(e,e.settingsMachine)),i=r===null?null:r.config,a=r===null?null:r.system,o=R(e=>e.settingsPage),s=i9.includes(o),c=a9(o),l=R(e=>c===null?null:e.settingsAccount),u=l===`new`?`New account`:[...r?.claudeAccounts??[],...r?.codexAccounts??[]].find(e=>e.id===l)?.name,d=R(e=>o===`Machines`?e.machines.find(t=>t.id===e.settingsEditedMachine)??null:null),f=l!==null||d!==null,[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(0);function _(e){let t=a9(e);return(0,B.jsxs)(`button`,{className:F(`text-muted-foreground hover:bg-accent hover:text-foreground flex h-9 flex-none items-center rounded-md px-2 text-sm transition-colors`,e===o&&`bg-accent text-foreground`),onClick:()=>Hd(e),children:[t!==null&&(0,B.jsx)(`span`,{className:`mr-2.5 flex size-4 items-center justify-center`,children:(0,B.jsx)(sA,{provider:t,className:F(t===`claude`&&`size-4`,t===`codex`&&`size-[19px] shrink-0`,t===`opencode`&&`h-3.5`)})}),e===`Machine`?`General`:e]},e)}return(0,B.jsx)(Y0,{open:e,onOpenChange:Vd,children:(0,B.jsxs)(Z0,{showCloseButton:!1,"aria-describedby":void 0,className:`flex h-[min(44rem,calc(100dvh-2rem))] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl sm:flex-row`,children:[(0,B.jsxs)(`nav`,{className:`flex flex-none gap-1 overflow-x-auto border-b p-3 sm:w-48 sm:flex-col sm:border-r sm:border-b-0`,children:[(0,B.jsx)(e2,{className:`hidden px-2 pt-1 pb-3 text-base font-semibold sm:block`,children:`Settings`}),zxe.map(_),(0,B.jsxs)(`div`,{className:`flex flex-none items-center gap-1 sm:mt-6 sm:flex-col sm:items-stretch`,children:[r!==null&&n.length>1&&(0,B.jsxs)(m2,{value:r.id,onValueChange:e=>z({settingsMachine:e,settingsAccount:null}),children:[(0,B.jsx)(g2,{className:`mb-1 w-40 sm:w-full`,children:(0,B.jsx)(h2,{})}),(0,B.jsx)(_2,{children:n.map(e=>(0,B.jsxs)(v2,{value:e.id,children:[(0,B.jsx)(U,{icon:rA[e.icon]}),e.name]},e.id))})]}),r!==null&&n.length===1&&(0,B.jsxs)(`p`,{className:`text-muted-foreground flex h-9 items-center gap-1.5 px-2 text-xs font-medium [&_svg]:size-4`,children:[(0,B.jsx)(U,{icon:rA[r.icon]}),(0,B.jsx)(`span`,{className:`truncate`,children:r.name})]}),i9.map(_)]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 pt-4 pb-7`,children:[(0,B.jsxs)(`div`,{className:`mb-5 flex h-9 items-center`,children:[f&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground text-xl font-semibold tracking-tight transition-colors`,onClick:()=>z({settingsAccount:null,settingsEditedMachine:null}),children:o}),(0,B.jsx)(U,{icon:LD,className:`text-muted-foreground mx-1.5 size-5`}),(0,B.jsx)(`h2`,{className:`truncate text-xl font-semibold tracking-tight`,children:l===null?d?.name:u})]}),!f&&(0,B.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:o===`Machine`?`General`:o}),c!==null&&l===null&&r!==null&&i!==null&&(0,B.jsx)(y2,{className:`ml-3`,checked:i.enabledProviders[c],onCheckedChange:e=>void Yd(r.id,{...i,enabledProviders:{...i.enabledProviders,[c]:e}}),"aria-label":`Enable ${o}`}),(0,B.jsx)(X0,{asChild:!0,children:(0,B.jsx)(H,{variant:`ghost`,size:`icon`,className:`-mr-2 ml-auto`,"aria-label":`Close settings`,children:(0,B.jsx)(U,{icon:UD})})})]}),s&&r!==null&&r.configError!==null&&(0,B.jsxs)(`p`,{className:`text-destructive mb-5 text-sm whitespace-pre-wrap`,children:[`Not saved: `,r.configError]}),(0,B.jsxs)(`div`,{className:`w-full space-y-5`,children:[o===`General`&&(0,B.jsx)(Yhe,{prefs:t,onRestore:()=>m(`browser`)}),o===`Machine`&&r!==null&&i!==null&&a!==null&&(0,B.jsx)(oge,{machine:r.id,config:i,platform:a.platform,defaultShell:a.defaultShell,claudeAccounts:r.claudeAccounts,codexAccounts:r.codexAccounts,openCode:r.openCode,onRestore:()=>m(`machine`)}),s&&r===null&&(0,B.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Add a machine to see its settings.`}),s&&r!==null&&(i===null||a===null)&&(0,B.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[r.name,` is not connected. Its settings show up once it is.`]}),o===`Terminal`&&(0,B.jsx)(Ixe,{prefs:t}),o===`Notifications`&&(0,B.jsx)(wxe,{prefs:t}),c!==null&&r!==null&&i!==null&&r.composer!==null&&a!==null&&(0,B.jsx)(jxe,{machine:r.id,config:i,composer:r.composer,platform:a.platform,defaultClaudeBaseDir:a.defaultClaudeBaseDir,provider:c,claudeAccounts:r.claudeAccounts,codexAccounts:r.codexAccounts,openCode:r.openCode,selected:l},c),o===`Machines`&&(0,B.jsx)(xxe,{}),o===`Shortcuts`&&(0,B.jsx)(Fxe,{})]},h)]}),(0,B.jsx)(a2,{open:p!==null,onOpenChange:e=>{e||m(null)},children:(0,B.jsxs)(s2,{children:[(0,B.jsxs)(c2,{children:[(0,B.jsx)(u2,{children:p===`browser`?`Restore browser defaults?`:`Restore machine defaults?`}),(0,B.jsx)(d2,{children:p===`browser`?`All settings of this browser go back to their defaults.`:`All settings of ${r?.name} go back to their defaults.`})]}),(0,B.jsxs)(l2,{children:[(0,B.jsx)(p2,{children:`Cancel`}),(0,B.jsx)(f2,{variant:`destructive`,onClick:()=>{if(g(h+1),p===`browser`)Ud(xd);else{if(r===null||i===null||a===null)throw Error(`Restoring machine defaults needs a connected machine`);Yd(r.id,{...a.defaults,claudeAccounts:i.claudeAccounts,codexAccounts:i.codexAccounts})}},children:`Restore defaults`})]})]})})]})})}function a9(e){return e===`Claude`?`claude`:e===`Codex`?`codex`:e===`OpenCode`?`opencode`:null}function Vxe(){return(0,B.jsx)(`div`,{className:`grid flex-1 place-items-center p-6`,children:(0,B.jsxs)(`div`,{className:`w-full max-w-md`,children:[(0,B.jsx)(`h1`,{className:`text-foreground text-center text-2xl font-normal tracking-tight sm:text-3xl`,children:`Connect a machine`}),(0,B.jsx)(`p`,{className:`text-muted-foreground mt-2 text-center text-sm`,children:`Run this on the computer you want to use, then open the pairing link it prints.`}),(0,B.jsx)(`pre`,{className:`bg-muted text-foreground mt-5 rounded-lg px-4 py-3 font-mono text-sm select-all`,children:`npx offsite serve`}),(0,B.jsx)(`p`,{className:`text-muted-foreground mt-8 mb-3 text-sm`,children:`Or connect it here.`}),(0,B.jsx)($7,{actions:e=>(0,B.jsx)(H,{type:`submit`,className:`mt-4`,disabled:!e,children:`Connect`})})]})})}function Hxe(){let e=R(e=>e.paletteOpen),t=R(e=>e.selection),n=R(e=>e.sessions),r=R(e=>e.machines),i=R(e=>e.projects),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(0),l=(0,v.useRef)(null),u=a.toLowerCase().split(/\s+/).filter(Boolean),d=[...t===null?[]:[{key:`new`,label:`New thread`,detail:i.find(e=>e.machine===t.machine&&e.id===t.projectId)?.path??``,run:()=>pf({...t,sessionId:null})}],{key:`accounts`,label:`Manage accounts`,detail:``,run:()=>Hd(Dd[L().settings.provider])},{key:`settings`,label:`Settings`,detail:`Theme, notifications, keyboard shortcuts`,run:()=>Vd(!0)}],f=n.map(e=>({key:Ze(e.machine,e.id),label:e.title,detail:`${e.status===`minimized`?`Minimized · `:``}${r.length>1?`${r.find(t=>t.id===e.machine)?.name??``}:`:``}${i.find(t=>t.machine===e.machine&&t.id===e.projectId)?.path??``}`,run:()=>pf({machine:e.machine,projectId:e.projectId,sessionId:e.id})})),p=[...d,...f].filter(e=>{let t=`${e.label} ${e.detail}`.toLowerCase();return u.every(e=>t.includes(e))}).slice(0,50),m=Math.min(s,p.length-1);(0,v.useLayoutEffect)(()=>{l.current?.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[m]);function h(e){Bd(!1),e.run()}return(0,B.jsx)(Y0,{open:e,onOpenChange:e=>{Bd(e),o(``),c(0)},children:(0,B.jsxs)(Z0,{showCloseButton:!1,className:`top-[20%] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-xl`,children:[(0,B.jsx)(e2,{className:`sr-only`,children:`Search threads`}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 border-b px-4`,children:[(0,B.jsx)(U,{icon:rk,className:`text-muted-foreground size-4 shrink-0`}),(0,B.jsx)(`input`,{value:a,onChange:e=>{o(e.target.value),c(0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;c((m+t+p.length)%p.length)}e.key===`Enter`&&m>=0&&(e.preventDefault(),h(p[m]))},placeholder:`Search threads and actions…`,className:`placeholder:text-placeholder/75 h-11 w-full bg-transparent text-sm outline-none`})]}),(0,B.jsxs)(`div`,{ref:l,className:`max-h-96 overflow-y-auto p-1`,children:[p.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground px-3 py-6 text-center text-xs`,children:`Nothing matches.`}),p.map((e,t)=>(0,B.jsxs)(`button`,{"data-active":t===m,className:F(`flex w-full cursor-pointer flex-col rounded-lg px-2.5 py-1.5 text-left`,t===m&&`bg-accent`),onMouseMove:()=>c(t),onClick:()=>h(e),children:[(0,B.jsx)(`span`,{className:`truncate text-sm`,children:e.label}),e.detail!==``&&(0,B.jsx)(`span`,{className:`text-secondary-label truncate text-xs`,children:e.detail})]},e.key))]})]})})}function o9({className:e,...t}){return(0,B.jsx)(bx,{"data-slot":`label`,className:F(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var Uxe=/\.(png|jpe?g|gif|webp|svg)$/i;function Wxe(e){let t=R(e=>e.machines),[n,r]=(0,v.useState)(e.machine),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(`~`),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),m=c.trim()===``?void 0:i?.listing,h=m?.directories.filter(e=>e.name.toLowerCase().includes(u.toLowerCase()));function g(e){l(e),d(``)}return(0,v.useEffect)(()=>{if(c.trim()===``)return;let e=!1,t=setTimeout(async()=>{try{let t=await M(n,`directories.list`,{path:c});if(e)return;a({path:c,listing:t}),s(null)}catch(t){if(e)return;a(null),s(Vn(t))}},150);return()=>{e=!0,clearTimeout(t)}},[n,c]),(0,B.jsx)(Y0,{open:!0,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`gap-0 overflow-hidden p-0 sm:max-w-lg`,showCloseButton:!1,"aria-describedby":void 0,children:[(0,B.jsx)(e2,{className:`sr-only`,children:`Add project`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 border-b p-1`,children:[(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Home folder`,onClick:()=>g(`~`),children:(0,B.jsx)(U,{icon:wO})}),(0,B.jsx)(`div`,{className:`bg-border mx-0.5 h-4 w-px`}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Parent folder`,disabled:m?.parent===void 0||m.parent===null,onClick:()=>{m?.parent!==void 0&&m.parent!==null&&g(m.parent)},children:(0,B.jsx)(U,{icon:zD})}),(0,B.jsx)(`input`,{"aria-label":`Folder path`,className:`hover:bg-muted focus:bg-muted h-7 min-w-0 flex-1 rounded-md bg-transparent px-1.5 font-mono text-xs outline-none`,spellCheck:!1,value:c,onChange:e=>g(e.target.value)}),(0,B.jsx)(X0,{asChild:!0,children:(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,children:(0,B.jsx)(U,{icon:UD})})})]}),(0,B.jsxs)(`label`,{className:`flex h-9 items-center gap-2.5 border-b px-3`,children:[(0,B.jsx)(U,{icon:rk,className:`text-muted-foreground size-4 flex-none`}),(0,B.jsx)(`input`,{className:`placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent text-sm outline-none`,placeholder:`Search this folder`,value:u,onChange:e=>d(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`h-72 overflow-y-auto p-1`,children:[h?.map(e=>(0,B.jsxs)(`button`,{className:`hover:bg-muted flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-md px-2.5 text-left text-sm transition-colors`,onClick:()=>g(e.path),children:[(0,B.jsx)(U,{icon:mO,className:`text-muted-foreground size-4 flex-none`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)),h?.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground grid h-full place-items-center text-sm`,children:u===``?`No folders here`:`No matching folders`})]}),o!==null&&c.trim()!==``&&(0,B.jsx)(`p`,{className:`text-destructive border-t px-3 py-2 text-sm break-all`,children:o}),(0,B.jsxs)($0,{className:`border-t p-3`,children:[t.length>1&&(0,B.jsxs)(m2,{value:n,onValueChange:e=>{r(e),a(null),g(`~`)},children:[(0,B.jsx)(g2,{className:`sm:mr-auto sm:w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsx)(_2,{children:t.map(e=>(0,B.jsx)(v2,{value:e.id,disabled:e.status!==`online`,children:e.name},e.id))})]}),(0,B.jsx)(H,{disabled:i?.path!==c||f,onClick:async()=>{if(i!==null&&i.path===c){p(!0);try{e.onAdd({...await eA(n,i.listing.path),machine:n})}catch(e){s(Vn(e)),p(!1)}}},children:`Add project`})]})]})})}function Gxe(e){let t=e.project.path,[n,r]=(0,v.useState)(e.project.name),[i,a]=(0,v.useState)(e.project.logo),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),m=(0,v.useRef)(null);return(0,B.jsx)(Y0,{open:!0,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`gap-0 overflow-hidden p-0 sm:max-w-md`,children:[(0,B.jsxs)(`form`,{className:`grid`,onSubmit:async t=>{t.preventDefault(),l(!0);try{await tA(e.project.machine,e.project.id,{name:n,logo:i}),e.onClose()}catch(e){s(Vn(e)),l(!1)}},children:[(0,B.jsxs)(Q0,{className:`gap-1 px-6 pt-4 pr-12`,children:[(0,B.jsx)(e2,{className:`text-base`,children:`Edit project`}),(0,B.jsx)(t2,{className:`truncate font-mono text-xs`,title:t,children:t})]}),(0,B.jsxs)(`div`,{className:`grid gap-6 p-6`,children:[(0,B.jsxs)(`div`,{className:`grid gap-2.5`,children:[(0,B.jsx)(o9,{children:`Icon`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsx)(oA,{name:n.trim()===``?cf(t):n,logo:i,className:`ring-foreground/10 size-16 rounded-2xl ring-1 [&>img]:rounded-2xl [&>svg]:rounded-2xl`}),(0,B.jsxs)(`div`,{className:`grid gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsxs)(H,{type:`button`,variant:`outline`,size:`sm`,title:`Upload an image from this device`,onClick:()=>m.current?.click(),children:[(0,B.jsx)(U,{icon:yk}),`Upload`]}),(0,B.jsxs)(H,{type:`button`,variant:`outline`,size:`sm`,title:`Choose an image from the project on the server`,onClick:()=>p(!0),children:[(0,B.jsx)(U,{icon:mO}),`Choose from project`]}),i!==null&&(0,B.jsx)(H,{type:`button`,variant:`ghost-muted`,size:`sm`,onClick:()=>a(null),children:`Remove`})]}),(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`PNG, JPG, GIF, WebP, SVG or ICO, up to 384 KB`})]})]}),(0,B.jsx)(`input`,{ref:m,type:`file`,accept:`image/png,image/jpeg,image/gif,image/webp,image/svg+xml,image/x-icon`,hidden:!0,onChange:async e=>{let t=e.target.files?.[0];e.target.value=``,t!==void 0&&a(`data:${t.type};base64,${await CE(t)}`)}})]}),(0,B.jsxs)(`div`,{className:`grid gap-2`,children:[(0,B.jsx)(o9,{htmlFor:`project-name`,children:`Name`}),(0,B.jsx)(xV,{id:`project-name`,placeholder:cf(t),value:n,onChange:e=>r(e.target.value)})]}),o!==null&&(0,B.jsx)(`p`,{className:`text-destructive text-sm break-all`,children:o})]}),(0,B.jsxs)($0,{className:`bg-muted/40 border-t px-6 py-4`,children:[(0,B.jsxs)(H,{type:`button`,variant:u?`destructive`:`ghost`,className:F(`sm:mr-auto`,!u&&`text-destructive hover:bg-destructive/10 hover:text-destructive`),title:`Its threads stay in their provider`,onClick:async()=>{if(!u)d(!0);else try{await nA(e.project.machine,e.project.id),e.onRemoved()}catch(e){s(Vn(e))}},children:[(0,B.jsx)(U,{icon:cO,className:`text-current`}),u?`Click again to remove`:`Remove project`]}),(0,B.jsx)(H,{type:`button`,variant:`outline`,onClick:e.onClose,children:`Cancel`}),(0,B.jsx)(H,{type:`submit`,disabled:n.trim()===``||c,children:`Save`})]})]}),f&&(0,B.jsx)(Kxe,{machine:e.project.machine,projectId:e.project.id,onClose:()=>p(!1),onPick:e=>{a(e),p(!1)}})]})})}function Kxe(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null),s=t?.filter(e=>Uxe.test(e)&&e.toLowerCase().includes(r.toLowerCase()));return(0,v.useEffect)(()=>{let t=!1;return(async()=>{try{let r=await M(e.machine,`files.list`,{projectId:e.projectId});t||n(r)}catch(e){t||o(Vn(e))}})(),()=>{t=!0}},[e.machine,e.projectId]),(0,B.jsx)(Y0,{open:!0,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`gap-0 overflow-hidden p-0 sm:max-w-lg`,showCloseButton:!1,"aria-describedby":void 0,children:[(0,B.jsx)(e2,{className:`sr-only`,children:`Pick icon`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 border-b p-1`,children:[(0,B.jsxs)(`label`,{className:`flex h-7 min-w-0 flex-1 items-center gap-2.5 px-2`,children:[(0,B.jsx)(U,{icon:rk,className:`text-muted-foreground size-4 flex-none`}),(0,B.jsx)(`input`,{className:`placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent text-sm outline-none`,placeholder:`Search images in this project`,value:r,onChange:e=>i(e.target.value)})]}),(0,B.jsx)(X0,{asChild:!0,children:(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,children:(0,B.jsx)(U,{icon:UD})})})]}),(0,B.jsxs)(`div`,{className:`h-72 overflow-y-auto p-1`,children:[s?.map(t=>(0,B.jsxs)(`button`,{className:`hover:bg-muted flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-md px-2.5 text-left text-sm transition-colors`,onClick:async()=>{try{let n=await M(e.machine,`files.read`,{projectId:e.projectId,path:t});n.kind===`image`?e.onPick(`data:${n.mediaType};base64,${n.data}`):n.kind===`large`?o(`${t} is too large`):o(`${t} is not an image`)}catch(e){o(Vn(e))}},children:[(0,B.jsx)(U,{icon:TO,className:`text-muted-foreground size-4 flex-none`}),(0,B.jsx)(`span`,{className:`truncate font-mono text-xs`,children:t})]},t)),s?.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground grid h-full place-items-center text-sm`,children:r===``?`No images in this project`:`No matching images`})]}),a!==null&&(0,B.jsx)(`p`,{className:`text-destructive border-t px-3 py-2 text-sm break-all`,children:a})]})})}var s9=`group/sidebar-row relative w-full cursor-pointer overflow-hidden rounded-md text-left outline-none select-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`;function qxe(e){let t=e.session,n=$k(t.machine,t.projectId),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=e.activity?.waiting===!0,l=!c&&e.activity?.running===!0,u=l||!c&&Object.values(e.activity?.tasks??{}).includes(`running`),d=!c&&!u&&e.unseen,f=!e.selected&&!c&&!d,p=e.saved&&(0,B.jsxs)(uA,{onOpenChange:()=>o(!1),children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground inline-flex h-5 cursor-pointer items-center rounded-md px-1.5`,title:`Thread actions`,onClick:e=>e.stopPropagation(),children:(0,B.jsx)(U,{icon:uO,className:`size-3.5`})})}),(0,B.jsxs)(pA,{align:`end`,className:`w-44`,onClick:e=>e.stopPropagation(),onCloseAutoFocus:e=>{s.current!==null&&(e.preventDefault(),s.current.focus(),s.current.select())},children:[(0,B.jsxs)(mA,{onSelect:()=>i(t.title),children:[(0,B.jsx)(U,{icon:XO}),`Rename`]}),(0,B.jsxs)(mA,{onSelect:()=>void Cf(t.machine,t.id,{status:t.status===`pinned`?`active`:`pinned`}),children:[(0,B.jsx)(U,{icon:t.status===`pinned`?ZO:QO}),t.status===`pinned`?`Unpin`:`Pin`]}),(0,B.jsxs)(mA,{onSelect:()=>void Cf(t.machine,t.id,{status:t.status===`minimized`?`active`:`minimized`}),children:[(0,B.jsx)(U,{icon:t.status===`minimized`?IO:VO}),t.status===`minimized`?`Restore`:`Minimize`]}),t.status!==`inactive`&&(0,B.jsxs)(mA,{onSelect:()=>void Cf(t.machine,t.id,{status:`inactive`}),children:[(0,B.jsx)(U,{icon:$O}),`Make inactive`]}),(0,B.jsx)(yA,{}),(0,B.jsxs)(mA,{variant:`destructive`,title:`Also removes it from ${sf[t.provider]}`,onSelect:e=>{a?wf(t.machine,t.id):(e.preventDefault(),o(!0))},children:[(0,B.jsx)(U,{icon:cO}),a?`Click again to delete`:`Delete`]})]})]}),m=r===null?(0,B.jsx)(`span`,{className:F(`min-w-0 flex-1 truncate text-sm`,f?`text-secondary-label font-normal`:`font-medium`,!f&&(e.unseen||c)&&`text-foreground`,!f&&!e.unseen&&!c&&`text-foreground/90`),children:t.title}):(0,B.jsx)(`form`,{className:`min-w-0 flex-1`,onSubmit:e=>{e.preventDefault();let n=r.trim();i(null),n!==``&&n!==t.title&&Cf(t.machine,t.id,{title:n})},children:(0,B.jsx)(`input`,{ref:s,value:r,onChange:e=>i(e.target.value),onClick:e=>e.stopPropagation(),onBlur:()=>i(null),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&i(null)},className:`text-foreground ring-ring/50 focus:ring-ring w-full rounded-sm bg-transparent text-sm font-medium ring-1 outline-none ring-inset`})}),h=F(e.selected&&`bg-sidebar-row-active text-sidebar-foreground`,f&&`text-sidebar-muted-foreground/75 hover:bg-sidebar-row-hover hover:text-sidebar-foreground`,!e.selected&&!f&&`text-sidebar-foreground hover:bg-sidebar-row-hover bg-transparent`);return e.slim?(0,B.jsx)(`li`,{className:`list-none`,children:(0,B.jsxs)(`div`,{role:`button`,tabIndex:0,className:F(s9,h,`flex h-9 items-center gap-2.5 px-2.5`),onClick:e.onSelect,onKeyDown:t=>{t.key===`Enter`&&e.onSelect()},children:[(0,B.jsx)(`span`,{className:`flex shrink-0 items-center opacity-40 grayscale transition-opacity group-hover/sidebar-row:opacity-100 group-hover/sidebar-row:grayscale-0`,children:(0,B.jsx)(aA,{machine:t.machine,projectId:t.projectId})}),m,(0,B.jsxs)(`span`,{className:`relative ml-auto flex h-6 min-w-8 shrink-0 items-center justify-end`,children:[(0,B.jsx)(`span`,{className:`text-secondary-label group-any-hover/sidebar-row:opacity-0 inline-flex justify-end text-xs tabular-nums transition-opacity`,children:lf(t.updatedAt)}),(0,B.jsx)(`span`,{className:`group-any-hover/sidebar-row:opacity-100 absolute inset-y-0 right-0 -mr-1 flex items-center opacity-0 transition-opacity has-[[data-state=open]]:opacity-100`,children:p})]})]})}):(0,B.jsx)(`li`,{className:`list-none py-0.5`,children:(0,B.jsxs)(`div`,{role:`button`,tabIndex:0,className:F(s9,h,u&&!e.selected&&`opacity-70 transition-opacity focus-within:opacity-100 hover:opacity-100`),onClick:e.onSelect,onKeyDown:t=>{t.key===`Enter`&&e.onSelect()},children:[(0,B.jsxs)(`div`,{className:`px-(--sidebar-row-content-inset) py-(--sidebar-content-inset)`,children:[(0,B.jsxs)(`div`,{className:`flex h-6 min-w-0 items-center gap-2`,children:[(0,B.jsx)(aA,{machine:t.machine,projectId:t.projectId,className:`size-5`}),m,t.status===`pinned`&&(0,B.jsx)(U,{icon:QO,className:`text-muted-foreground/65 size-3 shrink-0`}),u&&(0,B.jsx)(`span`,{title:l?`Working`:`Running in background`,className:F(`flex`,l?`text-info`:`text-muted-foreground`),children:(0,B.jsx)(U,{icon:$D,className:`size-4 shrink-0 animate-spin`})}),c&&(0,B.jsx)(`span`,{title:`Waiting for approval`,className:`text-warning-foreground flex`,children:(0,B.jsx)(U,{icon:lk,className:`size-4 shrink-0`})}),d&&(0,B.jsx)(`span`,{title:`Done`,className:`text-success flex`,children:(0,B.jsx)(U,{icon:QD,className:`size-4 shrink-0`})})]}),(0,B.jsxs)(`div`,{className:`text-secondary-label mt-1 flex h-5 min-w-0 items-center gap-1.5 text-xs`,children:[(0,B.jsxs)(`span`,{className:F(`min-w-0 flex-1 truncate`,f?`font-normal`:`font-medium`),children:[n,t.branch!==null&&(0,B.jsx)(`span`,{className:`text-muted-foreground/40 font-normal`,children:` | ${t.branch}`})]}),(0,B.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:lf(t.updatedAt)})]})]}),e.saved&&(0,B.jsxs)(`div`,{className:F(`group-any-hover/sidebar-row:pointer-events-auto group-any-hover/sidebar-row:opacity-100 pointer-events-none absolute inset-y-0 right-0 flex w-20 flex-col items-end bg-linear-to-l from-50% to-transparent py-(--sidebar-content-inset) pr-1.5 opacity-0 transition-opacity has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:opacity-100`,e.selected?`from-sidebar-row-active`:`from-sidebar-row-hover`),children:[(0,B.jsx)(`div`,{className:`flex h-6 items-center`,children:(0,B.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground inline-flex h-5 cursor-pointer items-center rounded-md px-1.5`,title:`Make inactive`,"aria-label":`Make inactive`,onClick:e=>{e.stopPropagation(),Cf(t.machine,t.id,{status:`inactive`})},children:(0,B.jsx)(U,{icon:$O,className:`size-3.5 scale-160`})})}),(0,B.jsx)(`div`,{className:`mt-1 flex h-5 items-center`,children:p})]})]})})}function Jxe(e){let t=$k(e.machine,e.projectId);return(0,B.jsx)(`li`,{className:`list-none py-0.5`,children:(0,B.jsx)(`div`,{role:`button`,tabIndex:0,className:F(s9,`bg-sidebar-row-active text-sidebar-foreground`),onClick:e.onSelect,children:(0,B.jsxs)(`div`,{className:`px-(--sidebar-row-content-inset) py-(--sidebar-content-inset)`,children:[(0,B.jsxs)(`div`,{className:`flex h-6 min-w-0 items-center gap-2`,children:[(0,B.jsx)(aA,{machine:e.machine,projectId:e.projectId,className:`size-5`}),(0,B.jsx)(`span`,{className:`text-foreground min-w-0 flex-1 truncate text-sm font-medium`,children:`New thread`}),(0,B.jsx)(U,{icon:dk,className:`text-warning-foreground size-4 shrink-0`})]}),(0,B.jsxs)(`div`,{className:`text-secondary-label mt-1 flex h-5 min-w-0 items-center gap-1.5 text-xs`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:[t,(0,B.jsx)(`span`,{className:`text-muted-foreground/40 font-normal`,children:` | Draft`})]}),(0,B.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:`now`})]})]})})})}var c9=`text-sidebar-muted-foreground/80 hover:bg-sidebar-row-hover hover:text-sidebar-foreground flex shrink-0 cursor-pointer items-center justify-center rounded-[var(--control-radius)] [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-(--sidebar-icon-color) hover:[&>svg]:text-sidebar-foreground`;function Yxe(e){let t=R(e=>e.selection),n=R(e=>e.machines),r=R(e=>e.projects),i=R(e=>e.sessions),a=R(e=>e.settings.provider),o=R(e=>e.unseen),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(Number(localStorage.getItem(`sidebarWidth`)??240)),w=[...r].sort((e,t)=>n.findIndex(t=>t.id===e.machine)-n.findIndex(e=>e.id===t.machine)||e.name.localeCompare(t.name)),T=i.filter(e=>s===null||e.machine===s.machine&&e.projectId===s.projectId).sort((e,t)=>t.updatedAt-e.updatedAt),E=i.filter(e=>{let t=Fd(n,e.machine,e.id);return t?.running===!0||t?.waiting===!0||Object.values(t?.tasks??{}).includes(`running`)||o.includes(Ze(e.machine,e.id))}),D=[...T.filter(e=>e.status===`pinned`),...T.filter(e=>e.status===`active`)],O=T.filter(e=>e.status===`minimized`),k=T.filter(e=>e.status===`inactive`),A=t!==null&&t.sessionId!==null&&!i.some(e=>e.machine===t.machine&&e.id===t.sessionId)?{machine:t.machine,id:t.sessionId,provider:a,title:`New thread`,projectId:t.projectId,branch:null,updatedAt:Date.now(),status:`active`}:null,ee=s?.machine??t?.machine??n.at(0)?.id;function te(e,t){return r.find(n=>n.machine===e&&n.id===t)}function ne(e){let t=n.find(t=>t.id===e);return t===void 0?``:t.status===`online`?t.name:t.status===`unpaired`?`${t.name} · needs pairing`:`${t.name} · offline`}function re(e){let t=n.find(t=>t.id===e);return t===void 0?null:(0,B.jsx)(U,{icon:rA[t.icon],className:`mr-1 inline size-3 align-[-2px]`})}function ie(t,n,r){pf({machine:t,projectId:n,sessionId:r}),e.onNavigate()}function j(){let e=s??t;e===null?u(!0):ie(e.machine,e.projectId,null)}Qk([`mod+n`,`mod+t`],j,{enableOnFormTags:!0,preventDefault:!0});function ae(e){let t=e.clientX-S;Hn(e,e=>{let n=Math.min(480,Math.max(200,e.clientX-t));C(n),localStorage.setItem(`sidebarWidth`,String(n))})}function oe(e,r){return(0,B.jsx)(qxe,{session:e,slim:r,selected:t?.machine===e.machine&&t.sessionId===e.id,activity:Fd(n,e.machine,e.id),unseen:o.includes(Ze(e.machine,e.id)),saved:e!==A,onSelect:()=>ie(e.machine,e.projectId,e.id)},Ze(e.machine,e.id))}function se(e,t,n,r,i){return t.length===0?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`li`,{className:F(`mx-0.5 h-9 pt-2`,i&&`mt-auto`),children:(0,B.jsxs)(`button`,{"aria-expanded":n,className:`text-sidebar-muted-foreground/60 flex h-9 w-full cursor-pointer items-center gap-2 rounded-md px-2 text-left text-xs font-medium`,onClick:r,children:[(0,B.jsx)(`span`,{className:`shrink-0`,children:n?e:`${e} (${t.length})`}),(0,B.jsx)(`span`,{className:`bg-sidebar-border/60 h-px min-w-2 flex-1`}),(0,B.jsx)(U,{icon:JD,className:F(`size-3 shrink-0 transition-transform`,!n&&`rotate-180`)})]})}),n&&t.map(e=>oe(e,!0))]})}return(0,B.jsxs)(`aside`,{className:F(`bg-sidebar text-sidebar-foreground border-sidebar-border flex flex-none border-r select-none`,e.className),children:[(0,B.jsxs)(`div`,{className:`relative flex min-w-0 flex-col`,style:{width:S},children:[(0,B.jsxs)(`div`,{className:`flex h-(--workspace-topbar-height) shrink-0 items-center gap-2 px-3`,children:[(0,B.jsx)(`button`,{className:F(c9,`size-7`),title:`Hide sidebar (${Bn}+B)`,"aria-label":`Hide sidebar`,onClick:e.onHide,children:(0,B.jsx)(U,{icon:KO})}),(0,B.jsxs)(uA,{open:h,onOpenChange:g,children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsxs)(`button`,{className:`hover:bg-sidebar-row-hover data-[state=open]:bg-sidebar-row-hover -ml-1.5 flex h-7 min-w-0 cursor-pointer items-center gap-1.5 rounded-[var(--control-radius)] px-1.5 text-sm font-medium`,title:s===null?`Inbox`:te(s.machine,s.projectId)?.path,children:[s===null?(0,B.jsx)(U,{icon:EO,className:`size-4 shrink-0 text-(--sidebar-icon-color)`}):(0,B.jsx)(aA,{machine:s.machine,projectId:s.projectId,className:`size-4 shrink-0 [&>img]:rounded-[4px] [&>svg]:rounded-[4px]`}),(0,B.jsx)(`span`,{className:`truncate`,children:s===null?`Inbox`:te(s.machine,s.projectId)?.name}),(0,B.jsx)(U,{icon:JD,className:`text-sidebar-muted-foreground size-3.5 shrink-0`})]})}),(0,B.jsxs)(pA,{className:`w-64`,children:[(0,B.jsxs)(gA,{value:s===null?``:Ze(s.machine,s.projectId),children:[(0,B.jsxs)(_A,{value:``,className:`pr-9 pl-8 *:data-[slot=dropdown-menu-radio-item-indicator]:right-auto *:data-[slot=dropdown-menu-radio-item-indicator]:left-2`,onSelect:()=>c(null),children:[(0,B.jsx)(U,{icon:EO}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Inbox`}),E.length>0&&(0,B.jsx)(`span`,{className:`text-foreground grid h-4 min-w-4 place-items-center rounded-full bg-[color-mix(in_srgb,var(--foreground)_22%,var(--background))] px-1 text-[10px] leading-none font-medium tabular-nums`,children:E.length})]}),w.map(e=>{let t=E.filter(t=>t.machine===e.machine&&t.projectId===e.id).length;return(0,B.jsxs)(_A,{value:Ze(e.machine,e.id),title:e.path,className:`pr-2 pl-8 *:data-[slot=dropdown-menu-radio-item-indicator]:right-auto *:data-[slot=dropdown-menu-radio-item-indicator]:left-2`,onSelect:()=>c({machine:e.machine,projectId:e.id}),onContextMenu:t=>{t.preventDefault(),g(!1),m(e)},children:[(0,B.jsx)(aA,{machine:e.machine,projectId:e.id,className:`size-4 shrink-0 [&>img]:rounded-[4px] [&>svg]:rounded-[4px]`}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.name,n.length>1&&(0,B.jsxs)(`span`,{className:`text-muted-foreground ml-1.5 text-xs`,children:[re(e.machine),ne(e.machine)]})]}),t>0&&(0,B.jsx)(`span`,{className:`text-foreground grid h-4 min-w-4 place-items-center rounded-full bg-[color-mix(in_srgb,var(--foreground)_22%,var(--background))] px-1 text-[10px] leading-none font-medium tabular-nums`,children:t}),(0,B.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground hover:bg-foreground/10 -my-0.5 grid size-5 shrink-0 cursor-pointer place-items-center rounded-sm [&_svg]:size-3.5`,title:`Configure project`,"aria-label":`Configure ${e.name}`,onClick:t=>{t.stopPropagation(),g(!1),m(e)},children:(0,B.jsx)(U,{icon:ak})})]},Ze(e.machine,e.id))})]}),(0,B.jsx)(yA,{}),(0,B.jsxs)(mA,{className:`pl-8`,onSelect:()=>u(!0),children:[(0,B.jsx)(U,{icon:MD}),`Add project…`]}),(0,B.jsxs)(mA,{className:`pl-8`,onSelect:()=>f(!0),children:[(0,B.jsx)(U,{icon:iO}),`Add machine…`]})]})]}),(0,B.jsx)(`button`,{className:F(c9,`ml-auto size-7`),title:`Search (${Bn}+K)`,"aria-label":`Search`,onClick:()=>Bd(!0),children:(0,B.jsx)(U,{icon:rk})}),(0,B.jsx)(`button`,{className:F(c9,`size-7`),title:`New thread (${Bn}+N)`,onClick:j,children:(0,B.jsx)(U,{icon:dk})})]}),(0,B.jsx)(`nav`,{className:`flex min-h-0 flex-1 [scrollbar-width:none] flex-col overflow-y-auto px-(--sidebar-content-inset) pb-(--sidebar-content-inset)`,children:(0,B.jsxs)(`ul`,{className:`flex flex-1 flex-col gap-px`,children:[t!==null&&t.sessionId===null&&(0,B.jsx)(Jxe,{machine:t.machine,projectId:t.projectId,onSelect:()=>ie(t.machine,t.projectId,null)}),A!==null&&oe(A,!1),D.map(e=>oe(e,!1)),D.length===0&&A===null&&t?.sessionId!==null&&(0,B.jsx)(`li`,{className:`text-sidebar-muted-foreground/60 px-2.5 py-6 text-center text-xs`,children:`No threads yet`}),se(`Minimized`,O,_,()=>y(!_),!0),se(`Inactive`,k,b,()=>x(!b),O.length===0)]})}),(0,B.jsx)(`div`,{className:`border-sidebar-border flex shrink-0 items-center gap-1 border-t p-(--sidebar-content-inset)`,children:(0,B.jsxs)(`button`,{className:F(c9,`h-8 flex-1 justify-start gap-2 px-2.5 text-sm`),title:`Settings`,onClick:()=>Vd(!0),children:[(0,B.jsx)(U,{icon:ak}),`Settings`]})}),(0,B.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:`group absolute inset-y-0 -right-1 z-20 hidden w-2 cursor-col-resize select-none md:block`,onPointerDown:ae,children:(0,B.jsx)(`span`,{className:`group-hover:bg-border group-active:bg-primary/60 pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 transition-colors`})})]}),l&&ee===void 0&&(0,B.jsx)(e9,{onClose:()=>u(!1)}),l&&ee!==void 0&&(0,B.jsx)(Wxe,{machine:ee,onClose:()=>u(!1),onAdd:e=>{u(!1),c({machine:e.machine,projectId:e.id}),ie(e.machine,e.id,null)}}),d&&(0,B.jsx)(e9,{onClose:()=>f(!1)}),p!==null&&(0,B.jsx)(Gxe,{project:p,onClose:()=>m(null),onRemoved:()=>{s?.machine===p.machine&&s.projectId===p.id&&c(null),m(null)}})]})}function Xxe({...e}){return(0,B.jsx)(Mte,{"data-slot":`context-menu`,...e})}function Zxe({className:e,...t}){return(0,B.jsx)(Pte,{"data-slot":`context-menu-trigger`,className:F(`select-none`,e),...t})}function Qxe({className:e,...t}){return(0,B.jsx)(Fte,{children:(0,B.jsx)(Lte,{"data-slot":`context-menu-content`,className:F(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})})}function l9({className:e,inset:t,variant:n=`default`,...r}){return(0,B.jsx)(Rte,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:F(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function $xe({className:e,children:t,checked:n,inset:r,...i}){return(0,B.jsxs)(zte,{"data-slot":`context-menu-checkbox-item`,"data-inset":r,className:F(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,B.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,B.jsx)(Bte,{children:(0,B.jsx)(U,{icon:gk,strokeWidth:2})})}),t]})}var u9=null,d9=new Set,f9=new Set;function eSe(e){return f9.add(e),()=>{f9.delete(e)}}function tSe(){return u9}function nSe(){u9!==null&&p9({open:!1,closing:u9.closing})}function p9(e){u9=e;for(let e of f9)e()}function rSe(){return document.querySelector(`[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]`)!==null}function m9(e){return uD(e)?.project.tabs.find(t=>t.id===e)}async function iSe(e){try{let t=await Promise.race([M(iD(),`terminal.busy`,{id:e}),new Promise((e,t)=>window.setTimeout(()=>t(Error(`timed out`)),5e3))]);return`error`in t?(console.error(`could not check whether tab ${e} is running a program`,t.error),{checked:!1}):{checked:!0,program:t.program}}catch(e){return console.error(`could not check whether a program is running`,e),{checked:!1}}}async function h9(e){if(!cD().behavior.confirmCloseBusyTab){mD({type:`closeTab`,id:e});return}if(!m9(e)||d9.has(e))return;d9.add(e);let t=await iSe(e);if(d9.delete(e),t.checked&&t.program===null){mD({type:`closeTab`,id:e});return}let n=m9(e);n&&!rSe()&&p9({open:!0,closing:{id:e,name:dD(n),program:t.checked?t.program:null}})}var g9=zn?`meta+t`:`ctrl+shift+t`,_9=zn?`meta+w`:`ctrl+shift+w`,v9=`ctrl+tab`,y9=`ctrl+shift+tab`;function aSe(){let e=lD()?.project;oD().open&&e&&e.activeTab!==null&&OD(e.activeTab).focus()}function oSe(){return Qk([g9,_9,v9,y9],(e,t)=>{e.preventDefault(),e.stopPropagation();let n=lD();if(n===null)return;if(t.hotkey===g9){mD({type:`createTab`,projectId:n.projectId});return}let r=n.project;if(r===null||r.activeTab===null)return;if(t.hotkey===_9){h9(r.activeTab);return}let i;if(t.hotkey===v9)i=1;else if(t.hotkey===y9)i=-1;else throw Error(`unknown terminal shortcut ${t.hotkey}`);let a=r.tabs.filter(e=>!e.minimized),o=a[(a.findIndex(e=>e.id===r.activeTab)+i+a.length)%a.length];o&&mD({type:`select`,projectId:n.projectId,tabId:o.id})},{enabled:()=>cD().behavior.captureShortcuts,enableOnFormTags:!0,eventListenerOptions:{capture:!0}})}function sSe(e){let[t,n]=(0,v.useState)(e.name);return(0,B.jsx)(Y0,{open:!0,onOpenChange:t=>{t||e.onDone()},children:(0,B.jsx)(Z0,{onCloseAutoFocus:b9,children:(0,B.jsxs)(`form`,{className:`grid gap-4`,onSubmit:n=>{n.preventDefault(),mD({type:`renameTab`,id:e.id,name:t.trim()}),e.onDone()},children:[(0,B.jsx)(Q0,{children:(0,B.jsx)(e2,{children:`Rename tab`})}),(0,B.jsx)(xV,{"aria-label":`Name`,placeholder:`Use terminal title`,value:t,onChange:e=>n(e.target.value)}),(0,B.jsxs)($0,{children:[(0,B.jsx)(H,{type:`button`,variant:`outline`,onClick:e.onDone,children:`Cancel`}),(0,B.jsx)(H,{type:`submit`,children:`Rename`})]})]})})})}function cSe(){let e=(0,v.useSyncExternalStore)(eSe,tSe),t=(0,v.useRef)(null);if(e===null)return null;let n=e.closing;return(0,B.jsx)(a2,{open:e.open,onOpenChange:e=>{e||nSe()},children:(0,B.jsxs)(s2,{onOpenAutoFocus:e=>{e.preventDefault(),t.current?.focus()},onCloseAutoFocus:b9,children:[(0,B.jsxs)(c2,{children:[(0,B.jsxs)(u2,{children:[`Close “`,n.name,`”?`]}),(0,B.jsx)(d2,{children:n.program===null?`OffSite couldn’t check whether a program is still running.`:`${n.program} is still running.`})]}),(0,B.jsxs)(l2,{children:[(0,B.jsx)(p2,{children:`Cancel`}),(0,B.jsx)(f2,{ref:t,variant:`destructive`,onClick:()=>mD({type:`closeTab`,id:n.id}),children:`Close`})]})]})})}function b9(e){e.preventDefault();let t=document.querySelector(`[role="dialog"], [role="alertdialog"]`);t===null?aSe():t.focus()}function lSe(e){let t=(0,v.useRef)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)({resultIndex:-1,resultCount:0});(0,v.useEffect)(()=>_D(e.id,a),[e.id]),(0,v.useEffect)(()=>t.current?.focus(),[]);function o(t,n,i){r(t),gD(e.id,t,n,i)}return(0,B.jsxs)(`div`,{className:`bg-card absolute top-2 right-4 z-10 flex items-center gap-1 rounded-lg border p-1 shadow-lg`,children:[(0,B.jsx)(xV,{ref:t,"data-find":!0,className:`h-7 w-52`,placeholder:`Find`,value:n,onChange:e=>o(e.target.value,!1,!0),onKeyDown:t=>{t.key===`Escape`?(t.preventDefault(),vD(e.id)):t.key===`Enter`?(t.preventDefault(),o(n,t.shiftKey,!1)):CD(t.nativeEvent)&&(t.preventDefault(),t.currentTarget.select())}}),(0,B.jsx)(`span`,{className:`text-muted-foreground w-16 text-center text-xs tabular-nums`,children:n===``?``:i.resultCount===0?`No results`:`${i.resultIndex+1} of ${i.resultCount}`}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Previous match`,onClick:()=>o(n,!0,!1),children:(0,B.jsx)(U,{icon:RD})}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Next match`,onClick:()=>o(n,!1,!1),children:(0,B.jsx)(U,{icon:FD})}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close find`,onClick:()=>vD(e.id),children:(0,B.jsx)(U,{icon:UD})})]})}var uSe=[{label:`Esc`,sequence:`\x1B`},{label:`Tab`,sequence:` `},{label:`↑`,sequence:`\x1B[A`},{label:`↓`,sequence:`\x1B[B`},{label:`←`,sequence:`\x1B[D`},{label:`→`,sequence:`\x1B[C`}];function dSe(e){let t=(0,v.useSyncExternalStore)(aD,oD),[n,r]=(0,v.useState)(null),i=t.status===`active`,a=t.layout[e.projectId],o=a?.activeTab??null,s=a?.tabs.filter(e=>!e.minimized)??[],c=a?.tabs.filter(e=>e.minimized)??[],l=oSe();return(0,v.useEffect)(()=>{i&&mD({type:`select`,projectId:e.projectId,tabId:null})},[e.projectId,i]),t.loaded?(0,B.jsxs)(`div`,{ref:l,className:`flex h-full flex-col text-sm`,children:[(0,B.jsxs)(`header`,{className:F(`flex h-9 flex-none select-none`,s.length===1?`bg-background`:`bg-sidebar`),children:[c.length>0&&(0,B.jsx)(mSe,{projectId:e.projectId,tabs:c,alerts:t.alerts,bordered:s.length>1}),(0,B.jsx)(`div`,{className:`flex min-w-0 flex-1 [scrollbar-width:none] overflow-x-auto`,children:s.map(n=>(0,B.jsx)(pSe,{tabId:n.id,onMinimize:s.length>1?()=>mD({type:`minimizeTab`,id:n.id}):void 0,onRename:()=>r({id:n.id,name:n.customName??``}),children:(0,B.jsxs)(`div`,{className:F(`group/tab text-muted-foreground hover:text-foreground relative flex min-w-28 flex-1 items-center justify-center border-r border-b px-7 text-xs transition-colors last:border-r-0`,n.id===o&&`bg-background text-foreground border-b-transparent`),onMouseDown:e=>e.preventDefault(),onClick:()=>mD({type:`select`,projectId:e.projectId,tabId:n.id}),children:[(0,B.jsx)(`span`,{className:`truncate`,children:dD(n)}),(0,B.jsx)(x9,{id:n.id,className:`ml-1.5 size-1.5 flex-none rounded-full`}),(0,B.jsx)(gSe,{progress:t.progress[n.id]}),(0,B.jsx)(`button`,{className:F(`text-muted-foreground hover:bg-accent hover:text-foreground absolute left-1.5 grid size-4.5 place-items-center rounded opacity-0 transition-opacity group-hover/tab:opacity-100`,n.id===o&&`pointer-coarse:opacity-100`),"aria-label":`Close tab`,onClick:e=>{e.stopPropagation(),h9(n.id)},children:(0,B.jsx)(U,{icon:UD,className:`size-3`})})]})},n.id))}),(0,B.jsx)(`button`,{className:F(`text-muted-foreground hover:text-foreground grid w-8 flex-none place-items-center transition-colors`,s.length>1&&`border-b border-l`),"aria-label":`New tab`,title:`New tab`,onClick:()=>mD({type:`createTab`,projectId:e.projectId}),children:(0,B.jsx)(U,{icon:MD,className:`size-4`})})]}),(0,B.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[o!==null&&(0,B.jsx)(fSe,{id:o},`${t.instance}-${o}`),o!==null&&t.finding===o&&(0,B.jsx)(lSe,{id:o},o),!i&&(0,B.jsx)(`div`,{className:`bg-background/80 animate-in fade-in absolute inset-0 z-20 grid place-items-center p-6 text-center backdrop-blur-md duration-200`,children:(0,B.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`border-foreground/15 border-t-foreground/70 size-6 animate-spin rounded-full border-[3px]`}),(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Connecting. Your terminals keep running while you wait.`})]})})]}),o!==null&&(0,B.jsxs)(`div`,{className:`bg-card hidden flex-none gap-1.5 overflow-x-auto border-t p-1.5 pointer-coarse:flex`,children:[uSe.map(e=>(0,B.jsx)(H,{variant:`secondary`,className:`min-w-11`,onPointerDown:e=>e.preventDefault(),onClick:()=>hD(o,e.sequence),children:e.label},e.label)),(0,B.jsx)(H,{variant:t.ctrl?`default`:`secondary`,className:`min-w-11`,onPointerDown:e=>e.preventDefault(),onClick:yD,children:`Ctrl`})]}),n!==null&&(0,B.jsx)(sSe,{id:n.id,name:n.name,onDone:()=>r(null)},n.id),(0,B.jsx)(cSe,{})]}):(0,B.jsx)(`div`,{className:`text-muted-foreground grid h-full place-items-center p-4 text-xs whitespace-pre-wrap`,children:t.failure===null?`Starting the terminal…`:`The terminal could not start: ${t.failure}`})}function fSe(e){let t=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!t.current)throw Error(`terminal container missing`);return kD(e.id,t.current)},[e.id]),(0,B.jsx)(`div`,{className:`bg-background absolute inset-0 pt-(--pad-top) pr-(--pad-right) pb-(--pad-bottom) pl-(--pad-left)`,ref:t})}function pSe(e){return(0,B.jsxs)(Xxe,{children:[(0,B.jsx)(Zxe,{asChild:!0,children:e.children}),(0,B.jsxs)(Qxe,{children:[(0,B.jsxs)(l9,{onSelect:e.onRename,children:[(0,B.jsx)(U,{icon:YO}),`Rename`]}),e.onMinimize&&(0,B.jsxs)(l9,{onSelect:e.onMinimize,children:[(0,B.jsx)(U,{icon:HO}),`Minimize`]}),(0,B.jsxs)($xe,{checked:oD().quiet.includes(e.tabId),onCheckedChange:()=>vE(e.tabId),children:[(0,B.jsx)(U,{icon:WO}),`Notify when quiet for 10s`]}),(0,B.jsxs)(l9,{variant:`destructive`,onSelect:()=>void h9(e.tabId),children:[(0,B.jsx)(U,{icon:cO}),`Close tab`]})]})]})}function mSe(e){return(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsxs)(`button`,{className:F(`text-muted-foreground hover:text-foreground flex flex-none items-center gap-1 px-2.5 transition-colors`,e.bordered&&`border-r border-b`),"aria-label":`Minimized tabs`,title:`Minimized tabs`,children:[(0,B.jsx)(U,{icon:AO,className:`size-4`}),(0,B.jsx)(hSe,{count:e.tabs.length,alert:e.tabs.some(t=>e.alerts.includes(t.id))})]})}),(0,B.jsx)(pA,{align:`start`,children:e.tabs.map(t=>(0,B.jsxs)(mA,{onSelect:()=>mD({type:`select`,projectId:e.projectId,tabId:t.id}),children:[(0,B.jsx)(`span`,{className:`max-w-80 truncate`,children:dD(t)}),(0,B.jsx)(x9,{id:t.id,className:`size-1.5 flex-none rounded-full`})]},t.id))})]})}function x9(e){return oD().alerts.includes(e.id)?(0,B.jsx)(`span`,{className:F(`bg-primary`,e.className)}):null}function hSe(e){return(0,B.jsx)(`span`,{className:F(`grid h-3.5 min-w-3.5 place-items-center rounded-full px-1 text-[9px] leading-none font-medium tabular-nums`,e.alert?`bg-primary text-primary-foreground`:`text-foreground bg-[color-mix(in_srgb,var(--text)_22%,var(--bg))]`),children:e.count})}function gSe(e){let t=e.progress;return!t||t.state===0?null:t.state===3?(0,B.jsx)(`span`,{className:`bg-primary absolute inset-x-0 bottom-0 h-0.5 animate-pulse`}):(0,B.jsx)(`span`,{className:F(`absolute bottom-0 left-0 h-0.5 transition-[width]`,t.state===1&&`bg-primary`,t.state===2&&`bg-destructive`,t.state===4&&`bg-yellow-500`),style:{width:`${t.state!==1&&t.value===0?100:t.value}%`}})}var S9={running:`Running`,completed:`Done`,failed:`Failed`,stopped:`Stopped`};function C9(e,t){return{agents:e.flatMap(e=>e.kind===`subagent`?[{item:e,agentId:e.agentId,status:T9(e.status,e.agentId,t)}]:[]),tasks:e.flatMap(e=>e.kind===`command`&&e.background!==null?[{item:e,taskId:e.background.taskId,path:e.background.outputPath,events:e.background.events,status:T9(e.status,e.background.taskId,t)}]:[])}}function w9(e){return e.description===``?e.command:e.description}function T9(e,t,n){let r=t===null?void 0:n?.tasks[t];return r===void 0?e===`running`?t===null&&n?.running===!0?`Running`:`Stopped`:S9[e]:S9[r]}function E9(e){return(0,B.jsx)(`span`,{className:F(e.active&&`text-shimmer`),children:e.text})}function _Se(e){return(0,B.jsxs)(`span`,{className:F(`flex min-w-0 items-baseline overflow-hidden text-[13px] leading-4 tracking-[-0.04px]`,e.grouped?`gap-1.5`:`gap-2`),children:[(0,B.jsx)(`span`,{className:F(`text-foreground shrink-0`,e.grouped?`font-normal`:`font-medium`),children:(0,B.jsx)(E9,{text:e.title,active:e.pending})}),e.subtitle!==void 0&&e.subtitle!==``&&(0,B.jsx)(`span`,{className:F(`min-w-0 truncate tabular-nums`,e.grouped?`text-muted-foreground/70`:`text-muted-foreground`),children:e.subtitle}),e.args?.map(t=>(0,B.jsx)(`span`,{className:F(`min-w-0 truncate tabular-nums`,e.grouped?`text-muted-foreground/70`:`text-muted-foreground`),children:t},t))]})}function D9(e){return(0,B.jsx)(`span`,{"aria-hidden":!0,className:F(`text-muted-foreground/70 flex size-6 shrink-0 items-center justify-center transition-opacity`,e.open?`opacity-100`:`opacity-0 group-hover/tool:opacity-100`,e.className),children:(0,B.jsx)(U,{icon:FD,strokeWidth:2.5,className:F(`size-3.5 transition-transform`,!e.open&&`-rotate-90`)})})}function O9(e){let t=e.onToggle,n=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`flex max-w-[calc(100%-24px)] min-w-0 items-center`,children:(0,B.jsx)(_Se,{title:e.title,subtitle:e.subtitle,args:e.args,pending:e.pending,grouped:e.grouped})}),t!==null&&(0,B.jsx)(D9,{open:e.open})]});return(0,B.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col`,children:[t===null?(0,B.jsx)(`div`,{className:F(`flex w-full items-center select-none`,e.grouped?`min-h-7`:`min-h-9`),children:n}):(0,B.jsx)(`button`,{type:`button`,"aria-expanded":e.open,onClick:t,className:F(`group/tool focus-visible:ring-ring/70 flex w-full cursor-pointer items-center rounded-md text-left select-none focus-visible:ring-2 focus-visible:outline-none`,e.grouped?`h-7`:`h-9`),children:n}),e.open&&e.children!==void 0&&(0,B.jsx)(`div`,{className:F(`min-w-0 pt-1`,e.rail!==!1&&`ps-3`),children:e.children})]})}var vSe=new Map([[`build`,`text-blue-400`],[`explore`,`text-yellow-400`],[`plan`,`text-pink-400`],[`review`,`text-green-400`],[`writer`,`text-purple-400`]]),ySe=new Map([[`Running`,`Launched agent`],[`Done`,`Agent finished`],[`Failed`,`Agent failed`],[`Stopped`,`Agent stopped`]]),bSe=new Map([[`Running`,`Started in background`],[`Done`,`Background task finished`],[`Failed`,`Background task failed`],[`Stopped`,`Background task stopped`]]),k9=[`text-sky-400`,`text-amber-400`,`text-fuchsia-400`,`text-emerald-400`,`text-violet-400`,`text-cyan-400`,`text-orange-400`,`text-teal-400`,`text-rose-400`,`text-indigo-400`,`text-lime-400`,`text-red-400`];function A9(e){let t=e.agent,n=t.toLowerCase(),r=0;for(let e of n)r=r*31+e.charCodeAt(0)>>>0;return{name:t[0].toUpperCase()+t.slice(1),description:e.description,tone:vSe.get(n)??k9[r%k9.length]}}function j9(e){return(0,B.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,className:F(`size-4 shrink-0`,e.className),children:[(0,B.jsx)(`path`,{d:`M4 4.5C4 4.22386 4.22386 4 4.5 4H11.5C11.7761 4 12 4.22386 12 4.5V11.5C12 11.7761 11.7761 12 11.5 12H4.5C4.22386 12 4 11.7761 4 11.5V4.5Z`,fill:`currentColor`}),(0,B.jsx)(`path`,{d:`M14.5 1C14.7761 1 15 1.22386 15 1.5V14.5C15 14.7761 14.7761 15 14.5 15H1.5C1.22386 15 1 14.7761 1 14.5V1.5C1 1.22386 1.22386 1 1.5 1H14.5ZM2 14H14V2H2V14Z`,fill:`currentColor`})]})}function M9(e){return(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":!0,className:F(`size-4 shrink-0`,e.className),children:Array.from({length:25},(e,t)=>(0,B.jsx)(`rect`,{x:1+t%5*3,y:1+Math.floor(t/5)*3,width:2,height:2,fill:`currentColor`,className:`agent-dot`,style:{animationDelay:`${(t%5+Math.floor(t/5))*90}ms`}},t))})}function xSe(e){let t=e.item;if(t.kind===`agent_message`){let n=t.target;return(0,B.jsx)(N9,{label:`Messaged agent`,detail:t.summary,pending:e.sending,onOpen:n===null?null:()=>e.onOpen(n)})}if(t.kind===`command`){let n=e.tasks.find(e=>e.item.id===t.id);if(n===void 0)throw Error(`Task ${t.id} is missing from the thread`);return(0,B.jsx)(N9,{label:bSe.get(n.status)??`Background task ${n.status.toLowerCase()}`,detail:w9(n.item),pending:n.status===`Running`,onOpen:()=>e.onOpen(t.id)})}let n=e.agents.find(e=>e.item.id===t.id);if(n===void 0)throw Error(`Agent ${t.id} is missing from the thread`);return(0,B.jsx)(N9,{label:ySe.get(n.status)??`Agent ${n.status.toLowerCase()}`,detail:t.description,pending:n.status===`Running`,onOpen:()=>e.onOpen(t.id)})}function N9(e){let t=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:(0,B.jsx)(E9,{text:e.detail===``?e.label:`${e.label}:`,active:e.pending})}),e.detail!==``&&(0,B.jsx)(`span`,{className:`text-foreground min-w-0 truncate`,children:e.detail})]});return e.onOpen===null?(0,B.jsx)(`div`,{className:`flex min-h-7 min-w-0 items-center gap-1 text-[13px] leading-4 tracking-[-0.04px] select-none`,children:t}):(0,B.jsxs)(`button`,{type:`button`,title:`Open in Tasks panel`,onClick:e.onOpen,className:`group/agent focus-visible:ring-ring/70 flex min-h-7 w-fit max-w-full cursor-pointer items-center gap-1 rounded-md text-left text-[13px] leading-4 tracking-[-0.04px] select-none focus-visible:ring-2 focus-visible:outline-none`,children:[t,(0,B.jsx)(`span`,{className:`text-muted-foreground/70 flex shrink-0 opacity-0 transition-opacity group-hover/agent:opacity-100 group-focus-visible/agent:opacity-100 pointer-coarse:opacity-100`,children:(0,B.jsx)(U,{icon:LD,className:`size-3.5`})})]})}function P9(e){return e.kind===`group`||e.kind===`agent`}function F9(e,t,n){let r=[],i=e.prompt?.id??`start`;e.prompt!==null&&r.push({kind:`user`,key:e.prompt.id,item:e.prompt,first:e.first});for(let t of e.items){let e=CSe(t,n!==null),i=r.at(-1);e?.kind===`group`&&i?.kind===`group`?i.entries.push(...e.entries):e!==null&&r.push(e)}let a=r.at(-1);return n!==null&&n.partial===``&&a?.kind===`group`&&(r[r.length-1]={...a,live:!0}),n!==null&&n.partial!==``&&r.push({kind:`assistant`,key:`${i}:partial`,message:``,text:n.partial,time:null,streaming:!0,meta:!1,changed:new Map}),n!==null&&n.partial===``&&r.push({kind:`working`,key:`${i}:working`}),n===null&&a?.kind===`assistant`&&(r[r.length-1]={...a,meta:!0,changed:SSe(e.items,t)}),r}function SSe(e,t){let n=new Map;for(let r of e){if(r.kind!==`file_change`||r.diffs.length===0)continue;let e=ZB(r),i=tV(r.path,t),a=n.get(i)??{added:0,removed:0};n.set(i,{added:a.added+e.added,removed:a.removed+e.removed})}return n}function CSe(e,t){switch(e.kind){case`assistant`:return{kind:`assistant`,key:e.id,message:e.message,text:e.text,time:e.time,streaming:!1,meta:!1,changed:new Map};case`reasoning`:case`file_change`:case`web_search`:case`skill`:case`tool`:return{kind:`group`,key:`group:${e.id}`,entries:[e],live:!1};case`command`:return e.background===null?{kind:`group`,key:`group:${e.id}`,entries:[e],live:!1}:{kind:`agent`,key:e.id,item:e,live:t};case`subagent`:case`agent_message`:return{kind:`agent`,key:e.id,item:e,live:t};case`plan`:return{kind:`plan`,key:e.id,plan:e.plan};case`question`:return{kind:`question`,key:e.id,item:e};case`notice`:return{kind:`notice`,key:e.id,text:e.text};case`compaction`:return{kind:`notice`,key:e.id,text:`Conversation compacted`};case`error`:return{kind:`error`,key:e.id,text:e.text,time:e.time};case`user`:case`todo_list`:return null}}function I9(e,t,n,r){let i=[],a=!1;for(let t of e)t.parent===null&&(t.kind===`user`?i.push({prompt:t,first:!a,items:[]}):(t.kind!==`notice`&&t.kind!==`error`&&t.kind!==`compaction`&&(a=!0),i.length===0&&i.push({prompt:null,first:!0,items:[]}),i[i.length-1].items.push(t)));let o=i.flatMap((e,a)=>F9(e,t,n&&a===i.length-1?{partial:r}:null));return n&&i.length===0&&o.push({kind:`working`,key:`working`}),o}function wSe(e){let t={name:``,path:``,stat:{added:0,removed:0},directories:new Map,files:[]};for(let[n,r]of e){let e=n.replaceAll(`\\`,`/`).split(`/`).filter(e=>e!==``),i=e.at(-1);if(i===void 0)continue;let a=[t],o=t;for(let t of e.slice(0,-1)){let e=o.directories.get(t)??{name:t,path:o.path===``?t:`${o.path}/${t}`,stat:{added:0,removed:0},directories:new Map,files:[]};o.directories.set(t,e),o=e,a.push(o)}o.files.push({kind:`file`,name:i,path:e.join(`/`),stat:r});for(let e of a)e.stat.added+=r.added,e.stat.removed+=r.removed}return R9(t)}function L9(e,t){return e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`})}function R9(e){return[...[...e.directories.values()].sort(L9).map(e=>TSe({kind:`directory`,name:e.name,path:e.path,stat:{...e.stat},children:R9(e)})),...[...e.files].sort(L9)]}function TSe(e){let t=e;for(;t.children.length===1&&t.children[0].kind===`directory`;){let e=t.children[0];t={kind:`directory`,name:`${t.name}/${e.name}`,path:e.path,stat:e.stat,children:e.children}}return t}function ESe(e){let[t,n]=(0,v.useState)(!1),r=[...e.files],i=Ce(r,e=>e[1].added),a=Ce(r,e=>e[1].removed),o=r.some(([e])=>/[/\\]/.test(e)),s=t?`Collapse all folders`:`Expand all folders`;return(0,B.jsxs)(`div`,{className:`bg-secondary dark:bg-input/20 @container/changed-files mt-4 rounded-lg`,children:[(0,B.jsxs)(`div`,{className:`bg-secondary dark:bg-background dark:from-input/20 dark:to-input/20 sticky top-2 z-10 flex items-center justify-between gap-2 rounded-t-lg px-3 py-2 dark:bg-linear-to-b`,children:[(0,B.jsxs)(`div`,{className:`text-foreground flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-xs font-medium`,children:[(0,B.jsxs)(`span`,{children:[r.length,` changed file`,r.length===1?``:`s`]}),(i>0||a>0)&&(0,B.jsx)(z9,{added:i,removed:a,layout:`inline`,className:`text-xs leading-4`})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[o&&(0,B.jsx)($z,{label:s,children:(0,B.jsx)(H,{type:`button`,size:`icon-xs`,variant:`ghost-muted`,"aria-label":s,onClick:()=>n(!t),children:(0,B.jsx)(U,{icon:t?ZD:vk,className:`size-3`})})}),(0,B.jsx)($z,{label:`Open the full diff`,children:(0,B.jsxs)(H,{type:`button`,size:`xs`,variant:`ghost-muted`,"aria-label":`Open diff`,onClick:e.onOpenDiff,children:[(0,B.jsx)(U,{icon:fO,className:`size-3`}),(0,B.jsx)(`span`,{className:`hidden @[24rem]/changed-files:inline`,children:`Open diff`})]})})]})]}),(0,B.jsx)(DSe,{files:e.files,allExpanded:t,onOpenDiff:e.onOpenDiff},String(t))]})}function DSe(e){let[t,n]=(0,v.useState)({}),r=wSe(e.files),i=r.some(e=>e.kind===`directory`),a=`group hover:bg-accent/60 focus-visible:ring-ring focus-visible:ring-offset-background flex w-full items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-none focus-visible:ring-inset`;function o(r,s){let c=`${8+s*14}px`;if(r.kind===`directory`){let i=t[r.path]??e.allExpanded;return(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":i,className:a,style:{paddingLeft:c},onClick:()=>n({...t,[r.path]:!i}),children:[(0,B.jsx)(U,{icon:YD,"aria-hidden":!0,className:F(`text-muted-foreground/70 group-hover:text-foreground/80 size-3.5 shrink-0 transition-transform`,i&&`rotate-90`)}),(0,B.jsx)(U,{icon:i?mO:hO,className:`text-muted-foreground/75 size-3.5 shrink-0`}),(0,B.jsx)(`span`,{className:`text-2xs text-muted-foreground/90 group-hover:text-foreground/90 truncate font-mono`,children:r.name}),(r.stat.added>0||r.stat.removed>0)&&(0,B.jsx)(`span`,{className:`text-3xs ml-auto shrink-0 font-mono tabular-nums`,children:(0,B.jsx)(z9,{added:r.stat.added,removed:r.stat.removed,layout:`aligned`})})]}),i&&(0,B.jsx)(`div`,{children:r.children.map(e=>o(e,s+1))})]},`dir:${r.path}`)}return(0,B.jsxs)(`button`,{type:`button`,className:a,style:{paddingLeft:c},onClick:e.onOpenDiff,children:[(i||s>0)&&(0,B.jsx)(`span`,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,B.jsx)(Uz,{path:r.path,className:`text-muted-foreground/70 size-3.5`}),(0,B.jsx)(`span`,{className:`text-foreground/85 group-hover:text-foreground flex min-w-0 font-mono text-xs`,children:(0,B.jsx)(`span`,{className:`truncate`,children:r.name})}),(0,B.jsx)(`span`,{className:`text-3xs ml-auto shrink-0 font-mono tabular-nums`,children:(0,B.jsx)(z9,{added:r.stat.added,removed:r.stat.removed,layout:`aligned`})})]},`file:${r.path}`)}return(0,B.jsx)(`div`,{className:`p-2`,children:r.map(e=>o(e,0))})}function z9(e){return(0,B.jsxs)(`span`,{role:`group`,"aria-label":`${e.added} additions, ${e.removed} deletions`,className:F(e.layout===`inline`?`inline-flex items-center gap-1 align-middle tabular-nums`:`inline-grid grid-cols-[4ch_4ch] gap-2 text-right align-middle tabular-nums`,e.className),children:[(0,B.jsxs)(`span`,{"aria-hidden":!0,className:`text-diff-addition font-mono`,children:[`+`,ff(e.added)]}),(0,B.jsxs)(`span`,{"aria-hidden":!0,className:`text-diff-deletion font-mono`,children:[`-`,ff(e.removed)]})]})}function OSe(e){let[t,n]=(0,v.useState)(!1),r=eB(),i=e.plan,a=B9(i),o=i.length>900||i.split(`
1197
+ `},renderHeaderPrefix:()=>(0,B.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground flex size-5 cursor-pointer items-center justify-center`,"aria-label":t?`Expand file`:`Collapse file`,onClick:()=>f(t?u.filter(t=>t!==e.name):[...u,e.name]),children:(0,B.jsx)(U,{icon:t?YD:JD,className:`size-3.5`})})},e.name)})]})]})}function Hhe(e,t,n){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{if(t===null||n)return;let r=!0;M(e,`git.status`,{projectId:t}).then(n=>{r&&i({key:Ze(e,t),status:n})},Wd);function a(){o(e=>e+1)}return window.addEventListener(`focus`,a),()=>{r=!1,window.removeEventListener(`focus`,a)}},[e,t,n,a]),{status:r!==null&&t!==null&&r.key===Ze(e,t)?r.status:null,setStatus:n=>i(t===null?null:{key:Ze(e,t),status:n}),refresh:()=>o(e=>e+1)}}function Uhe(e){let t=e.status,[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(!1),o=t.upstream===null||t.ahead>0;async function s(t){a(!0);try{await t()}catch(e){Wd(e)}finally{a(!1),e.onRefresh()}}function c(){s(async()=>{e.onStatus(await M(e.machine,`git.push`,{projectId:e.projectId}))})}function l(){s(async()=>{let t=await M(e.machine,`git.pullRequest`,{projectId:e.projectId});window.open(t.url,`_blank`,`noopener`)})}let u=t.changed>0?{label:`Commit`,icon:(0,B.jsx)(U,{icon:gO}),run:()=>r(!0)}:o?{label:`Push`,icon:(0,B.jsx)(U,{icon:tO}),run:c}:{label:`Create PR`,icon:(0,B.jsx)(U,{icon:yO}),run:l};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex w-fit`,children:[(0,B.jsxs)(H,{variant:`outline`,size:`xs`,className:`rounded-e-none border-e-0`,disabled:i,onClick:u.run,children:[u.icon,(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:u.label})]}),(0,B.jsx)(`div`,{className:`bg-input dark:bg-input/32 w-px`}),(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,size:`icon-xs`,className:`rounded-s-none border-s-0`,disabled:i,"aria-label":`Git actions`,children:(0,B.jsx)(U,{icon:JD,className:`size-4`})})}),(0,B.jsxs)(pA,{align:`end`,className:`w-56`,children:[(0,B.jsx)(vA,{children:t.upstream??`No upstream branch`}),(0,B.jsxs)(mA,{disabled:t.changed===0,onSelect:()=>r(!0),children:[(0,B.jsx)(U,{icon:gO}),`Commit `,t.changed,` `,t.changed===1?`change`:`changes`,`…`]}),(0,B.jsxs)(mA,{disabled:!o,onSelect:c,children:[(0,B.jsx)(U,{icon:tO}),`Push`,t.ahead>0&&(0,B.jsxs)(`span`,{className:`text-muted-foreground ml-auto text-xs tabular-nums`,children:[`↑`,t.ahead]})]}),(0,B.jsx)(yA,{}),(0,B.jsxs)(mA,{onSelect:l,children:[(0,B.jsx)(U,{icon:yO}),`Create pull request`]})]})]})]}),(0,B.jsx)(Whe,{machine:e.machine,projectId:e.projectId,open:n,onClose:()=>r(!1),onDone:t=>{e.onStatus(t),r(!1)}})]})}function Whe(e){let t=R(t=>Md(t,e.machine,e.projectId)?.path),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null);async function c(t,i){a(t),s(null);try{if(t===`generate`){let t=await M(e.machine,`git.message`,{projectId:e.projectId});r(t.message);return}let a=await M(e.machine,`git.commit`,{projectId:e.projectId,message:n});r(``),e.onDone(i?await M(e.machine,`git.push`,{projectId:e.projectId}):a)}catch(e){s(Vn(e))}finally{a(null)}}return(0,B.jsx)(Y0,{open:e.open,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`sm:max-w-lg`,children:[(0,B.jsxs)(Q0,{children:[(0,B.jsx)(e2,{children:`Commit changes`}),(0,B.jsxs)(t2,{children:[`Stages every change in `,t,` and commits it.`]})]}),(0,B.jsx)(`textarea`,{value:n,onChange:e=>r(e.target.value),placeholder:`Commit message`,rows:5,className:`bg-background focus:border-ring/60 w-full resize-none rounded-lg border px-3 py-2 font-mono text-xs outline-none`}),o!==null&&(0,B.jsx)(`p`,{className:`text-destructive text-xs whitespace-pre-wrap`,children:o}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsxs)(H,{variant:`outline`,size:`sm`,disabled:i!==null,onClick:()=>void c(`generate`,!1),children:[(0,B.jsx)(U,{icon:uk}),i===`generate`?`Writing…`:`Write message`]}),(0,B.jsx)(`span`,{className:`flex-1`}),(0,B.jsx)(H,{variant:`outline`,size:`sm`,disabled:i!==null||n.trim()===``,onClick:()=>void c(`commit`,!0),children:`Commit and push`}),(0,B.jsx)(H,{size:`sm`,disabled:i!==null||n.trim()===``,onClick:()=>void c(`commit`,!1),children:`Commit`})]})]})})}function a2({...e}){return(0,B.jsx)(xee,{"data-slot":`alert-dialog`,...e})}function o2({...e}){return(0,B.jsx)(See,{"data-slot":`alert-dialog-trigger`,...e})}function Ghe({...e}){return(0,B.jsx)(Cee,{"data-slot":`alert-dialog-portal`,...e})}function Khe({className:e,...t}){return(0,B.jsx)(wee,{"data-slot":`alert-dialog-overlay`,className:F(`fixed inset-0 z-50 bg-background/80 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function s2({className:e,size:t=`default`,...n}){return(0,B.jsxs)(Ghe,{children:[(0,B.jsx)(Khe,{}),(0,B.jsx)(Dee,{"data-slot":`alert-dialog-content`,"data-size":t,className:F(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function c2({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:F(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function l2({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:F(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function u2({className:e,...t}){return(0,B.jsx)(Oee,{"data-slot":`alert-dialog-title`,className:F(`text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function d2({className:e,...t}){return(0,B.jsx)(kee,{"data-slot":`alert-dialog-description`,className:F(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function f2({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,B.jsx)(H,{variant:t,size:n,asChild:!0,children:(0,B.jsx)(Aee,{"data-slot":`alert-dialog-action`,className:F(e),...r})})}function p2({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,B.jsx)(H,{variant:t,size:n,asChild:!0,children:(0,B.jsx)(__,{"data-slot":`alert-dialog-cancel`,className:F(e),...r})})}function m2({...e}){return(0,B.jsx)(lS,{"data-slot":`select`,...e})}function h2({...e}){return(0,B.jsx)(pS,{"data-slot":`select-value`,...e})}function g2({className:e,size:t=`default`,children:n,...r}){return(0,B.jsxs)(dS,{"data-slot":`select-trigger`,"data-size":t,className:F(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,B.jsx)(mS,{asChild:!0,children:(0,B.jsx)(U,{icon:vk,className:`text-muted-foreground pointer-events-none size-4`})})]})}function _2({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,B.jsx)(_S,{children:(0,B.jsxs)(yS,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:F(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,B.jsx)(qhe,{}),(0,B.jsx)(jS,{"data-position":n,className:F(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,B.jsx)(Jhe,{})]})})}function v2({className:e,children:t,...n}){return(0,B.jsxs)(FS,{"data-slot":`select-item`,className:F(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,B.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,B.jsx)(zS,{children:(0,B.jsx)(U,{icon:KD,className:`pointer-events-none`})})}),(0,B.jsx)(LS,{children:t})]})}function qhe({className:e,...t}){return(0,B.jsx)(VS,{"data-slot":`select-scroll-up-button`,className:F(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,B.jsx)(U,{icon:XD})})}function Jhe({className:e,...t}){return(0,B.jsx)(US,{"data-slot":`select-scroll-down-button`,className:F(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,B.jsx)(U,{icon:JD})})}function y2({className:e,size:t=`default`,...n}){return(0,B.jsx)(sC,{"data-slot":`switch`,"data-size":t,className:F(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,B.jsx)(lC,{"data-slot":`switch-thumb`,className:`bg-background dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0`})})}function b2(e){return(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`h2`,{className:`text-muted-foreground mb-2 px-1 text-xs font-medium`,children:[e.title,e.note&&(0,B.jsxs)(`span`,{className:`font-normal`,children:[` · `,e.note]})]}),(0,B.jsx)(`div`,{className:`divide-y overflow-hidden rounded-xl border`,children:e.children})]})}function x2(e){return(0,B.jsxs)(`label`,{className:`flex min-h-13 items-center justify-between gap-4 px-4 py-2.5`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),(0,B.jsx)(`div`,{className:`shrink-0`,children:e.children})]})}function S2(e){let[t,n]=(0,v.useState)(e.value);function r(){t!==e.value&&(e.valid&&!e.valid(t)?n(e.value):e.onCommit(t))}return(0,B.jsx)(xV,{className:F(`w-56`,e.className),type:e.type,min:e.type===`number`?0:void 0,step:e.step,placeholder:e.placeholder,value:t,onChange:e=>n(e.target.value),onBlur:r,onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}})}function C2(e){return(0,B.jsx)(S2,{type:`number`,className:`w-24`,step:e.step??1,value:String(e.value),valid:e=>e!==``&&Number(e)>=0,onCommit:t=>e.onCommit(Number(t))},e.value)}function Yhe(e){let t=e.prefs;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(b2,{title:`Appearance`,children:(0,B.jsx)(x2,{label:`Theme`,children:(0,B.jsxs)(m2,{value:t.theme,onValueChange:e=>Ud({...t,theme:e}),children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsx)(_2,{children:Un.map(e=>(0,B.jsx)(v2,{value:e.id,children:e.name},e.id))})]})})}),(0,B.jsx)(Xhe,{}),(0,B.jsx)(H,{variant:`outline`,onClick:e.onRestore,children:`Restore browser defaults`})]})}function Xhe(){let[e,t]=(0,v.useState)(`idle`),[n,r]=(0,v.useState)(null);async function i(){t(`checking`),r(null);try{let e=`serviceWorker`in navigator?await navigator.serviceWorker.getRegistration():void 0;if(e===void 0){location.reload();return}await e.update(),t(e.installing===null&&e.waiting===null?`current`:`updating`)}catch(e){console.error(`could not check for updates`,e),r(Vn(e)),t(`idle`)}}return(0,B.jsx)(b2,{title:`App`,children:(0,B.jsx)(x2,{label:`Load the newest version of OffSite in this browser`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[n!==null&&(0,B.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Could not check: `,n]}),e===`current`&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Up to date`}),e===`updating`&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Updating, the page reloads when it's ready`}),(0,B.jsx)(H,{size:`sm`,variant:`outline`,disabled:e===`checking`||e===`updating`,onClick:()=>void i(),children:`Check for updates`})]})})})}function Zhe(e){for(let t=0;t<e.length;t++){let n=e[t];if(!n.startsWith(`-`)&&!n.startsWith(`+`))return!1;let r=n.startsWith(`-`),i=n.slice(1);if(i===``||i===`-`)return!1;if(i.startsWith(`-`)){if(!w2(i.slice(1),r))return!1}else for(let n=0;n<i.length;n++){let a=i[n];if(a===`o`){let a=i.slice(n+1);if(a===``){if(t++,t===e.length)return!1;a=e[t]}if(!w2(a,r))return!1;break}if(a===`b`||a===`c`||r&&`dfnprvx`.includes(a)||!r&&a===`i`)return!1}}return!0}function w2(e,t){let n=e.toLowerCase().replace(/[-_]/g,``),r=t;return n.startsWith(`no`)&&(n=n.slice(2),r=!t),[`rcs`,`globalrcs`,`interactive`,`exec`].includes(n)?r:![`privileged`,`restricted`,`sourcetrace`,`verbose`,`xtrace`].includes(n)||!r}function Qhe(e,t,n){if(t===`windows`)return`Not available on Windows`;if(e!==null&&/[\n"'\\$`;&|<>()*?[\]{}#!]/.test(e))return`Not available for commands with shell syntax`;let r=e===null?[n]:e.split(/[ \t]/).filter(e=>e!==``);if(r.length===0)return`Available for bash, zsh and fish`;let i=r[0],a=i.split(`/`).pop(),o=r.slice(1);return a===`bash`?t===`macos`&&(i===`/bin/bash`||!i.includes(`/`))?`Needs a newer bash than the one macOS includes`:o.every(e=>[`-l`,`--login`,`-i`].includes(e))?null:`Not available with these bash options`:a===`zsh`?Zhe(o)?null:`Not available with these zsh options`:a===`fish`?o.every(e=>{if(e.startsWith(`--`)){let t=e.slice(2).split(`=`)[0];return t===``||![`command`,`no-config`,`no-execute`].some(e=>e.startsWith(t))}return!(e.startsWith(`-`)&&/[cNn]/.test(e))})?null:`Not available with these fish options`:`Available for bash, zsh and fish`}var T2=[1,2,3,5,10,15,30,60];function $he(e){let t=e.config,n=t.autoResolve;function r(r){Yd(e.machine,{...t,autoResolve:{...n,...r}})}return(0,B.jsxs)(b2,{title:`Agents`,children:[(0,B.jsx)(x2,{label:`Send while working`,children:(0,B.jsxs)(m2,{value:t.delivery,onValueChange:n=>{if(n!==`queue`&&n!==`steer`)throw Error(`Unknown delivery ${n}`);Yd(e.machine,{...t,delivery:n})},children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`queue`,children:`Queue messages`}),(0,B.jsx)(v2,{value:`steer`,children:`Steer the agent`})]})]})}),(0,B.jsx)(x2,{label:`Auto-submit questions`,children:(0,B.jsx)(E2,{value:n.questions,onChange:e=>r({questions:e})})}),(0,B.jsx)(x2,{label:`Auto-resolve permissions`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n.permissions!==null&&(0,B.jsxs)(m2,{value:n.permissionDecision,onValueChange:e=>{if(e!==`allow`&&e!==`deny`)throw Error(`Unknown decision ${e}`);r({permissionDecision:e})},children:[(0,B.jsx)(g2,{className:`w-24`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`allow`,children:`Allow`}),(0,B.jsx)(v2,{value:`deny`,children:`Deny`})]})]}),(0,B.jsx)(E2,{value:n.permissions,onChange:e=>r({permissions:e})})]})})]})}function E2(e){let t=e.value===null||T2.includes(e.value)?T2:[...T2,e.value].sort((e,t)=>e-t);return(0,B.jsxs)(m2,{value:e.value===null?`off`:String(e.value),onValueChange:t=>e.onChange(t===`off`?null:Number(t)),children:[(0,B.jsx)(g2,{className:`w-40`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`off`,children:`Off`}),t.map(e=>(0,B.jsx)(v2,{value:String(e),children:e===60?`After 1 hour`:`After ${e} ${e===1?`minute`:`minutes`}`},e))]})]})}function ege(e){let t=e.config.commitMessage,[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(t.provider===null)return;let n=!0;return r(null),a(null),M(e.machine,`capabilities`,{provider:t.provider,accountId:t.accountId,projectId:null}).then(e=>{n&&r(e.models)},e=>{n&&a(Vn(e))}),()=>{n=!1}},[e.machine,t.provider,t.accountId]);function o(t){Yd(e.machine,{...e.config,commitMessage:t})}function s(t){if(t===`off`){o({provider:null,accountId:null,model:null});return}if(t===`opencode`){o({provider:`opencode`,accountId:null,model:null});return}let n=[...e.claudeAccounts,...e.codexAccounts].find(e=>e.id===t);if(n===void 0)throw Error(`That account was removed`);o({provider:n.provider,accountId:n.id,model:null})}return(0,B.jsxs)(b2,{title:`Commit messages`,children:[(0,B.jsx)(x2,{label:`Account`,children:(0,B.jsxs)(m2,{value:t.provider===null?`off`:t.provider===`opencode`?`opencode`:t.accountId??`off`,onValueChange:s,children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`off`,children:`Off`}),[...e.claudeAccounts,...e.codexAccounts].map(e=>(0,B.jsxs)(v2,{value:e.id,disabled:!e.valid,children:[(0,B.jsx)(sA,{provider:e.provider,className:`size-4`}),`${sf[e.provider]} · ${e.name}`]},e.id)),e.openCode.available&&(0,B.jsxs)(v2,{value:`opencode`,children:[(0,B.jsx)(sA,{provider:`opencode`,className:`size-4`}),sf.opencode]})]})]})}),t.provider!==null&&(0,B.jsx)(x2,{label:`Model`,children:(0,B.jsxs)(m2,{value:t.model??void 0,disabled:n===null,onValueChange:e=>o({...t,model:e}),children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{placeholder:i===null?n===null?`Loading…`:`Choose a model`:`Unavailable`})}),(0,B.jsx)(_2,{children:(n??[]).filter(e=>!e.hidden||e.value===t.model).map(e=>(0,B.jsx)(v2,{value:e.value,children:e.name},e.value))})]})}),i!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-4 py-3 text-xs`,children:i})]})}var tge={zsh:`M11.415 5.038a.58.58 0 0 0-.543.197L.135 18.021a.58.58 0 0 0 .071.814.58.58 0 0 0 .815-.07L11.757 5.979a.58.58 0 0 0-.07-.815.6.6 0 0 0-.272-.126m-8.113.317a3.133 3.133 0 0 0-3.12 3.12 3.13 3.13 0 0 0 3.12 3.119A3.133 3.133 0 0 0 6.42 8.475a3.13 3.13 0 0 0-3.119-3.119m0 1.806a1.3 1.3 0 0 1 1.314 1.313 1.3 1.3 0 0 1-1.314 1.312A1.3 1.3 0 0 1 1.99 8.475a1.3 1.3 0 0 1 1.312-1.314m5.253 5.253a3.13 3.13 0 0 0-3.119 3.119 3.13 3.13 0 0 0 3.12 3.118 3.133 3.133 0 0 0 3.118-3.12 3.133 3.133 0 0 0-3.119-3.118m0 1.805a1.3 1.3 0 0 1 1.313 1.314c0 .735-.577 1.312-1.312 1.312a1.3 1.3 0 0 1-1.314-1.312 1.3 1.3 0 0 1 1.313-1.314m7.201 3.276a.58.58 0 0 0-.578.578.58.58 0 0 0 .578.578h7.666a.58.58 0 0 0 .579-.578.58.58 0 0 0-.579-.578Z`,bash:`M21.038,4.9l-7.577-4.498C13.009,0.134,12.505,0,12,0c-0.505,0-1.009,0.134-1.462,0.403L2.961,4.9 C2.057,5.437,1.5,6.429,1.5,7.503v8.995c0,1.073,0.557,2.066,1.462,2.603l7.577,4.497C10.991,23.866,11.495,24,12,24 c0.505,0,1.009-0.134,1.461-0.402l7.577-4.497c0.904-0.537,1.462-1.529,1.462-2.603V7.503C22.5,6.429,21.943,5.437,21.038,4.9z M15.17,18.946l0.013,0.646c0.001,0.078-0.05,0.167-0.111,0.198l-0.383,0.22c-0.061,0.031-0.111-0.007-0.112-0.085L14.57,19.29 c-0.328,0.136-0.66,0.169-0.872,0.084c-0.04-0.016-0.057-0.075-0.041-0.142l0.139-0.584c0.011-0.046,0.036-0.092,0.069-0.121 c0.012-0.011,0.024-0.02,0.036-0.026c0.022-0.011,0.043-0.014,0.062-0.006c0.229,0.077,0.521,0.041,0.802-0.101 c0.357-0.181,0.596-0.545,0.592-0.907c-0.003-0.328-0.181-0.465-0.613-0.468c-0.55,0.001-1.064-0.107-1.072-0.917 c-0.007-0.667,0.34-1.361,0.889-1.8l-0.007-0.652c-0.001-0.08,0.048-0.168,0.111-0.2l0.37-0.236 c0.061-0.031,0.111,0.007,0.112,0.087l0.006,0.653c0.273-0.109,0.511-0.138,0.726-0.088c0.047,0.012,0.067,0.076,0.048,0.151 l-0.144,0.578c-0.011,0.044-0.036,0.088-0.065,0.116c-0.012,0.012-0.025,0.021-0.038,0.028c-0.019,0.01-0.038,0.013-0.057,0.009 c-0.098-0.022-0.332-0.073-0.699,0.113c-0.385,0.195-0.52,0.53-0.517,0.778c0.003,0.297,0.155,0.387,0.681,0.396 c0.7,0.012,1.003,0.318,1.01,1.023C16.105,17.747,15.736,18.491,15.17,18.946z M19.143,17.859c0,0.06-0.008,0.116-0.058,0.145 l-1.916,1.164c-0.05,0.029-0.09,0.004-0.09-0.056v-0.494c0-0.06,0.037-0.093,0.087-0.122l1.887-1.129 c0.05-0.029,0.09-0.004,0.09,0.056V17.859z M20.459,6.797l-7.168,4.427c-0.894,0.523-1.553,1.109-1.553,2.187v8.833 c0,0.645,0.26,1.063,0.66,1.184c-0.131,0.023-0.264,0.039-0.398,0.039c-0.42,0-0.833-0.114-1.197-0.33L3.226,18.64 c-0.741-0.44-1.201-1.261-1.201-2.142V7.503c0-0.881,0.46-1.702,1.201-2.142l7.577-4.498c0.363-0.216,0.777-0.33,1.197-0.33 c0.419,0,0.833,0.114,1.197,0.33l7.577,4.498c0.624,0.371,1.046,1.013,1.164,1.732C21.686,6.557,21.12,6.411,20.459,6.797z`,fish:`m19.164 9.228-3.016 2.688v.527l3.016 2.688v-1.228l-1.936-1.723 1.936-1.724V9.228m-6.658.046v1.208l1.905 1.696-1.905 1.695v1.209l2.968-2.645v-.518l-2.968-2.645M9.781 7.847a6.519 6.519 0 0 0-2.038-.335c-.672 0-1.349.112-2.03.335a9.23 9.23 0 0 0-2.088 1.017v.723c.69-.4 1.377-.7 2.06-.897a7.388 7.388 0 0 1 2.058-.296c.684 0 1.368.098 2.052.296a9.452 9.452 0 0 1 2.075.897v-.723a9.229 9.229 0 0 0-2.09-1.017m.014 7.78a7.371 7.371 0 0 1-2.052.296 7.388 7.388 0 0 1-2.057-.296 9.18 9.18 0 0 1-2.061-.897v.723a9.228 9.228 0 0 0 2.088 1.017 6.492 6.492 0 0 0 2.03.335c.678 0 1.357-.112 2.038-.335a9.227 9.227 0 0 0 2.089-1.017v-.723c-.7.4-1.391.7-2.075.897m.602-11.23h-.51L7.28 6.92h1.19l1.672-1.62 1.671 1.62h1.191l-2.607-2.525m-2.965 13.68v-.824H6.427v.825l.786 1.527h.614l-.395-1.527M4.127 10.95v1.216H5.13V10.95H4.127m-1.16-1.695L0 11.901v.518l2.967 2.645v-1.208L1.063 12.16l1.904-1.695V9.256m20.68 3.28c-.235-.3-.574-.509-1.017-.626.395-.103.696-.278.902-.525.206-.247.31-.556.31-.926 0-.546-.197-.984-.59-1.314-.393-.33-.919-.495-1.575-.495-.22 0-.473.025-.758.073-.284.048-.61.12-.974.217v.84c.314-.12.613-.21.9-.27a4.05 4.05 0 0 1 .832-.091c.403 0 .714.093.933.278.218.185.328.451.328.798 0 .328-.118.584-.353.768-.235.184-.562.276-.98.276h-.697v.75h.696c.458 0 .821.116 1.09.346.268.23.402.542.402.934 0 .425-.134.75-.402.976-.269.226-.653.339-1.153.339a3.55 3.55 0 0 1-.89-.117 4.395 4.395 0 0 1-.91-.358v.909a6.1 6.1 0 0 0 .95.249c.323.057.639.085.95.085.738 0 1.315-.177 1.733-.53.417-.355.626-.842.626-1.463 0-.449-.118-.823-.353-1.123`,powershell:`M23.181 2.974c.568 0 .923.463.792 1.035l-3.659 15.982c-.13.572-.697 1.035-1.265 1.035H.819c-.568 0-.923-.463-.792-1.035L3.686 4.009c.13-.572.697-1.035 1.265-1.035zm-8.375 9.346c.251-.394.227-.905-.09-1.243L9.122 5.125c-.38-.404-1.037-.407-1.466-.003-.429.402-.468 1.056-.088 1.46l4.662 4.96v.11l-7.42 5.374c-.45.327-.533.977-.187 1.453.346.476.991.597 1.44.27l8.229-5.91c.28-.196.438-.365.514-.52zm-2.796 4.399a.928.928 0 00-.934.923c0 .51.418.923.934.923h4.433a.928.928 0 00.934-.923.928.928 0 00-.934-.923z`,cmd:`M8.165 6V3h7.665v3H8.165zm-.5-3H1c-.55 0-1 .45-1 1v2h7.665V3zM23 3h-6.67v3H24V4c0-.55-.45-1-1-1zM0 6.5h24V20c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V6.5zM11.5 18c0 .3.2.5.5.5h8c.3 0 .5-.2.5-.5v-1.5c0-.3-.2-.5-.5-.5h-8c-.3 0-.5.2-.5.5V18zm-5.2-4.55l-3.1 3.1c-.25.25-.25.6 0 .8l.9.9c.25.25.6.25.8 0l4.4-4.4a.52.52 0 0 0 0-.8l-4.4-4.4c-.2-.2-.6-.2-.8 0l-.9.9c-.25.2-.25.55 0 .8l3.1 3.1z`},D2={zsh:`zsh`,bash:`bash`,fish:`fish`,pwsh:`powershell`,powershell:`powershell`,cmd:`cmd`},nge={macos:[`zsh`,`bash`,`fish`,`pwsh`],linux:[`bash`,`zsh`,`fish`,`pwsh`],windows:[`pwsh`,`powershell`,`cmd`]};function rge(e){let t=e.trim().split(/[\\/]/).pop()?.toLowerCase().replace(/\.exe$/,``);return t===void 0?void 0:D2[t]}function ige(e){return e.replace(/[\\/][^\\/]*$/,``)}function O2(e){return(0,B.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-4 flex-none`,fill:`currentColor`,children:(0,B.jsx)(`path`,{d:tge[e.logo]})})}function age(e){let[t,n]=(0,v.useState)(e.value??``),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),s=rge(t),c=e.platform===e.device,l=c?r:nge[e.platform].map(e=>({name:e,path:null}));(0,v.useEffect)(()=>{c&&M(e.machine,`terminal.shells`,void 0).then(i,e=>o(Vn(e)))},[e.machine,c]);function u(t){n(t),t!==(e.value??``)&&e.onCommit(t===``?null:t)}return(0,B.jsxs)(`div`,{className:`relative w-56`,children:[s&&(0,B.jsx)(`span`,{className:`text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2`,children:(0,B.jsx)(O2,{logo:s})}),(0,B.jsx)(xV,{className:s?`pr-9 pl-8`:`pr-9`,placeholder:`System default`,value:t,onChange:e=>n(e.target.value),onBlur:()=>u(t),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}}),(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsx)(H,{variant:`ghost`,size:`icon-xs`,"aria-label":`Known shells`,className:`text-muted-foreground absolute top-1/2 right-1.5 -translate-y-1/2`,children:(0,B.jsx)(U,{icon:FD})})}),(0,B.jsxs)(pA,{align:`end`,className:`w-72`,children:[a&&(0,B.jsx)(`p`,{className:`text-destructive px-2 py-1.5 text-xs`,children:a}),l?.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground px-2 py-1.5 text-xs`,children:`No known shells found`}),l?.map(e=>(0,B.jsxs)(mA,{onSelect:()=>u(e.path??e.name),children:[(0,B.jsx)(O2,{logo:D2[e.name]}),e.name,e.path!==null&&(0,B.jsx)(`span`,{className:`text-muted-foreground ml-auto min-w-0 truncate pl-3 text-xs [direction:rtl]`,title:e.path,children:(0,B.jsx)(`bdi`,{children:ige(e.path)})})]},e.path??e.name)),(0,B.jsx)(yA,{}),(0,B.jsx)(mA,{onSelect:()=>u(``),children:`System default`})]})]})]})}function oge(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(sge,{machine:e.machine,config:e.config,platform:e.platform,defaultShell:e.defaultShell},e.machine),(0,B.jsx)($he,{machine:e.machine,config:e.config}),(0,B.jsx)(ege,{machine:e.machine,config:e.config,claudeAccounts:e.claudeAccounts,codexAccounts:e.codexAccounts,openCode:e.openCode},`git-${e.machine}`),(0,B.jsx)(H,{variant:`outline`,onClick:e.onRestore,children:`Restore machine defaults`})]})}function sge(e){let t=e.config.terminal,[n,r]=(0,v.useState)(e.platform),i=Qhe(t.shell[e.platform],e.platform,e.defaultShell);function a(t){Yd(e.machine,{...e.config,terminal:t})}return(0,B.jsxs)(b2,{title:`Shell`,note:`Applies to new terminals`,children:[(0,B.jsx)(x2,{label:`Platform`,children:(0,B.jsxs)(m2,{value:n,onValueChange:e=>r(e),children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsx)(_2,{children:VE.map(t=>(0,B.jsxs)(v2,{value:t.value,children:[t.label,t.value===e.platform&&(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`(this machine)`})]},t.value))})]})}),(0,B.jsx)(x2,{label:`Command`,children:(0,B.jsx)(age,{machine:e.machine,platform:n,device:e.platform,value:t.shell[n],onCommit:e=>a({...t,shell:{...t.shell,[n]:e}})},`${e.machine}-${n}-command`)}),(0,B.jsx)(x2,{label:(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Shell integration`,(0,B.jsx)($z,{label:(0,B.jsxs)(`div`,{children:[`Tells the terminal where prompts and commands start and end.`,(0,B.jsxs)(`ul`,{className:`mt-1 list-disc pl-4`,children:[(0,B.jsx)(`li`,{children:`Click in the command line to move the cursor`}),(0,B.jsx)(`li`,{children:`Ignore clipboard reads once the command that asked has finished`})]})]}),children:(0,B.jsx)(`span`,{onClick:e=>e.preventDefault(),children:(0,B.jsx)(U,{icon:OO,"aria-label":`About shell integration`,className:`text-muted-foreground size-3.5`})})})]}),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i!==null&&(0,B.jsx)(`span`,{className:`text-muted-foreground max-w-32 text-right text-xs sm:max-w-none`,children:i}),(0,B.jsx)(y2,{checked:i===null&&t.behavior.shellIntegration,disabled:i!==null,onCheckedChange:e=>a({...t,behavior:{...t.behavior,shellIntegration:e}})})]})}),(0,B.jsx)(cge,{identity:t.behavior.terminalIdentity,onChange:e=>a({...t,behavior:{...t.behavior,terminalIdentity:e}})})]})}function cge(e){return(0,B.jsx)(x2,{label:`Report the terminal as`,children:(0,B.jsxs)(m2,{value:e.identity,onValueChange:e.onChange,children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`offsite`,children:`OffSite`}),(0,B.jsx)(v2,{value:`ghostty`,children:`Ghostty`}),(0,B.jsx)(v2,{value:`iterm2`,children:`iTerm2`})]})]})})}var k2=(0,v.createContext)({});function A2(e){let t=(0,v.useRef)(null);return t.current===null&&(t.current=e()),t.current}var j2=typeof window<`u`?v.useLayoutEffect:v.useEffect,M2=(0,v.createContext)(null);function N2(e,t){e.indexOf(t)===-1&&e.push(t)}function P2(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function F2([...e],t,n){let r=t<0?e.length+t:t;if(r>=0&&r<e.length){let r=n<0?e.length+n:n,[i]=e.splice(t,1);e.splice(r,0,i)}return e}var I2=(e,t,n)=>n>t?t:n<e?e:n,L2={},R2=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),z2=e=>typeof e==`object`&&!!e,B2=e=>/^0[^.\s]+$/u.test(e);function V2(e){let t;return()=>(t===void 0&&(t=e()),t)}var H2=e=>e,U2=(...e)=>e.reduce((e,t)=>n=>t(e(n))),W2=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},G2=class{constructor(){this.subscriptions=[]}add(e){return N2(this.subscriptions,e),()=>this.remove(e)}remove(e){P2(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},K2=e=>e*1e3,q2=e=>e/1e3,J2=(e,t)=>t?1e3/t*e:0,Y2=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function X2(e,t,n,r){return e===t&&n===r?H2:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=Y2(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(Y2(s+1e-7,e,n)-i-r)}return Y2(s,t,r)}}var Z2=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Q2=e=>t=>1-e(1-t),$2=X2(.33,1.53,.69,.99),e4=Q2($2),t4=Z2(e4),n4=e=>e>=1?1:(e*=2)<1?.5*e4(e):.5*(2-2**(-10*(e-1))),r4=e=>1-Math.sin(Math.acos(e)),i4=Q2(r4),a4=Z2(r4),lge=X2(.42,0,1,1),uge=X2(0,0,.58,1),o4=X2(.42,0,.58,1),dge=e=>Array.isArray(e)&&typeof e[0]!=`number`,s4=e=>Array.isArray(e)&&typeof e[0]==`number`,c4={linear:H2,easeIn:lge,easeInOut:o4,easeOut:uge,circIn:r4,circInOut:a4,circOut:i4,backIn:e4,backInOut:t4,backOut:$2,anticipate:n4},fge=e=>typeof e==`string`,l4=e=>{if(s4(e)){e.length;let[t,n,r,i]=e;return X2(t,n,r,i)}return fge(e)?(c4[e],`${e}`,c4[e]):e},u4={delta:0,timestamp:0,isProcessing:!1},d4;function pge(){d4=void 0}var f4={now:()=>(d4===void 0&&f4.set(u4.isProcessing||L2.useManualTiming?u4.timestamp:performance.now()),d4),set:e=>{d4=e,queueMicrotask(pge)}},p4=e=>Math.round(e*1e5)/1e5,m4=e=>t=>typeof t==`string`&&t.startsWith(e),h4=m4(`--`),mge=m4(`var(--`),g4=e=>mge(e)?hge.test(e.split(`/*`)[0].trim()):!1,hge=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _4(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var v4={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},y4={...v4,transform:e=>I2(0,1,e)},b4={...v4,default:1},x4=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gge(e){return e==null}var _ge=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,S4=(e,t)=>n=>!!(typeof n==`string`&&_ge.test(n)&&n.startsWith(e)||t&&!gge(n)&&Object.prototype.hasOwnProperty.call(n,t)),C4=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(x4);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},vge=e=>I2(0,255,e),w4={...v4,transform:e=>Math.round(vge(e))},T4={test:S4(`rgb`,`red`),parse:C4(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+w4.transform(e)+`, `+w4.transform(t)+`, `+w4.transform(n)+`, `+p4(y4.transform(r))+`)`};function yge(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var E4={test:S4(`#`),parse:yge,transform:T4.transform},D4=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),O4=D4(`deg`),k4=D4(`%`),A4=D4(`px`),bge=D4(`vh`),xge=D4(`vw`),j4={...k4,parse:e=>k4.parse(e)/100,transform:e=>k4.transform(e*100)},M4={test:S4(`hsl`,`hue`),parse:C4(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+k4.transform(p4(t))+`, `+k4.transform(p4(n))+`, `+p4(y4.transform(r))+`)`},N4={test:e=>T4.test(e)||E4.test(e)||M4.test(e),parse:e=>T4.test(e)?T4.parse(e):M4.test(e)?M4.parse(e):E4.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?T4.transform(e):M4.transform(e),getAnimatableNone:e=>{let t=N4.parse(e);return t.alpha=0,N4.transform(t)}},Sge=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,P4=new RegExp(x4.source),F4=new RegExp(Sge.source,`i`);function Cge(e){return isNaN(e)&&typeof e==`string`&&(P4.test(e)||F4.test(e))}var I4=`number`,L4=`color`,wge=`var`,Tge=`var(`,R4="${}",Ege=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function Dge(e){let t=e.toString();return P4.test(t)||F4.test(t)}function z4(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Ege,e=>(N4.test(e)?(r.color.push(a),i.push(L4),n.push(N4.parse(e))):e.startsWith(Tge)?(r.var.push(a),i.push(wge),n.push(e)):(r.number.push(a),i.push(I4),n.push(parseFloat(e))),++a,R4)).split(R4),indexes:r,types:i}}function Oge(e){return z4(e).values}function B4({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===I4?p4(r[a]):e===L4?N4.transform(r[a]):r[a]}return i}}function kge(e){return B4(z4(e))}var Age=e=>typeof e==`number`?0:N4.test(e)?N4.getAnimatableNone(e):e,jge=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Age(e);function Mge(e){let t=z4(e);return B4(t)(t.values.map((e,n)=>jge(e,t.split[n])))}var V4={test:Cge,parse:Oge,createTransformer:kge,getAnimatableNone:Mge};function H4(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Nge({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=H4(s,r,e+1/3),a=H4(s,r,e),o=H4(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function U4(e,t){return n=>n>0?t:e}var W4=(e,t,n)=>e+(t-e)*n,G4=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Pge=[E4,T4,M4],Fge=e=>Pge.find(t=>t.test(e));function K4(e){let t=Fge(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===M4&&(n=Nge(n)),n}var q4=(e,t)=>{let n=K4(e),r=K4(t);if(!n||!r)return U4(e,t);let i={...n};return e=>(i.red=G4(n.red,r.red,e),i.green=G4(n.green,r.green,e),i.blue=G4(n.blue,r.blue,e),i.alpha=W4(n.alpha,r.alpha,e),T4.transform(i))},J4=new Set([`none`,`hidden`]);function Ige(e,t){return J4.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Lge(e,t){return n=>W4(e,t,n)}function Y4(e){return typeof e==`number`?Lge:typeof e==`string`?g4(e)?U4:N4.test(e)?q4:Bge:Array.isArray(e)?X4:typeof e==`object`?N4.test(e)?q4:Rge:U4}function X4(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Y4(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Rge(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Y4(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function zge(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Bge=(e,t)=>{let n=V4.createTransformer(t),r=z4(e),i=z4(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?J4.has(e)&&!i.values.length||J4.has(t)&&!r.values.length?Ige(e,t):U2(X4(zge(r,i),i.values),n):(`${e}${t}`,U4(e,t))},Z4=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Vge(e,t){let n=Z4.exec(e);if(!n)return;let r=Z4.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>p4(W4(a,o,e))+i}function Q4(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return W4(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Vge(e,t);if(n)return n}return Y4(e)(e,t)}var $4=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Hge(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Uge=40;function e3(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=$4.reduce((e,t)=>(e[t]=Hge(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=L2.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,Uge),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:$4.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<$4.length;t++)o[$4[t]].cancel(e)},state:n,steps:o}}var{schedule:t3,cancel:n3,steps:r3}=e3(typeof requestAnimationFrame<`u`?requestAnimationFrame:H2,!0,u4),i3=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>t3.update(t,e),stop:()=>n3(t),now:()=>u4.isProcessing?u4.timestamp:f4.now()}},a3=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},o3=2e4;function s3(e,t=50,n=o3,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function Wge(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(s3(o),o3);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:q2(s)}}var c3={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},l3=e=>e<0?1/Math.max(1+e,c3.minDamping):Math.max(1-e,c3.minDamping);function u3(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return f3(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function d3(e,t){return e*Math.sqrt(1-t*t)}var Gge=12;function f3(e,t,n){let r=n;for(let n=1;n<Gge;n++)r-=e(r)/t(r);return r}var p3=.001;function Kge({duration:e=c3.duration,bounce:t=c3.bounce}){let n,r;c3.maxDuration;let i=l3(t);e=I2(c3.minDuration,c3.maxDuration,q2(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=d3(t,i),o=Math.exp(-r);return p3-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=d3(t*t,i);return(-n(t)+p3>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=f3(n,r,a),s=o*u3(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:K2(e)}}var m3=(e,t)=>(t?e>=0:e>0)&&e<1/0;function h3(e,t){if(m3(e,t))return e}function qge(e){let t=h3(e.stiffness),n=h3(e.damping,!0),r=h3(e.mass),i={...e,stiffness:t??c3.stiffness,damping:n??c3.damping,mass:r??c3.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=l3(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*u3(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Kge(i)),i.isResolvedFromDuration=!0;(!m3(i.stiffness)||!m3(i.damping,!0))&&(i.stiffness=c3.stiffness,i.damping=c3.damping)}return i}function g3(e=c3.visualDuration,t=c3.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=qge({...n}),f=e=>d?0:-q2(e),p=s/(2*Math.sqrt(o*c)),m=q2(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?c3.restSpeed.granular:c3.restSpeed.default),g.restDelta=n.restDelta||(e?c3.restDelta.granular:c3.restDelta.default)};_();let v,y,b;if(p<1){let e=d3(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>K2(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=K2(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(s3(S),o3),t=a3(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}g3.applyToOptions=e=>{let t=Wge(e,100,g3);return e.ease=t.ease,e.duration=K2(t.duration),e.type=`keyframes`,e};function _3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=g3({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Jge(e,t,n){let r=[],i=n||L2.mix||Q4,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=U2(Array.isArray(t)?t[n]||H2:t,a)),r.push(a)}return r}function v3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Jge(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=W2(e[r],e[r+1],n);return s[r](i)};return n?t=>l(I2(e[0],e[a-1],t)):l}function Yge(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=W2(0,t,r);e.push(W4(n,1,i))}}function y3(e){let t=[0];return Yge(t,e.length-1),t}function Xge(e,t){return e.map(e=>e*t)}function Zge(e,t){return e.map(()=>t||o4).splice(0,e.length-1)}function b3({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=dge(r)?r.map(l4):l4(r)||o4,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(L2.mix||Q4)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?I2(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=v3(Xge(n&&n.length===t.length?n:y3(t),e),t,{ease:Array.isArray(i)?i:Zge(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Qge=5;function $ge(e,t,n){let r=Math.max(t-Qge,0);return J2(n-e(r),t-r)}function e_e(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):$ge(t=>e.next(t).value,t,e.next(t).value)}var t_e=e=>e!==null;function x3(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(t_e),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var n_e={decay:_3,inertia:_3,tween:b3,keyframes:b3,spring:g3};function S3(e){typeof e.type==`string`&&(e.type=n_e[e.type])}var r_e=40,C3=(e,t)=>t-e>r_e&&!L2.useManualTiming?t:e;function w3(e,t){return{kind:e,animation:t,timestamp:f4.now(),frameTimestamp:u4.timestamp,frameIsProcessing:u4.isProcessing}}function T3(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...w3(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function i_e(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...w3(`layout-animation-start`,e),node:t})}catch{}}var E3=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},a_e=e=>e/100,D3=e=>Math.round(e*1e4)/1e4,O3=class extends E3{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==f4.now()&&this.tick(f4.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),T3(this,this.options)}initAnimation(){let{options:e}=this;S3(e);let{type:t=b3,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||b3;s!==b3&&typeof o[0]!=`number`&&(this.mixKeyframes=U2(a_e,Q4(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=s3(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=C3(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;!d&&i!==null&&(p=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==_3&&(f.value=x3(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??D3((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==_3?x3(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=I2(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}then(e,t){return this.finished.then(e,t)}get duration(){return q2(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+q2(e)}get time(){return q2(this.currentTime)}set time(e){e=K2(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return e_e(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(f4.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=q2(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=i3,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(f4.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},o_e=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function s_e(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(x4)||[];if(!r)return e;let i=n.replace(r,``),a=+!!o_e.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var c_e=/\b([a-z-]*)\(.*?\)/gu,k3={...V4,getAnimatableNone:e=>{let t=e.match(c_e);return t?t.map(s_e).join(` `):e}},A3={...V4,getAnimatableNone:e=>{let t=V4.parse(e);return V4.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},j3={...v4,transform:Math.round},M3={borderWidth:A4,borderTopWidth:A4,borderRightWidth:A4,borderBottomWidth:A4,borderLeftWidth:A4,borderRadius:A4,borderTopLeftRadius:A4,borderTopRightRadius:A4,borderBottomRightRadius:A4,borderBottomLeftRadius:A4,width:A4,maxWidth:A4,height:A4,maxHeight:A4,top:A4,right:A4,bottom:A4,left:A4,inset:A4,insetBlock:A4,insetBlockStart:A4,insetBlockEnd:A4,insetInline:A4,insetInlineStart:A4,insetInlineEnd:A4,padding:A4,paddingTop:A4,paddingRight:A4,paddingBottom:A4,paddingLeft:A4,paddingBlock:A4,paddingBlockStart:A4,paddingBlockEnd:A4,paddingInline:A4,paddingInlineStart:A4,paddingInlineEnd:A4,margin:A4,marginTop:A4,marginRight:A4,marginBottom:A4,marginLeft:A4,marginBlock:A4,marginBlockStart:A4,marginBlockEnd:A4,marginInline:A4,marginInlineStart:A4,marginInlineEnd:A4,fontSize:A4,backgroundPositionX:A4,backgroundPositionY:A4,rotate:O4,pathRotation:O4,rotateX:O4,rotateY:O4,rotateZ:O4,scale:b4,scaleX:b4,scaleY:b4,scaleZ:b4,skew:O4,skewX:O4,skewY:O4,distance:A4,translateX:A4,translateY:A4,translateZ:A4,x:A4,y:A4,z:A4,perspective:A4,transformPerspective:A4,opacity:y4,originX:j4,originY:j4,originZ:A4,zIndex:j3,fillOpacity:y4,strokeOpacity:y4,numOctaves:j3},l_e={...M3,color:N4,backgroundColor:N4,outlineColor:N4,fill:N4,stroke:N4,borderColor:N4,borderTopColor:N4,borderRightColor:N4,borderBottomColor:N4,borderLeftColor:N4,filter:k3,WebkitFilter:k3,mask:A3,WebkitMask:A3},N3=e=>l_e[e],u_e=new Set([k3,A3]);function P3(e,t){let n=N3(e);return u_e.has(n)||(n=V4),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function d_e(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var F3=e=>e*180/Math.PI,I3=e=>L3(F3(Math.atan2(e[1],e[0]))),f_e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:I3,rotateZ:I3,skewX:e=>F3(Math.atan(e[1])),skewY:e=>F3(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},L3=e=>(e%=360,e<0&&(e+=360),e),R3=I3,z3=e=>Math.hypot(e[0],e[1]),B3=e=>Math.hypot(e[4],e[5]),p_e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:z3,scaleY:B3,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(z3(e)+B3(e))/2,rotateX:e=>L3(F3(Math.atan2(e[6],e[5]))),rotateY:e=>L3(F3(Math.atan2(-e[2],e[0]))),rotateZ:R3,rotate:R3,skewX:e=>F3(Math.atan(e[4])),skewY:e=>F3(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function V3(e){return+!!e.includes(`scale`)}function H3(e,t){if(!e||e===`none`)return V3(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=p_e,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=f_e,i=t}if(!i)return V3(t);let a=r[t],o=i[1].split(`,`).map(h_e);return typeof a==`function`?a(o):o[a]}var m_e=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return H3(n,t)};function h_e(e){return parseFloat(e.trim())}var U3=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],W3=new Set([...U3,`pathRotation`]),G3=e=>e===v4||e===A4,g_e=new Set([`x`,`y`,`z`]),__e=U3.filter(e=>!g_e.has(e));function v_e(e){let t=[];return __e.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var y_e=new Set([`bottom`,`right`]);function K3(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var q3={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>K3(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>K3(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>H3(e,`x`),y:({transform:e})=>H3(e,`y`)};q3.translateX=q3.x,q3.translateY=q3.y;var J3=new Set,Y3=!1,X3=!1,Z3=!1;function Q3(){if(X3){let e=[],t=new Set,n=new Set;J3.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),y_e.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=v_e(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}X3=!1,Y3=!1,J3.forEach(e=>e.complete(Z3)),J3.clear()}function $3(){J3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(X3=!0)})}function b_e(){Z3=!0,$3(),Q3(),Z3=!1}function x_e(e,t,n){if(typeof e==`string`){if(R2(e)||B2(e))return parseFloat(e);if(!V4.test(e)&&V4.test(n))return P3(t,n)}return e??void 0}var e6=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(J3.add(this),Y3||(Y3=!0,t3.read($3),t3.resolveKeyframes(Q3))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=x_e(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}d_e(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),J3.delete(this)}cancel(){this.state===`scheduled`&&(J3.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},S_e=e=>e.startsWith(`--`);function t6(e,t,n){S_e(t)?e.style.setProperty(t,n):e.style[t]=n}var C_e={};function n6(e,t){let n=V2(e);return()=>C_e[t]??n()}var w_e=n6(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),r6=n6(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),i6=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,a6={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:i6([0,.65,.55,1]),circOut:i6([.55,0,1,.45]),backIn:i6([.31,.01,.66,-.59]),backOut:i6([.33,1.53,.69,.99])};function o6(e,t){if(e)return typeof e==`function`?r6()?a3(e,t):`ease-out`:s4(e)?i6(e):Array.isArray(e)?e.map(e=>o6(e,t)||a6.easeOut):a6[e]}function T_e(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=o6(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function s6(e){return typeof e==`function`&&`applyToOptions`in e}function E_e({type:e,...t}){return s6(e)&&r6()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var c6=class extends E3{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=E_e(e);this.animation=T_e(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=x3(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),t6(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},T3(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return q2(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+q2(e)}get time(){return q2(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=K2(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&w_e()?(this.animation.timeline=e,t?.(this.animation),H2):n(this)}},l6={anticipate:n4,backInOut:t4,circInOut:a4};function D_e(e){return e in l6}function O_e(e){typeof e.ease==`string`&&D_e(e.ease)&&(e.ease=l6[e.ease])}var k_e=class extends c6{constructor(e){O_e(e),S3(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(f4.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new O3({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?I2(0,10,a):0,s=this.sample(a);n&&r&&t6(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},u6=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(V4.test(e)||e===`0`)&&!e.startsWith(`url(`));function A_e(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function j_e(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=u6(i,t),s=u6(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):A_e(e)||(n===`spring`||s6(n))&&r}function d6(e){e.duration=0,e.type=`keyframes`}var f6=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),M_e=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function N_e(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&M_e.test(e[t]))return!0;return!1}var p6=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),m6=V2(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function P_e(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(f6.has(n)||p6.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return m6()&&(f6.has(n)||p6.has(n)&&N_e(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var h6=(e,t)=>t&&typeof e==`number`?t.transform(e):e,g6={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},F_e=U3.length;function _6(e,t,n){let r=``,i=!0;for(let a=0;a<F_e;a++){let o=U3[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=h6(s,M3[o]);if(!c){i=!1;let t=g6[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${h6(a,M3.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}var v6=new WeakMap,I_e=200,y6=.001,L_e=.1,R_e=.001,z_e=100,B_e=e=>/^(linear|ease(In|Out|InOut))$/.test(e),b6=(e,t)=>e-t,x6=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(W4(e,t,i/n));return r},S6=e=>e.motionValue.owner,C6=e=>v6.get(e),w6=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),V_e=({name:e,motionValue:t})=>e&&U3.includes(e)&&t?.owner?.current instanceof HTMLElement&&m6()&&r6();function H_e(e){let t=S6(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(w6(t,`transform`)||`none`)===`none`&&!w6(t,`pathRotation`)&&!t.projection?.isProjecting()}var U_e=class extends O3{constructor(e){let t=S6(e).current,{driver:n=i3}=e,r=H_e(e);e.driver=e=>{let r=n(e);return{js:r,now:r.now,start:(e=!0)=>{let n=C6(t);!n||n.isJS?r.start(e):n.schedule(!1,!e)},stop:()=>{r.stop();let e=C6(t);e?.schedule(!e.isFinishing)}}},super(e),this.canAccelerate=r;let{stop:i}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),i()}}get group(){return C6(S6(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(f4.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=s4(n)?i6(n):B_e(n)&&a6[n];if(o&&!i&&!r&&e.length===2&&t===b3&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||b3)===b3?u||y3(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=f4.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||W_e(S6(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(f4.now())}get time(){return this.isAccelerated()?q2(I2(0,this.totalDuration,this.at(f4.now())-(this.options.delay||0))):super.time}set time(e){super.time=e}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function W_e(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,d=-1/0,f=e=>{for(let t of n)if(t.name===e)return!0},p=(t,n)=>{let o={};for(let s of t===void 0?U3:a){let a=r.get(s),c=t===void 0?w6(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},m=(e,t)=>{let n=``,r=p(e,t);for(let e in r)n+=(g6[e]||e)+`(`+h6(r[e],M3[e])+`) `;return n||`none`},h=(e=p())=>{t.style.transform=_6(e,{})},g=(e=!0)=>{e&&h(),s.forEach(({animation:e})=>e.cancel()),s=[]},_=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=f4.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),E.schedule(!1)}),e.oncancel=()=>s.includes(r)&&E.demote(),s.push(r)},v=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},y=(e,t,n,r)=>{let i=Math.min(I_e,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=x6(t,n,i).concat(r).sort(b6),o=e=>W2(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e[e.length-1]-n,i=e.map(e=>r?(e-n)/r:e-n);if(!r){if(i.some(e=>!(Math.abs(e)<=y6)))return}else if(!s)s=i,c=e=>(t.numberAt(e)-n)/r;else if(i.some((e,t)=>!(Math.abs(e-s[t])<=y6)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=y6))return`linear`;let l=[],u=(e,t=c(e))=>l.push(D3(t)+` `+D3(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&v(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},b=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?R_e:L_e))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...v(e=>r.numberAt(e),t,n));i.push(n)}},s=x6(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(b6))e>c&&o(c,e,0),c=e;return i.sort(b6)},x=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},S=(e,n,r,i={fill:`both`},a,o)=>{let s=e.flatMap(e=>e.boundaries(n,r)),c=o||y(e,n,r,s),l=c?[n,r]:b(e,n,r,s),u=l.map(e=>m(e,a)),d={transform:u};return c||(d.offset=l.map(e=>W2(n,r,e))),u.every(e=>e===u[0])&&(h(p(n,a)),d=null),t.animate(d,{...i,duration:r-n,easing:c||`linear`})},C=c=>{let l=c,u=0,d=0,f=[],p=[],m=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[t,n]=e.timing(),i=t===1/0;if(o.set(e,[e.at(c),e.speed,i]),i)e.sync();else{if(e.speed<0)return;if(n){if(u){let e=(t-d)/n;if(Math.abs(n-u)>1||Math.abs(e-Math.round(e))*u>1)return}else u=n,d=t;p.push(e)}else m.add(t);f.push(e),l=Math.max(l,t)}}i={},a=U3.filter(t=>{if(r.has(t))return!0;let n=i[t]=w6(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),g(!1);let h=!u&&x(f);try{if(h&&h[1]>c){let[e,t,n]=h;_(S(f,e,t,void 0,void 0,n),e-c,t-e)}else l>c&&(_(S(f,c,l),0,l-c),m.forEach(e=>e<l-1&&_(t.animate(null,{duration:e-c}),0,e-c)));if(u){let e=d+Math.floor((l-d)/u)*u;_(S(p,e,e+u,{iterations:1/0,iterationStart:(l-e)/u,fill:`forwards`},l),l-c)}}catch{return}return s.length||g(),!0},w=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r?(n.playbackRate=r,n.startTime=e-o/r):(n.pause(),n.currentTime=o)}return!0},T=()=>{let r=f4.now();if(E.isJS||(E.isFinishing=!0,n.forEach(t=>{let[n,a]=t.timing();t.state===`running`&&t.speed>0&&!a&&n<=r+1&&(t.complete(),i[t.name]=w6(e,t.name),o.has(t)||(c=!0))}),E.isFinishing=!1),l=!1,n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),!n.size){v6.delete(t),E.isJS||g();return}for(let e of n)if(!e.canAccelerate)return E.demote(!0);E.isJS&&(E.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let a=c,s=u;if(c=u=!1,a||!w(r)){if(s){if(r-d<z_e)return E.demote();d=r}if(!C(r))return E.demote()}},E={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){c||=e,u||=!!t,l||(l=!0,u4.isProcessing?t3.render(T,!1,!0):queueMicrotask(T))},check(){if(!E.isJS){for(let t in i)if(w6(e,t)!==i[t]&&!f(t))return E.schedule(!0,!0)}},demote(e){E.isJS||(n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),E.isJS=!0,o=new Map,g(),n.forEach(e=>e.state===`running`&&e.js?.start()))}};return v6.set(t,E),E}var G_e=class extends E3{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=f4.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||e6;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=f4.now();let u=!0;j_e(e,i,a,o)||(u=!1,(L2.instantAnimations||!s)&&l?.(x3(e,n,t)),e[0]=e[e.length-1],d6(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&P_e(n),p=!f&&V_e(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=C3(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new k_e(n)}catch{m=new O3(n)}}else m=p?new U_e(n):new O3(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),b_e()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function T6(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var E6=30,K_e=e=>!isNaN(parseFloat(e)),D6={current:void 0},q_e=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=f4.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=f4.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=K_e(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new G2)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new G2,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){t3.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){D6.current&&D6.current.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=f4.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>E6)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,E6);return J2(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function O6(e,t){return new q_e(e,t)}function k6(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function A6(e,t){let n=e?.[t]??e?.default??e;return n===e?n:k6(n,e)}var J_e={type:`spring`,stiffness:500,damping:25,restSpeed:10},Y_e=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),X_e={type:`keyframes`,duration:.8},Z_e={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Q_e=(e,{keyframes:t})=>t.length>2?X_e:W3.has(e)?e.startsWith(`scale`)?Y_e(t[1]):J_e:Z_e,$_e=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function eve(e){for(let t in e)if(!$_e.has(t))return!0;return!1}var j6=(e,t,n,r={},i,a)=>o=>{let s=A6(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=K2(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};eve(s)||Object.assign(u,Q_e(e,u)),u.duration&&=K2(u.duration),u.repeatDelay&&=K2(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(d6(u),u.delay===0&&(d=!0)),(L2.instantAnimations||L2.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,d6(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=x3(u.keyframes,s);if(e!==void 0){t3.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new O3(u):new G_e(u)},tve=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function nve(e){let t=tve.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function M6(e,t,n=1){`${e}`;let[r,i]=nve(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return R2(e)?parseFloat(e):e}return g4(i)?M6(i,t,n+1):i}function rve(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function N6(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...rve(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function P6(e,t,n){return N6(e.getProps(),t,n,e)}var F6=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,I6=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...U3]),ive=e=>Array.isArray(e);function ave(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,O6(n))}function ove(e){return ive(e)?e[e.length-1]||0:e}function sve(e,t){let{transitionEnd:n={},transition:r={},...i}=P6(e,t)||{};i={...i,...n};for(let t in i)ave(e,t,ove(i[t]))}var L6=e=>!!(e&&e.getVelocity);function cve(e){return!!(L6(e)&&e.add)}function R6(e,t){let n=e.getValue(`willChange`);if(cve(n))return n.add(t);if(!n&&L2.WillChange){let n=new L2.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function z6(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var B6=`data-`+z6(`framerAppearId`);function V6(e){return e.props[B6]}var lve=typeof window<`u`;function uve({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function H6(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?k6(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&uve(f,t))continue;let o={delay:n,...A6(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){t3.update(()=>r.set(i));continue}let p=!1;if(lve&&window.MotionHandoffAnimation){let n=V6(e);if(n){let e=window.MotionHandoffAnimation(n,t,t3);e!==null&&(o.startTime=e,p=!0)}}R6(e,t);let m=l??e.shouldReduceMotion;r.start(j6(t,r,i,m&&I6.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>t3.update(()=>{o&&sve(e,o)});d.length?Promise.all(d).then(t):t()}return d}function U6(e,t,n={}){let r=P6(e,t,F6(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?H6(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(U6(e,t,{...n,delay:r+(typeof o==`function`?0:o)+T6(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function dve(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>U6(e,t,n))):typeof t==`string`?U6(e,t,n):Promise.all(H6(e,P6(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var fve={test:e=>e===`auto`,parse:e=>e},pve=e=>t=>t.test(e),mve=[v4,A4,k4,O4,xge,bge,fve],W6=e=>mve.find(pve(e));function hve(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||B2(e)}var gve=new Set([`auto`,`none`,`0`]);function _ve(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!gve.has(t)&&Dge(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=P3(n,i))}var vve=class extends e6{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(_4(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),g4(r))){let i=M6(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!I6.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=W6(r),o=W6(i);if(_4(r)!==_4(i)&&q3[n])this.needsMeasurement=!0;else if(a!==o){if(G3(a)&&G3(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else q3[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||hve(e[t]))&&n.push(t);n.length&&_ve(e,n,t)}measure(){let{element:e,name:t}=this;return q3[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},G6=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function yve(e){return z2(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function K6(e){return z2(e)&&`ownerSVGElement`in e}function q6(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function J6(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(W3.has(e))o=!0;else if(h4(e))i[e]=n;else{let t=h6(n,M3[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=_6(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var bve={offset:`stroke-dashoffset`,array:`stroke-dasharray`},xve={offset:`strokeDashoffset`,array:`strokeDasharray`};function Sve(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?bve:xve;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Y6=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function X6(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(J6(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Y6)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Sve(d,i,a,o,!1)}function Z6({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Cve({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function wve(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Q6(e){return e===void 0||e===1}function $6({scale:e,scaleX:t,scaleY:n}){return!Q6(e)||!Q6(t)||!Q6(n)}function e8(e){return $6(e)||t8(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function t8(e){return n8(e.x)||n8(e.y)}function n8(e){return e&&e!==`0%`}function r8(e,t,n){return n+t*(e-n)}function i8(e,t,n,r,i){return i!==void 0&&(e=r8(e,i,r)),r8(e,n,r)+t}function a8(e,t=0,n=1,r,i){e.min=i8(e.min,t,n,r,i),e.max=i8(e.max,t,n,r,i)}function o8(e,{x:t,y:n}){a8(e.x,t.translate,t.scale,t.originPoint),a8(e.y,n.translate,n.scale,n.originPoint)}var s8=.999999999999,c8=1.0000000000001;function Tve(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(l8(e.x,-a.scroll.offset.x),l8(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,o8(e,o)),r&&e8(a.latestValues)&&f8(e,a.latestValues,a.layout?.layoutBox))}t.x<c8&&t.x>s8&&(t.x=1),t.y<c8&&t.y>s8&&(t.y=1)}function l8(e,t){e.min+=t,e.max+=t}function u8(e,t,n,r,i=.5){a8(e,t,n,W4(e.min,e.max,i),r)}function d8(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function f8(e,t,n){let r=n??e;u8(e.x,d8(t.x,r.x),t.scaleX,t.scale,t.originX),u8(e.y,d8(t.y,r.y),t.scaleY,t.scale,t.originY)}function p8(e,t){return Z6(wve(e.getBoundingClientRect(),t))}function Eve(e,t,n){let r=p8(e,n),{scroll:i}=t;return i&&(l8(r.x,i.offset.x),l8(r.y,i.offset.y)),r}var{schedule:m8,cancel:Dve}=e3(queueMicrotask,!1),h8={x:!1,y:!1};function g8(){return h8.x||h8.y}function Ove(e){return e===`x`||e===`y`?h8[e]?null:(h8[e]=!0,()=>{h8[e]=!1}):h8.x||h8.y?null:(h8.x=h8.y=!0,()=>{h8.x=h8.y=!1})}function _8(e,t){let n=q6(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function kve(e){return!(e.pointerType===`touch`||g8())}function Ave(e,t,n={}){let[r,i,a]=_8(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!kve(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var v8=(e,t)=>t?e===t||v8(e,t.parentElement):!1,y8=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,jve=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Mve(e){return jve.has(e.tagName)||e.isContentEditable===!0}var Nve=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Pve(e){return Nve.has(e.tagName)||e.isContentEditable===!0}var b8=new WeakSet;function x8(e){return t=>{t.key===`Enter`&&e(t)}}function S8(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Fve=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=x8(()=>{if(b8.has(n))return;S8(n,`down`);let e=x8(()=>{S8(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>S8(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function C8(e){return y8(e)&&!g8()}var w8=new WeakSet;function Ive(e,t,n={}){let[r,i,a]=_8(e,n),o=e=>{let r=e.currentTarget;if(!C8(e)||w8.has(e))return;b8.add(r),n.stopPropagation&&w8.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),b8.has(r)&&b8.delete(r),C8(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||v8(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),yve(e)&&(e.addEventListener(`focus`,e=>Fve(e,i)),!Mve(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var T8=new WeakMap,E8,D8=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:K6(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Lve=D8(`inline`,`width`,`offsetWidth`),Rve=D8(`block`,`height`,`offsetHeight`);function zve({target:e,borderBoxSize:t}){T8.get(e)?.forEach(n=>{n(e,{get width(){return Lve(e,t)},get height(){return Rve(e,t)}})})}function Bve(e){e.forEach(zve)}function Vve(){typeof ResizeObserver<`u`&&(E8=new ResizeObserver(Bve))}function Hve(e,t){E8||Vve();let n=q6(e);return n.forEach(e=>{let n=T8.get(e);n||(n=new Set,T8.set(e,n)),n.add(t),E8?.observe(e)}),()=>{n.forEach(e=>{let n=T8.get(e);n?.delete(t),n?.size||E8?.unobserve(e)})}}var O8=new Set,k8;function Uve(){k8=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};O8.forEach(t=>t(e))},window.addEventListener(`resize`,k8)}function Wve(e){return O8.add(e),k8||Uve(),()=>{O8.delete(e),!O8.size&&typeof k8==`function`&&(window.removeEventListener(`resize`,k8),k8=void 0)}}function A8(e,t){return typeof e==`function`?Wve(e):Hve(e,t)}var j8={value:null,addProjectionMetrics:null};function Gve(e){return K6(e)&&e.tagName===`svg`}function Kve(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=v3(i,a,o);return t?s(r):s}var M8=e=>typeof e==`number`?e:parseFloat(e),N8=()=>({translate:0,scale:1,origin:0,originPoint:0}),P8=()=>({x:N8(),y:N8()}),F8=()=>({min:0,max:0}),I8=()=>({x:F8(),y:F8()}),qve=new WeakMap;function L8(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function R8(e){return typeof e==`string`||Array.isArray(e)}var z8=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],B8=[`initial`,...z8];function V8(e){if(L8(e.animate))return!0;for(let t=0;t<B8.length;t++)if(R8(e[B8[t]]))return!0;return!1}function H8(e){return!!(V8(e)||e.variants)}function Jve(e,t,n){for(let r in t){let i=t[r],a=n[r];if(L6(i))e.addValue(r,i);else if(L6(a))e.addValue(r,O6(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,O6(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var U8={current:null},W8={current:!1},Yve=typeof window<`u`;function Xve(){if(W8.current=!0,Yve){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>U8.current=e.matches;e.addEventListener(`change`,t),t()}else U8.current=!1}}var G8=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],K8={};function q8(e){K8=e}function Zve(){return K8}var Qve=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=e6,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=f4.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,t3.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=V8(t),this.isVariantNode=H8(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&L6(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,qve.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(W8.current||Xve(),this.shouldReduceMotion=U8.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),n3(this.notifyUpdate),n3(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&f6.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new c6({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:K2(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=W3.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&t3.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),v6.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in K8){let t=K8[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):I8()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&v6.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<G8.length;t++){let n=G8[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Jve(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=O6(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(R2(n)||B2(n))?n=parseFloat(n):typeof n!=`number`&&!V4.test(n)&&V4.test(t)&&(n=P3(e,t)),this.setBaseTarget(e,L6(n)?n.get():n)),L6(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new G2),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){m8.render(this.render)}},J8=class extends Qve{constructor(){super(...arguments),this.KeyframeResolver=vve}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;L6(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Y8=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function X8(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var Z8={};function Q8(e,{layout:t,layoutId:n}){return W3.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Z8[e]||e===`opacity`)}function $8(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(L6(r[t])||i&&L6(i[t])||Q8(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function $ve(e){return window.getComputedStyle(e)}var eye=class extends J8{constructor(){super(...arguments),this.type=`html`,this.renderInstance=X8}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(W3.has(t))return this.projection?.isProjecting?V3(t):m_e(e,t);{let n=$ve(e),r=(h4(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return p8(e,t)}build(e,t,n){J6(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return $8(e,t,n)}},e5=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),t5=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function tye(e,t,n,r){X8(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(e5.has(n)?n:z6(n),t.attrs[n])}function n5(e,t,n){let r=$8(e,t,n);for(let n in e)if(n!==`children`&&(L6(e[n])||L6(t[n]))){let t=U3.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var nye=class extends J8{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=I8}getBaseTargetFromProps(e,t){return W3.has(t)?super.getBaseTargetFromProps(e,t)??V3(t):e[t]}getDefaultValue(e){return W3.has(e)?this.latestValues[e]??V3(e):void 0}readValueFromInstance(e,t){if(W3.has(t)){let e=N3(t);return e&&e.default||0}if(Y6.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=e5.has(t)?t:z6(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return n5(e,t,n)}build(e,t,n){X6(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){tye(e,t,n,r)}mount(e){this.isSVGTag=t5(e.tagName),super.mount(e)}};function r5(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var rye=[...z8].reverse();function iye(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>dve(e,t,n))),n=i5(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(rye.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?R8(g)||g===!1?g:void 0:h,v=R8(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||L8(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=aye(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=P6(e,n,F6(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!r5(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=P6(s,n)?.transition?.delayChildren;r.delay=T6(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&P6(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!L6(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=i5(),i=!0}}}function aye(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!r5(t,e):!1}function i5(){let e={};for(let t of z8)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function a5(e,t){e.min=t.min,e.max=t.max}function o5(e,t){a5(e.x,t.x),a5(e.y,t.y)}function s5(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var oye=.9999,sye=1.0001,cye=-.01,lye=.01;function c5(e){return e.max-e.min}function uye(e,t,n){return Math.abs(e-t)<=n}function l5(e,t,n,r=.5){e.origin=r,e.originPoint=W4(t.min,t.max,e.origin),e.scale=c5(n)/c5(t),e.translate=W4(n.min,n.max,e.origin)-e.originPoint,(e.scale>=oye&&e.scale<=sye||isNaN(e.scale))&&(e.scale=1),(e.translate>=cye&&e.translate<=lye||isNaN(e.translate))&&(e.translate=0)}function u5(e,t,n,r){l5(e.x,t.x,n.x,r?r.originX:void 0),l5(e.y,t.y,n.y,r?r.originY:void 0)}function d5(e,t,n,r=0){e.min=(r?W4(n.min,n.max,r):n.min)+t.min,e.max=e.min+c5(t)}function dye(e,t,n,r){d5(e.x,t.x,n.x,r?.x),d5(e.y,t.y,n.y,r?.y)}function f5(e,t,n,r=0){let i=r?W4(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+c5(t)}function p5(e,t,n,r){f5(e.x,t.x,n.x,r?.x),f5(e.y,t.y,n.y,r?.y)}function m5(e,t,n,r,i){return e-=t,e=r8(e,1/n,r),i!==void 0&&(e=r8(e,1/i,r)),e}function fye(e,t=0,n=1,r=.5,i,a=e,o=e){if(k4.test(t)&&(t=parseFloat(t),t=W4(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=W4(a.min,a.max,r);e===a&&(s-=t),e.min=m5(e.min,t,n,s,i),e.max=m5(e.max,t,n,s,i)}function h5(e,t,[n,r,i],a,o){fye(e,t[n],t[r],t[i],t.scale,a,o)}var pye=[`x`,`scaleX`,`originX`],mye=[`y`,`scaleY`,`originY`];function g5(e,t,n,r){h5(e.x,t,pye,n?n.x:void 0,r?r.x:void 0),h5(e.y,t,mye,n?n.y:void 0,r?r.y:void 0)}function _5(e){return e.translate===0&&e.scale===1}function v5(e){return _5(e.x)&&_5(e.y)}function y5(e,t){return e.min===t.min&&e.max===t.max}function hye(e,t){return y5(e.x,t.x)&&y5(e.y,t.y)}function b5(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function x5(e,t){return b5(e.x,t.x)&&b5(e.y,t.y)}function S5(e){return c5(e.x)/c5(e.y)}function C5(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function w5(e){return[e(`x`),e(`y`)]}function T5(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var E5={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(A4.test(e))e=parseFloat(e);else return e}return`${T5(e,t.target.x)}% ${T5(e,t.target.y)}%`}},gye={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=V4.parse(e);if(i.length>5)return r;let a=V4.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=W4(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function _ye(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var vye=G6.length,D5=e=>typeof e==`number`||A4.test(e);function yye(e,t,n,r,i,a){i?(e.opacity=W4(0,n.opacity??1,bye(r)),e.opacityExit=W4(t.opacity??1,0,xye(r))):a&&(e.opacity=W4(t.opacity??1,n.opacity??1,r));for(let i=0;i<vye;i++){let a=G6[i],o=O5(t,a),s=O5(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||D5(o)===D5(s)?(e[a]=Math.max(W4(M8(o),M8(s),r),0),(k4.test(s)||k4.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=W4(t.rotate||0,n.rotate||0,r))}function O5(e,t){return e[t]===void 0?e.borderRadius:e[t]}var bye=k5(0,.5,i4),xye=k5(.5,.95,H2);function k5(e,t,n){return r=>r<e?0:r>t?1:n(W2(e,t,r))}function Sye(e,t,n){let r=L6(e)?e:O6(e);return r.start(j6(``,r,t,n)),r.animation}function A5(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Cye=(e,t)=>e.depth-t.depth,wye=class{constructor(){this.children=[],this.isDirty=!1}add(e){N2(this.children,e),this.isDirty=!0}remove(e){P2(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Cye),this.isDirty=!1,this.children.forEach(e)}};function Tye(e,t){let n=f4.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(n3(r),e(a-t))};return t3.setup(r,!0),()=>n3(r)}function j5(e){return L6(e)?e.get():e}var Eye=class{constructor(){this.members=[]}add(e){N2(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(P2(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(P2(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Dye={borderRadius:{...E5,applyTo:[...G6]},borderTopLeftRadius:E5,borderTopRightRadius:E5,borderBottomLeftRadius:E5,borderBottomRightRadius:E5,boxShadow:gye},M5={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Z8,{...Dye,...Z8});var N5={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},P5=[``,`X`,`Y`,`Z`],Oye=1e3,kye=0;function F5(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var I5=({instance:e})=>e&&v6.get(e)?.demote();function L5(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=V6(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,t3,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&L5(r)}function R5({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=kye++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,j8.value&&(N5.nodes=N5.calculatedTargetDeltas=N5.calculatedProjections=0),this.nodes.forEach(Mye),this.nodes.forEach(Bye),this.nodes.forEach(Vye),this.nodes.forEach(Nye),j8.addProjectionMetrics&&j8.addProjectionMetrics(N5)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new wye)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new G2),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=K6(t)&&!Gve(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;t3.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Tye(i,250),M5.hasAnimatedSinceResize&&(M5.hasAnimatedSinceResize=!1,this.nodes.forEach(V5)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Kye,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!x5(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...A6(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||V5(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),n3(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Hye),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&L5(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;I5(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,I5(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Fye),this.nodes.forEach(z5);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(B5);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Lye),this.nodes.forEach(Rye),this.nodes.forEach(zye),this.nodes.forEach(Aye),this.nodes.forEach(jye)):this.nodes.forEach(B5),this.clearAllSnapshots();let e=f4.now();u4.delta=I2(0,1e3/60,e-u4.timestamp),u4.timestamp=e,u4.isProcessing=!0,r3.update.process(u4),r3.preRender.process(u4),r3.render.process(u4),u4.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,m8.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Pye),this.sharedNodes.forEach(Uye)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,t3.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){t3.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!c5(this.snapshot.measuredBox.x)&&!c5(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=I8(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&I5(this);let t=this.projectionDelta&&!v5(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||e8(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),qye(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return I8();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Jye))){let{scroll:e}=this.root;e&&(l8(t.x,e.offset.x),l8(t.y,e.offset.y))}return t}removeElementScroll(e){let t=I8();if(o5(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&o5(t,e),l8(t.x,i.offset.x),l8(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||I8();o5(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(l8(r.x,-n.scroll.offset.x),l8(r.y,-n.scroll.offset.y)),e8(n.latestValues)&&f8(r,n.latestValues,n.layout?.layoutBox)}return e8(this.latestValues)&&f8(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=I8();o5(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!e8(n.latestValues))continue;let r;n.instance&&($6(n.latestValues)&&n.updateSnapshot(),r=I8(),o5(r,n.measurePageBox())),g5(t,n.latestValues,n.snapshot?.layoutBox,r)}return e8(this.latestValues)&&g5(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==u4.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=u4.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=I8(),this.targetWithTransforms=I8()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),dye(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):o5(this.target,this.layout.layoutBox),o8(this.target,this.targetDelta)):o5(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),j8.value&&N5.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||$6(this.parent.latestValues)||t8(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=I8(),this.relativeTargetOrigin=I8(),p5(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),o5(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===u4.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;o5(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Tve(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=I8());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(s5(this.prevProjectionDelta.x,this.projectionDelta.x),s5(this.prevProjectionDelta.y,this.projectionDelta.y)),u5(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!C5(this.projectionDelta.x,this.prevProjectionDelta.x)||!C5(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),j8.value&&N5.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=P8(),this.projectionDelta=P8(),this.projectionDeltaWithTransform=P8()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=P8();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=I8(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Gye));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=W4(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=W4(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(H5(o.x,e.x,n),H5(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(p5(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Wye(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&hye(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=I8(),o5(f,this.relativeTarget)),c&&(this.animationValues=a,yye(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(n3(this.pendingAnimation),void 0),this.pendingAnimation=t3.update(()=>{M5.hasAnimatedSinceResize=!0,this.motionValue||=O6(0),this.motionValue.jump(0,!1),this.currentAnimation=Sye(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),i_e(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Oye),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&q5(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||I8();let t=c5(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=c5(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}o5(t,i),f8(t,r),u5(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Eye),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&F5(`z`,e,r,this.animationValues);for(let t=0;t<P5.length;t++)F5(`rotate${P5[t]}`,e,r,this.animationValues),F5(`skew${P5[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=j5(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=j5(t?.pointerEvents)||``),this.hasProjected&&!e8(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=_ye(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Z8){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Z8[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?j5(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(z5),this.root.sharedNodes.clear()}}}function Aye(e){e.updateLayout(),Iye(e)}function jye(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)w5(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=c5(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;a5(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else q5(i,t.layoutBox,n)&&w5(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=c5(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=P8();u5(o,n,t.layoutBox);let s=P8();a?u5(s,e.applyTransform(r,!0),t.measuredBox):u5(s,n,t.layoutBox);let c=!v5(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=I8();p5(s,t.layoutBox,i.layoutBox,o);let c=I8();p5(c,n,a.layoutBox,o),x5(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Mye(e){j8.value&&N5.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Nye(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Pye(e){e.clearSnapshot()}function z5(e){e.clearMeasurements()}function Fye(e){e.isLayoutDirty=!0,e.updateLayout()}function B5(e){e.isLayoutDirty=!1}function Iye(e){let{snapshot:t,dragAncestor:n}=e,r=n?.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;w5(e=>l8(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function Lye(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Rye(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function zye(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function V5(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Bye(e){e.resolveTargetDelta()}function Vye(e){e.calcProjection()}function Hye(e){e.resetSkewAndRotation()}function Uye(e){e.removeLeadSnapshot()}function H5(e,t,n){e.translate=W4(t.translate,0,n),e.scale=W4(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function U5(e,t,n,r){e.min=W4(t.min,n.min,r),e.max=W4(t.max,n.max,r)}function Wye(e,t,n,r){U5(e.x,t.x,n.x,r),U5(e.y,t.y,n.y,r)}function Gye(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Kye={duration:.45,ease:[.4,0,.1,1]},W5=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),G5=W5(`applewebkit/`)&&!W5(`chrome/`)?Math.round:H2;function K5(e){e.min=G5(e.min),e.max=G5(e.max)}function qye(e){K5(e.x),K5(e.y)}function q5(e,t,n){return e===`position`||e===`preserve-aspect`&&!uye(S5(t),S5(n),.2)}function Jye(e){return e!==e.root&&e.scroll?.wasRoot}var Yye=R5({attachResizeListener:(e,t)=>A5(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),J5={current:void 0},Y5=R5({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!J5.current){let e=new Yye({});e.mount(window),e.setOptions({layoutScroll:!0}),J5.current=e}return J5.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),X5=(0,v.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Xye(e=!0){let t=(0,v.useContext)(M2);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,v.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Z5=(0,v.createContext)({strict:!1}),Q5={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},$5=!1;function Zye(){if($5)return;let e={};for(let t in Q5)e[t]={isEnabled:e=>Q5[t].some(t=>!!e[t])};q8(e),$5=!0}function e7(){return Zye(),Zve()}function Qye(e){let t=e7();for(let n in e)t[n]={...t[n],...e[n]};q8(t)}var t7=(0,v.createContext)({});function $ye(e,t){if(V8(e)){let{initial:t,animate:n}=e;return{initial:t===!1||R8(t)?t:void 0,animate:R8(n)?n:void 0}}return e.inherit===!1?{}:t}function ebe(e){let{initial:t,animate:n}=$ye(e,(0,v.useContext)(t7));return(0,v.useMemo)(()=>({initial:t,animate:n}),[n7(t),n7(n)])}function n7(e){return Array.isArray(e)?e.join(` `):e}var r7=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function i7(e,t,n){for(let r in t)!L6(t[r])&&!Q8(r,n)&&(e[r]=t[r])}function tbe({transformTemplate:e},t){return(0,v.useMemo)(()=>{let n=r7();return J6(n,t,e),Object.assign({},n.vars,n.style)},[t])}function nbe(e,t){let n=e.style||{},r={};return i7(r,n,e),Object.assign(r,tbe(e,t)),r}function rbe(e,t){let n={},r=nbe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var a7=()=>({...r7(),attrs:{}});function ibe(e,t,n,r){let i=(0,v.useMemo)(()=>{let n=a7();return X6(n,t,t5(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};i7(t,e.style,e),i.style={...t,...i.style}}return i}var o7=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function s7(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||o7.has(e)}function abe(e,t){return e.startsWith(`on`)?!s7(e):t?.(e)??!s7(e)}function obe(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(L6(e[a])||(abe(a,r)||n===!0&&s7(a)||!t&&!s7(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var sbe=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function c7(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(sbe.indexOf(e)>-1||/[A-Z]/u.test(e))}function cbe(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??c7(e)?ibe:rbe)(t,r,i,e),l=obe(t,typeof e==`string`,a,s),u=e===v.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,v.useMemo)(()=>L6(d)?d.get():d,[d]);return(0,v.createElement)(e,{...u,children:f})}function lbe({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:ube(n,r,i,e),renderState:t()}}function ube(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=j5(a[e]);let{initial:o,animate:s}=e,c=V8(e),l=H8(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!L8(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=N6(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var l7=e=>(t,n)=>{let r=(0,v.useContext)(t7),i=(0,v.useContext)(M2),a=()=>lbe(e,t,r,i);return n?a():A2(a)},dbe=l7({scrapeMotionValuesFromProps:$8,createRenderState:r7}),fbe=l7({scrapeMotionValuesFromProps:n5,createRenderState:a7}),pbe=Symbol.for(`motionComponentSymbol`);function mbe(e,t,n){let r=(0,v.useRef)(n);(0,v.useInsertionEffect)(()=>{r.current=n});let i=(0,v.useRef)(null);return(0,v.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var u7=(0,v.createContext)({});function d7(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function hbe(e,t,n,r,i,a){let{visualElement:o}=(0,v.useContext)(t7),s=(0,v.useContext)(Z5),c=(0,v.useContext)(M2),l=(0,v.useContext)(X5),u=l.reducedMotion,d=l.skipAnimations,f=(0,v.useRef)(null),p=(0,v.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,v.useContext)(u7);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&gbe(f.current,n,i,h);let g=(0,v.useRef)(!1);(0,v.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[B6],y=(0,v.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return j2(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),j2(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),(0,v.useEffect)(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function gbe(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:f7(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&d7(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function f7(e){if(e)return e.options.allowProjection===!1?f7(e.parent):e.projection}function p7(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Qye(r);let a=n?n===`svg`:c7(e),o=a?fbe:dbe;function s(n,s){let c,l={...(0,v.useContext)(X5),...n,layoutId:_be(n)},{isStatic:u,isValidProp:d}=l,f=ebe(n),p=o(n,u);if(!u&&typeof window<`u`){vbe(l,r);let t=ybe(l);c=t.MeasureLayout,f.visualElement=hbe(e,p,l,i,t.ProjectionNode,a)}return(0,B.jsxs)(t7.Provider,{value:f,children:[c&&f.visualElement?(0,B.jsx)(c,{visualElement:f.visualElement,...l}):null,cbe(e,n,mbe(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,v.forwardRef)(s);return c[pbe]=e,c}function _be({layoutId:e}){let t=(0,v.useContext)(k2).id;return t&&e!==void 0?t+`-`+e:e}function vbe(e,t){(0,v.useContext)(Z5).strict}function ybe(e){let{drag:t,layout:n}=e7();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function bbe(e,t){if(typeof Proxy>`u`)return p7;let n=new Map,r=(n,r)=>p7(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,p7(a,void 0,e,t)),n.get(a))})}var xbe=(e,t)=>t.isSVG??c7(e)?new nye(t):new eye(t,{allowProjection:e!==v.Fragment}),Sbe=class extends Y8{constructor(e){super(e),e.animationState||=iye(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();L8(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Cbe=0,wbe={animation:{Feature:Sbe},exit:{Feature:class extends Y8{constructor(){super(...arguments),this.id=Cbe++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=P6(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function m7(e){return{point:{x:e.pageX,y:e.pageY}}}var Tbe=e=>t=>y8(t)&&e(t,m7(t));function h7(e,t,n,r){return A5(e,t,Tbe(n),r)}var g7=({current:e})=>e?e.ownerDocument.defaultView:null,_7=(e,t)=>Math.abs(e-t);function Ebe(e,t){let n=_7(e.x,t.x),r=_7(e.y,t.y);return Math.sqrt(n**2+r**2)}var v7=new Set([`auto`,`scroll`]),y7=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=b7(this.lastRawMoveEventInfo,this.transformPagePoint));let e=S7(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Ebe(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:f4.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=b7(t,this.transformPagePoint),this.hasPendingMove=!0,t3.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=S7(e.type===`pointercancel`?this.lastMoveEventInfo:b7(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!y8(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=b7(m7(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=u4;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,S7(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=U2(h7(this.contextWindow,`pointermove`,this.handlePointerMove,d),h7(this.contextWindow,`pointerup`,this.handlePointerUp,d),h7(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(v7.has(e.overflowX)||v7.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),t3.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),n3(this.updatePoint)}};function b7(e,t){return t?{point:t(e.point)}:e}function x7(e,t){return{x:e.x-t.x,y:e.y-t.y}}function S7({point:e},t){return{point:e,delta:x7(e,C7(t)),offset:x7(e,Dbe(t)),velocity:Obe(t,.1)}}function Dbe(e){return e[0]}function C7(e){return e[e.length-1]}function Obe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=C7(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>K2(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>K2(t)*2&&(r=e[1]);let a=q2(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function kbe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?W4(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?W4(n,e,r.max):Math.min(e,n)),e}function w7(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Abe(e,{top:t,left:n,bottom:r,right:i}){return{x:w7(e.x,n,i),y:w7(e.y,t,r)}}function T7(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function jbe(e,t){return{x:T7(e.x,t.x),y:T7(e.y,t.y)}}function Mbe(e,t){let n=.5,r=c5(e),i=c5(t);return i>r?n=W2(t.min,t.max-r,e.min):r>i&&(n=W2(e.min,e.max-i,t.min)),I2(0,1,n)}function Nbe(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var E7=.35;function Pbe(e=E7){return e===!1?e=0:e===!0&&(e=E7),{x:D7(e,`left`,`right`),y:D7(e,`top`,`bottom`)}}function D7(e,t,n){return{min:O7(e,t),max:O7(e,n)}}function O7(e,t){return typeof e==`number`?e:e[t]||0}var Fbe=new WeakMap,Ibe=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=I8(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ove(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),w5(e=>{let t=this.getAxisMotionValue(e).get()||0;if(k4.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=c5(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&t3.update(()=>i(e,t),!1,!0),R6(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;r&&this.currentDirection===null?(this.currentDirection=Rbe(o),this.currentDirection!==null&&i&&i(this.currentDirection)):(this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&t3.update(()=>a(e,t),!1,!0))},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new y7(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:g7(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&t3.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!A7(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=kbe(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&d7(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?Abe(n.layoutBox,e):!1,this.elastic=Pbe(t),r!==this.constraints&&!d7(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&w5(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Nbe(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!d7(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Eve(n,r.root,this.visualElement.getTransformPagePoint()),a=jbe(r.layout.layoutBox,i);if(t){let e=t(Cve(a));this.hasMutatedConstraints=!!e,e&&(a=Z6(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=w5(o=>{if(!A7(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return R6(this.visualElement,e),n.start(j6(e,n,0,t,this.visualElement,!1))}stopAnimation(){w5(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();w5(e=>{if(!A7(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-W4(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!d7(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};w5(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Mbe({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),w5(t=>{let n=this.getAxisMotionValue(t);if(!A7(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(W4(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Fbe.set(this.visualElement,this);let e=this.visualElement.current,t=h7(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Pve(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();d7(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Lbe(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),t3.read(r);let o=A5(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(w5(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=E7,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function k7(e){let t=!0;return()=>{t?t=!1:e()}}function Lbe(e,t,n){let r=A8(e,k7(n)),i=A8(t,k7(n));return()=>{r(),i()}}function A7(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Rbe(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var zbe=class extends Y8{constructor(e){super(e),this.removeGroupControls=H2,this.removeListeners=H2,this.controls=new Ibe(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||H2}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},j7=e=>(t,n)=>{e&&t3.update(()=>e(t,n),!1,!0)},Bbe=class extends Y8{constructor(){super(...arguments),this.removePointerDownListener=H2}onPointerDown(e){this.session=new y7(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:g7(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:j7(e),onStart:j7(t),onMove:j7(n),onEnd:(e,t)=>{delete this.session,r&&t3.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=h7(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},M7=!1,Vbe=class extends v.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),M7&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),M5.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a&&(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),M7=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||t3.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),m8.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;M7=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function N7(e){let[t,n]=Xye(),r=(0,v.useContext)(k2);return(0,B.jsx)(Vbe,{...e,layoutGroup:r,switchLayoutGroup:(0,v.useContext)(u7),isPresent:t,safeToRemove:n})}var Hbe={pan:{Feature:Bbe},drag:{Feature:zbe,ProjectionNode:Y5,MeasureLayout:N7}};function P7(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&t3.postRender(()=>i(t,m7(t)))}var Ube=class extends Y8{mount(){let{current:e}=this.node;e&&(this.unmount=Ave(e,(e,t)=>(P7(this.node,t,`Start`),e=>P7(this.node,e,`End`))))}unmount(){}},Wbe=class extends Y8{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=U2(A5(this.node.current,`focus`,()=>this.onFocus()),A5(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function F7(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&t3.postRender(()=>i(t,m7(t)))}var Gbe=class extends Y8{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Ive(e,(e,t)=>(F7(this.node,t,`Start`),(e,{success:t})=>F7(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},I7=new WeakMap,L7=new WeakMap,Kbe=e=>{let t=I7.get(e.target);t&&t(e)},qbe=e=>{e.forEach(Kbe)};function Jbe({root:e,...t}){let n=e||document;L7.has(n)||L7.set(n,{});let r=L7.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(qbe,{root:e,...t})),r[i]}function Ybe(e,t,n){let r=Jbe(t);return I7.set(e,n),r.observe(e),()=>{I7.delete(e),r.unobserve(e)}}var Xbe={some:0,all:1},Zbe=class extends Y8{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Xbe[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Ybe(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Qbe(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Qbe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var $be={inView:{Feature:Zbe},tap:{Feature:Gbe},focus:{Feature:Wbe},hover:{Feature:Ube}},exe={layout:{ProjectionNode:Y5,MeasureLayout:N7}},R7=bbe({...wbe,...$be,...Hbe,...exe},xbe);function z7(e){let t=A2(()=>O6(e)),{isStatic:n}=(0,v.useContext)(X5);if(n){let[,n]=(0,v.useState)(e);(0,v.useEffect)(()=>t.on(`change`,n),[])}return t}function B7(e,t){let n=z7(t()),r=()=>n.set(t());return r(),j2(()=>{let t=()=>t3.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return r(),()=>{n.forEach(e=>e()),n3(r)}}),n}function txe(e){D6.current=[],e();let t=B7(D6.current,e);return D6.current=void 0,t}function V7(e,t,n,r){if(typeof e==`function`)return txe(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return nxe(e,t,n,r);let i=typeof t==`function`?t:Kve(t,n,r),a=Array.isArray(e)?H7(e,i):H7([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function H7(e,t){let n=A2(()=>[]);return B7(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function nxe(e,t,n,r){let i=A2(()=>Object.keys(n)),a=A2(()=>({}));for(let o of i)a[o]=V7(e,t,n[o],r);return a}var rxe=class{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,t){this.componentControls.forEach(n=>{n.start(e.nativeEvent||e,t)})}cancel(){this.componentControls.forEach(e=>{e.cancel()})}stop(){this.componentControls.forEach(e=>{e.stop()})}},ixe=()=>new rxe;function axe(){return A2(ixe)}var U7=(0,v.createContext)(null);function oxe(e,t,n,r,i,a=`ltr`){let o=e.findIndex(e=>e.value===t);if(o===-1)return e;if(i===`xy`){let{layout:t}=e[o],r={x:W4(t.x.min,t.x.max,.5)+n.x,y:W4(t.y.min,t.y.max,.5)+n.y},i=sxe(e),s=i.find(t=>t.items.includes(e[o])),c=i.reduce((e,t)=>W7(r.y,t)<W7(r.y,e)?t:e);if(c!==s)return cxe(e,o,r.x,c,a);let l=G7(r,t),u=-1,d=l;return e.forEach((e,t)=>{if(t===o)return;let n=G7(r,e.layout);n<d&&(u=t,d=n)}),u===-1?e:F2(e,o,o+Math.sign(u-o))}if(!r[i])return e;let s=r[i]>0?1:-1,c=e[o+s];if(!c)return e;let l=e[o].layout[i],u=c.layout[i],d=W4(u.min,u.max,.5);return s===1&&l.max+n[i]>d||s===-1&&l.min+n[i]<d?F2(e,o,o+s):e}function sxe(e){let t=[];return e.forEach(e=>{let{min:n,max:r}=e.layout.y,i=t[t.length-1];!i||n>=i.max||r<=i.min?t.push({items:[e],min:n,max:r}):(i.items.push(e),i.min=Math.min(i.min,n),i.max=Math.max(i.max,r))}),t}function W7(e,t){return e<t.min?t.min-e:e>t.max?e-t.max:0}function cxe(e,t,n,r,i){let a=e.filter((e,n)=>n!==t),o=r.items.find(e=>{let t=W4(e.layout.x.min,e.layout.x.max,.5);return i===`ltr`?n<t:n>t}),s=o?a.indexOf(o):a.indexOf(r.items[r.items.length-1])+1,c=[...a];return c.splice(s,0,e[t]),c.every((t,n)=>t===e[n])?e:c}function G7(e,t){let n=Math.max(t.x.min-e.x,0,e.x-t.x.max),r=Math.max(t.y.min-e.y,0,e.y-t.y.max);return n*n+r*r}var K7=(e,t)=>e.max<=t.min||t.max<=e.min;function lxe(e){let t=!1,n=!1;for(let r=0;r<e.length;r++)for(let i=r+1;i<e.length;i++)if(t||=K7(e[r].x,e[i].x),n||=K7(e[r].y,e[i].y),t&&n)return`xy`;return t?`x`:`y`}function uxe({children:e,as:t=`ul`,axis:n,onReorder:r,values:i,onPointerDownCapture:a,onClickCapture:o,...s},c){let l=A2(()=>R7[t]),u=(0,v.useRef)(new Map),[d,f]=(0,v.useState)(`y`),p=(0,v.useRef)(!1),m=(0,v.useRef)(!1),h=(0,v.useRef)(null),g=n||d,_=new Set(i);u.current.forEach((e,t)=>{_.has(t)||u.current.delete(t)});let y={axis:g,groupRef:h,hasReordered:m,registerItem:(e,t)=>{if(u.current.set(e,t),!n){let e=lxe(i.flatMap(e=>{let t=u.current.get(e);return t?[t]:[]}));e!==d&&f(e)}},updateOrder:(e,t,n)=>{if(p.current)return;let a=i.flatMap(e=>{let t=u.current.get(e);return t?[{value:e,layout:t}]:[]}),o=h.current?.ownerDocument.defaultView?.getComputedStyle(h.current).direction===`rtl`?`rtl`:`ltr`,s=oxe(a,e,t,n,g,o);if(a!==s){p.current=!0,m.current=!0;let e=[...i],t=a.map(({value:e})=>i.indexOf(e));s.forEach(({value:n},r)=>{e[t[r]]=n}),r(e)}}};(0,v.useEffect)(()=>{p.current=!1},[i]);let b=e=>{h.current=e,typeof c==`function`?c(e):c&&(c.current=e)},x={overflowAnchor:`none`,...s.style};return(0,B.jsx)(l,{...s,style:x,ref:b,onPointerDownCapture:e=>{m.current=!1,a?.(e)},onClickCapture:e=>{m.current&&e.detail&&(m.current=!1,e.stopPropagation(),e.preventDefault()),o?.(e)},ignoreStrict:!0,children:(0,B.jsx)(U7.Provider,{value:y,children:e})})}var dxe=(0,v.forwardRef)(uxe),q7=50,fxe=25,pxe=new Set([`auto`,`scroll`]),J7=new WeakMap,Y7=new WeakMap,X7=null;function mxe(){if(X7){let e=Z7(X7,`y`);e&&(Y7.delete(e),J7.delete(e));let t=Z7(X7,`x`);t&&t!==e&&(Y7.delete(t),J7.delete(t)),X7=null}}function hxe(e,t){let n=getComputedStyle(e),r=t===`x`?n.overflowX:n.overflowY,i=e===document.body||e===document.documentElement;return pxe.has(r)||i}function Z7(e,t){let n=e?.parentElement;for(;n;){if(hxe(n,t))return n;n=n.parentElement}return null}function gxe(e,t,n){let r=t.getBoundingClientRect(),i=n===`x`?Math.max(0,r.left):Math.max(0,r.top),a=n===`x`?Math.min(window.innerWidth,r.right):Math.min(window.innerHeight,r.bottom),o=e-i,s=a-e;if(o<q7){let e=1-o/q7;return{amount:-25*e*e,edge:`start`}}if(s<q7){let e=1-s/q7;return{amount:fxe*e*e,edge:`end`}}return{amount:0,edge:null}}function _xe(e,t,n,r){if(!e)return;X7=e;let i=Z7(e,n);if(!i)return;let{amount:a,edge:o}=gxe(t-(n===`x`?window.scrollX:window.scrollY),i,n);if(o===null){Y7.delete(i),J7.delete(i);return}let s=Y7.get(i),c=i===document.body||i===document.documentElement;if(s!==o){if(!(o===`start`&&r<0||o===`end`&&r>0))return;Y7.set(i,o);let e=n===`x`?i.scrollWidth-(c?window.innerWidth:i.clientWidth):i.scrollHeight-(c?window.innerHeight:i.clientHeight);J7.set(i,e)}if(a>0){let e=J7.get(i);if((n===`x`?c?window.scrollX:i.scrollLeft:c?window.scrollY:i.scrollTop)>=e)return}n===`x`?c?window.scrollBy({left:a}):i.scrollLeft+=a:c?window.scrollBy({top:a}):i.scrollTop+=a}function Q7(e,t=0){return L6(e)?e:z7(t)}function vxe({children:e,style:t={},value:n,as:r=`li`,onDrag:i,onDragEnd:a,layout:o=!0,...s},c){let l=A2(()=>R7[r]),u=(0,v.useContext)(U7),d={x:Q7(t.x),y:Q7(t.y)},f=V7([d.x,d.y],([e,t])=>e||t?1:`unset`),{axis:p,registerItem:m,updateOrder:h,groupRef:g,hasReordered:_}=u;return(0,B.jsx)(l,{drag:p===`xy`||p,...s,dragSnapToOrigin:!0,style:{...t,x:d.x,y:d.y,zIndex:f},layout:o,onDrag:(e,t)=>{let{velocity:r,point:a}=t,o={x:d.x.get(),y:d.y.get()};h(n,o,r);let s=p===`xy`?Math.abs(r.x)>Math.abs(r.y)?`x`:`y`:p;_xe(g.current,a[s],s,r[s]),i&&i(e,t)},onDragEnd:(e,t)=>{_.current=!1,mxe(),a&&a(e,t)},onLayoutMeasure:e=>{m(n,e)},ref:c,ignoreStrict:!0,children:e})}var yxe=(0,v.forwardRef)(vxe);function $7(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(null);return(0,B.jsxs)(`form`,{className:`grid`,onSubmit:async n=>{n.preventDefault(),u(null);try{if(t)await tt(Xe(a).address,s.trim()===``?null:s.trim());else{let e=Xe(r);await tt(e.address,e.code)}e.onAdded?.()}catch(e){u(Vn(e))}},children:[(0,B.jsxs)(`div`,{className:F(`grid gap-2`,e.fieldsClassName),children:[t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(xV,{"aria-label":`Server URL`,placeholder:`Server URL, e.g. http://127.0.0.1:47841`,spellCheck:!1,autoComplete:`off`,value:a,onChange:e=>o(e.target.value)}),(0,B.jsx)(xV,{"aria-label":`Pairing code`,placeholder:`Pairing code, empty if auth is off`,spellCheck:!1,autoComplete:`off`,value:s,onChange:e=>c(e.target.value)})]}):(0,B.jsx)(xV,{"aria-label":`Pairing link`,placeholder:`Pairing link`,spellCheck:!1,autoComplete:`off`,value:r,onChange:e=>i(e.target.value)}),l!==null&&(0,B.jsx)(`p`,{className:`text-destructive text-sm break-all`,children:l}),(0,B.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground w-fit cursor-pointer text-xs`,onClick:()=>{n(!t),u(null)},children:t?`Paste a pairing link instead`:`Enter the server URL and code separately`})]}),e.actions(t?a.trim()!==``:r.trim()!==``)]})}function e9(e){return(0,B.jsx)(Y0,{open:!0,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`gap-0 overflow-hidden p-0 sm:max-w-md`,children:[(0,B.jsxs)(Q0,{className:`gap-1 px-6 pt-4 pr-12`,children:[(0,B.jsx)(e2,{className:`text-base`,children:`Add machine`}),(0,B.jsx)(t2,{children:`Paste the pairing link that OffSite printed when it started.`})]}),(0,B.jsx)($7,{fieldsClassName:`p-6`,onAdded:e.onClose,actions:t=>(0,B.jsxs)($0,{className:`bg-muted/40 border-t px-6 py-4`,children:[(0,B.jsx)(H,{type:`button`,variant:`outline`,onClick:e.onClose,children:`Cancel`}),(0,B.jsx)(H,{type:`submit`,disabled:!t,children:`Add machine`})]})})]})})}var bxe={connecting:`Connecting…`,online:`Online`,offline:`Offline`,unpaired:`Needs pairing`};function xxe(){let e=R(e=>e.machines),t=R(e=>e.machines.find(t=>t.id===e.settingsEditedMachine)),[n,r]=(0,v.useState)(!1);return t===void 0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(b2,{title:`Machines`,note:`This browser connects to each one directly. The list stays in this browser`,children:e.map(e=>(0,B.jsxs)(`div`,{className:`flex min-h-13 items-center gap-4 px-4 py-2.5`,children:[(0,B.jsx)(U,{icon:rA[e.icon],className:`text-muted-foreground size-5 shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.name}),e.addresses.map(e=>(0,B.jsx)(`p`,{className:`text-muted-foreground truncate font-mono text-xs`,children:e},e)),e.providers.filter(e=>e.state===`error`).map(e=>(0,B.jsxs)(`p`,{className:`text-destructive truncate text-xs`,title:e.error??void 0,children:[sf[e.provider],` threads: `,e.error]},e.provider))]}),(0,B.jsxs)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:[bxe[e.status],e.status===`online`&&e.via!==null&&e.via!==e.addresses[0]&&` · via ${new URL(e.via).host}`]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,B.jsx)(H,{size:`icon-sm`,variant:`ghost`,title:`Reconnect, trying the first address first`,onClick:()=>ot(e.id),children:(0,B.jsx)(U,{icon:ek})}),(0,B.jsx)(H,{size:`icon-sm`,variant:`ghost-muted`,title:`Open machine`,onClick:()=>z({settingsEditedMachine:e.id}),children:(0,B.jsx)(U,{icon:LD})})]})]},e.id))}),(0,B.jsx)(`div`,{className:`flex gap-2`,children:(0,B.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>r(!0),children:`Add machine…`})}),n&&(0,B.jsx)(e9,{onClose:()=>r(!1)})]}):(0,B.jsx)(Sxe,{machine:t})}function Sxe(e){let t=e.machine,[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),u=c??t.addresses,d=(0,v.useRef)(null);(0,v.useEffect)(()=>{n&&d.current?.focus()},[n]);function f(e){s(null);try{return it(t.id,{addresses:[...new Set(e.map(e=>Xe(e).address))]}),!0}catch(e){return s(Vn(e)),!1}}async function p(e){s(null);let n=e.trim();if(n===``)return!0;try{let e=n.includes(`#`)?Xe(n).code:n;if(e===null)throw Error(`That link has no pairing code`);return await nt(t.id,e),!0}catch(e){return s(Vn(e)),!1}}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(b2,{title:`Machine`,children:[(0,B.jsx)(x2,{label:`Name`,children:(0,B.jsx)(S2,{value:t.label??``,placeholder:t.hostname,onCommit:e=>it(t.id,{label:e.trim()===``?null:e.trim()})},t.label)}),(0,B.jsxs)(`div`,{className:`flex min-h-13 items-center justify-between gap-4 px-4 py-2.5`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium`,children:`Icon`}),(0,B.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1`,children:Object.entries(rA).map(e=>(0,B.jsx)(H,{size:`icon-sm`,variant:e[0]===t.icon?`default`:`ghost`,title:e[0],"aria-pressed":e[0]===t.icon,onClick:()=>it(t.id,{icon:e[0]}),children:(0,B.jsx)(U,{icon:e[1]})},e[0]))})]})]}),(0,B.jsx)(b2,{title:`Pairing`,children:(0,B.jsxs)(`div`,{className:`flex min-h-13 items-center justify-between gap-4 px-4 py-2.5`,children:[t.pairedAt!==null&&t.status!==`unpaired`&&(0,B.jsx)(`span`,{className:`text-sm`,children:t.pairedAt===null?`Paired`:`Paired ${df(t.pairedAt)}`}),(t.pairedAt===null||t.status===`unpaired`)&&(0,B.jsxs)(`form`,{className:`flex flex-1 items-center gap-3`,onSubmit:async e=>{e.preventDefault(),await p(i)&&a(``)},children:[(0,B.jsx)(xV,{className:`flex-1 font-mono`,placeholder:`Pairing link or code`,spellCheck:!1,autoComplete:`off`,value:i,onChange:e=>a(e.target.value)}),(0,B.jsxs)(H,{type:`submit`,variant:`outline`,className:`px-4`,disabled:i.trim()===``,children:[(0,B.jsx)(U,{icon:NO}),`Pair`]})]})]})}),(0,B.jsxs)(b2,{title:`Addresses`,note:`OffSite tries them in order whenever it reconnects`,children:[(0,B.jsx)(dxe,{as:`div`,axis:`y`,className:`divide-y`,values:u,onReorder:l,children:u.map((e,t)=>(0,B.jsxs)(Cxe,{address:e,onDragEnd:()=>{c!==null&&f(c),l(null)},children:[(0,B.jsx)(S2,{className:`flex-1 font-mono`,value:e,onCommit:e=>f(u.map((n,r)=>r===t?e:n))}),(0,B.jsx)(H,{size:`icon-sm`,variant:`ghost`,title:`Remove address`,disabled:u.length===1,onClick:()=>f(u.filter((e,n)=>n!==t)),children:(0,B.jsx)(U,{icon:cO})})]},e))}),n&&(0,B.jsx)(`div`,{className:`px-4 py-2.5`,children:(0,B.jsx)(xV,{ref:d,className:`font-mono`,placeholder:`http://192.168.1.10:47841`,spellCheck:!1,autoComplete:`off`,onBlur:e=>{let n=e.target.value.trim();(n===``||f([...t.addresses,n]))&&r(!1)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}})}),!n&&(0,B.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:bg-muted/50 hover:text-foreground flex w-full items-center gap-2 px-4 py-3 text-sm transition-colors`,onClick:()=>r(!0),children:[(0,B.jsx)(U,{icon:MD,className:`size-4`}),`Add address`]})]}),o!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-1 text-xs break-all`,children:o}),(0,B.jsxs)(a2,{children:[(0,B.jsx)(o2,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`text-destructive`,children:`Remove machine`})}),(0,B.jsxs)(s2,{children:[(0,B.jsxs)(c2,{children:[(0,B.jsxs)(u2,{children:[`Remove `,t.name,`?`]}),(0,B.jsx)(d2,{children:`This browser forgets the machine. The machine and its threads stay untouched.`})]}),(0,B.jsxs)(l2,{children:[(0,B.jsx)(p2,{children:`Cancel`}),(0,B.jsx)(f2,{variant:`destructive`,onClick:()=>{z({settingsEditedMachine:null}),st(t.id)},children:`Remove machine`})]})]})]})]})}function Cxe(e){let t=axe();return(0,B.jsxs)(yxe,{as:`div`,value:e.address,dragListener:!1,dragControls:t,onDragEnd:e.onDragEnd,className:`bg-background relative flex items-center gap-3 px-4 py-2.5`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground hover:text-foreground cursor-grab touch-none active:cursor-grabbing`,title:`Drag to reorder`,onPointerDown:e=>t.start(e),children:(0,B.jsx)(U,{icon:lO,className:`size-4`})}),e.children]})}var t9=new Map([[`denied`,`Blocked in the browser's site settings`],[`insecure`,`Needs https or localhost`],[`install`,`Add OffSite to the Home Screen first`],[`unsupported`,`Not supported in this browser`]]);function wxe(e){let t=e.prefs.terminal,n=t.behavior;function r(r){Ud({...e.prefs,terminal:{...t,behavior:{...n,...r}}})}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(b2,{title:`Notifications`,children:[(0,B.jsx)(x2,{label:`Desktop notifications on this device`,children:(0,B.jsx)(Txe,{})}),(0,B.jsx)(x2,{label:`Push terminal alerts when no OffSite page is open`,children:(0,B.jsx)(Exe,{})})]}),(0,B.jsxs)(b2,{title:`Terminal bell`,children:[(0,B.jsx)(x2,{label:`Flash the screen on bell`,children:(0,B.jsx)(y2,{checked:n.bellFlash,onCheckedChange:e=>r({bellFlash:e})})}),(0,B.jsx)(x2,{label:`Play a sound on bell`,children:(0,B.jsx)(y2,{checked:n.bellSound,onCheckedChange:e=>r({bellSound:e})})})]})]})}function Txe(){let[e,t]=(0,v.useState)(Of),[n,r]=(0,v.useState)(kf);(0,v.useEffect)(()=>{let e=Of();if(e===`insecure`||e===`unsupported`)return;let n=new AbortController;return jf(n.signal,()=>t(Of())).catch(e=>console.error(`could not watch the notification permission`,e)),()=>n.abort()},[]);async function i(e){await Af(e),r(e),t(Of())}return(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[t9.has(e)&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t9.get(e)}),(0,B.jsx)(y2,{checked:e===`granted`&&n,disabled:e!==`granted`&&e!=="default",onCheckedChange:e=>void i(e)})]})}function Exe(){let[e,t]=(0,v.useState)(zf),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(()=>zf()===`supported`),[o,s]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(zf()!==`supported`)return;let e=!0;async function t(){try{let t=await Vf();e&&r(t)}catch(e){console.error(`could not read the push subscription`,e)}e&&a(!1)}return t(),()=>{e=!1}},[]);async function c(e){a(!0),s(null);try{e?r(await Hf()):(await Uf(),r(!1))}catch(e){console.error(`could not change push notifications`,e),s(Vn(e))}t(zf()),a(!1)}return(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[o!==null&&(0,B.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Could not update: `,o]}),t9.has(e)&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t9.get(e)}),(0,B.jsx)(y2,{checked:e===`supported`&&n,disabled:e!==`supported`||i,onCheckedChange:e=>void c(e)})]})}var Dxe={five_hour:`5h`,seven_day:`Week`,seven_day_opus:`Week (Opus)`,seven_day_sonnet:`Week (Sonnet)`};function Oxe(e){return Dxe[e.window]??e.window}function kxe(e){let t=e.account,[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),c=n===null?null:n.models;(0,v.useEffect)(()=>{let n=!0;return r(null),a(null),M(e.machine,`capabilities`,{provider:t.provider,accountId:t.id,projectId:null}).then(e=>{n&&r(e)},e=>{n&&a(Vn(e))}),()=>{n=!1}},[e.machine,t.provider,t.id,t.configDir]);async function l(n){s(null);try{await M(e.machine,`accounts.update`,{id:t.id,name:t.name,configDir:t.configDir,enabled:t.enabled,hiddenModels:t.hiddenModels,...n})}catch(e){s(Vn(e))}}async function u(){s(null);try{await M(e.machine,`accounts.remove`,{id:t.id}),z({settingsAccount:null})}catch(e){s(Vn(e))}}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(b2,{title:`Account`,children:[(0,B.jsx)(x2,{label:`Name`,children:(0,B.jsx)(S2,{value:t.name,valid:e=>e.trim()!==``,onCommit:e=>void l({name:e})},t.name)}),(0,B.jsx)(x2,{label:`Config directory`,children:(0,B.jsx)(S2,{className:`w-72 font-mono`,value:t.configDir,valid:e=>e.trim()!==``,onCommit:e=>void l({configDir:e})},t.configDir)})]}),o!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-1 text-xs`,children:o}),(0,B.jsxs)(b2,{title:`Models`,note:`Overrides the provider settings`,children:[i!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-4 py-3 text-xs`,children:i}),i===null&&c===null&&(0,B.jsx)(`p`,{className:`text-muted-foreground px-4 py-3 text-xs`,children:`Loading…`}),(c??[]).map(n=>{let r=e.settings[n.value]?.hidden??n.deprecated,i=t.hiddenModels[n.value],a=i??r;return(0,B.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3 px-4 py-1.5`,children:[(0,B.jsx)(`span`,{className:F(`min-w-0 flex-1 truncate text-sm`,a&&`text-muted-foreground`),children:n.name}),i!==void 0&&(0,B.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Override`}),(0,B.jsx)(y2,{size:`sm`,checked:!a,onCheckedChange:e=>{let i={...t.hiddenModels};!e===r?delete i[n.value]:i[n.value]=!e,l({hiddenModels:i})},"aria-label":`Show ${n.name}`})]},n.value)})]}),(0,B.jsxs)(a2,{children:[(0,B.jsx)(o2,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`text-destructive`,children:`Remove account`})}),(0,B.jsxs)(s2,{children:[(0,B.jsxs)(c2,{children:[(0,B.jsxs)(u2,{children:[`Remove `,t.name,`?`]}),(0,B.jsx)(d2,{children:`OffSite stops using this account. Its config directory and sessions stay untouched.`})]}),(0,B.jsxs)(l2,{children:[(0,B.jsx)(p2,{children:`Cancel`}),(0,B.jsx)(f2,{variant:`destructive`,onClick:()=>void u(),children:`Remove account`})]})]})]})]})}function Axe(e){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null);async function l(){o(!0),c(null);try{await M(e.machine,`accounts.add`,{provider:e.provider,name:t,configDir:r}),z({settingsAccount:null})}catch(e){c(Vn(e)),o(!1)}}return(0,B.jsxs)(`form`,{className:`space-y-5`,onSubmit:e=>{e.preventDefault(),l()},children:[(0,B.jsxs)(b2,{title:`Account`,children:[(0,B.jsx)(x2,{label:`Name`,children:(0,B.jsx)(xV,{className:`w-56`,value:t,onChange:e=>n(e.target.value),placeholder:`Work`})}),(0,B.jsx)(x2,{label:`Config directory`,children:(0,B.jsx)(xV,{className:`w-72 font-mono`,value:r,onChange:e=>i(e.target.value),placeholder:e.provider===`claude`?`~/.claude-work`:`~/.codex-work`})})]}),s!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-1 text-xs`,children:s}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{type:`button`,variant:`ghost`,onClick:()=>z({settingsAccount:null}),children:`Cancel`}),(0,B.jsx)(H,{type:`submit`,disabled:a||t.trim()===``||r.trim()===``,children:`Add account`})]})]})}function jxe(e){let t=e.config,n=t.enabledProviders[e.provider],r=e.provider===`claude`?e.claudeAccounts:e.provider===`codex`?e.codexAccounts:[],i=r.find(e=>e.valid),a=t.claudeBaseDir[e.platform]??e.defaultClaudeBaseDir;if(e.selected===`new`){if(e.provider===`opencode`)throw Error(`OpenCode accounts cannot be added`);return(0,B.jsx)(Axe,{machine:e.machine,provider:e.provider})}if(e.selected!==null){let n=r.find(t=>t.id===e.selected);return n===void 0?(0,B.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`This account no longer exists.`}):(0,B.jsx)(kxe,{machine:e.machine,settings:t.models[e.provider],account:n})}return(0,B.jsxs)(B.Fragment,{children:[e.provider===`claude`&&(0,B.jsx)(`div`,{className:`divide-y overflow-hidden rounded-xl border`,children:(0,B.jsx)(x2,{label:`Base directory`,children:(0,B.jsx)(S2,{className:`w-72 font-mono`,value:a,valid:e=>e.trim()!==``,onCommit:n=>Yd(e.machine,{...t,claudeBaseDir:{...t.claudeBaseDir,[e.platform]:n}})},a)})}),(0,B.jsxs)(`div`,{className:F(`space-y-5 transition-opacity`,!n&&`opacity-50`),children:[e.provider!==`opencode`&&(0,B.jsx)(b2,{title:`Accounts`,children:(0,B.jsx)(Mxe,{machine:e.machine,accounts:r})}),n&&e.provider===`opencode`&&e.openCode.available&&(0,B.jsx)(n9,{machine:e.machine,config:t,composer:e.composer,provider:e.provider,accountId:null}),n&&e.provider!==`opencode`&&i!==void 0&&(0,B.jsx)(n9,{machine:e.machine,config:t,composer:e.composer,provider:e.provider,accountId:i.id})]})]})}function n9(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=e.config.models[e.provider],o=t===null?null:t.models,s=e.composer[e.provider],c=s.model??(t===null?null:t.defaultModel);(0,v.useEffect)(()=>{let t=!0;return n(null),i(null),M(e.machine,`capabilities`,{provider:e.provider,accountId:e.accountId,projectId:null}).then(e=>{t&&n(e)},e=>{t&&i(Vn(e))}),()=>{t=!1}},[e.machine,e.provider,e.accountId]);function l(t,n){Yd(e.machine,{...e.config,models:{...e.config.models,[e.provider]:{...a,[t]:n}}})}return(0,B.jsxs)(b2,{title:`Models`,children:[o!==null&&(0,B.jsx)(x2,{label:`Default model`,children:(0,B.jsxs)(m2,{value:c??void 0,onValueChange:t=>{let n=o?.find(e=>e.value===t)?.effort??null;Zd(e.machine,{...e.composer,[e.provider]:{...s,model:t,...n===null?{}:{effort:n}}})},children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{placeholder:`Choose a model`})}),(0,B.jsx)(_2,{children:o.filter(e=>!(a[e.value]?.hidden??e.deprecated)||e.value===c).map(e=>(0,B.jsx)(v2,{value:e.value,children:e.name},e.value))})]})}),r!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-4 py-3 text-xs`,children:r}),r===null&&o===null&&(0,B.jsx)(`p`,{className:`text-muted-foreground px-4 py-3 text-xs`,children:`Loading…`}),(o??[]).map(t=>{let n=a[t.value]??{hidden:t.deprecated,effort:t.effort};return(0,B.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3 px-4 py-1.5`,children:[(0,B.jsxs)(`div`,{className:F(`min-w-0 flex-1 truncate text-sm`,n.hidden&&`text-muted-foreground`),children:[t.name,e.provider===`opencode`&&(0,B.jsx)(`span`,{className:`text-muted-foreground ml-2 text-xs`,children:t.description})]}),t.efforts.length>0&&(0,B.jsxs)(m2,{value:n.effort??t.effort??void 0,onValueChange:e=>l(t.value,{...n,effort:e}),children:[(0,B.jsx)(g2,{size:`sm`,className:`w-28`,children:(0,B.jsx)(h2,{placeholder:`Effort`})}),(0,B.jsx)(_2,{children:t.efforts.map(e=>(0,B.jsx)(v2,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,B.jsx)(y2,{size:`sm`,checked:!n.hidden,onCheckedChange:e=>l(t.value,{...n,hidden:!e}),"aria-label":`Show ${t.name}`})]},t.value)})]})}function Mxe(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(null);async function a(e){n(!0),i(null);try{await e()}catch(e){i(Vn(e))}finally{n(!1)}}return(0,B.jsxs)(B.Fragment,{children:[e.accounts.map(n=>(0,B.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,B.jsxs)(`div`,{className:F(`min-w-0 flex-1`,!n.enabled&&`opacity-50`),children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(`span`,{className:F(`size-2 shrink-0 rounded-full`,!n.enabled&&`bg-muted-foreground/40`,n.enabled&&n.error!==null&&`bg-destructive`,n.enabled&&n.error===null&&!n.linked&&`bg-warning`,n.enabled&&n.error===null&&n.linked&&`bg-success`)}),(0,B.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n.name}),n.plan!==null&&(0,B.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:n.plan})]}),n.error!==null&&(0,B.jsx)(`p`,{className:`text-destructive mt-1 truncate pl-4 text-xs`,children:n.error}),n.error===null&&!n.linked&&(0,B.jsx)(`p`,{className:`text-warning mt-1 truncate pl-4 text-xs`,children:`Not linked to shared threads · hidden in the composer`}),n.error===null&&n.linked&&n.limits.length>0&&(0,B.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-x-5 gap-y-1.5 pl-4`,children:n.limits.map(e=>(0,B.jsx)(Nxe,{limit:e},e.window))})]}),(0,B.jsx)(y2,{size:`sm`,checked:n.enabled,disabled:t,onCheckedChange:t=>void a(()=>M(e.machine,`accounts.update`,{id:n.id,name:n.name,configDir:n.configDir,enabled:t,hiddenModels:n.hiddenModels})),"aria-label":`Enable ${n.name}`}),(0,B.jsx)(H,{size:`icon-sm`,variant:`ghost-muted`,title:`Open account`,onClick:()=>z({settingsAccount:n.id}),children:(0,B.jsx)(U,{icon:LD})})]},n.id)),(0,B.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:bg-muted/50 hover:text-foreground flex w-full items-center gap-2 px-4 py-3 text-sm transition-colors`,onClick:()=>z({settingsAccount:`new`}),children:[(0,B.jsx)(U,{icon:MD,className:`size-4`}),`Add account`]}),r!==null&&(0,B.jsx)(`p`,{className:`text-destructive px-4 py-3 text-xs`,children:r})]})}function Nxe(e){let t=e.limit,n=t.rejected?100:t.utilization===null?null:Math.min(100,Math.round(t.utilization*100));return n===null?null:(0,B.jsx)($z,{label:t.resetsAt===null?`Reset time unknown`:`Resets ${df(t.resetsAt*1e3)}`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:Oxe(t)}),(0,B.jsx)(`div`,{className:`bg-foreground/10 h-1 w-16 overflow-hidden rounded-full`,children:(0,B.jsx)(`div`,{className:F(`h-full rounded-full`,t.rejected&&`bg-destructive`,!t.rejected&&n>=80&&`bg-warning`,!t.rejected&&n<80&&`bg-foreground/50`),style:{width:`${n}%`}})}),(0,B.jsxs)(`span`,{className:F(`tabular-nums`,t.rejected&&`text-destructive`,!t.rejected&&`text-muted-foreground`),children:[n,`%`]})]})})}var r9=zn?`⌘`:`Ctrl+Shift`,Pxe=[[`Enter`,`Send, or queue or steer while the agent works`],[`${Bn}+Enter`,`Send the other way while the agent works`],[`Shift+Enter`,`New line`],[`↑`,`Recall your last message`],[`Shift+Tab`,`Cycle permission mode`],[`Esc`,`Stop the agent`],[`/`,`Slash commands`],[`@`,`Mention a file`],[`${Bn}+K`,`Search sessions and actions`],[`${Bn}+N or ${Bn}+T`,`New thread`],[zn?"⌘+`, Ctrl+` or ⌘+J":"Ctrl+` or Ctrl+J",`Toggle the terminal`],[`${Bn}+B`,`Toggle the sidebar`],[`${r9}+T`,`New terminal tab, in the terminal`],[`${r9}+W`,`Close the terminal tab`],[`${r9}+F`,`Find in the terminal`],[`Ctrl+Tab`,`Next terminal tab`],[`Ctrl+Shift+Tab`,`Previous terminal tab`]];function Fxe(){return(0,B.jsx)(b2,{title:`Keyboard shortcuts`,children:Pxe.map(([e,t])=>(0,B.jsx)(x2,{label:t,children:(0,B.jsx)(`kbd`,{className:`bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-sans text-xs`,children:e})},e))})}function Ixe(e){let t=e.prefs.terminal,[n,r]=(0,v.useState)(!BE.some(e=>e.family===t.font.family));function i(t){Ud({...e.prefs,terminal:t})}function a(e,n){i({...t,[e]:{...t[e],...n}})}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(b2,{title:`Font`,children:[(0,B.jsx)(x2,{label:`Family`,children:(0,B.jsxs)(m2,{value:n?`custom`:t.font.family,onValueChange:e=>{r(e===`custom`),e!==`custom`&&a(`font`,{family:e})},children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[BE.map(e=>(0,B.jsx)(v2,{value:e.family,children:e.label},e.family)),(0,B.jsx)(v2,{value:`custom`,children:`Custom`})]})]})}),n&&(0,B.jsx)(x2,{label:`Custom family`,children:(0,B.jsx)(S2,{placeholder:`Installed font name`,value:t.font.family,onCommit:e=>a(`font`,{family:e})})}),(0,B.jsx)(x2,{label:`Size`,children:(0,B.jsx)(C2,{value:t.font.size,step:.5,onCommit:e=>a(`font`,{size:e})})}),(0,B.jsx)(x2,{label:`Line height`,children:(0,B.jsx)(C2,{value:t.font.lineHeight,step:.05,onCommit:e=>a(`font`,{lineHeight:e})})}),(0,B.jsx)(x2,{label:`Ligatures`,children:(0,B.jsx)(y2,{checked:t.font.ligatures,onCheckedChange:e=>a(`font`,{ligatures:e})})}),(0,B.jsx)(x2,{label:`Bold text in bright colors`,children:(0,B.jsx)(y2,{checked:t.boldIsBright,onCheckedChange:e=>i({...t,boldIsBright:e})})})]}),(0,B.jsxs)(b2,{title:`Cursor`,children:[(0,B.jsx)(x2,{label:`Style`,children:(0,B.jsxs)(m2,{value:t.cursor.style,onValueChange:e=>a(`cursor`,{style:e}),children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`block`,children:`Block`}),(0,B.jsx)(v2,{value:`bar`,children:`Bar`}),(0,B.jsx)(v2,{value:`underline`,children:`Underline`})]})]})}),(0,B.jsx)(x2,{label:`Blink`,children:(0,B.jsx)(y2,{checked:t.cursor.blink,onCheckedChange:e=>a(`cursor`,{blink:e})})})]}),(0,B.jsx)(Lxe,{behavior:t.behavior,onChange:e=>a(`behavior`,e)}),(0,B.jsx)(Rxe,{behavior:t.behavior,onChange:e=>a(`behavior`,e)}),(0,B.jsxs)(b2,{title:`Layout`,children:[[`top`,`right`,`bottom`,`left`].map(e=>(0,B.jsx)(x2,{label:`Padding ${e}`,children:(0,B.jsx)(C2,{value:t.padding[e],onCommit:t=>a(`padding`,{[e]:t})})},e)),(0,B.jsx)(x2,{label:`Scrollback lines`,children:(0,B.jsx)(C2,{value:t.scrollback,step:1e3,onCommit:e=>i({...t,scrollback:e})})})]})]})}function Lxe(e){return(0,B.jsxs)(b2,{title:`Behavior`,children:[(0,B.jsx)(x2,{label:`Modernize Shift+Enter`,children:(0,B.jsx)(y2,{checked:e.behavior.modernizeShiftEnter,onCheckedChange:t=>e.onChange({modernizeShiftEnter:t})})}),(0,B.jsx)(x2,{label:`${NE.linux.label} (${NE.windows.label} on Windows machines) pastes images from the browser clipboard`,children:(0,B.jsx)(y2,{checked:e.behavior.pasteBrowserImages,onCheckedChange:t=>e.onChange({pasteBrowserImages:t})})}),(0,B.jsx)(x2,{label:`Capture browser shortcuts`,children:(0,B.jsx)(y2,{checked:e.behavior.captureShortcuts,onCheckedChange:t=>e.onChange({captureShortcuts:t})})}),(0,B.jsx)(x2,{label:`Click moves the cursor in the command line`,children:(0,B.jsx)(y2,{checked:e.behavior.clickToMoveCursor,onCheckedChange:t=>e.onChange({clickToMoveCursor:t})})}),(0,B.jsx)(x2,{label:`Ask before closing a tab that is running a program`,children:(0,B.jsx)(y2,{checked:e.behavior.confirmCloseBusyTab,onCheckedChange:t=>e.onChange({confirmCloseBusyTab:t})})})]})}function Rxe(e){return zn?(0,B.jsx)(b2,{title:`Mac keys`,note:`Meta keeps that Option key from typing @, | and other symbols. Safari and Firefox use US key positions`,children:(0,B.jsx)(x2,{label:`Use Option as Meta`,children:(0,B.jsxs)(m2,{value:e.behavior.optionAsMeta,onValueChange:t=>e.onChange({optionAsMeta:t}),children:[(0,B.jsx)(g2,{className:`w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsxs)(_2,{children:[(0,B.jsx)(v2,{value:`off`,children:`Off`}),(0,B.jsx)(v2,{value:`left`,children:`Left Option`}),(0,B.jsx)(v2,{value:`right`,children:`Right Option`}),(0,B.jsx)(v2,{value:`both`,children:`Both Options`})]})]})})}):null}var zxe=[`General`,`Terminal`,`Notifications`,`Shortcuts`,`Machines`],i9=[`Machine`,`Claude`,`Codex`,`OpenCode`];function Bxe(){let e=R(e=>e.settingsOpen),t=R(e=>e.prefs),n=R(e=>e.machines),r=R(e=>e.settingsMachine===null?null:jd(e,e.settingsMachine)),i=r===null?null:r.config,a=r===null?null:r.system,o=R(e=>e.settingsPage),s=i9.includes(o),c=a9(o),l=R(e=>c===null?null:e.settingsAccount),u=l===`new`?`New account`:[...r?.claudeAccounts??[],...r?.codexAccounts??[]].find(e=>e.id===l)?.name,d=R(e=>o===`Machines`?e.machines.find(t=>t.id===e.settingsEditedMachine)??null:null),f=l!==null||d!==null,[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(0);function _(e){let t=a9(e);return(0,B.jsxs)(`button`,{className:F(`text-muted-foreground hover:bg-accent hover:text-foreground flex h-9 flex-none items-center rounded-md px-2 text-sm transition-colors`,e===o&&`bg-accent text-foreground`),onClick:()=>Hd(e),children:[t!==null&&(0,B.jsx)(`span`,{className:`mr-2.5 flex size-4 items-center justify-center`,children:(0,B.jsx)(sA,{provider:t,className:F(t===`claude`&&`size-4`,t===`codex`&&`size-[19px] shrink-0`,t===`opencode`&&`h-3.5`)})}),e===`Machine`?`General`:e]},e)}return(0,B.jsx)(Y0,{open:e,onOpenChange:Vd,children:(0,B.jsxs)(Z0,{showCloseButton:!1,"aria-describedby":void 0,className:`flex h-[min(44rem,calc(100dvh-2rem))] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl sm:flex-row`,children:[(0,B.jsxs)(`nav`,{className:`flex flex-none gap-1 overflow-x-auto border-b p-3 sm:w-48 sm:flex-col sm:border-r sm:border-b-0`,children:[(0,B.jsx)(e2,{className:`hidden px-2 pt-1 pb-3 text-base font-semibold sm:block`,children:`Settings`}),zxe.map(_),(0,B.jsxs)(`div`,{className:`flex flex-none items-center gap-1 sm:mt-6 sm:flex-col sm:items-stretch`,children:[r!==null&&n.length>1&&(0,B.jsxs)(m2,{value:r.id,onValueChange:e=>z({settingsMachine:e,settingsAccount:null}),children:[(0,B.jsx)(g2,{className:`mb-1 w-40 sm:w-full`,children:(0,B.jsx)(h2,{})}),(0,B.jsx)(_2,{children:n.map(e=>(0,B.jsxs)(v2,{value:e.id,children:[(0,B.jsx)(U,{icon:rA[e.icon]}),e.name]},e.id))})]}),r!==null&&n.length===1&&(0,B.jsxs)(`p`,{className:`text-muted-foreground flex h-9 items-center gap-1.5 px-2 text-xs font-medium [&_svg]:size-4`,children:[(0,B.jsx)(U,{icon:rA[r.icon]}),(0,B.jsx)(`span`,{className:`truncate`,children:r.name})]}),i9.map(_)]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 pt-4 pb-7`,children:[(0,B.jsxs)(`div`,{className:`mb-5 flex h-9 items-center`,children:[f&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground text-xl font-semibold tracking-tight transition-colors`,onClick:()=>z({settingsAccount:null,settingsEditedMachine:null}),children:o}),(0,B.jsx)(U,{icon:LD,className:`text-muted-foreground mx-1.5 size-5`}),(0,B.jsx)(`h2`,{className:`truncate text-xl font-semibold tracking-tight`,children:l===null?d?.name:u})]}),!f&&(0,B.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:o===`Machine`?`General`:o}),c!==null&&l===null&&r!==null&&i!==null&&(0,B.jsx)(y2,{className:`ml-3`,checked:i.enabledProviders[c],onCheckedChange:e=>void Yd(r.id,{...i,enabledProviders:{...i.enabledProviders,[c]:e}}),"aria-label":`Enable ${o}`}),(0,B.jsx)(X0,{asChild:!0,children:(0,B.jsx)(H,{variant:`ghost`,size:`icon`,className:`-mr-2 ml-auto`,"aria-label":`Close settings`,children:(0,B.jsx)(U,{icon:UD})})})]}),s&&r!==null&&r.configError!==null&&(0,B.jsxs)(`p`,{className:`text-destructive mb-5 text-sm whitespace-pre-wrap`,children:[`Not saved: `,r.configError]}),(0,B.jsxs)(`div`,{className:`w-full space-y-5`,children:[o===`General`&&(0,B.jsx)(Yhe,{prefs:t,onRestore:()=>m(`browser`)}),o===`Machine`&&r!==null&&i!==null&&a!==null&&(0,B.jsx)(oge,{machine:r.id,config:i,platform:a.platform,defaultShell:a.defaultShell,claudeAccounts:r.claudeAccounts,codexAccounts:r.codexAccounts,openCode:r.openCode,onRestore:()=>m(`machine`)}),s&&r===null&&(0,B.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Add a machine to see its settings.`}),s&&r!==null&&(i===null||a===null)&&(0,B.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[r.name,` is not connected. Its settings show up once it is.`]}),o===`Terminal`&&(0,B.jsx)(Ixe,{prefs:t}),o===`Notifications`&&(0,B.jsx)(wxe,{prefs:t}),c!==null&&r!==null&&i!==null&&r.composer!==null&&a!==null&&(0,B.jsx)(jxe,{machine:r.id,config:i,composer:r.composer,platform:a.platform,defaultClaudeBaseDir:a.defaultClaudeBaseDir,provider:c,claudeAccounts:r.claudeAccounts,codexAccounts:r.codexAccounts,openCode:r.openCode,selected:l},c),o===`Machines`&&(0,B.jsx)(xxe,{}),o===`Shortcuts`&&(0,B.jsx)(Fxe,{})]},h)]}),(0,B.jsx)(a2,{open:p!==null,onOpenChange:e=>{e||m(null)},children:(0,B.jsxs)(s2,{children:[(0,B.jsxs)(c2,{children:[(0,B.jsx)(u2,{children:p===`browser`?`Restore browser defaults?`:`Restore machine defaults?`}),(0,B.jsx)(d2,{children:p===`browser`?`All settings of this browser go back to their defaults.`:`All settings of ${r?.name} go back to their defaults.`})]}),(0,B.jsxs)(l2,{children:[(0,B.jsx)(p2,{children:`Cancel`}),(0,B.jsx)(f2,{variant:`destructive`,onClick:()=>{if(g(h+1),p===`browser`)Ud(xd);else{if(r===null||i===null||a===null)throw Error(`Restoring machine defaults needs a connected machine`);Yd(r.id,{...a.defaults,claudeAccounts:i.claudeAccounts,codexAccounts:i.codexAccounts})}},children:`Restore defaults`})]})]})})]})})}function a9(e){return e===`Claude`?`claude`:e===`Codex`?`codex`:e===`OpenCode`?`opencode`:null}function Vxe(){return(0,B.jsx)(`div`,{className:`grid flex-1 place-items-center p-6`,children:(0,B.jsxs)(`div`,{className:`w-full max-w-md`,children:[(0,B.jsx)(`h1`,{className:`text-foreground text-center text-2xl font-normal tracking-tight sm:text-3xl`,children:`Connect a machine`}),(0,B.jsx)(`p`,{className:`text-muted-foreground mt-2 text-center text-sm`,children:`Run this on the computer you want to use, then open the pairing link it prints.`}),(0,B.jsx)(`pre`,{className:`bg-muted text-foreground mt-5 rounded-lg px-4 py-3 font-mono text-sm select-all`,children:`npx offsite serve`}),(0,B.jsx)(`p`,{className:`text-muted-foreground mt-8 mb-3 text-sm`,children:`Or connect it here.`}),(0,B.jsx)($7,{actions:e=>(0,B.jsx)(H,{type:`submit`,className:`mt-4`,disabled:!e,children:`Connect`})})]})})}function Hxe(){let e=R(e=>e.paletteOpen),t=R(e=>e.selection),n=R(e=>e.sessions),r=R(e=>e.machines),i=R(e=>e.projects),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(0),l=(0,v.useRef)(null),u=a.toLowerCase().split(/\s+/).filter(Boolean),d=[...t===null?[]:[{key:`new`,label:`New thread`,detail:i.find(e=>e.machine===t.machine&&e.id===t.projectId)?.path??``,run:()=>pf({...t,sessionId:null})}],{key:`accounts`,label:`Manage accounts`,detail:``,run:()=>Hd(Dd[L().settings.provider])},{key:`settings`,label:`Settings`,detail:`Theme, notifications, keyboard shortcuts`,run:()=>Vd(!0)}],f=n.map(e=>({key:Ze(e.machine,e.id),label:e.title,detail:`${e.status===`minimized`?`Minimized · `:``}${r.length>1?`${r.find(t=>t.id===e.machine)?.name??``}:`:``}${i.find(t=>t.machine===e.machine&&t.id===e.projectId)?.path??``}`,run:()=>pf({machine:e.machine,projectId:e.projectId,sessionId:e.id})})),p=[...d,...f].filter(e=>{let t=`${e.label} ${e.detail}`.toLowerCase();return u.every(e=>t.includes(e))}).slice(0,50),m=Math.min(s,p.length-1);(0,v.useLayoutEffect)(()=>{l.current?.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[m]);function h(e){Bd(!1),e.run()}return(0,B.jsx)(Y0,{open:e,onOpenChange:e=>{Bd(e),o(``),c(0)},children:(0,B.jsxs)(Z0,{showCloseButton:!1,className:`top-[20%] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-xl`,children:[(0,B.jsx)(e2,{className:`sr-only`,children:`Search threads`}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 border-b px-4`,children:[(0,B.jsx)(U,{icon:rk,className:`text-muted-foreground size-4 shrink-0`}),(0,B.jsx)(`input`,{value:a,onChange:e=>{o(e.target.value),c(0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;c((m+t+p.length)%p.length)}e.key===`Enter`&&m>=0&&(e.preventDefault(),h(p[m]))},placeholder:`Search threads and actions…`,className:`placeholder:text-placeholder/75 h-11 w-full bg-transparent text-sm outline-none`})]}),(0,B.jsxs)(`div`,{ref:l,className:`max-h-96 overflow-y-auto p-1`,children:[p.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground px-3 py-6 text-center text-xs`,children:`Nothing matches.`}),p.map((e,t)=>(0,B.jsxs)(`button`,{"data-active":t===m,className:F(`flex w-full cursor-pointer flex-col rounded-lg px-2.5 py-1.5 text-left`,t===m&&`bg-accent`),onMouseMove:()=>c(t),onClick:()=>h(e),children:[(0,B.jsx)(`span`,{className:`truncate text-sm`,children:e.label}),e.detail!==``&&(0,B.jsx)(`span`,{className:`text-secondary-label truncate text-xs`,children:e.detail})]},e.key))]})]})})}function o9({className:e,...t}){return(0,B.jsx)(bx,{"data-slot":`label`,className:F(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var Uxe=/\.(png|jpe?g|gif|webp|svg)$/i;function Wxe(e){let t=R(e=>e.machines),[n,r]=(0,v.useState)(e.machine),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(`~`),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),m=c.trim()===``?void 0:i?.listing,h=m?.directories.filter(e=>e.name.toLowerCase().includes(u.toLowerCase()));function g(e){l(e),d(``)}return(0,v.useEffect)(()=>{if(c.trim()===``)return;let e=!1,t=setTimeout(async()=>{try{let t=await M(n,`directories.list`,{path:c});if(e)return;a({path:c,listing:t}),s(null)}catch(t){if(e)return;a(null),s(Vn(t))}},150);return()=>{e=!0,clearTimeout(t)}},[n,c]),(0,B.jsx)(Y0,{open:!0,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`gap-0 overflow-hidden p-0 sm:max-w-lg`,showCloseButton:!1,"aria-describedby":void 0,children:[(0,B.jsx)(e2,{className:`sr-only`,children:`Add project`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 border-b p-1`,children:[(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Home folder`,onClick:()=>g(`~`),children:(0,B.jsx)(U,{icon:wO})}),(0,B.jsx)(`div`,{className:`bg-border mx-0.5 h-4 w-px`}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Parent folder`,disabled:m?.parent===void 0||m.parent===null,onClick:()=>{m?.parent!==void 0&&m.parent!==null&&g(m.parent)},children:(0,B.jsx)(U,{icon:zD})}),(0,B.jsx)(`input`,{"aria-label":`Folder path`,className:`hover:bg-muted focus:bg-muted h-7 min-w-0 flex-1 rounded-md bg-transparent px-1.5 font-mono text-xs outline-none`,spellCheck:!1,value:c,onChange:e=>g(e.target.value)}),(0,B.jsx)(X0,{asChild:!0,children:(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,children:(0,B.jsx)(U,{icon:UD})})})]}),(0,B.jsxs)(`label`,{className:`flex h-9 items-center gap-2.5 border-b px-3`,children:[(0,B.jsx)(U,{icon:rk,className:`text-muted-foreground size-4 flex-none`}),(0,B.jsx)(`input`,{className:`placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent text-sm outline-none`,placeholder:`Search this folder`,value:u,onChange:e=>d(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`h-72 overflow-y-auto p-1`,children:[h?.map(e=>(0,B.jsxs)(`button`,{className:`hover:bg-muted flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-md px-2.5 text-left text-sm transition-colors`,onClick:()=>g(e.path),children:[(0,B.jsx)(U,{icon:mO,className:`text-muted-foreground size-4 flex-none`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)),h?.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground grid h-full place-items-center text-sm`,children:u===``?`No folders here`:`No matching folders`})]}),o!==null&&c.trim()!==``&&(0,B.jsx)(`p`,{className:`text-destructive border-t px-3 py-2 text-sm break-all`,children:o}),(0,B.jsxs)($0,{className:`border-t p-3`,children:[t.length>1&&(0,B.jsxs)(m2,{value:n,onValueChange:e=>{r(e),a(null),g(`~`)},children:[(0,B.jsx)(g2,{className:`sm:mr-auto sm:w-56`,children:(0,B.jsx)(h2,{})}),(0,B.jsx)(_2,{children:t.map(e=>(0,B.jsx)(v2,{value:e.id,disabled:e.status!==`online`,children:e.name},e.id))})]}),(0,B.jsx)(H,{disabled:i?.path!==c||f,onClick:async()=>{if(i!==null&&i.path===c){p(!0);try{e.onAdd({...await eA(n,i.listing.path),machine:n})}catch(e){s(Vn(e)),p(!1)}}},children:`Add project`})]})]})})}function Gxe(e){let t=e.project.path,[n,r]=(0,v.useState)(e.project.name),[i,a]=(0,v.useState)(e.project.logo),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),m=(0,v.useRef)(null);return(0,B.jsx)(Y0,{open:!0,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`gap-0 overflow-hidden p-0 sm:max-w-md`,children:[(0,B.jsxs)(`form`,{className:`grid`,onSubmit:async t=>{t.preventDefault(),l(!0);try{await tA(e.project.machine,e.project.id,{name:n,logo:i}),e.onClose()}catch(e){s(Vn(e)),l(!1)}},children:[(0,B.jsxs)(Q0,{className:`gap-1 px-6 pt-4 pr-12`,children:[(0,B.jsx)(e2,{className:`text-base`,children:`Edit project`}),(0,B.jsx)(t2,{className:`truncate font-mono text-xs`,title:t,children:t})]}),(0,B.jsxs)(`div`,{className:`grid gap-6 p-6`,children:[(0,B.jsxs)(`div`,{className:`grid gap-2.5`,children:[(0,B.jsx)(o9,{children:`Icon`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsx)(oA,{name:n.trim()===``?cf(t):n,logo:i,className:`ring-foreground/10 size-16 rounded-2xl ring-1 [&>img]:rounded-2xl [&>svg]:rounded-2xl`}),(0,B.jsxs)(`div`,{className:`grid gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsxs)(H,{type:`button`,variant:`outline`,size:`sm`,title:`Upload an image from this device`,onClick:()=>m.current?.click(),children:[(0,B.jsx)(U,{icon:yk}),`Upload`]}),(0,B.jsxs)(H,{type:`button`,variant:`outline`,size:`sm`,title:`Choose an image from the project on the server`,onClick:()=>p(!0),children:[(0,B.jsx)(U,{icon:mO}),`Choose from project`]}),i!==null&&(0,B.jsx)(H,{type:`button`,variant:`ghost-muted`,size:`sm`,onClick:()=>a(null),children:`Remove`})]}),(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`PNG, JPG, GIF, WebP, SVG or ICO, up to 384 KB`})]})]}),(0,B.jsx)(`input`,{ref:m,type:`file`,accept:`image/png,image/jpeg,image/gif,image/webp,image/svg+xml,image/x-icon`,hidden:!0,onChange:async e=>{let t=e.target.files?.[0];e.target.value=``,t!==void 0&&a(`data:${t.type};base64,${await CE(t)}`)}})]}),(0,B.jsxs)(`div`,{className:`grid gap-2`,children:[(0,B.jsx)(o9,{htmlFor:`project-name`,children:`Name`}),(0,B.jsx)(xV,{id:`project-name`,placeholder:cf(t),value:n,onChange:e=>r(e.target.value)})]}),o!==null&&(0,B.jsx)(`p`,{className:`text-destructive text-sm break-all`,children:o})]}),(0,B.jsxs)($0,{className:`bg-muted/40 border-t px-6 py-4`,children:[(0,B.jsxs)(H,{type:`button`,variant:u?`destructive`:`ghost`,className:F(`sm:mr-auto`,!u&&`text-destructive hover:bg-destructive/10 hover:text-destructive`),title:`Its threads stay in their provider`,onClick:async()=>{if(!u)d(!0);else try{await nA(e.project.machine,e.project.id),e.onRemoved()}catch(e){s(Vn(e))}},children:[(0,B.jsx)(U,{icon:cO,className:`text-current`}),u?`Click again to remove`:`Remove project`]}),(0,B.jsx)(H,{type:`button`,variant:`outline`,onClick:e.onClose,children:`Cancel`}),(0,B.jsx)(H,{type:`submit`,disabled:n.trim()===``||c,children:`Save`})]})]}),f&&(0,B.jsx)(Kxe,{machine:e.project.machine,projectId:e.project.id,onClose:()=>p(!1),onPick:e=>{a(e),p(!1)}})]})})}function Kxe(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null),s=t?.filter(e=>Uxe.test(e)&&e.toLowerCase().includes(r.toLowerCase()));return(0,v.useEffect)(()=>{let t=!1;return(async()=>{try{let r=await M(e.machine,`files.list`,{projectId:e.projectId});t||n(r)}catch(e){t||o(Vn(e))}})(),()=>{t=!0}},[e.machine,e.projectId]),(0,B.jsx)(Y0,{open:!0,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`gap-0 overflow-hidden p-0 sm:max-w-lg`,showCloseButton:!1,"aria-describedby":void 0,children:[(0,B.jsx)(e2,{className:`sr-only`,children:`Pick icon`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 border-b p-1`,children:[(0,B.jsxs)(`label`,{className:`flex h-7 min-w-0 flex-1 items-center gap-2.5 px-2`,children:[(0,B.jsx)(U,{icon:rk,className:`text-muted-foreground size-4 flex-none`}),(0,B.jsx)(`input`,{className:`placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent text-sm outline-none`,placeholder:`Search images in this project`,value:r,onChange:e=>i(e.target.value)})]}),(0,B.jsx)(X0,{asChild:!0,children:(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,children:(0,B.jsx)(U,{icon:UD})})})]}),(0,B.jsxs)(`div`,{className:`h-72 overflow-y-auto p-1`,children:[s?.map(t=>(0,B.jsxs)(`button`,{className:`hover:bg-muted flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-md px-2.5 text-left text-sm transition-colors`,onClick:async()=>{try{let n=await M(e.machine,`files.read`,{projectId:e.projectId,path:t});n.kind===`image`?e.onPick(`data:${n.mediaType};base64,${n.data}`):n.kind===`large`?o(`${t} is too large`):o(`${t} is not an image`)}catch(e){o(Vn(e))}},children:[(0,B.jsx)(U,{icon:TO,className:`text-muted-foreground size-4 flex-none`}),(0,B.jsx)(`span`,{className:`truncate font-mono text-xs`,children:t})]},t)),s?.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground grid h-full place-items-center text-sm`,children:r===``?`No images in this project`:`No matching images`})]}),a!==null&&(0,B.jsx)(`p`,{className:`text-destructive border-t px-3 py-2 text-sm break-all`,children:a})]})})}var s9=`group/sidebar-row relative w-full cursor-pointer overflow-hidden rounded-md text-left outline-none select-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`;function qxe(e){let t=e.session,n=$k(t.machine,t.projectId),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=e.activity?.waiting===!0,l=!c&&e.activity?.running===!0,u=l||!c&&Object.values(e.activity?.tasks??{}).includes(`running`),d=!c&&!u&&e.unseen,f=!e.selected&&!c&&!d,p=e.saved&&(0,B.jsxs)(uA,{onOpenChange:()=>o(!1),children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground inline-flex h-5 cursor-pointer items-center rounded-md px-1.5`,title:`Thread actions`,onClick:e=>e.stopPropagation(),children:(0,B.jsx)(U,{icon:uO,className:`size-3.5`})})}),(0,B.jsxs)(pA,{align:`end`,className:`w-44`,onClick:e=>e.stopPropagation(),onCloseAutoFocus:e=>{s.current!==null&&(e.preventDefault(),s.current.focus(),s.current.select())},children:[(0,B.jsxs)(mA,{onSelect:()=>i(t.title),children:[(0,B.jsx)(U,{icon:XO}),`Rename`]}),(0,B.jsxs)(mA,{onSelect:()=>void Cf(t.machine,t.id,{status:t.status===`pinned`?`active`:`pinned`}),children:[(0,B.jsx)(U,{icon:t.status===`pinned`?ZO:QO}),t.status===`pinned`?`Unpin`:`Pin`]}),(0,B.jsxs)(mA,{onSelect:()=>void Cf(t.machine,t.id,{status:t.status===`minimized`?`active`:`minimized`}),children:[(0,B.jsx)(U,{icon:t.status===`minimized`?IO:VO}),t.status===`minimized`?`Restore`:`Minimize`]}),t.status!==`inactive`&&(0,B.jsxs)(mA,{onSelect:()=>void Cf(t.machine,t.id,{status:`inactive`}),children:[(0,B.jsx)(U,{icon:$O}),`Make inactive`]}),(0,B.jsx)(yA,{}),(0,B.jsxs)(mA,{variant:`destructive`,title:`Also removes it from ${sf[t.provider]}`,onSelect:e=>{a?wf(t.machine,t.id):(e.preventDefault(),o(!0))},children:[(0,B.jsx)(U,{icon:cO}),a?`Click again to delete`:`Delete`]})]})]}),m=r===null?(0,B.jsx)(`span`,{className:F(`min-w-0 flex-1 truncate text-sm`,f?`text-secondary-label font-normal`:`font-medium`,!f&&(e.unseen||c)&&`text-foreground`,!f&&!e.unseen&&!c&&`text-foreground/90`),children:t.title}):(0,B.jsx)(`form`,{className:`min-w-0 flex-1`,onSubmit:e=>{e.preventDefault();let n=r.trim();i(null),n!==``&&n!==t.title&&Cf(t.machine,t.id,{title:n})},children:(0,B.jsx)(`input`,{ref:s,value:r,onChange:e=>i(e.target.value),onClick:e=>e.stopPropagation(),onBlur:()=>i(null),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&i(null)},className:`text-foreground ring-ring/50 focus:ring-ring w-full rounded-sm bg-transparent text-sm font-medium ring-1 outline-none ring-inset`})}),h=F(e.selected&&`bg-sidebar-row-active text-sidebar-foreground`,f&&`text-sidebar-muted-foreground/75 hover:bg-sidebar-row-hover hover:text-sidebar-foreground`,!e.selected&&!f&&`text-sidebar-foreground hover:bg-sidebar-row-hover bg-transparent`);return e.slim?(0,B.jsx)(`li`,{className:`list-none`,children:(0,B.jsxs)(`div`,{role:`button`,tabIndex:0,className:F(s9,h,`flex h-9 items-center gap-2.5 px-2.5`),onClick:e.onSelect,onKeyDown:t=>{t.key===`Enter`&&e.onSelect()},children:[(0,B.jsx)(`span`,{className:`flex shrink-0 items-center opacity-40 grayscale transition-opacity group-hover/sidebar-row:opacity-100 group-hover/sidebar-row:grayscale-0`,children:(0,B.jsx)(aA,{machine:t.machine,projectId:t.projectId})}),m,(0,B.jsxs)(`span`,{className:`relative ml-auto flex h-6 min-w-8 shrink-0 items-center justify-end`,children:[(0,B.jsx)(`span`,{className:`text-secondary-label group-any-hover/sidebar-row:opacity-0 inline-flex justify-end text-xs tabular-nums transition-opacity`,children:lf(t.updatedAt)}),(0,B.jsx)(`span`,{className:`group-any-hover/sidebar-row:opacity-100 absolute inset-y-0 right-0 -mr-1 flex items-center opacity-0 transition-opacity has-[[data-state=open]]:opacity-100`,children:p})]})]})}):(0,B.jsx)(`li`,{className:`list-none py-0.5`,children:(0,B.jsxs)(`div`,{role:`button`,tabIndex:0,className:F(s9,h,u&&!e.selected&&`opacity-70 transition-opacity focus-within:opacity-100 hover:opacity-100`),onClick:e.onSelect,onKeyDown:t=>{t.key===`Enter`&&e.onSelect()},children:[(0,B.jsxs)(`div`,{className:`px-(--sidebar-row-content-inset) py-(--sidebar-content-inset)`,children:[(0,B.jsxs)(`div`,{className:`flex h-6 min-w-0 items-center gap-2`,children:[(0,B.jsx)(aA,{machine:t.machine,projectId:t.projectId,className:`size-5`}),m,t.status===`pinned`&&(0,B.jsx)(U,{icon:QO,className:`text-muted-foreground/65 size-3 shrink-0`}),u&&(0,B.jsx)(`span`,{title:l?`Working`:`Running in background`,className:F(`flex`,l?`text-info`:`text-muted-foreground`),children:(0,B.jsx)(U,{icon:$D,className:`size-4 shrink-0 animate-spin`})}),c&&(0,B.jsx)(`span`,{title:`Waiting for approval`,className:`text-warning-foreground flex`,children:(0,B.jsx)(U,{icon:lk,className:`size-4 shrink-0`})}),d&&(0,B.jsx)(`span`,{title:`Done`,className:`text-success flex`,children:(0,B.jsx)(U,{icon:QD,className:`size-4 shrink-0`})})]}),(0,B.jsxs)(`div`,{className:`text-secondary-label mt-1 flex h-5 min-w-0 items-center gap-1.5 text-xs`,children:[(0,B.jsxs)(`span`,{className:F(`min-w-0 flex-1 truncate`,f?`font-normal`:`font-medium`),children:[n,t.branch!==null&&(0,B.jsx)(`span`,{className:`text-muted-foreground/40 font-normal`,children:` | ${t.branch}`})]}),(0,B.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:lf(t.updatedAt)})]})]}),e.saved&&(0,B.jsxs)(`div`,{className:F(`group-any-hover/sidebar-row:pointer-events-auto group-any-hover/sidebar-row:opacity-100 pointer-events-none absolute inset-y-0 right-0 flex w-20 flex-col items-end bg-linear-to-l from-50% to-transparent py-(--sidebar-content-inset) pr-1.5 opacity-0 transition-opacity has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:opacity-100`,e.selected?`from-sidebar-row-active`:`from-sidebar-row-hover`),children:[(0,B.jsx)(`div`,{className:`flex h-6 items-center`,children:(0,B.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground inline-flex h-5 cursor-pointer items-center rounded-md px-1.5`,title:`Make inactive`,"aria-label":`Make inactive`,onClick:e=>{e.stopPropagation(),Cf(t.machine,t.id,{status:`inactive`})},children:(0,B.jsx)(U,{icon:$O,className:`size-3.5 scale-160`})})}),(0,B.jsx)(`div`,{className:`mt-1 flex h-5 items-center`,children:p})]})]})})}function Jxe(e){let t=$k(e.machine,e.projectId);return(0,B.jsx)(`li`,{className:`list-none py-0.5`,children:(0,B.jsx)(`div`,{role:`button`,tabIndex:0,className:F(s9,`bg-sidebar-row-active text-sidebar-foreground`),onClick:e.onSelect,children:(0,B.jsxs)(`div`,{className:`px-(--sidebar-row-content-inset) py-(--sidebar-content-inset)`,children:[(0,B.jsxs)(`div`,{className:`flex h-6 min-w-0 items-center gap-2`,children:[(0,B.jsx)(aA,{machine:e.machine,projectId:e.projectId,className:`size-5`}),(0,B.jsx)(`span`,{className:`text-foreground min-w-0 flex-1 truncate text-sm font-medium`,children:`New thread`}),(0,B.jsx)(U,{icon:dk,className:`text-warning-foreground size-4 shrink-0`})]}),(0,B.jsxs)(`div`,{className:`text-secondary-label mt-1 flex h-5 min-w-0 items-center gap-1.5 text-xs`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:[t,(0,B.jsx)(`span`,{className:`text-muted-foreground/40 font-normal`,children:` | Draft`})]}),(0,B.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:`now`})]})]})})})}var c9=`text-sidebar-muted-foreground/80 hover:bg-sidebar-row-hover hover:text-sidebar-foreground flex shrink-0 cursor-pointer items-center justify-center rounded-[var(--control-radius)] [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-(--sidebar-icon-color) hover:[&>svg]:text-sidebar-foreground`;function Yxe(e){let t=R(e=>e.selection),n=R(e=>e.machines),r=R(e=>e.projects),i=R(e=>e.sessions),a=R(e=>e.settings.provider),o=R(e=>e.unseen),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(Number(localStorage.getItem(`sidebarWidth`)??240)),w=[...r].sort((e,t)=>n.findIndex(t=>t.id===e.machine)-n.findIndex(e=>e.id===t.machine)||e.name.localeCompare(t.name)),T=i.filter(e=>s===null||e.machine===s.machine&&e.projectId===s.projectId).sort((e,t)=>t.updatedAt-e.updatedAt),E=i.filter(e=>{let t=Fd(n,e.machine,e.id);return t?.running===!0||t?.waiting===!0||Object.values(t?.tasks??{}).includes(`running`)||o.includes(Ze(e.machine,e.id))}),D=[...T.filter(e=>e.status===`pinned`),...T.filter(e=>e.status===`active`)],O=T.filter(e=>e.status===`minimized`),k=T.filter(e=>e.status===`inactive`),A=t!==null&&t.sessionId!==null&&!i.some(e=>e.machine===t.machine&&e.id===t.sessionId)?{machine:t.machine,id:t.sessionId,provider:a,title:`New thread`,projectId:t.projectId,branch:null,updatedAt:Date.now(),status:`active`}:null,ee=s?.machine??t?.machine??n.at(0)?.id;function te(e,t){return r.find(n=>n.machine===e&&n.id===t)}function ne(e){let t=n.find(t=>t.id===e);return t===void 0?``:t.status===`online`?t.name:t.status===`unpaired`?`${t.name} · needs pairing`:`${t.name} · offline`}function re(e){let t=n.find(t=>t.id===e);return t===void 0?null:(0,B.jsx)(U,{icon:rA[t.icon],className:`mr-1 inline size-3 align-[-2px]`})}function ie(t,n,r){pf({machine:t,projectId:n,sessionId:r}),e.onNavigate()}function j(){let e=s??t;e===null?u(!0):ie(e.machine,e.projectId,null)}Qk([`mod+n`,`mod+t`],j,{enableOnFormTags:!0,preventDefault:!0});function ae(e){let t=e.clientX-S;Hn(e,e=>{let n=Math.min(480,Math.max(200,e.clientX-t));C(n),localStorage.setItem(`sidebarWidth`,String(n))})}function oe(e,r){return(0,B.jsx)(qxe,{session:e,slim:r,selected:t?.machine===e.machine&&t.sessionId===e.id,activity:Fd(n,e.machine,e.id),unseen:o.includes(Ze(e.machine,e.id)),saved:e!==A,onSelect:()=>ie(e.machine,e.projectId,e.id)},Ze(e.machine,e.id))}function se(e,t,n,r,i){return t.length===0?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`li`,{className:F(`mx-0.5 h-9 pt-2`,i&&`mt-auto`),children:(0,B.jsxs)(`button`,{"aria-expanded":n,className:`text-sidebar-muted-foreground/60 flex h-9 w-full cursor-pointer items-center gap-2 rounded-md px-2 text-left text-xs font-medium`,onClick:r,children:[(0,B.jsx)(`span`,{className:`shrink-0`,children:n?e:`${e} (${t.length})`}),(0,B.jsx)(`span`,{className:`bg-sidebar-border/60 h-px min-w-2 flex-1`}),(0,B.jsx)(U,{icon:JD,className:F(`size-3 shrink-0 transition-transform`,!n&&`rotate-180`)})]})}),n&&t.map(e=>oe(e,!0))]})}return(0,B.jsxs)(`aside`,{className:F(`bg-sidebar text-sidebar-foreground border-sidebar-border flex flex-none border-r select-none`,e.className),children:[(0,B.jsxs)(`div`,{className:`relative flex min-w-0 flex-col`,style:{width:S},children:[(0,B.jsxs)(`div`,{className:`flex h-(--workspace-topbar-height) shrink-0 items-center gap-2 px-3`,children:[(0,B.jsx)(`button`,{className:F(c9,`size-7`),title:`Hide sidebar (${Bn}+B)`,"aria-label":`Hide sidebar`,onClick:e.onHide,children:(0,B.jsx)(U,{icon:KO})}),(0,B.jsxs)(uA,{open:h,onOpenChange:g,children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsxs)(`button`,{className:`hover:bg-sidebar-row-hover data-[state=open]:bg-sidebar-row-hover -ml-1.5 flex h-7 min-w-0 cursor-pointer items-center gap-1.5 rounded-[var(--control-radius)] px-1.5 text-sm font-medium`,title:s===null?`Inbox`:te(s.machine,s.projectId)?.path,children:[s===null?(0,B.jsx)(U,{icon:EO,className:`size-4 shrink-0 text-(--sidebar-icon-color)`}):(0,B.jsx)(aA,{machine:s.machine,projectId:s.projectId,className:`size-4 shrink-0 [&>img]:rounded-[4px] [&>svg]:rounded-[4px]`}),(0,B.jsx)(`span`,{className:`truncate`,children:s===null?`Inbox`:te(s.machine,s.projectId)?.name}),(0,B.jsx)(U,{icon:JD,className:`text-sidebar-muted-foreground size-3.5 shrink-0`})]})}),(0,B.jsxs)(pA,{className:`w-64`,children:[(0,B.jsxs)(gA,{value:s===null?``:Ze(s.machine,s.projectId),children:[(0,B.jsxs)(_A,{value:``,className:`pr-9 pl-8 *:data-[slot=dropdown-menu-radio-item-indicator]:right-auto *:data-[slot=dropdown-menu-radio-item-indicator]:left-2`,onSelect:()=>c(null),children:[(0,B.jsx)(U,{icon:EO}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Inbox`}),E.length>0&&(0,B.jsx)(`span`,{className:`text-foreground grid h-4 min-w-4 place-items-center rounded-full bg-[color-mix(in_srgb,var(--foreground)_22%,var(--background))] px-1 text-[10px] leading-none font-medium tabular-nums`,children:E.length})]}),w.map(e=>{let t=E.filter(t=>t.machine===e.machine&&t.projectId===e.id).length;return(0,B.jsxs)(_A,{value:Ze(e.machine,e.id),title:e.path,className:`pr-2 pl-8 *:data-[slot=dropdown-menu-radio-item-indicator]:right-auto *:data-[slot=dropdown-menu-radio-item-indicator]:left-2`,onSelect:()=>c({machine:e.machine,projectId:e.id}),onContextMenu:t=>{t.preventDefault(),g(!1),m(e)},children:[(0,B.jsx)(aA,{machine:e.machine,projectId:e.id,className:`size-4 shrink-0 [&>img]:rounded-[4px] [&>svg]:rounded-[4px]`}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.name,n.length>1&&(0,B.jsxs)(`span`,{className:`text-muted-foreground ml-1.5 text-xs`,children:[re(e.machine),ne(e.machine)]})]}),t>0&&(0,B.jsx)(`span`,{className:`text-foreground grid h-4 min-w-4 place-items-center rounded-full bg-[color-mix(in_srgb,var(--foreground)_22%,var(--background))] px-1 text-[10px] leading-none font-medium tabular-nums`,children:t}),(0,B.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground hover:bg-foreground/10 -my-0.5 grid size-5 shrink-0 cursor-pointer place-items-center rounded-sm [&_svg]:size-3.5`,title:`Configure project`,"aria-label":`Configure ${e.name}`,onClick:t=>{t.stopPropagation(),g(!1),m(e)},children:(0,B.jsx)(U,{icon:ak})})]},Ze(e.machine,e.id))})]}),(0,B.jsx)(yA,{}),(0,B.jsxs)(mA,{className:`pl-8`,onSelect:()=>u(!0),children:[(0,B.jsx)(U,{icon:MD}),`Add project…`]}),(0,B.jsxs)(mA,{className:`pl-8`,onSelect:()=>f(!0),children:[(0,B.jsx)(U,{icon:iO}),`Add machine…`]})]})]}),(0,B.jsx)(`button`,{className:F(c9,`ml-auto size-7`),title:`Search (${Bn}+K)`,"aria-label":`Search`,onClick:()=>Bd(!0),children:(0,B.jsx)(U,{icon:rk})}),(0,B.jsx)(`button`,{className:F(c9,`size-7`),title:`New thread (${Bn}+N)`,onClick:j,children:(0,B.jsx)(U,{icon:dk})})]}),(0,B.jsx)(`nav`,{className:`flex min-h-0 flex-1 [scrollbar-width:none] flex-col overflow-y-auto px-(--sidebar-content-inset) pb-(--sidebar-content-inset)`,children:(0,B.jsxs)(`ul`,{className:`flex flex-1 flex-col gap-px`,children:[t!==null&&t.sessionId===null&&(0,B.jsx)(Jxe,{machine:t.machine,projectId:t.projectId,onSelect:()=>ie(t.machine,t.projectId,null)}),A!==null&&oe(A,!1),D.map(e=>oe(e,!1)),D.length===0&&A===null&&t?.sessionId!==null&&(0,B.jsx)(`li`,{className:`text-sidebar-muted-foreground/60 px-2.5 py-6 text-center text-xs`,children:`No threads yet`}),se(`Minimized`,O,_,()=>y(!_),!0),se(`Inactive`,k,b,()=>x(!b),O.length===0)]})}),(0,B.jsx)(`div`,{className:`border-sidebar-border flex shrink-0 items-center gap-1 border-t p-(--sidebar-content-inset)`,children:(0,B.jsxs)(`button`,{className:F(c9,`h-8 flex-1 justify-start gap-2 px-2.5 text-sm`),title:`Settings`,onClick:()=>Vd(!0),children:[(0,B.jsx)(U,{icon:ak}),`Settings`]})}),(0,B.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:`group absolute inset-y-0 -right-1 z-20 hidden w-2 cursor-col-resize select-none md:block`,onPointerDown:ae,children:(0,B.jsx)(`span`,{className:`group-hover:bg-border group-active:bg-primary/60 pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 transition-colors`})})]}),l&&ee===void 0&&(0,B.jsx)(e9,{onClose:()=>u(!1)}),l&&ee!==void 0&&(0,B.jsx)(Wxe,{machine:ee,onClose:()=>u(!1),onAdd:e=>{u(!1),c({machine:e.machine,projectId:e.id}),ie(e.machine,e.id,null)}}),d&&(0,B.jsx)(e9,{onClose:()=>f(!1)}),p!==null&&(0,B.jsx)(Gxe,{project:p,onClose:()=>m(null),onRemoved:()=>{s?.machine===p.machine&&s.projectId===p.id&&c(null),m(null)}})]})}function Xxe({...e}){return(0,B.jsx)(Mte,{"data-slot":`context-menu`,...e})}function Zxe({className:e,...t}){return(0,B.jsx)(Pte,{"data-slot":`context-menu-trigger`,className:F(`select-none`,e),...t})}function Qxe({className:e,...t}){return(0,B.jsx)(Fte,{children:(0,B.jsx)(Lte,{"data-slot":`context-menu-content`,className:F(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})})}function l9({className:e,inset:t,variant:n=`default`,...r}){return(0,B.jsx)(Rte,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:F(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function $xe({className:e,children:t,checked:n,inset:r,...i}){return(0,B.jsxs)(zte,{"data-slot":`context-menu-checkbox-item`,"data-inset":r,className:F(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,B.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,B.jsx)(Bte,{children:(0,B.jsx)(U,{icon:gk,strokeWidth:2})})}),t]})}var u9=null,d9=new Set,f9=new Set;function eSe(e){return f9.add(e),()=>{f9.delete(e)}}function tSe(){return u9}function nSe(){u9!==null&&p9({open:!1,closing:u9.closing})}function p9(e){u9=e;for(let e of f9)e()}function rSe(){return document.querySelector(`[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]`)!==null}function m9(e){return uD(e)?.project.tabs.find(t=>t.id===e)}async function iSe(e){try{let t=await Promise.race([M(iD(),`terminal.busy`,{id:e}),new Promise((e,t)=>window.setTimeout(()=>t(Error(`timed out`)),5e3))]);return`error`in t?(console.error(`could not check whether tab ${e} is running a program`,t.error),{checked:!1}):{checked:!0,program:t.program}}catch(e){return console.error(`could not check whether a program is running`,e),{checked:!1}}}async function h9(e){if(!cD().behavior.confirmCloseBusyTab){mD({type:`closeTab`,id:e});return}if(!m9(e)||d9.has(e))return;d9.add(e);let t=await iSe(e);if(d9.delete(e),t.checked&&t.program===null){mD({type:`closeTab`,id:e});return}let n=m9(e);n&&!rSe()&&p9({open:!0,closing:{id:e,name:dD(n),program:t.checked?t.program:null}})}var g9=zn?`meta+t`:`ctrl+shift+t`,_9=zn?`meta+w`:`ctrl+shift+w`,v9=`ctrl+tab`,y9=`ctrl+shift+tab`;function aSe(){let e=lD()?.project;oD().open&&e&&e.activeTab!==null&&OD(e.activeTab).focus()}function oSe(){return Qk([g9,_9,v9,y9],(e,t)=>{e.preventDefault(),e.stopPropagation();let n=lD();if(n===null)return;if(t.hotkey===g9){mD({type:`createTab`,projectId:n.projectId});return}let r=n.project;if(r===null||r.activeTab===null)return;if(t.hotkey===_9){h9(r.activeTab);return}let i;if(t.hotkey===v9)i=1;else if(t.hotkey===y9)i=-1;else throw Error(`unknown terminal shortcut ${t.hotkey}`);let a=r.tabs.filter(e=>!e.minimized),o=a[(a.findIndex(e=>e.id===r.activeTab)+i+a.length)%a.length];o&&mD({type:`select`,projectId:n.projectId,tabId:o.id})},{enabled:()=>cD().behavior.captureShortcuts,enableOnFormTags:!0,eventListenerOptions:{capture:!0}})}function sSe(e){let[t,n]=(0,v.useState)(e.name);return(0,B.jsx)(Y0,{open:!0,onOpenChange:t=>{t||e.onDone()},children:(0,B.jsx)(Z0,{onCloseAutoFocus:b9,children:(0,B.jsxs)(`form`,{className:`grid gap-4`,onSubmit:n=>{n.preventDefault(),mD({type:`renameTab`,id:e.id,name:t.trim()}),e.onDone()},children:[(0,B.jsx)(Q0,{children:(0,B.jsx)(e2,{children:`Rename tab`})}),(0,B.jsx)(xV,{"aria-label":`Name`,placeholder:`Use terminal title`,value:t,onChange:e=>n(e.target.value)}),(0,B.jsxs)($0,{children:[(0,B.jsx)(H,{type:`button`,variant:`outline`,onClick:e.onDone,children:`Cancel`}),(0,B.jsx)(H,{type:`submit`,children:`Rename`})]})]})})})}function cSe(){let e=(0,v.useSyncExternalStore)(eSe,tSe),t=(0,v.useRef)(null);if(e===null)return null;let n=e.closing;return(0,B.jsx)(a2,{open:e.open,onOpenChange:e=>{e||nSe()},children:(0,B.jsxs)(s2,{onOpenAutoFocus:e=>{e.preventDefault(),t.current?.focus()},onCloseAutoFocus:b9,children:[(0,B.jsxs)(c2,{children:[(0,B.jsxs)(u2,{children:[`Close “`,n.name,`”?`]}),(0,B.jsx)(d2,{children:n.program===null?`OffSite couldn’t check whether a program is still running.`:`${n.program} is still running.`})]}),(0,B.jsxs)(l2,{children:[(0,B.jsx)(p2,{children:`Cancel`}),(0,B.jsx)(f2,{ref:t,variant:`destructive`,onClick:()=>mD({type:`closeTab`,id:n.id}),children:`Close`})]})]})})}function b9(e){e.preventDefault();let t=document.querySelector(`[role="dialog"], [role="alertdialog"]`);t===null?aSe():t.focus()}function lSe(e){let t=(0,v.useRef)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)({resultIndex:-1,resultCount:0});(0,v.useEffect)(()=>_D(e.id,a),[e.id]),(0,v.useEffect)(()=>t.current?.focus(),[]);function o(t,n,i){r(t),gD(e.id,t,n,i)}return(0,B.jsxs)(`div`,{className:`bg-card absolute top-2 right-4 z-10 flex items-center gap-1 rounded-lg border p-1 shadow-lg`,children:[(0,B.jsx)(xV,{ref:t,"data-find":!0,className:`h-7 w-52`,placeholder:`Find`,value:n,onChange:e=>o(e.target.value,!1,!0),onKeyDown:t=>{t.key===`Escape`?(t.preventDefault(),vD(e.id)):t.key===`Enter`?(t.preventDefault(),o(n,t.shiftKey,!1)):CD(t.nativeEvent)&&(t.preventDefault(),t.currentTarget.select())}}),(0,B.jsx)(`span`,{className:`text-muted-foreground w-16 text-center text-xs tabular-nums`,children:n===``?``:i.resultCount===0?`No results`:`${i.resultIndex+1} of ${i.resultCount}`}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Previous match`,onClick:()=>o(n,!0,!1),children:(0,B.jsx)(U,{icon:RD})}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Next match`,onClick:()=>o(n,!1,!1),children:(0,B.jsx)(U,{icon:FD})}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close find`,onClick:()=>vD(e.id),children:(0,B.jsx)(U,{icon:UD})})]})}var uSe=[{label:`Esc`,sequence:`\x1B`},{label:`Tab`,sequence:` `},{label:`↑`,sequence:`\x1B[A`},{label:`↓`,sequence:`\x1B[B`},{label:`←`,sequence:`\x1B[D`},{label:`→`,sequence:`\x1B[C`}];function dSe(e){let t=(0,v.useSyncExternalStore)(aD,oD),[n,r]=(0,v.useState)(null),i=t.status===`active`,a=t.layout[e.projectId],o=a?.activeTab??null,s=a?.tabs.filter(e=>!e.minimized)??[],c=a?.tabs.filter(e=>e.minimized)??[],l=oSe();return(0,v.useEffect)(()=>{i&&mD({type:`select`,projectId:e.projectId,tabId:null})},[e.projectId,i]),t.loaded?(0,B.jsxs)(`div`,{ref:l,className:`flex h-full flex-col text-sm`,children:[(0,B.jsxs)(`header`,{className:F(`flex h-9 flex-none select-none`,s.length===1?`bg-background`:`bg-sidebar`),children:[c.length>0&&(0,B.jsx)(mSe,{projectId:e.projectId,tabs:c,alerts:t.alerts,bordered:s.length>1}),(0,B.jsx)(`div`,{className:`flex min-w-0 flex-1 [scrollbar-width:none] overflow-x-auto`,children:s.map(n=>(0,B.jsx)(pSe,{tabId:n.id,onMinimize:s.length>1?()=>mD({type:`minimizeTab`,id:n.id}):void 0,onRename:()=>r({id:n.id,name:n.customName??``}),children:(0,B.jsxs)(`div`,{className:F(`group/tab text-muted-foreground hover:text-foreground relative flex min-w-28 flex-1 items-center justify-center border-r border-b px-7 text-xs transition-colors last:border-r-0`,n.id===o&&`bg-background text-foreground border-b-transparent`),onMouseDown:e=>e.preventDefault(),onClick:()=>mD({type:`select`,projectId:e.projectId,tabId:n.id}),children:[(0,B.jsx)(`span`,{className:`truncate`,children:dD(n)}),(0,B.jsx)(x9,{id:n.id,className:`ml-1.5 size-1.5 flex-none rounded-full`}),(0,B.jsx)(gSe,{progress:t.progress[n.id]}),(0,B.jsx)(`button`,{className:F(`text-muted-foreground hover:bg-accent hover:text-foreground absolute left-1.5 grid size-4.5 place-items-center rounded opacity-0 transition-opacity group-hover/tab:opacity-100`,n.id===o&&`pointer-coarse:opacity-100`),"aria-label":`Close tab`,onClick:e=>{e.stopPropagation(),h9(n.id)},children:(0,B.jsx)(U,{icon:UD,className:`size-3`})})]})},n.id))}),(0,B.jsx)(`button`,{className:F(`text-muted-foreground hover:text-foreground grid w-8 flex-none place-items-center transition-colors`,s.length>1&&`border-b border-l`),"aria-label":`New tab`,title:`New tab`,onClick:()=>mD({type:`createTab`,projectId:e.projectId}),children:(0,B.jsx)(U,{icon:MD,className:`size-4`})})]}),(0,B.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[o!==null&&(0,B.jsx)(fSe,{id:o},`${t.instance}-${o}`),o!==null&&t.finding===o&&(0,B.jsx)(lSe,{id:o},o),!i&&(0,B.jsx)(`div`,{className:`bg-background/80 animate-in fade-in absolute inset-0 z-20 grid place-items-center p-6 text-center backdrop-blur-md duration-200`,children:(0,B.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`border-foreground/15 border-t-foreground/70 size-6 animate-spin rounded-full border-[3px]`}),(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Connecting. Your terminals keep running while you wait.`})]})})]}),o!==null&&(0,B.jsxs)(`div`,{className:`bg-card hidden flex-none gap-1.5 overflow-x-auto border-t p-1.5 pointer-coarse:flex`,children:[uSe.map(e=>(0,B.jsx)(H,{variant:`secondary`,className:`min-w-11`,onPointerDown:e=>e.preventDefault(),onClick:()=>hD(o,e.sequence),children:e.label},e.label)),(0,B.jsx)(H,{variant:t.ctrl?`default`:`secondary`,className:`min-w-11`,onPointerDown:e=>e.preventDefault(),onClick:yD,children:`Ctrl`})]}),n!==null&&(0,B.jsx)(sSe,{id:n.id,name:n.name,onDone:()=>r(null)},n.id),(0,B.jsx)(cSe,{})]}):(0,B.jsx)(`div`,{className:`text-muted-foreground grid h-full place-items-center p-4 text-xs whitespace-pre-wrap`,children:t.failure===null?`Starting the terminal…`:`The terminal could not start: ${t.failure}`})}function fSe(e){let t=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!t.current)throw Error(`terminal container missing`);return kD(e.id,t.current)},[e.id]),(0,B.jsx)(`div`,{className:`bg-background absolute inset-0 pt-(--pad-top) pr-(--pad-right) pb-(--pad-bottom) pl-(--pad-left)`,ref:t})}function pSe(e){return(0,B.jsxs)(Xxe,{children:[(0,B.jsx)(Zxe,{asChild:!0,children:e.children}),(0,B.jsxs)(Qxe,{children:[(0,B.jsxs)(l9,{onSelect:e.onRename,children:[(0,B.jsx)(U,{icon:YO}),`Rename`]}),e.onMinimize&&(0,B.jsxs)(l9,{onSelect:e.onMinimize,children:[(0,B.jsx)(U,{icon:HO}),`Minimize`]}),(0,B.jsxs)($xe,{checked:oD().quiet.includes(e.tabId),onCheckedChange:()=>vE(e.tabId),children:[(0,B.jsx)(U,{icon:WO}),`Notify when quiet for 10s`]}),(0,B.jsxs)(l9,{variant:`destructive`,onSelect:()=>void h9(e.tabId),children:[(0,B.jsx)(U,{icon:cO}),`Close tab`]})]})]})}function mSe(e){return(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsxs)(`button`,{className:F(`text-muted-foreground hover:text-foreground flex flex-none items-center gap-1 px-2.5 transition-colors`,e.bordered&&`border-r border-b`),"aria-label":`Minimized tabs`,title:`Minimized tabs`,children:[(0,B.jsx)(U,{icon:AO,className:`size-4`}),(0,B.jsx)(hSe,{count:e.tabs.length,alert:e.tabs.some(t=>e.alerts.includes(t.id))})]})}),(0,B.jsx)(pA,{align:`start`,children:e.tabs.map(t=>(0,B.jsxs)(mA,{onSelect:()=>mD({type:`select`,projectId:e.projectId,tabId:t.id}),children:[(0,B.jsx)(`span`,{className:`max-w-80 truncate`,children:dD(t)}),(0,B.jsx)(x9,{id:t.id,className:`size-1.5 flex-none rounded-full`})]},t.id))})]})}function x9(e){return oD().alerts.includes(e.id)?(0,B.jsx)(`span`,{className:F(`bg-primary`,e.className)}):null}function hSe(e){return(0,B.jsx)(`span`,{className:F(`grid h-3.5 min-w-3.5 place-items-center rounded-full px-1 text-[9px] leading-none font-medium tabular-nums`,e.alert?`bg-primary text-primary-foreground`:`text-foreground bg-[color-mix(in_srgb,var(--text)_22%,var(--bg))]`),children:e.count})}function gSe(e){let t=e.progress;return!t||t.state===0?null:t.state===3?(0,B.jsx)(`span`,{className:`bg-primary absolute inset-x-0 bottom-0 h-0.5 animate-pulse`}):(0,B.jsx)(`span`,{className:F(`absolute bottom-0 left-0 h-0.5 transition-[width]`,t.state===1&&`bg-primary`,t.state===2&&`bg-destructive`,t.state===4&&`bg-yellow-500`),style:{width:`${t.state!==1&&t.value===0?100:t.value}%`}})}var S9={running:`Running`,completed:`Done`,failed:`Failed`,stopped:`Stopped`};function C9(e,t){return{agents:e.flatMap(e=>e.kind===`subagent`?[{item:e,agentId:e.agentId,status:T9(e.status,e.agentId,t)}]:[]),tasks:e.flatMap(e=>e.kind===`command`&&e.background!==null?[{item:e,taskId:e.background.taskId,path:e.background.outputPath,events:e.background.events,status:T9(e.status,e.background.taskId,t)}]:[])}}function w9(e){return e.description===``?e.command:e.description}function T9(e,t,n){let r=t===null?void 0:n?.tasks[t];return r===void 0?e===`running`?t===null&&n?.running===!0?`Running`:`Stopped`:S9[e]:S9[r]}function E9(e){return(0,B.jsx)(`span`,{className:F(e.active&&`text-shimmer`),children:e.text})}function _Se(e){return(0,B.jsxs)(`span`,{className:F(`flex min-w-0 items-baseline overflow-hidden text-[13px] leading-4 tracking-[-0.04px]`,e.grouped?`gap-1.5`:`gap-2`),children:[(0,B.jsx)(`span`,{className:F(`text-foreground shrink-0`,e.grouped?`font-normal`:`font-medium`),children:(0,B.jsx)(E9,{text:e.title,active:e.pending})}),e.subtitle!==void 0&&e.subtitle!==``&&(0,B.jsx)(`span`,{className:F(`min-w-0 truncate tabular-nums`,e.grouped?`text-muted-foreground/70`:`text-muted-foreground`),children:e.subtitle}),e.args?.map(t=>(0,B.jsx)(`span`,{className:F(`min-w-0 truncate tabular-nums`,e.grouped?`text-muted-foreground/70`:`text-muted-foreground`),children:t},t))]})}function D9(e){return(0,B.jsx)(`span`,{"aria-hidden":!0,className:F(`text-muted-foreground/70 flex size-6 shrink-0 items-center justify-center transition-opacity`,e.open?`opacity-100`:`opacity-0 group-hover/tool:opacity-100`,e.className),children:(0,B.jsx)(U,{icon:FD,strokeWidth:2.5,className:F(`size-3.5 transition-transform`,!e.open&&`-rotate-90`)})})}function O9(e){let t=e.onToggle,n=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`flex max-w-[calc(100%-24px)] min-w-0 items-center`,children:(0,B.jsx)(_Se,{title:e.title,subtitle:e.subtitle,args:e.args,pending:e.pending,grouped:e.grouped})}),t!==null&&(0,B.jsx)(D9,{open:e.open})]});return(0,B.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col`,children:[t===null?(0,B.jsx)(`div`,{className:F(`flex w-full items-center select-none`,e.grouped?`min-h-7`:`min-h-9`),children:n}):(0,B.jsx)(`button`,{type:`button`,"aria-expanded":e.open,onClick:t,className:F(`group/tool focus-visible:ring-ring/70 flex w-full cursor-pointer items-center rounded-md text-left select-none focus-visible:ring-2 focus-visible:outline-none`,e.grouped?`h-7`:`h-9`),children:n}),e.open&&e.children!==void 0&&(0,B.jsx)(`div`,{className:F(`min-w-0 pt-1`,e.rail!==!1&&`ps-3`),children:e.children})]})}var vSe=new Map([[`build`,`text-blue-400`],[`explore`,`text-yellow-400`],[`plan`,`text-pink-400`],[`review`,`text-green-400`],[`writer`,`text-purple-400`]]),ySe=new Map([[`Running`,`Launched agent`],[`Done`,`Agent finished`],[`Failed`,`Agent failed`],[`Stopped`,`Agent stopped`]]),bSe=new Map([[`Running`,`Started in background`],[`Done`,`Background task finished`],[`Failed`,`Background task failed`],[`Stopped`,`Background task stopped`]]),k9=[`text-sky-400`,`text-amber-400`,`text-fuchsia-400`,`text-emerald-400`,`text-violet-400`,`text-cyan-400`,`text-orange-400`,`text-teal-400`,`text-rose-400`,`text-indigo-400`,`text-lime-400`,`text-red-400`];function A9(e){let t=e.agent,n=t.toLowerCase(),r=0;for(let e of n)r=r*31+e.charCodeAt(0)>>>0;return{name:t[0].toUpperCase()+t.slice(1),description:e.description,tone:vSe.get(n)??k9[r%k9.length]}}function j9(e){return(0,B.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,className:F(`size-4 shrink-0`,e.className),children:[(0,B.jsx)(`path`,{d:`M4 4.5C4 4.22386 4.22386 4 4.5 4H11.5C11.7761 4 12 4.22386 12 4.5V11.5C12 11.7761 11.7761 12 11.5 12H4.5C4.22386 12 4 11.7761 4 11.5V4.5Z`,fill:`currentColor`}),(0,B.jsx)(`path`,{d:`M14.5 1C14.7761 1 15 1.22386 15 1.5V14.5C15 14.7761 14.7761 15 14.5 15H1.5C1.22386 15 1 14.7761 1 14.5V1.5C1 1.22386 1.22386 1 1.5 1H14.5ZM2 14H14V2H2V14Z`,fill:`currentColor`})]})}function M9(e){return(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":!0,className:F(`size-4 shrink-0`,e.className),children:Array.from({length:25},(e,t)=>(0,B.jsx)(`rect`,{x:1+t%5*3,y:1+Math.floor(t/5)*3,width:2,height:2,fill:`currentColor`,className:`agent-dot`,style:{animationDelay:`${(t%5+Math.floor(t/5))*90}ms`}},t))})}function xSe(e){let t=e.item;if(t.kind===`agent_message`){let n=t.target;return(0,B.jsx)(N9,{label:`Messaged agent`,detail:t.summary,pending:e.sending,onOpen:n===null?null:()=>e.onOpen(n)})}if(t.kind===`command`){let n=e.tasks.find(e=>e.item.id===t.id);if(n===void 0)throw Error(`Task ${t.id} is missing from the thread`);return(0,B.jsx)(N9,{label:bSe.get(n.status)??`Background task ${n.status.toLowerCase()}`,detail:w9(n.item),pending:n.status===`Running`,onOpen:()=>e.onOpen(t.id)})}let n=e.agents.find(e=>e.item.id===t.id);if(n===void 0)throw Error(`Agent ${t.id} is missing from the thread`);return(0,B.jsx)(N9,{label:ySe.get(n.status)??`Agent ${n.status.toLowerCase()}`,detail:t.description,pending:n.status===`Running`,onOpen:()=>e.onOpen(t.id)})}function N9(e){let t=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:(0,B.jsx)(E9,{text:e.detail===``?e.label:`${e.label}:`,active:e.pending})}),e.detail!==``&&(0,B.jsx)(`span`,{className:`text-foreground min-w-0 truncate`,children:e.detail})]});return e.onOpen===null?(0,B.jsx)(`div`,{className:`flex min-h-7 min-w-0 items-center gap-1 text-[13px] leading-4 tracking-[-0.04px] select-none`,children:t}):(0,B.jsxs)(`button`,{type:`button`,title:`Open in Tasks panel`,onClick:e.onOpen,className:`group/agent focus-visible:ring-ring/70 flex min-h-7 w-fit max-w-full cursor-pointer items-center gap-1 rounded-md text-left text-[13px] leading-4 tracking-[-0.04px] select-none focus-visible:ring-2 focus-visible:outline-none`,children:[t,(0,B.jsx)(`span`,{className:`text-muted-foreground/70 flex shrink-0 opacity-0 transition-opacity group-hover/agent:opacity-100 group-focus-visible/agent:opacity-100 pointer-coarse:opacity-100`,children:(0,B.jsx)(U,{icon:LD,className:`size-3.5`})})]})}function P9(e){return e.kind===`group`||e.kind===`agent`}function F9(e,t,n){let r=[],i=e.prompt?.id??`start`;e.prompt!==null&&r.push({kind:`user`,key:e.prompt.id,item:e.prompt,first:e.first});for(let t of e.items){let e=CSe(t,n!==null),i=r.at(-1);e?.kind===`group`&&i?.kind===`group`?i.entries.push(...e.entries):e!==null&&r.push(e)}let a=r.at(-1);return n!==null&&n.partial===``&&a?.kind===`group`&&(r[r.length-1]={...a,live:!0}),n!==null&&n.partial!==``&&r.push({kind:`assistant`,key:`${i}:partial`,message:``,text:n.partial,time:null,streaming:!0,meta:!1,changed:new Map}),n!==null&&n.partial===``&&r.push({kind:`working`,key:`${i}:working`}),n===null&&a?.kind===`assistant`&&(r[r.length-1]={...a,meta:!0,changed:SSe(e.items,t)}),r}function SSe(e,t){let n=new Map;for(let r of e){if(r.kind!==`file_change`||r.diffs.length===0)continue;let e=ZB(r),i=tV(r.path,t),a=n.get(i)??{added:0,removed:0};n.set(i,{added:a.added+e.added,removed:a.removed+e.removed})}return n}function CSe(e,t){switch(e.kind){case`assistant`:return{kind:`assistant`,key:e.id,message:e.message,text:e.text,time:e.time,streaming:!1,meta:!1,changed:new Map};case`reasoning`:case`file_change`:case`web_search`:case`skill`:case`tool`:return{kind:`group`,key:`group:${e.id}`,entries:[e],live:!1};case`command`:return e.background===null?{kind:`group`,key:`group:${e.id}`,entries:[e],live:!1}:{kind:`agent`,key:e.id,item:e,live:t};case`subagent`:case`agent_message`:return{kind:`agent`,key:e.id,item:e,live:t};case`plan`:return{kind:`plan`,key:e.id,plan:e.plan};case`question`:return{kind:`question`,key:e.id,item:e};case`notice`:return{kind:`notice`,key:e.id,text:e.text};case`compaction`:return{kind:`notice`,key:e.id,text:`Conversation compacted`};case`error`:return{kind:`error`,key:e.id,text:e.text,time:e.time};case`user`:case`todo_list`:return null}}function I9(e,t,n,r){let i=[],a=!1;for(let t of e)t.parent===null&&(t.kind===`user`?i.push({prompt:t,first:!a,items:[]}):(t.kind!==`notice`&&t.kind!==`error`&&t.kind!==`compaction`&&(a=!0),i.length===0&&i.push({prompt:null,first:!0,items:[]}),i[i.length-1].items.push(t)));let o=i.flatMap((e,a)=>F9(e,t,n&&a===i.length-1?{partial:r}:null));return n&&i.length===0&&o.push({kind:`working`,key:`working`}),o}function wSe(e){let t={name:``,path:``,stat:{added:0,removed:0},directories:new Map,files:[]};for(let[n,r]of e){let e=n.replaceAll(`\\`,`/`).split(`/`).filter(e=>e!==``),i=e.at(-1);if(i===void 0)continue;let a=[t],o=t;for(let t of e.slice(0,-1)){let e=o.directories.get(t)??{name:t,path:o.path===``?t:`${o.path}/${t}`,stat:{added:0,removed:0},directories:new Map,files:[]};o.directories.set(t,e),o=e,a.push(o)}o.files.push({kind:`file`,name:i,path:e.join(`/`),stat:r});for(let e of a)e.stat.added+=r.added,e.stat.removed+=r.removed}return R9(t)}function L9(e,t){return e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`})}function R9(e){return[...[...e.directories.values()].sort(L9).map(e=>TSe({kind:`directory`,name:e.name,path:e.path,stat:{...e.stat},children:R9(e)})),...[...e.files].sort(L9)]}function TSe(e){let t=e;for(;t.children.length===1&&t.children[0].kind===`directory`;){let e=t.children[0];t={kind:`directory`,name:`${t.name}/${e.name}`,path:e.path,stat:e.stat,children:e.children}}return t}function ESe(e){let[t,n]=(0,v.useState)(!1),r=[...e.files],i=Ce(r,e=>e[1].added),a=Ce(r,e=>e[1].removed),o=r.some(([e])=>/[/\\]/.test(e)),s=t?`Collapse all folders`:`Expand all folders`;return(0,B.jsxs)(`div`,{className:`bg-secondary dark:bg-input/20 @container/changed-files mt-4 rounded-lg`,children:[(0,B.jsxs)(`div`,{className:`bg-secondary dark:bg-background dark:from-input/20 dark:to-input/20 sticky top-2 z-10 flex items-center justify-between gap-2 rounded-t-lg px-3 py-2 dark:bg-linear-to-b`,children:[(0,B.jsxs)(`div`,{className:`text-foreground flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-xs font-medium`,children:[(0,B.jsxs)(`span`,{children:[r.length,` changed file`,r.length===1?``:`s`]}),(i>0||a>0)&&(0,B.jsx)(z9,{added:i,removed:a,layout:`inline`,className:`text-xs leading-4`})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[o&&(0,B.jsx)($z,{label:s,children:(0,B.jsx)(H,{type:`button`,size:`icon-xs`,variant:`ghost-muted`,"aria-label":s,onClick:()=>n(!t),children:(0,B.jsx)(U,{icon:t?ZD:vk,className:`size-3`})})}),(0,B.jsx)($z,{label:`Open the full diff`,children:(0,B.jsxs)(H,{type:`button`,size:`xs`,variant:`ghost-muted`,"aria-label":`Open diff`,onClick:e.onOpenDiff,children:[(0,B.jsx)(U,{icon:fO,className:`size-3`}),(0,B.jsx)(`span`,{className:`hidden @[24rem]/changed-files:inline`,children:`Open diff`})]})})]})]}),(0,B.jsx)(DSe,{files:e.files,allExpanded:t,onOpenDiff:e.onOpenDiff},String(t))]})}function DSe(e){let[t,n]=(0,v.useState)({}),r=wSe(e.files),i=r.some(e=>e.kind===`directory`),a=`group hover:bg-accent/60 focus-visible:ring-ring focus-visible:ring-offset-background flex w-full items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-none focus-visible:ring-inset`;function o(r,s){let c=`${8+s*14}px`;if(r.kind===`directory`){let i=t[r.path]??e.allExpanded;return(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":i,className:a,style:{paddingLeft:c},onClick:()=>n({...t,[r.path]:!i}),children:[(0,B.jsx)(U,{icon:YD,"aria-hidden":!0,className:F(`text-muted-foreground/70 group-hover:text-foreground/80 size-3.5 shrink-0 transition-transform`,i&&`rotate-90`)}),(0,B.jsx)(U,{icon:i?mO:hO,className:`text-muted-foreground/75 size-3.5 shrink-0`}),(0,B.jsx)(`span`,{className:`text-2xs text-muted-foreground/90 group-hover:text-foreground/90 truncate font-mono`,children:r.name}),(r.stat.added>0||r.stat.removed>0)&&(0,B.jsx)(`span`,{className:`text-3xs ml-auto shrink-0 font-mono tabular-nums`,children:(0,B.jsx)(z9,{added:r.stat.added,removed:r.stat.removed,layout:`aligned`})})]}),i&&(0,B.jsx)(`div`,{children:r.children.map(e=>o(e,s+1))})]},`dir:${r.path}`)}return(0,B.jsxs)(`button`,{type:`button`,className:a,style:{paddingLeft:c},onClick:e.onOpenDiff,children:[(i||s>0)&&(0,B.jsx)(`span`,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,B.jsx)(Uz,{path:r.path,className:`text-muted-foreground/70 size-3.5`}),(0,B.jsx)(`span`,{className:`text-foreground/85 group-hover:text-foreground flex min-w-0 font-mono text-xs`,children:(0,B.jsx)(`span`,{className:`truncate`,children:r.name})}),(0,B.jsx)(`span`,{className:`text-3xs ml-auto shrink-0 font-mono tabular-nums`,children:(0,B.jsx)(z9,{added:r.stat.added,removed:r.stat.removed,layout:`aligned`})})]},`file:${r.path}`)}return(0,B.jsx)(`div`,{className:`p-2`,children:r.map(e=>o(e,0))})}function z9(e){return(0,B.jsxs)(`span`,{role:`group`,"aria-label":`${e.added} additions, ${e.removed} deletions`,className:F(e.layout===`inline`?`inline-flex items-center gap-1 align-middle tabular-nums`:`inline-grid grid-cols-[4ch_4ch] gap-2 text-right align-middle tabular-nums`,e.className),children:[(0,B.jsxs)(`span`,{"aria-hidden":!0,className:`text-diff-addition font-mono`,children:[`+`,ff(e.added)]}),(0,B.jsxs)(`span`,{"aria-hidden":!0,className:`text-diff-deletion font-mono`,children:[`-`,ff(e.removed)]})]})}function OSe(e){let[t,n]=(0,v.useState)(!1),r=eB(),i=e.plan,a=B9(i),o=i.length>900||i.split(`
1198
1198
  `).length>20,s=o&&!t,c=`${i.trimEnd()}\n`;return(0,B.jsxs)(`div`,{className:`border-border/80 bg-card/70 rounded-3xl border p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`bg-secondary text-secondary-foreground relative inline-flex h-5.5 min-w-5.5 shrink-0 items-center justify-center gap-1 rounded-sm border border-transparent px-[calc(--spacing(1)-1px)] text-sm font-medium whitespace-nowrap sm:h-4.5 sm:min-w-4.5 sm:text-xs`,children:`Plan`}),(0,B.jsx)(`h3`,{className:`text-foreground truncate text-sm font-medium`,children:a??`Proposed plan`})]}),(0,B.jsxs)(uA,{children:[(0,B.jsx)(fA,{asChild:!0,children:(0,B.jsx)(H,{"aria-label":`Plan actions`,size:`icon-xs`,variant:`outline`,children:(0,B.jsx)(U,{icon:UO,className:`size-4`})})}),(0,B.jsxs)(pA,{align:`end`,children:[(0,B.jsx)(mA,{onSelect:e=>{e.preventDefault(),r.copy(c)},children:r.copied?`Copied!`:`Copy to clipboard`}),(0,B.jsx)(mA,{onSelect:()=>{let e=URL.createObjectURL(new Blob([c],{type:`text/markdown;charset=utf-8`})),t=document.createElement(`a`);t.href=e,t.download=`${ASe(a??`plan`)}.md`,t.click(),setTimeout(()=>URL.revokeObjectURL(e),0)},children:`Download as markdown`})]})]})]}),(0,B.jsxs)(`div`,{className:`mt-4`,children:[(0,B.jsxs)(`div`,{className:F(`relative`,s&&`max-h-104 overflow-hidden`),children:[(0,B.jsx)(lB,{text:s?kSe(i):V9(i)}),s&&(0,B.jsx)(`div`,{className:`from-card/95 via-card/80 pointer-events-none absolute inset-x-0 bottom-0 h-24 bg-linear-to-t to-transparent`})]}),o&&(0,B.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,B.jsx)(H,{size:`sm`,variant:`outline`,onClick:()=>n(!t),children:t?`Collapse plan`:`Expand plan`})})]})]})}function B9(e){let t=/^\s{0,3}#{1,6}\s+(.+)$/m.exec(e)?.[1]?.trim();return t===void 0||t===``?null:t}function V9(e){let t=e.trimEnd().split(/\r?\n/),n=/^\s{0,3}#{1,6}\s+/.test(t[0]??``)?t.slice(1):t;for(;n[0]?.trim()===``;)n.shift();if(/^\s{0,3}#{1,6}\s+(.+)$/.exec(n[0]??``)?.[1]?.trim().toLowerCase()===`summary`)for(n.shift();n[0]?.trim()===``;)n.shift();return n.join(`
1199
1199
  `)}function kSe(e){let t=V9(e).trimEnd().split(/\r?\n/).map(e=>e.trimEnd()),n=[],r=0,i=!1;for(let e of t){let t=e.trim()!==``;if(t&&r>=10){i=!0;break}n.push(e),t&&(r+=1)}for(;n.length>0&&n.at(-1)?.trim()===``;)n.pop();return n.length===0?B9(e)??`Plan preview unavailable.`:(i&&n.push(``,`...`),n.join(`
1200
1200
  `))}function ASe(e){let t=e.toLowerCase().replace(/[`'".,!?()[\]{}]+/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);return t===``?`plan`:t}function jSe(e){let t=e.item.answers;return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 text-sm leading-6 select-text`,children:[e.item.questions.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-foreground font-medium`,children:e.question}),(0,B.jsx)(`ul`,{className:`text-secondary-label list-disc pl-5`,children:e.options.map(e=>(0,B.jsxs)(`li`,{children:[e.label,e.description!==``&&` — ${e.description}`]},e.label))}),t?.[e.question]!==void 0&&(0,B.jsxs)(`p`,{className:`text-foreground whitespace-pre-wrap`,children:[`Answer: `,t[e.question]]})]},e.question)),e.item.status===`failed`&&(0,B.jsx)(`p`,{className:`text-muted-foreground`,children:`Skipped`})]})}function MSe(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),l=e.target,u=R(e=>e.selection),d=R(e=>e.settings.provider),f=d!==`codex`,p=u?.machine??null,m=u?.sessionId??null,h=u?.projectId??``,g=R(e=>p===null?``:Md(e,p,h)?.path??``);(0,v.useEffect)(()=>{if(n(null),i(null),o(null),l===null||p===null||m===null||!f)return;let e=!0;return M(p,`sessions.rewind`,{sessionId:m,projectId:h,messageId:l.messageId,settings:L().settings,code:!0,conversation:!1,dryRun:!0}).then(t=>{e&&n(t)},t=>{e&&i(Vn(t))}),()=>{e=!1}},[l,p,m,h,f]);async function _(t,n){if(l!==null&&p!==null&&m!==null){c(!0),o(null);try{let r=n&&(!l.first||d===`opencode`);(t||r)&&await M(p,`sessions.rewind`,{sessionId:m,projectId:h,messageId:l.messageId,settings:L().settings,code:t,conversation:r,dryRun:!1}),n&&l.first&&d!==`opencode`&&pf({machine:p,projectId:h,sessionId:null}),n&&zd(l.text),e.onClose()}catch(e){o(Vn(e))}finally{c(!1)}}}let y=t!==null&&r===null;return(0,B.jsx)(Y0,{open:l!==null,onOpenChange:()=>e.onClose(),children:(0,B.jsxs)(Z0,{className:`sm:max-w-md`,children:[(0,B.jsxs)(Q0,{children:[(0,B.jsx)(e2,{children:`Rewind to this message`}),(0,B.jsx)(t2,{children:`The conversation restarts from just before this message, which goes back into the composer so you can edit and resend it.`})]}),f&&(0,B.jsxs)(`div`,{className:`bg-secondary dark:bg-input/20 text-muted-foreground rounded-lg px-3 py-2 text-xs`,children:[r!==null&&`Code can't be restored: ${r}`,r===null&&t===null&&`Checking file changes…`,t!==null&&t.files.length===0&&`No file changes since this message.`,t!==null&&t.files.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{children:[`Restores `,t.files.length,` `,t.files.length===1?`file`:`files`,` (`,(0,B.jsxs)(`span`,{className:`text-diff-addition`,children:[`+`,t.insertions]}),` `,(0,B.jsxs)(`span`,{className:`text-diff-deletion`,children:[`−`,t.deletions]}),`)`]}),(0,B.jsx)(`ul`,{className:`mt-1 max-h-32 overflow-y-auto font-mono`,children:t.files.map(e=>(0,B.jsx)(`li`,{className:`truncate`,children:tV(e,g)},e))})]})]}),a!==null&&(0,B.jsx)(`p`,{className:`text-destructive text-xs`,children:a}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[f&&(0,B.jsx)(H,{disabled:s||!y,onClick:()=>void _(!0,!0),children:`Restore code and conversation`}),(0,B.jsx)(H,{variant:f?`secondary`:`default`,disabled:s,onClick:()=>void _(!1,!0),children:f?`Restore conversation only`:`Restore conversation`}),d===`claude`&&(0,B.jsx)(H,{variant:`secondary`,disabled:s||!y,onClick:()=>void _(!0,!1),children:`Restore code only`})]})]})})}var H9=`linear-gradient(to bottom, black calc(100% - 1.75rem), transparent)`;function NSe(e){let[t,n]=(0,v.useState)(!1),r=e.onRewind,i=e.item,a=i.format===`text`?i.text:``,o=a.trim()!==``&&(a.length>600||a.split(`
1201
- `).length>8),s=o&&!t;return(0,B.jsxs)(`div`,{className:`group flex flex-col items-end gap-1`,children:[(0,B.jsxs)(`div`,{className:`bg-message text-message-foreground relative max-w-[80%] rounded-2xl px-3 py-2`,children:[i.images.length>0&&(0,B.jsx)(`div`,{className:`mb-2 grid max-w-[210px] grid-cols-2 gap-2`,children:i.images.map((e,t)=>(0,B.jsx)(`div`,{className:`border-border/80 bg-background/70 aspect-[4/3] overflow-hidden rounded-lg border`,children:(0,B.jsx)(PSe,{itemId:i.id,index:t,mediaType:e.mediaType,data:e.data})},t))}),i.text!==``&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:F(`relative`,s&&`max-h-44 overflow-hidden`),style:s?{WebkitMaskImage:H9,maskImage:H9}:void 0,children:[i.format===`command`&&(0,B.jsx)(`span`,{className:`font-mono text-sm`,children:i.text}),i.format===`output`&&(0,B.jsx)(`pre`,{className:`text-muted-foreground font-mono text-xs whitespace-pre-wrap`,children:i.text}),i.format===`text`&&(0,B.jsx)(lB,{text:i.text,className:`text-foreground`,lineBreaks:!0,rawHtml:!1})]}),o&&(0,B.jsx)(`div`,{className:`mt-1.5 flex items-center justify-end gap-2`,children:(0,B.jsx)(H,{type:`button`,size:`xs`,variant:`ghost-muted`,"aria-expanded":t,className:`-ml-1`,onClick:()=>n(!t),children:t?`Show less`:`Show full message`})})]})]}),(0,B.jsx)(`div`,{className:`flex w-full max-w-[80%] items-center justify-end pe-1 text-xs tabular-nums opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100`,children:(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i.time!==null&&(0,B.jsx)($z,{label:df(i.time),children:(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs tabular-nums`,children:uf(i.time)})}),a!==``&&(0,B.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[r!==null&&(0,B.jsx)($z,{label:`Edit from here`,children:(0,B.jsx)(H,{type:`button`,size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit from here`,disabled:e.running,onClick:()=>r({messageId:i.id,text:a,first:e.first}),children:(0,B.jsx)(U,{icon:YO,className:`size-3.5`})})}),(0,B.jsx)(U9,{text:a})]})]})})]})}function U9(e){let t=eB();return(0,B.jsx)($z,{label:`Copy message`,children:(0,B.jsx)(H,{type:`button`,size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Copy message`,disabled:t.copied,onClick:()=>void t.copy(e.text),children:(0,B.jsx)(U,{icon:t.copied?KD:oO,className:F(`size-3.5`,t.copied&&`text-primary`)})})})}function PSe(e){let t=R(e=>e.selection),n=t?.machine??null,r=t?.sessionId??null,[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(e.data!==null||n===null||r===null)return;let t=!0;return M(n,`sessions.image`,{sessionId:r,itemId:e.itemId,index:e.index}).then(e=>{t&&a(e.data)}).catch(Wd),()=>{t=!1}},[e.data,e.itemId,e.index,n,r]);let o=e.data??i;return o===null?null:(0,B.jsx)(`img`,{src:`data:${e.mediaType};base64,${o}`,alt:``,className:`block size-full object-cover`})}function W9(e){switch(e.kind){case`command`:return`Shell`;case`file_change`:return`Edit`;case`web_search`:return e.url===null?`Web Search`:`Webfetch`;case`skill`:return`Skill`;case`tool`:return e.name}}function FSe(e){let t=e.item,n=e.live&&t.status===`running`;if(t.status===`failed`)return(0,B.jsx)(BSe,{title:W9(t),subtitle:K9(t,e.cwd),error:t.output});switch(t.kind){case`command`:return(0,B.jsx)(ISe,{command:t.command,output:t.output,pending:n});case`file_change`:return(0,B.jsx)(G9,{items:[t],cwd:e.cwd,live:e.live});case`web_search`:{let e=t.url;return e===null?(0,B.jsx)(LSe,{query:t.query??``,links:t.results,pending:n}):(0,B.jsx)(O9,{title:`Webfetch`,subtitle:(0,B.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`text-primary hover:underline hover:underline-offset-2`,children:e}),pending:n,grouped:!0,open:!1,onToggle:null})}case`skill`:return(0,B.jsxs)(`div`,{className:`flex min-h-7 items-center gap-1 text-[13px] leading-4 tracking-[-0.04px]`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`Loaded`}),(0,B.jsx)(`span`,{className:`text-foreground`,children:(0,B.jsx)(E9,{text:t.skill,active:n})}),(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`skill`})]});case`tool`:{let r=t.input;switch(YB(t.name)){case`read`:return(0,B.jsx)(O9,{title:`Read`,subtitle:VSe(XB(r)),args:q9(r,[`offset`,`limit`]),pending:n,grouped:!0,open:!1,onToggle:null});case`search`:return(0,B.jsx)(O9,{title:t.name,subtitle:K9(t,e.cwd),args:[...q9(r,[`pattern`]),...eV(r.glob)===``?[]:[`include=${eV(r.glob)}`]],pending:n,grouped:!0,open:!1,onToggle:null});case`other`:return(0,B.jsx)(O9,{title:`Called ${t.name}`,subtitle:K9(t,e.cwd),args:q9(r,Object.keys(r).filter(e=>![`description`,`query`,`url`,`path`,`pattern`].includes(e))).slice(0,3),pending:n,grouped:!0,open:!1,onToggle:null})}}}}function ISe(e){let[t,n]=(0,v.useState)(!1);return(0,B.jsx)(O9,{title:`Shell`,subtitle:t?void 0:e.command,pending:e.pending,grouped:!0,open:t,onToggle:()=>n(!t),rail:!1,children:(0,B.jsxs)(`div`,{dir:`ltr`,className:`group/output border-border relative w-full overflow-hidden rounded-md border`,children:[(0,B.jsx)(`div`,{className:`absolute top-1 right-1 opacity-0 transition-opacity group-hover/output:opacity-100 focus-within:opacity-100`,children:(0,B.jsx)(U9,{text:e.command})}),(0,B.jsx)(`div`,{className:`max-h-60 [scrollbar-width:none] overflow-x-hidden overflow-y-auto`,children:(0,B.jsx)(`pre`,{className:`m-0 font-mono text-[13px] leading-5 tracking-[-0.04px] [overflow-wrap:anywhere] whitespace-pre-wrap select-text`,children:(0,B.jsxs)(`code`,{children:[(0,B.jsx)(`span`,{className:`text-foreground block p-3`,children:e.command}),e.output!==``&&(0,B.jsx)(`span`,{className:`border-border bg-muted text-muted-foreground block border-t p-3`,children:e.output})]})})})]})})}function LSe(e){let[t,n]=(0,v.useState)(!1),r=e.links;return(0,B.jsx)(O9,{title:`Web Search`,subtitle:e.query,pending:e.pending,grouped:!0,open:t,onToggle:r.length===0?null:()=>n(!t),children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-1 text-[13px] leading-5`,children:[r.slice(0,10).map(e=>(0,B.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-primary truncate hover:underline hover:underline-offset-2`,children:e.title===``?e.url:e.title},e.url)),r.length>10&&(0,B.jsxs)(`span`,{className:`text-muted-foreground`,children:[`+`,r.length-10,` more`]})]})})}function RSe(e){let[t,n]=(0,v.useState)(!1);return(0,B.jsx)(O9,{title:e.streaming?`Thinking`:`Thought`,subtitle:e.streaming?HSe(e.text):void 0,pending:e.streaming,grouped:!0,open:t,onToggle:()=>n(!t),children:(0,B.jsx)(lB,{text:e.text,className:`text-muted-foreground text-[13px]`,lineBreaks:!0})})}function G9(e){let t=new Map;for(let n of e.items){let r=tV(n.path,e.cwd);t.set(r,[...t.get(r)??[],n])}return(0,B.jsx)(`div`,{className:`border-border overflow-hidden rounded-md border`,children:[...t].map(([t,n])=>(0,B.jsx)(zSe,{file:t,items:n,pending:e.live&&n.some(e=>e.status===`running`)},t))})}function zSe(e){let[t,n]=(0,v.useState)(!1),r=e.file.lastIndexOf(`/`),i=0,a=0;for(let t of e.items){let e=ZB(t);i+=e.added,a+=e.removed}return(0,B.jsxs)(`div`,{className:`border-border border-b last:border-b-0`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(!t),className:`group/tool flex h-9 w-full cursor-pointer items-center gap-2 ps-3 pe-1 text-left text-[13px] leading-4 tracking-[-0.04px] select-none`,children:[(0,B.jsx)(Uz,{path:e.file,className:`size-4 shrink-0`}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline`,children:[r>=0&&(0,B.jsx)(`span`,{className:`text-muted-foreground truncate`,children:e.file.slice(0,r+1)}),(0,B.jsx)(`span`,{className:`text-foreground shrink-0`,children:(0,B.jsx)(E9,{text:e.file.slice(r+1),active:e.pending})})]}),(0,B.jsx)(z9,{added:i,removed:a,layout:`inline`,className:`text-xs`}),(0,B.jsx)(D9,{open:t})]}),t&&(0,B.jsx)(`div`,{className:`border-border flex flex-col gap-2 border-t p-2`,children:e.items.map(e=>(0,B.jsx)(qB,{item:e},e.id))})]})}function BSe(e){let[t,n]=(0,v.useState)(!1),r=e.error.replace(/<\/?tool_use_error>/g,``).trim(),i=r.split(`: `)[0].trim();return(0,B.jsxs)(`div`,{className:`group/error flex w-full min-w-0 flex-col`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(!t),className:`flex h-6 w-full cursor-pointer items-center text-left text-[13px] leading-4 tracking-[-0.04px] select-none`,children:[(0,B.jsxs)(`span`,{className:`flex max-w-[calc(100%-20px)] min-w-0 items-center gap-1.5`,children:[(0,B.jsx)(U,{icon:PD,className:`text-destructive size-4 shrink-0`}),(0,B.jsx)(`span`,{className:`text-foreground shrink-0 font-medium`,children:e.title}),e.subtitle!==``&&!t&&(0,B.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate`,children:e.subtitle}),!t&&(0,B.jsx)(`span`,{className:`text-destructive min-w-0 truncate`,children:i===``?`Failed`:i[0].toUpperCase()+i.slice(1)})]}),(0,B.jsx)(D9,{open:!0,className:`ms-1.5 size-3.5`})]}),t&&(0,B.jsxs)(`div`,{className:`relative ps-6 pe-10 select-text`,children:[(0,B.jsx)(`div`,{className:`absolute top-0 right-0 opacity-0 transition-opacity group-hover/error:opacity-100 focus-within:opacity-100`,children:(0,B.jsx)(U9,{text:r})}),(0,B.jsx)(`p`,{className:`text-destructive text-[13px] leading-5 tracking-[-0.04px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:r})]})]})}function K9(e,t){switch(e.kind){case`command`:return e.command;case`file_change`:return e.path;case`web_search`:return e.url??e.query??``;case`skill`:return e.skill;case`tool`:{let n=e.input;if(YB(e.name)===`search`){let e=eV(n.path);return e===``||e===t?``:tV(e,t)}return[`description`,`query`,`url`,`file_path`,`path`,`pattern`].map(e=>eV(n[e])).find(e=>e!==``)??``}}}function q9(e,t){return t.flatMap(t=>{let n=e[t];return typeof n==`string`||typeof n==`number`||typeof n==`boolean`?[`${t}=${n}`]:[]})}function VSe(e){return e.split(`/`).at(-1)??e}function HSe(e){let t=[...e.matchAll(/^\s*(?:#{1,6}[ \t]+(.+?)|\*\*([^*\n]+)\*\*)\s*$/gm)].at(-1);return t===void 0?void 0:(t[1]??t[2]).trim()}var USe=new Intl.ListFormat(`en`,{style:`long`,type:`conjunction`});function WSe(e){let t=e.entries.flatMap(e=>e.kind===`reasoning`?[]:[e]),n=e.entries.length-t.length,r=USe.format([...new Set(t.map(W9))]),i=r===``?n===1?`Thought`:`Thoughts`:r,a=t.length>0?t.length:n;return(0,B.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":e.open,"aria-label":`Used ${a} ${i}`,onClick:e.onToggle,className:F(`group/tool focus-visible:ring-ring/70 flex h-7 w-full cursor-pointer items-center rounded-md text-left text-[13px] leading-4 tracking-[-0.04px] select-none focus-visible:ring-2 focus-visible:outline-none`,e.open&&`bg-background sticky top-0 z-20 box-content pb-2`),children:[(0,B.jsxs)(`span`,{className:`flex max-w-[calc(100%-24px)] min-w-0 items-center gap-1`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:`Used`}),(0,B.jsx)(`span`,{className:`text-foreground shrink-0 tabular-nums`,children:a}),(0,B.jsx)(`span`,{className:`text-foreground min-w-0 truncate font-medium`,children:i})]}),(0,B.jsx)(D9,{open:e.open})]}),e.open&&(0,B.jsx)(`div`,{className:`flex flex-col gap-2`,children:KSe(e.entries).map(t=>(0,B.jsx)(`div`,{className:`flex min-h-7 min-w-0 flex-col justify-center`,children:(0,B.jsx)(GSe,{item:t,cwd:e.cwd,live:e.live})},t.key))})]})}function GSe(e){let t=e.item;switch(t.kind){case`thinking`:return(0,B.jsx)(RSe,{text:t.text,streaming:e.live&&t.last});case`tool`:return(0,B.jsx)(FSe,{item:t.item,cwd:e.cwd,live:e.live});case`reads`:return(0,B.jsx)(O9,{title:`Read`,subtitle:(0,B.jsx)(`span`,{title:t.items.map(e=>XB(e.input)).join(`
1201
+ `).length>8),s=o&&!t;return(0,B.jsxs)(`div`,{className:`group flex flex-col items-end gap-1`,children:[(0,B.jsxs)(`div`,{className:`bg-message text-message-foreground relative max-w-[80%] rounded-2xl px-3 py-2`,children:[i.images.length>0&&(0,B.jsx)(`div`,{className:`mb-2 grid max-w-[210px] grid-cols-2 gap-2`,children:i.images.map((e,t)=>(0,B.jsx)(`div`,{className:`border-border/80 bg-background/70 aspect-[4/3] overflow-hidden rounded-lg border`,children:(0,B.jsx)(PSe,{itemId:i.id,index:t,mediaType:e.mediaType,data:e.data})},t))}),i.text!==``&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:F(`relative`,s&&`max-h-44 overflow-hidden`),style:s?{WebkitMaskImage:H9,maskImage:H9}:void 0,children:[i.format===`command`&&(0,B.jsx)(`span`,{className:`font-mono text-sm`,children:i.text}),i.format===`output`&&(0,B.jsx)(`pre`,{className:`text-muted-foreground font-mono text-xs whitespace-pre-wrap`,children:i.text}),i.format===`text`&&(0,B.jsx)(lB,{text:i.text,className:`text-foreground`,lineBreaks:!0,rawHtml:!1})]}),o&&(0,B.jsx)(`div`,{className:`mt-1.5 flex items-center justify-end gap-2`,children:(0,B.jsx)(H,{type:`button`,size:`xs`,variant:`ghost-muted`,"aria-expanded":t,className:`-ml-1`,onClick:()=>n(!t),children:t?`Show less`:`Show full message`})})]})]}),(0,B.jsx)(`div`,{className:`flex w-full max-w-[80%] items-center justify-end pe-1 text-xs tabular-nums opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100`,children:(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i.time!==null&&(0,B.jsx)($z,{label:df(i.time),children:(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs tabular-nums`,children:uf(i.time)})}),a!==``&&(0,B.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[r!==null&&(0,B.jsx)($z,{label:`Edit from here`,children:(0,B.jsx)(H,{type:`button`,size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit from here`,disabled:e.running,onClick:()=>r({messageId:i.id,text:a,first:e.first}),children:(0,B.jsx)(U,{icon:YO,className:`size-3.5`})})}),(0,B.jsx)(U9,{text:a})]})]})})]})}function U9(e){let t=eB();return(0,B.jsx)($z,{label:`Copy message`,children:(0,B.jsx)(H,{type:`button`,size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Copy message`,disabled:t.copied,onClick:()=>void t.copy(e.text),children:(0,B.jsx)(U,{icon:t.copied?KD:oO,className:F(`size-3.5`,t.copied&&`text-primary`)})})})}function PSe(e){let t=R(e=>e.selection),n=t?.machine??null,r=t?.sessionId??null,[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(e.data!==null||n===null||r===null)return;let t=!0;return M(n,`sessions.image`,{sessionId:r,itemId:e.itemId,index:e.index}).then(e=>{t&&a(e.data)}).catch(Wd),()=>{t=!1}},[e.data,e.itemId,e.index,n,r]);let o=e.data??i;return o===null?null:(0,B.jsx)(`img`,{src:`data:${e.mediaType};base64,${o}`,alt:``,className:`block size-full object-cover`})}function W9(e){switch(e.kind){case`command`:return`Shell`;case`file_change`:return`Edit`;case`web_search`:return e.url===null?`Web Search`:`Webfetch`;case`skill`:return`Skill`;case`tool`:return e.name}}function FSe(e){let t=e.item,n=e.live&&t.status===`running`;if(t.status===`failed`)return(0,B.jsx)(BSe,{title:W9(t),subtitle:K9(t,e.cwd),error:t.output});switch(t.kind){case`command`:return(0,B.jsx)(ISe,{command:t.command,output:t.output,pending:n});case`file_change`:return(0,B.jsx)(G9,{items:[t],cwd:e.cwd,live:e.live});case`web_search`:{let e=t.url;return e===null?(0,B.jsx)(LSe,{query:t.query??``,links:t.results,pending:n}):(0,B.jsx)(O9,{title:`Webfetch`,subtitle:(0,B.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`text-primary hover:underline hover:underline-offset-2`,children:e}),pending:n,grouped:!0,open:!1,onToggle:null})}case`skill`:return(0,B.jsxs)(`div`,{className:`flex min-h-7 items-center gap-1 text-[13px] leading-4 tracking-[-0.04px]`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`Loaded`}),(0,B.jsx)(`span`,{className:`text-foreground`,children:(0,B.jsx)(E9,{text:t.skill,active:n})}),(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`skill`})]});case`tool`:{let r=t.input;switch(YB(t.name)){case`read`:return(0,B.jsx)(O9,{title:`Read`,subtitle:VSe(XB(r)),args:q9(r,[`offset`,`limit`]),pending:n,grouped:!0,open:!1,onToggle:null});case`search`:return(0,B.jsx)(O9,{title:t.name,subtitle:K9(t,e.cwd),args:[...q9(r,[`pattern`]),...eV(r.glob)===``?[]:[`include=${eV(r.glob)}`]],pending:n,grouped:!0,open:!1,onToggle:null});case`other`:return(0,B.jsx)(O9,{title:`Called ${t.name}`,subtitle:K9(t,e.cwd),args:q9(r,Object.keys(r).filter(e=>![`description`,`query`,`url`,`path`,`pattern`].includes(e))).slice(0,3),pending:n,grouped:!0,open:!1,onToggle:null})}}}}function ISe(e){let[t,n]=(0,v.useState)(!1);return(0,B.jsx)(O9,{title:`Shell`,subtitle:t?void 0:e.command,pending:e.pending,grouped:!0,open:t,onToggle:()=>n(!t),rail:!1,children:(0,B.jsxs)(`div`,{dir:`ltr`,className:`group/output border-border relative w-full overflow-hidden rounded-md border`,children:[(0,B.jsx)(`div`,{className:`absolute top-1 right-1 opacity-0 transition-opacity group-hover/output:opacity-100 focus-within:opacity-100`,children:(0,B.jsx)(U9,{text:e.command})}),(0,B.jsx)(`div`,{className:`max-h-60 [scrollbar-width:none] overflow-x-hidden overflow-y-auto`,children:(0,B.jsx)(`pre`,{className:`m-0 font-mono text-[13px] leading-5 tracking-[-0.04px] [overflow-wrap:anywhere] whitespace-pre-wrap select-text`,children:(0,B.jsxs)(`code`,{children:[(0,B.jsx)(`span`,{className:`text-foreground block p-3`,children:e.command}),e.output!==``&&(0,B.jsx)(`span`,{className:`border-border bg-muted text-muted-foreground block border-t p-3`,children:e.output})]})})})]})})}function LSe(e){let[t,n]=(0,v.useState)(!1),r=e.links;return(0,B.jsx)(O9,{title:`Web Search`,subtitle:e.query,pending:e.pending,grouped:!0,open:t,onToggle:r.length===0?null:()=>n(!t),children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-1 text-[13px] leading-5`,children:[r.slice(0,10).map(e=>(0,B.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-primary truncate hover:underline hover:underline-offset-2`,children:e.title===``?e.url:e.title},e.url)),r.length>10&&(0,B.jsxs)(`span`,{className:`text-muted-foreground`,children:[`+`,r.length-10,` more`]})]})})}function RSe(e){let[t,n]=(0,v.useState)(!1);return(0,B.jsx)(O9,{title:e.streaming?`Thinking`:`Thought`,subtitle:e.streaming?HSe(e.text):void 0,pending:e.streaming,grouped:!0,open:t,onToggle:()=>n(!t),children:(0,B.jsx)(lB,{text:e.text,className:`text-muted-foreground text-[13px]`,lineBreaks:!0})})}function G9(e){let t=new Map;for(let n of e.items){let r=tV(n.path,e.cwd);t.set(r,[...t.get(r)??[],n])}return(0,B.jsx)(`div`,{className:`border-border overflow-hidden rounded-md border`,children:[...t].map(([t,n])=>(0,B.jsx)(zSe,{file:t,items:n,pending:e.live&&n.some(e=>e.status===`running`)},t))})}function zSe(e){let[t,n]=(0,v.useState)(!1),r=e.file.lastIndexOf(`/`),i=0,a=0;for(let t of e.items){let e=ZB(t);i+=e.added,a+=e.removed}return(0,B.jsxs)(`div`,{className:`border-border border-b last:border-b-0`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(!t),className:`group/tool flex h-9 w-full cursor-pointer items-center gap-2 ps-3 pe-1 text-left text-[13px] leading-4 tracking-[-0.04px] select-none`,children:[(0,B.jsx)(Uz,{path:e.file,className:`size-4 shrink-0`}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline`,children:[r>=0&&(0,B.jsx)(`span`,{className:`text-muted-foreground truncate`,children:e.file.slice(0,r+1)}),(0,B.jsx)(`span`,{className:`text-foreground shrink-0`,children:(0,B.jsx)(E9,{text:e.file.slice(r+1),active:e.pending})})]}),(0,B.jsx)(z9,{added:i,removed:a,layout:`inline`,className:`text-xs`}),(0,B.jsx)(D9,{open:t})]}),t&&(0,B.jsx)(`div`,{className:`border-border flex flex-col gap-2 border-t p-2`,children:e.items.map(e=>(0,B.jsx)(qB,{item:e},e.id))})]})}function BSe(e){let[t,n]=(0,v.useState)(!1),r=e.error.replace(/<\/?tool_use_error>/g,``).trim(),i=r.split(`: `)[0].trim();return(0,B.jsxs)(`div`,{className:`group/error flex w-full min-w-0 flex-col`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(!t),className:`flex h-6 w-full cursor-pointer items-center text-left text-[13px] leading-4 tracking-[-0.04px] select-none`,children:[(0,B.jsxs)(`span`,{className:`flex max-w-[calc(100%-20px)] min-w-0 items-center gap-1.5`,children:[(0,B.jsx)(U,{icon:PD,className:`text-destructive size-4 shrink-0`}),(0,B.jsx)(`span`,{className:`text-foreground shrink-0 font-medium`,children:e.title}),e.subtitle!==``&&!t&&(0,B.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate`,children:e.subtitle}),!t&&(0,B.jsx)(`span`,{className:`text-destructive min-w-0 truncate`,children:i===``?`Failed`:i[0].toUpperCase()+i.slice(1)})]}),(0,B.jsx)(D9,{open:!0,className:`ms-1.5 size-3.5`})]}),t&&(0,B.jsxs)(`div`,{className:`relative ps-6 pe-10 select-text`,children:[(0,B.jsx)(`div`,{className:`absolute top-0 right-0 opacity-0 transition-opacity group-hover/error:opacity-100 focus-within:opacity-100`,children:(0,B.jsx)(U9,{text:r})}),(0,B.jsx)(`p`,{className:`text-destructive text-[13px] leading-5 tracking-[-0.04px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:r})]})]})}function K9(e,t){switch(e.kind){case`command`:return e.command;case`file_change`:return e.path;case`web_search`:return e.url??e.query??``;case`skill`:return e.skill;case`tool`:{let n=e.input;if(YB(e.name)===`search`){let e=eV(n.path);return e===``||e===t?``:tV(e,t)}return[`description`,`query`,`url`,`file_path`,`path`,`pattern`].map(e=>eV(n[e])).find(e=>e!==``)??``}}}function q9(e,t){return t.flatMap(t=>{let n=e[t];return typeof n==`string`||typeof n==`number`||typeof n==`boolean`?[`${t}=${n}`]:[]})}function VSe(e){return e.split(`/`).at(-1)??e}function HSe(e){let t=[...e.matchAll(/^\s*(?:#{1,6}[ \t]+(.+?)|\*\*([^*\n]+)\*\*)\s*$/gm)].at(-1);return t===void 0?void 0:(t[1]??t[2]).trim()}var USe=new Intl.ListFormat(`en`,{style:`long`,type:`conjunction`});function WSe(e){let t=e.entries.flatMap(e=>e.kind===`reasoning`?[]:[e]),n=e.entries.length-t.length,r=USe.format([...new Set(t.map(W9))]),i=r===``?n===1?`Thought`:`Thoughts`:r,a=t.length>0?t.length:n;return(0,B.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":e.open,"aria-label":`Used ${a} ${i}`,onClick:e.onToggle,className:F(`group/tool focus-visible:ring-ring/70 flex h-7 w-full cursor-pointer items-center rounded-md text-left text-xs select-none focus-visible:ring-2 focus-visible:outline-none`,e.open&&`bg-background sticky top-0 z-20 box-content pb-2`),children:[(0,B.jsxs)(`span`,{className:`flex max-w-[calc(100%-24px)] min-w-0 items-center gap-1`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:`Used`}),(0,B.jsx)(`span`,{className:`text-muted-foreground shrink-0 tabular-nums`,children:a}),(0,B.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate`,children:i})]}),(0,B.jsx)(D9,{open:e.open})]}),e.open&&(0,B.jsx)(`div`,{className:`flex flex-col gap-2`,children:KSe(e.entries).map(t=>(0,B.jsx)(`div`,{className:`flex min-h-7 min-w-0 flex-col justify-center`,children:(0,B.jsx)(GSe,{item:t,cwd:e.cwd,live:e.live})},t.key))})]})}function GSe(e){let t=e.item;switch(t.kind){case`thinking`:return(0,B.jsx)(RSe,{text:t.text,streaming:e.live&&t.last});case`tool`:return(0,B.jsx)(FSe,{item:t.item,cwd:e.cwd,live:e.live});case`reads`:return(0,B.jsx)(O9,{title:`Read`,subtitle:(0,B.jsx)(`span`,{title:t.items.map(e=>XB(e.input)).join(`
1202
1202
  `),children:t.items.map((t,n)=>(0,B.jsxs)(`span`,{children:[n>0&&` `,(0,B.jsx)(E9,{text:XB(t.input).split(`/`).at(-1)??``,active:e.live&&t.status===`running`})]},t.id))}),pending:e.live&&t.items.some(e=>e.status===`running`),grouped:!0,open:!1,onToggle:null});case`files`:return(0,B.jsx)(G9,{items:t.items,cwd:e.cwd,live:e.live})}}function KSe(e){let t=[];return e.forEach((n,r)=>{if(n.kind===`reasoning`){t.push({kind:`thinking`,key:n.id,text:n.text,last:r===e.length-1});return}let i=t.at(-1);n.status!==`failed`&&n.kind===`file_change`?i?.kind===`files`?i.items.push(n):t.push({kind:`files`,key:n.id,items:[n]}):n.status!==`failed`&&n.kind===`tool`&&YB(n.name)===`read`?i?.kind===`reads`?i.items.push(n):t.push({kind:`reads`,key:n.id,items:[n]}):t.push({kind:`tool`,key:n.id,item:n})}),t}var J9=30;function qSe(e){let t=R(e=>e.selection),n=R(e=>e.loaded),r=R(e=>e.items),i=R(e=>e.earlier),a=R(e=>e.before),o=R(e=>e.partial),s=R(e=>e.requests),c=R(Id),l=(0,v.useRef)(null),u=(0,v.useRef)(!0),d=(0,v.useRef)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)([]),[y,b]=(0,v.useState)(null),x=R(e=>t===null?``:Md(e,t.machine,t.projectId)?.path??``),S=R(Ld),C=R(e=>e.sentAt);(0,v.useLayoutEffect)(()=>{let e=l.current;e!==null&&C!==0&&(u.current=!0,e.scrollTop=e.scrollHeight)},[C]),(0,v.useLayoutEffect)(()=>{let e=l.current;e!==null&&u.current&&(e.scrollTop=e.scrollHeight)},[r,o,s,S]);let w=C9([...i,...r],c),T=I9(i,x,!1,``),E=[...T,...I9(r,x,S,o)],D=E.findIndex(e=>e.key===y?.key),O=Math.max(0,D===-1?E.length-J9:D-(y?.above??0));(0,v.useLayoutEffect)(()=>{let e=l.current;e!==null&&d.current!==null&&(e.scrollTop=e.scrollHeight-d.current),d.current=null},[i,O]),(0,v.useLayoutEffect)(()=>{let e=l.current;e!==null&&E.length!==0&&(D===-1?b({key:E[O].key,above:0}):k(e))});function k(e){O===0||e.scrollTop>=e.clientHeight||(d.current=e.scrollHeight-e.scrollTop,b({key:E[O].key,above:J9}))}function A(e){_(g.includes(e)?g.filter(t=>t!==e):[...g,e])}return(0,B.jsxs)(`div`,{ref:l,className:`topbar-scroll-fade min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-3 pb-8 sm:px-12`,onScroll:e=>{let t=e.currentTarget;u.current=t.scrollHeight-t.scrollTop-t.clientHeight<40,k(t)},children:[(0,B.jsxs)(`div`,{className:`mx-auto w-full max-w-(--chat-content-max-width) pt-3`,children:[!n&&(0,B.jsx)(`p`,{className:`text-muted-foreground py-6 text-center text-xs`,children:`Loading…`}),a!==null&&O===0&&(0,B.jsx)(`div`,{className:`flex justify-center pb-4`,children:(0,B.jsx)(H,{type:`button`,size:`xs`,variant:`ghost-muted`,disabled:f,onClick:async()=>{let e=l.current;e!==null&&(d.current=e.scrollHeight-e.scrollTop),b({key:E[0].key,above:J9}),p(!0),await xf(),p(!1)},children:f?`Loading…`:`Load earlier conversation`})}),E.slice(O).map((t,n)=>{let r=O+n,i=E[r-1],a=r<T.length;return(0,B.jsx)(`div`,{className:F(i===void 0?void 0:t.kind===`user`?`pt-6`:t.kind===`working`?void 0:P9(t)&&P9(i)?`pt-2`:`pt-4`,t.kind===`assistant`&&`group/assistant`),children:(0,B.jsx)(Y9,{row:t,agents:w.agents,tasks:w.tasks,running:S,fork:!a,expanded:g.includes(t.key),onToggle:()=>A(t.key),onOpenTask:e.onOpenTask,onRewind:a?null:h,onOpenDiff:e.onOpenDiff,cwd:x})},t.key)})]}),(0,B.jsx)(MSe,{target:m,onClose:()=>h(null)})]})}function Y9(e){let t=e.row;switch(t.kind){case`user`:return(0,B.jsx)(NSe,{item:t.item,first:t.first,running:e.running,onRewind:e.onRewind});case`working`:return(0,B.jsx)(`div`,{className:`text-muted-foreground h-9 pt-3 text-[13px] leading-5 font-medium tracking-[-0.04px]`,children:(0,B.jsx)(E9,{text:`Working`,active:!0})});case`group`:return(0,B.jsx)(WSe,{entries:t.entries,cwd:e.cwd,live:t.live,open:e.expanded,onToggle:e.onToggle});case`agent`:return(0,B.jsx)(xSe,{item:t.item,agents:e.agents,tasks:e.tasks,sending:t.live&&t.item.status===`running`,onOpen:e.onOpenTask});case`assistant`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,B.jsx)(lB,{text:t.text===``&&!t.streaming?`(empty response)`:t.text,streaming:t.streaming}),t.changed.size>0&&(0,B.jsx)(ESe,{files:t.changed,onOpenDiff:e.onOpenDiff})]}),t.meta&&(0,B.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 text-xs tabular-nums opacity-0 transition-opacity duration-200 group-hover/assistant:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100`,children:[(0,B.jsx)(U9,{text:t.text}),e.fork&&(0,B.jsx)(JSe,{uuid:t.message}),t.time!==null&&(0,B.jsx)($z,{label:df(t.time),children:(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs tabular-nums`,children:uf(t.time)})})]})]});case`error`:return(0,B.jsxs)(`div`,{className:`text-destructive flex gap-1.5 text-[13px] leading-5 tracking-[-0.04px]`,children:[(0,B.jsx)(U,{icon:PD,className:`mt-0.5 size-4 shrink-0`}),(0,B.jsx)(`p`,{className:`min-w-0 [overflow-wrap:anywhere] whitespace-pre-wrap select-text`,children:t.text})]});case`notice`:return(0,B.jsxs)(`div`,{className:`text-muted-foreground mx-auto flex w-full max-w-(--chat-content-max-width) items-center gap-3 py-1 text-xs`,children:[(0,B.jsx)(`span`,{className:`bg-border/70 h-px flex-1`}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t.text===`Conversation compacted`&&(0,B.jsx)(U,{icon:BO,className:`size-3`}),t.text]}),(0,B.jsx)(`span`,{className:`bg-border/70 h-px flex-1`})]});case`plan`:return(0,B.jsx)(`div`,{className:`min-w-0`,children:(0,B.jsx)(OSe,{plan:t.plan})});case`question`:return(0,B.jsx)(jSe,{item:t.item})}}function JSe(e){let[t,n]=(0,v.useState)(!1);return(0,B.jsx)($z,{label:`Fork from this response`,children:(0,B.jsx)(H,{type:`button`,size:`icon-xs`,variant:`ghost-muted`,disabled:t,"aria-label":`Fork from this response`,onClick:()=>{n(!0),bf(e.uuid).finally(()=>n(!1))},children:(0,B.jsx)(U,{icon:vO,className:F(`size-3.5`,t&&`animate-pulse`)})})})}function YSe(e){let t=R(e=>e.items),n=R(e=>e.earlier),r=R(t=>Fd(t.machines,e.machine,e.sessionId)),i=[...n,...t],a=C9(i,r),o=a.agents.find(t=>t.item.id===e.selected),s=a.tasks.find(t=>t.item.id===e.selected),c=o===void 0?null:A9(o.item);return(0,B.jsxs)(`div`,{className:`bg-background flex h-full min-h-0 min-w-0 flex-col`,children:[(0,B.jsxs)(`div`,{className:`border-border/60 bg-background flex h-(--workspace-topbar-height) shrink-0 items-center gap-1 border-b pr-39 pl-3`,children:[(0,B.jsx)(H,{size:`icon-sm`,variant:`ghost`,title:`Close`,"aria-label":`Close`,onClick:e.onClose,children:(0,B.jsx)(U,{icon:xk,className:`size-3.5`})}),o===void 0&&s===void 0&&(0,B.jsx)(`span`,{className:`text-foreground min-w-0 truncate text-xs font-medium`,children:`Tasks`}),(o!==void 0||s!==void 0)&&(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs`,children:[(0,B.jsx)(H,{size:`icon-sm`,variant:`ghost`,title:`Back to tasks`,"aria-label":`Back to tasks`,onClick:()=>e.onSelect(null),children:(0,B.jsx)(U,{icon:ID,className:`size-3.5`})}),o!==void 0&&c!==null&&(0,B.jsxs)(B.Fragment,{children:[o.status===`Running`?(0,B.jsx)(M9,{className:c.tone}):(0,B.jsx)(j9,{className:c.tone}),(0,B.jsx)(`span`,{className:`text-foreground shrink-0 font-medium`,children:c.name}),c.description!==``&&(0,B.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate`,children:c.description}),o.status===`Running`&&o.agentId!==null&&e.sessionId!==null&&(0,B.jsx)(X9,{machine:e.machine,sessionId:e.sessionId,taskId:o.agentId})]}),s!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(U,{icon:rO,className:`text-muted-foreground size-4 shrink-0`}),(0,B.jsx)(`span`,{className:`text-foreground min-w-0 truncate font-medium`,children:w9(s.item)}),(0,B.jsx)(`span`,{className:F(`text-muted-foreground shrink-0`,s.status===`Failed`&&`text-destructive`),children:s.status}),s.status===`Running`&&s.taskId!==null&&e.sessionId!==null&&(0,B.jsx)(X9,{machine:e.machine,sessionId:e.sessionId,taskId:s.taskId})]})]})]}),o===void 0&&s===void 0&&(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:[(0,B.jsx)(`h2`,{className:`text-muted-foreground px-1 pb-1.5 text-xs font-medium`,children:`Agents`}),a.agents.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground px-1 py-1 text-xs`,children:`No agents in this thread.`}),(0,B.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:[...a.agents.filter(e=>e.status===`Running`),...a.agents.filter(e=>e.status!==`Running`)].map(t=>{let n=A9(t.item);return(0,B.jsxs)(`button`,{type:`button`,"aria-label":`Open ${n.name} agent: ${n.description}`,className:`bg-secondary hover:bg-accent focus-visible:ring-ring/70 flex w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-left text-[13px] leading-5 tracking-[-0.04px] select-none focus-visible:ring-2 focus-visible:outline-none`,onClick:()=>e.onSelect(t.item.id),children:[t.status===`Running`?(0,B.jsx)(M9,{className:n.tone}):(0,B.jsx)(j9,{className:n.tone}),(0,B.jsx)(`span`,{className:`text-foreground shrink-0 font-medium`,children:n.name}),(0,B.jsx)(`span`,{className:`text-foreground min-w-0 flex-1 truncate`,children:n.description}),(0,B.jsx)(`span`,{className:F(`text-muted-foreground shrink-0 text-xs`,t.status===`Failed`&&`text-destructive`),children:t.status})]},t.item.id)})}),(0,B.jsx)(`h2`,{className:`text-muted-foreground px-1 pt-5 pb-1.5 text-xs font-medium`,children:`Tasks`}),a.tasks.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground px-1 py-1 text-xs`,children:`No background tasks in this thread.`}),(0,B.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:[...a.tasks.filter(e=>e.status===`Running`),...a.tasks.filter(e=>e.status!==`Running`)].map(t=>(0,B.jsxs)(`button`,{type:`button`,"aria-label":`Open task: ${w9(t.item)}`,className:`bg-secondary hover:bg-accent focus-visible:ring-ring/70 flex w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-left text-[13px] leading-5 tracking-[-0.04px] select-none focus-visible:ring-2 focus-visible:outline-none`,onClick:()=>e.onSelect(t.item.id),children:[(0,B.jsx)(U,{icon:rO,className:F(`size-4 shrink-0`,t.status===`Running`?`text-foreground animate-pulse`:`text-muted-foreground`)}),(0,B.jsx)(`span`,{className:`text-foreground min-w-0 flex-1 truncate`,children:w9(t.item)}),(0,B.jsx)(`span`,{className:F(`text-muted-foreground shrink-0 text-xs`,t.status===`Failed`&&`text-destructive`),children:t.status})]},t.item.id))})]}),o!==void 0&&(0,B.jsx)(ZSe,{item:o.item,agentId:o.agentId,running:o.status===`Running`,items:i,found:a,cwd:e.cwd,onSelect:e.onSelect,onOpenDiff:e.onOpenDiff},o.item.id),s!==void 0&&e.sessionId!==null&&(0,B.jsx)(XSe,{machine:e.machine,sessionId:e.sessionId,command:s.item.command,path:s.path,events:s.events,running:s.status===`Running`},s.item.id)]})}function X9(e){return(0,B.jsx)(H,{size:`xs`,variant:`outline`,className:`shrink-0`,onClick:()=>vf(e.machine,e.sessionId,e.taskId),children:`Stop`})}function XSe(e){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(null),a=(0,v.useRef)(null),o=(0,v.useRef)(!0);(0,v.useEffect)(()=>{let t=e.path;if(t===null)return;let r=!0;async function a(t){try{let a=await M(e.machine,`tasks.output`,{sessionId:e.sessionId,path:t});if(!r)return;n(a),i(null)}catch(e){r&&i(Vn(e))}}a(t);let o=e.running?window.setInterval(()=>void a(t),2e3):null;return()=>{r=!1,o!==null&&window.clearInterval(o)}},[e.machine,e.sessionId,e.path,e.running]),(0,v.useLayoutEffect)(()=>{let e=a.current;e!==null&&o.current&&(e.scrollTop=e.scrollHeight)},[t,e.events]);let s=e.path===null?e.events.join(`
1203
1203
  `):t?.text??``;return(0,B.jsxs)(`div`,{ref:a,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain p-3`,onScroll:e=>{let t=e.currentTarget;o.current=t.scrollHeight-t.scrollTop-t.clientHeight<40},children:[e.command!==``&&(0,B.jsxs)(`p`,{className:`text-muted-foreground pb-2 font-mono text-xs [overflow-wrap:anywhere] whitespace-pre-wrap`,children:[`$ `,e.command]}),r!==null&&(0,B.jsx)(`p`,{className:`text-destructive text-xs`,children:r}),r===null&&e.path!==null&&t===void 0&&(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Loading…`}),r===null&&e.path!==null&&t===null&&(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`The output file no longer exists.`}),t?.truncated===!0&&(0,B.jsx)(`p`,{className:`text-muted-foreground pb-2 text-xs`,children:`Showing the end of the output.`}),e.path===null&&e.events.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No events yet.`}),t?.text===``&&(0,B.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e.running?`No output yet.`:`No output.`}),s!==``&&(0,B.jsx)(`pre`,{className:`bg-secondary text-foreground rounded-lg p-3 font-mono text-xs leading-5 [overflow-wrap:anywhere] whitespace-pre-wrap select-text`,children:s})]})}function ZSe(e){let t=(0,v.useRef)(null),n=(0,v.useRef)(!0),[r,i]=(0,v.useState)([]);(0,v.useLayoutEffect)(()=>{let e=t.current;e!==null&&n.current&&(e.scrollTop=e.scrollHeight)},[e.items,e.running]);function a(e){i(r.includes(e)?r.filter(t=>t!==e):[...r,e])}let o=e.items.filter(t=>t.parent===e.item.id),s=o.length===0;(0,v.useEffect)(()=>{s&&e.agentId!==null&&Sf(e.item.id,e.agentId)},[s,e.item.id,e.agentId]);let c=o.at(0),l=c?.kind===`user`?c:null,u=F9({prompt:null,first:!1,items:l===null?o:o.slice(1)},e.cwd,e.running?{partial:``}:null);return(0,B.jsxs)(`div`,{ref:t,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-4 pt-1 pb-8`,onScroll:e=>{let t=e.currentTarget;n.current=t.scrollHeight-t.scrollTop-t.clientHeight<40},children:[l!==null&&(0,B.jsx)(O9,{title:`Prompt`,pending:!1,grouped:!0,open:r.includes(`prompt`),onToggle:()=>a(`prompt`),children:(0,B.jsx)(lB,{text:l.text,className:`text-muted-foreground text-[13px]`})}),u.map((t,n)=>{let i=u[n-1];return(0,B.jsx)(`div`,{className:F(i===void 0?`pt-2`:t.kind===`working`?void 0:P9(t)&&P9(i)?`pt-2`:`pt-4`,t.kind===`assistant`&&`group/assistant`),children:(0,B.jsx)(Y9,{row:t,agents:e.found.agents,tasks:e.found.tasks,running:e.running,fork:!1,expanded:r.includes(t.key),onToggle:()=>a(t.key),onOpenTask:e.onSelect,onRewind:null,onOpenDiff:e.onOpenDiff,cwd:e.cwd})},t.key)})]})}var Z9=window.matchMedia(`(min-width: 768px)`),Q9=`text-foreground hover:bg-accent data-[pressed=true]:bg-accent grid h-7 min-w-7 cursor-pointer place-items-center rounded-lg border border-transparent [&_svg]:size-4 [&_svg]:opacity-80`;function QSe(){let e=R(e=>e.selection),t=R(e=>e.sessions),n=R(e=>e.selection===null?``:Md(e,e.selection.machine,e.selection.projectId)?.path??``),r=R(e=>{let t=Nd(e);return t===null?null:jd(e,t)}),i=R(e=>e.error),[a,o]=(0,v.useState)(Z9.matches),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(()=>{let e=Number(localStorage.getItem(`panelWidth`)??540);return Number.isFinite(e)&&e>=360?e:540}),[p,m]=(0,v.useState)(280),h=(0,v.useSyncExternalStore)(aD,()=>oD().open),g=(0,v.useSyncExternalStore)(aD,()=>oD().alerts.length>0),_=R(Ld),y=R(e=>{if(e.selection?.sessionId===null)return 0;let t=C9([...e.earlier,...e.items],Id(e));return[...t.agents,...t.tasks].filter(e=>e.status===`Running`).length}),b=Hhe(e?.machine??``,r?.status===`online`?e?.projectId??null:null,_),x=t.find(t=>t.machine===e?.machine&&t.id===e.sessionId),S=$k(e?.machine??``,e?.projectId??``);return Qk(`mod+k`,()=>Bd(!L().paletteOpen),{enableOnFormTags:!0,preventDefault:!0}),Qk([`mod+j`,`meta+backquote`,`ctrl+backquote`],e=>{e.stopPropagation(),fD(!oD().open)},{enableOnFormTags:!0,preventDefault:!0,eventListenerOptions:{capture:!0}}),Qk(`mod+b`,()=>o(e=>!e),{enableOnFormTags:!0,preventDefault:!0}),(0,B.jsxs)(`div`,{className:`flex h-dvh text-sm`,children:[a&&(0,B.jsx)(`div`,{className:`fixed inset-0 z-30 bg-black/50 md:hidden`,onClick:()=>o(!1)}),(0,B.jsx)(Yxe,{className:F(`fixed inset-y-0 left-0 z-40 transition-transform motion-reduce:transition-none md:relative md:z-auto`,a?`translate-x-0`:`-translate-x-full md:hidden`),onNavigate:()=>{Z9.matches||o(!1)},onHide:()=>o(!1)}),!a&&(0,B.jsx)(`div`,{className:`fixed top-0 left-3 z-50 flex h-(--workspace-topbar-height) items-center`,children:(0,B.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":`Show sidebar`,title:`Show sidebar (${Bn}+B)`,onClick:()=>o(!0),children:(0,B.jsx)(U,{icon:qO})})}),(0,B.jsxs)(`main`,{className:`bg-background relative flex min-w-0 flex-1 overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden`,children:[(0,B.jsxs)(`header`,{className:F(`bg-background flex h-(--workspace-topbar-height) shrink-0 items-center gap-3 pr-3 pl-[3.25rem] sm:pr-5`,a&&`md:pl-5`,s===null&&`pr-36 sm:pr-36`),children:[e!==null&&r!==null&&(0,B.jsx)(`nav`,{className:`min-w-0 flex-1`,children:(0,B.jsxs)(`ol`,{className:`flex min-w-0 items-center gap-2 text-sm sm:gap-3`,children:[(0,B.jsxs)(`li`,{className:`text-muted-foreground flex min-w-0 shrink items-center gap-1.5 font-medium`,title:`${r.name}:${n}`,children:[(0,B.jsx)(aA,{machine:e.machine,projectId:e.projectId,className:`size-3.5`}),(0,B.jsx)(`span`,{className:`max-w-40 truncate`,children:S})]}),(0,B.jsx)(`li`,{"aria-hidden":!0,className:`text-icon-muted shrink-0`,children:`/`}),(0,B.jsx)(`li`,{className:`text-foreground min-w-10 flex-1 truncate font-medium`,children:x?.title??`New thread`})]})}),e===null&&(0,B.jsx)(`span`,{className:`flex-1`}),r!==null&&r.status!==`online`&&(0,B.jsxs)(`span`,{className:`text-warning-foreground shrink-0 text-xs`,children:[r.status===`connecting`&&`Connecting to ${r.name}…`,r.status===`offline`&&`${r.name} is offline, reconnecting…`,r.status===`unpaired`&&`${r.name} needs pairing`]}),e!==null&&b.status!==null&&(0,B.jsx)(Uhe,{machine:e.machine,projectId:e.projectId,status:b.status,onStatus:b.setStatus,onRefresh:b.refresh})]}),(0,B.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[i!==null&&(0,B.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-30 flex justify-center px-4 pt-3`,children:(0,B.jsxs)(`div`,{className:`border-error/30 bg-background/80 text-error-foreground pointer-events-auto flex w-fit max-w-[min(48rem,100%)] items-start gap-2 rounded-xl border px-3.5 py-3 text-sm backdrop-blur-md`,children:[(0,B.jsx)(U,{icon:ND,className:`text-error mt-0.5 size-4 shrink-0`}),(0,B.jsx)(`div`,{className:`line-clamp-3 min-w-0 flex-1 whitespace-pre-wrap`,children:i}),(0,B.jsx)(H,{variant:`ghost`,size:`icon-xs`,"aria-label":`Dismiss`,onClick:Gd,children:(0,B.jsx)(U,{icon:xk})})]})}),r===null&&(0,B.jsx)(Vxe,{}),e===null&&r!==null&&(0,B.jsx)(`div`,{className:`grid flex-1 place-items-center p-6 text-center`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-foreground text-2xl font-normal tracking-tight sm:text-3xl`,children:`Pick a thread, or start one`}),(0,B.jsx)(`p`,{className:`text-muted-foreground mt-2 text-sm`,children:`Open a project from the sidebar to talk to Claude.`})]})}),e!==null&&(0,B.jsxs)(v.Fragment,{children:[(0,B.jsx)(qSe,{onOpenDiff:()=>c(`diff`),onOpenTask:e=>{u(e),c(`tasks`)}}),(0,B.jsx)(yV,{})]},`${e.machine} ${e.sessionId??e.projectId}`)]}),e!==null&&h&&(0,B.jsxs)(`aside`,{className:`border-border/80 bg-background relative shrink-0 overflow-hidden border-t`,style:{height:p},children:[(0,B.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,className:`group absolute inset-x-0 top-0 z-30 h-1.5 cursor-row-resize touch-none select-none`,onPointerDown:e=>Hn(e,e=>{let t=Math.max(120,Math.floor(window.innerHeight*.8));m(Math.min(t,Math.max(120,window.innerHeight-e.clientY)))}),children:(0,B.jsx)(`span`,{className:`group-hover:bg-border group-active:bg-primary/60 pointer-events-none absolute inset-x-0 top-0 h-px transition-colors`})}),(0,B.jsx)(dSe,{projectId:e.projectId})]})]}),e!==null&&s!==null&&(0,B.jsxs)(`div`,{className:`bg-background fixed inset-0 z-40 flex flex-col md:relative md:inset-auto md:z-auto md:shrink-0 md:border-l`,style:Z9.matches?{width:d}:void 0,children:[(0,B.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:`group absolute inset-y-0 -left-1 z-20 hidden w-2 cursor-col-resize select-none md:block`,onPointerDown:e=>Hn(e,e=>{let t=Math.max(360,Math.floor(window.innerWidth*.7)),n=Math.min(t,Math.max(360,window.innerWidth-e.clientX));f(n),localStorage.setItem(`panelWidth`,String(n))}),children:(0,B.jsx)(`span`,{className:`group-hover:bg-border group-active:bg-primary/60 pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 transition-colors`})}),s===`files`&&(0,B.jsx)(Lhe,{machine:e.machine,projectId:e.projectId,onClose:()=>c(null)}),s===`diff`&&(0,B.jsx)(Vhe,{machine:e.machine,projectId:e.projectId,running:_,onClose:()=>c(null)},`${e.machine} ${e.projectId}`),s===`tasks`&&(0,B.jsx)(YSe,{machine:e.machine,cwd:n,sessionId:e.sessionId,selected:l,onSelect:u,onOpenDiff:()=>c(`diff`),onClose:()=>c(null)})]})]}),e!==null&&(0,B.jsxs)(`div`,{className:`fixed top-0 right-3 z-50 flex h-(--workspace-topbar-height) items-center gap-1`,children:[s!==null&&(0,B.jsx)(`span`,{className:`bg-foreground/15 mr-0.5 h-4 w-px`}),(0,B.jsxs)(`button`,{className:F(Q9,`relative`),"data-pressed":s===`tasks`,"aria-label":`Toggle tasks panel`,title:`Tasks`,onClick:()=>{u(null),c(s===`tasks`?null:`tasks`)},children:[(0,B.jsx)(U,{icon:mk}),y>0&&(0,B.jsx)(`span`,{className:`bg-primary text-primary-foreground absolute -top-0.5 -right-0.5 grid h-3.5 min-w-3.5 place-items-center rounded-full px-0.5 text-[9px] leading-none font-medium tabular-nums`,children:y})]}),(0,B.jsxs)(`button`,{className:F(Q9,`relative`),"data-pressed":h,"aria-label":`Toggle terminal`,title:`Terminal (${Bn}+\`)`,onClick:()=>fD(!h),children:[(0,B.jsx)(U,{icon:pk}),g&&(0,B.jsx)(`span`,{className:`bg-primary absolute top-1 right-1 size-1.5 rounded-full`})]}),(0,B.jsx)(`button`,{className:Q9,"data-pressed":s===`files`,"aria-label":`Toggle files panel`,title:`Files`,onClick:()=>c(s===`files`?null:`files`),children:(0,B.jsx)(U,{icon:mO})}),(0,B.jsx)(`button`,{className:Q9,"data-pressed":s===`diff`,"aria-label":`Toggle diff panel`,title:`Diff`,onClick:()=>c(s===`diff`?null:`diff`),children:(0,B.jsx)(U,{icon:_O})})]}),(0,B.jsx)(Hxe,{}),(0,B.jsx)(Bxe,{}),(0,B.jsx)(kE,{})]})}var $9=document.getElementById(`root`);if(!$9)throw Error(`root element missing`);if(`serviceWorker`in navigator){let e=navigator.serviceWorker.controller!==null,t=document.querySelector(`link[rel="manifest"]`)!==null;navigator.serviceWorker.addEventListener(`controllerchange`,()=>{e&&location.reload()}),navigator.serviceWorker.register(t?`/sw.js?pwa`:`/sw.js`,{type:`classic`}).catch(e=>console.error(`could not register the service worker`,e))}oe(),ue({open:e=>{Wf(e).catch(e=>console.error(`could not refresh the push subscription`,e))}}),Qf(),eD(),(0,y.createRoot)($9).render((0,B.jsx)(v.StrictMode,{children:(0,B.jsx)(qC,{children:(0,B.jsx)(QSe,{})})}));export{s as t};