@open-mercato/cezar 0.9.2 → 0.9.3

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 (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -2
  3. package/dist/contract/health.d.ts +2 -0
  4. package/dist/contract/index.js +23 -10
  5. package/dist/git-diff-base.d.ts +51 -26
  6. package/dist/git-diff-base.js +163 -37
  7. package/dist/git-diff-base.js.map +1 -1
  8. package/dist/git-worktree.d.ts +15 -6
  9. package/dist/git-worktree.js +10 -3
  10. package/dist/git-worktree.js.map +1 -1
  11. package/dist/server/capabilities.d.ts +15 -1
  12. package/dist/server/capabilities.js +16 -1
  13. package/dist/server/capabilities.js.map +1 -1
  14. package/dist/server/git-changes.d.ts +7 -5
  15. package/dist/server/git-changes.js +15 -10
  16. package/dist/server/git-changes.js.map +1 -1
  17. package/dist/server/server.d.ts +59 -58
  18. package/dist/server/server.js +54 -3
  19. package/dist/server/server.js.map +1 -1
  20. package/dist/workflows/run.d.ts +27 -7
  21. package/dist/workflows/run.js +106 -43
  22. package/dist/workflows/run.js.map +1 -1
  23. package/dist/workspace/config.d.ts +8 -0
  24. package/dist/workspace/config.js +29 -2
  25. package/dist/workspace/config.js.map +1 -1
  26. package/dist/workspace/semaphore.d.ts +7 -1
  27. package/dist/workspace/semaphore.js +10 -4
  28. package/dist/workspace/semaphore.js.map +1 -1
  29. package/dist/workspace/ui-state.d.ts +3 -2
  30. package/dist/workspace/ui-state.js +3 -2
  31. package/dist/workspace/ui-state.js.map +1 -1
  32. package/package.json +3 -3
  33. package/web/dist/assets/{alert-dialog-ghffK6g9.js → alert-dialog-V9cigyAO.js} +1 -1
  34. package/web/dist/assets/arrow-down-DflHdNlN.js +1 -0
  35. package/web/dist/assets/arrow-left-IIL4uR-C.js +1 -0
  36. package/web/dist/assets/centered-state-BkAJVLJE.js +43 -0
  37. package/web/dist/assets/chevron-right-CxAoD1eD.js +1 -0
  38. package/web/dist/assets/circle-check-CdwcIbkx.js +1 -0
  39. package/web/dist/assets/{circle-x-C3EFZ3xf.js → circle-x-Cnc43xJ2.js} +1 -1
  40. package/web/dist/assets/{collapsible-B0JVzd0B.js → collapsible-BlF-7CeC.js} +1 -1
  41. package/web/dist/assets/{commit-list-wm6DPHNs.js → commit-list-D2mKElUx.js} +1 -1
  42. package/web/dist/assets/{compare-variants-DbdP4Y5T.js → compare-variants-CFBY16Rc.js} +1 -1
  43. package/web/dist/assets/{diff-Bizc96qe.js → diff-DE6u5dTe.js} +2 -2
  44. package/web/dist/assets/{diff-stat-Dyfg3ltF.js → diff-stat-B1j6L7C6.js} +1 -1
  45. package/web/dist/assets/{diff-view-CG8ek6tC.js → diff-view-Gb2kk3Le.js} +1 -1
  46. package/web/dist/assets/{dropdown-menu-C1Dlf35P.js → dropdown-menu-Ns-rY6sm.js} +1 -1
  47. package/web/dist/assets/editable-title-BGuiDxFT.js +1 -0
  48. package/web/dist/assets/{ellipsis-vertical-DpGTRqC2.js → ellipsis-vertical-BbxtXb6s.js} +1 -1
  49. package/web/dist/assets/{file-DlUGpUlb.js → file-j5O4NryU.js} +1 -1
  50. package/web/dist/assets/{folder-BAY6Vddy.js → folder-w9Lwj9x9.js} +1 -1
  51. package/web/dist/assets/{git-pull-request-agOG0iGM.js → git-pull-request-DlSop3Ch.js} +1 -1
  52. package/web/dist/assets/{git-toolbar-DGiNMmtY.js → git-toolbar-BdJ8XSxI.js} +1 -1
  53. package/web/dist/assets/github-CCLn2OAU.js +1 -0
  54. package/web/dist/assets/{image-preview-BWGk5fPX.js → image-preview-CcFdkZXW.js} +1 -1
  55. package/web/dist/assets/index-BmHHLbwc.js +6 -0
  56. package/web/dist/assets/index-u8OAnq0r.css +2 -0
  57. package/web/dist/assets/{markdown-BGBOGCA_.js → markdown-q9lm7kQ2.js} +1 -1
  58. package/web/dist/assets/{new-task-form-BpAw_Dks.js → new-task-form-BuYxAWN7.js} +1 -1
  59. package/web/dist/assets/{pill-Dvs-P0xy.js → pill-t97MvPW_.js} +1 -1
  60. package/web/dist/assets/{project-router-Cx8NPoqn.js → project-router-DudOmkHf.js} +1 -1
  61. package/web/dist/assets/{prompt-templates-CSBYBR1I.js → prompt-templates-C5iO3Lda.js} +1 -1
  62. package/web/dist/assets/{refresh-cw-BoGdAykg.js → refresh-cw-_C2EGJK5.js} +1 -1
  63. package/web/dist/assets/{repo-git-PmX-BNMo.js → repo-git-DqQzj33d.js} +1 -1
  64. package/web/dist/assets/{run-diff-EcOkf3ti.js → run-diff-BLoKEnTx.js} +1 -1
  65. package/web/dist/assets/run-header-Dho4eurS.js +1 -0
  66. package/web/dist/assets/{search-x-X3EpVhgs.js → search-x-BgxaJgro.js} +1 -1
  67. package/web/dist/assets/{skill-empty-hint-CZLALx6l.js → skill-empty-hint-D5MOmycv.js} +1 -1
  68. package/web/dist/assets/skills-B5g064CC.js +1 -0
  69. package/web/dist/assets/{sparkles-Dt4q7pbG.js → sparkles-ANSka5bH.js} +1 -1
  70. package/web/dist/assets/{square-terminal-hwBL8XsC.js → square-terminal-qojq20cH.js} +1 -1
  71. package/web/dist/assets/{tab-link-DIlR5T07.js → tab-link-CIcwFJtC.js} +1 -1
  72. package/web/dist/assets/task-changes-yRfsEsnh.js +1 -0
  73. package/web/dist/assets/{task-commits-BTTA5k5T.js → task-commits-yXmDrCoE.js} +1 -1
  74. package/web/dist/assets/{task-files-Da8_4C9g.js → task-files-BDRmCCPN.js} +2 -2
  75. package/web/dist/assets/task-thread-C9AnIz4Z.js +9 -0
  76. package/web/dist/assets/{textarea-CUdokhkv.js → textarea-DVO7pg8Y.js} +1 -1
  77. package/web/dist/assets/{thread-loading-B8q8ukXJ.js → thread-loading-DJDl701Z.js} +1 -1
  78. package/web/dist/assets/{trash-2-DhVIdWv8.js → trash-2-DKcnmg6e.js} +1 -1
  79. package/web/dist/assets/{triangle-alert-XYT0DGCI.js → triangle-alert-CPUEVSZ3.js} +1 -1
  80. package/web/dist/assets/{upload-BKjN59-1.js → upload-D5Jrq7QK.js} +1 -1
  81. package/web/dist/assets/{use-desktop-Bf5LS_P4.js → use-desktop-CXae6uyk.js} +1 -1
  82. package/web/dist/assets/{use-submit-shortcut-CzVyoAMd.js → use-submit-shortcut-RKJLKdsW.js} +1 -1
  83. package/web/dist/assets/{utils-DsLuRXwV.js → utils-Wtkd5E6j.js} +1 -1
  84. package/web/dist/assets/{workflows-o2QU_pvU.js → workflows-CGyTdyds.js} +3 -3
  85. package/web/dist/assets/{zoomable-image-7WyUiaVD.js → zoomable-image-hcqwUIlQ.js} +1 -1
  86. package/web/dist/index.html +22 -22
  87. package/web/dist/assets/arrow-down-Cz8qb71e.js +0 -1
  88. package/web/dist/assets/arrow-left-wcYKQXI_.js +0 -1
  89. package/web/dist/assets/centered-state-ZtnFHA-n.js +0 -43
  90. package/web/dist/assets/chevron-right-G4caF2QV.js +0 -1
  91. package/web/dist/assets/circle-check--KvBxXWp.js +0 -1
  92. package/web/dist/assets/editable-title-5rC_QRBZ.js +0 -1
  93. package/web/dist/assets/github-Vp7lxYGQ.js +0 -1
  94. package/web/dist/assets/index-DSxyJpuK.css +0 -2
  95. package/web/dist/assets/index-DiawI6RX.js +0 -6
  96. package/web/dist/assets/run-header-BGiv6_qX.js +0 -1
  97. package/web/dist/assets/skills-CC91ouGH.js +0 -1
  98. package/web/dist/assets/task-changes-XkHDxzQA.js +0 -1
  99. package/web/dist/assets/task-thread-DoNXUsHr.js +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"semaphore.js","sourceRoot":"","sources":["../../src/workspace/semaphore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAoDlD;;;gFAGgF;AAChF,SAAS,iBAAiB,CAAC,IAAY;IACrC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAkBD,MAAM,cAAc,GAA4B;IAC9C,WAAW,EAAE,CAAC;IACd,qBAAqB,EAAE,CAAC;IACxB,6BAA6B,EAAE,IAAI;IACnC,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF;;;;kEAIkE;AAClE,KAAK,UAAU,kBAAkB;IAC/B,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,mBAAmB,EAAE,CAAC;IAC5D,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAChD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,QAAQ;YAAE,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACpG,CAAC;IACD,OAAO;QACL,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,qBAAqB,EAAE,SAAS,CAAC,qBAAqB;QACtD,6BAA6B,EAAE,SAAS,CAAC,6BAA6B;QACtE,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,aAAa;KACd,CAAC;AACJ,CAAC;AAYD,MAAM,OAAO,kBAAkB;IACZ,YAAY,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC/C,IAAI,CAAyC;IACtD,MAAM,CAA0B;IACxC,+DAA+D;IACvD,YAAY,GAAG,KAAK,CAAC;IAC7B;iFAC6E;IACrE,cAAc,GAAG,KAAK,CAAC;IAE/B,YAAY,OAAO,GAA8B,EAAE;QACjD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,kBAAkB,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1D,CAAC;IAED;0EACsE;IACtE,QAAQ,CAAC,WAAiC;QACxC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACnC,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;IAED;6CACyC;IACzC,IAAI;QACF,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,YAAY;YAAE,KAAK,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC;QAC9E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0CAA0C;IAC1C,WAAW;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACjC,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,qBAAqB,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,6BAA6B;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,6BAA6B,IAAI,IAAI,CAAC;IAC3D,CAAC;IAED,kEAAkE;IAClE,aAAa;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACnC,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;YAC3B,OAAO;QACT,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC;YACH,GAAG,CAAC;gBACF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;gBAC5B,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;qBACnC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;oBACrB,WAAW;oBACX,qEAAqE;oBACrE,KAAK,EAAE,WAAW,CAAC,cAAc,EAAE,IAAI,MAAM,CAAC,gBAAgB;iBAC/D,CAAC,CAAC;qBACF,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;gBACrC,KAAK,MAAM,EAAE,WAAW,EAAE,IAAI,OAAO;oBAAE,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;YAClE,CAAC,QAAQ,IAAI,CAAC,cAAc,EAAE;QAChC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC;IAED;;;;;;;;;OASG;IACH,kBAAkB,CAAC,QAAgB;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7E,OAAO,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,8BAA8B;QAChC,CAAC;QACD,sEAAsE;QACtE,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;CACF"}
1
+ {"version":3,"file":"semaphore.js","sourceRoot":"","sources":["../../src/workspace/semaphore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAsDnF;;;gFAGgF;AAChF,SAAS,iBAAiB,CAAC,IAAY;IACrC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAkBD,MAAM,cAAc,GAA4B;IAC9C,WAAW,EAAE,CAAC;IACd,qBAAqB,EAAE,CAAC;IACxB,6BAA6B,EAAE,+BAA+B;IAC9D,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF;;;;;kEAKkE;AAClE,KAAK,UAAU,kBAAkB;IAC/B,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,mBAAmB,EAAE,CAAC;IAC5D,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAChD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,QAAQ;YAAE,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACpG,CAAC;IACD,OAAO;QACL,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,qBAAqB,EAAE,SAAS,CAAC,qBAAqB;QACtD,6BAA6B,EAAE,SAAS,CAAC,6BAA6B;QACtE,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,aAAa;KACd,CAAC;AACJ,CAAC;AAYD,MAAM,OAAO,kBAAkB;IACZ,YAAY,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC/C,IAAI,CAAyC;IACtD,MAAM,CAA0B;IACxC,+DAA+D;IACvD,YAAY,GAAG,KAAK,CAAC;IAC7B;iFAC6E;IACrE,cAAc,GAAG,KAAK,CAAC;IAE/B,YAAY,OAAO,GAA8B,EAAE;QACjD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,kBAAkB,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1D,CAAC;IAED;0EACsE;IACtE,QAAQ,CAAC,WAAiC;QACxC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACnC,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;IAED;6CACyC;IACzC,IAAI;QACF,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,YAAY;YAAE,KAAK,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC;QAC9E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0CAA0C;IAC1C,WAAW;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACjC,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,qBAAqB,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;;yEAGqE;IACrE,6BAA6B;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,6BAA6B,CAAC;QAC7D,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,UAAU,CAAC;IACjF,CAAC;IAED,kEAAkE;IAClE,aAAa;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACnC,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;YAC3B,OAAO;QACT,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC;YACH,GAAG,CAAC;gBACF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;gBAC5B,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;qBACnC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;oBACrB,WAAW;oBACX,qEAAqE;oBACrE,KAAK,EAAE,WAAW,CAAC,cAAc,EAAE,IAAI,MAAM,CAAC,gBAAgB;iBAC/D,CAAC,CAAC;qBACF,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;gBACrC,KAAK,MAAM,EAAE,WAAW,EAAE,IAAI,OAAO;oBAAE,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;YAClE,CAAC,QAAQ,IAAI,CAAC,cAAc,EAAE;QAChC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC;IAED;;;;;;;;;OASG;IACH,kBAAkB,CAAC,QAAgB;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7E,OAAO,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,8BAA8B;QAChC,CAAC;QACD,sEAAsE;QACtE,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;CACF"}
@@ -6,8 +6,9 @@ import type { WorkspaceUiState } from '../contract/index.js';
6
6
  * read and the atomic write; the schema and key cap live at the route boundary
7
7
  * (`GET/PUT /api/workspace/ui-state`, step 2.7). The state is an opaque
8
8
  * `.passthrough()`-style bag — cross-project prefs (appearance, notifications,
9
- * per-project sidebar collapse) live here; project-scoped prefs stay in each
10
- * repo's own file.
9
+ * curated skills) live here; project-scoped prefs stay in each repo's own file,
10
+ * and prefs that describe the BROWSER rather than the workspace (sidebar
11
+ * collapse, the last visited location) stay in that browser's localStorage.
11
12
  */
12
13
  /** Read `~/.cezar/ui-state.json` on demand — never cached, never throws.
13
14
  * Missing, unreadable, malformed, or non-object all degrade to `{}`.
@@ -8,8 +8,9 @@ import { atomicWriteJsonSync } from './config.js';
8
8
  * read and the atomic write; the schema and key cap live at the route boundary
9
9
  * (`GET/PUT /api/workspace/ui-state`, step 2.7). The state is an opaque
10
10
  * `.passthrough()`-style bag — cross-project prefs (appearance, notifications,
11
- * per-project sidebar collapse) live here; project-scoped prefs stay in each
12
- * repo's own file.
11
+ * curated skills) live here; project-scoped prefs stay in each repo's own file,
12
+ * and prefs that describe the BROWSER rather than the workspace (sidebar
13
+ * collapse, the last visited location) stay in that browser's localStorage.
13
14
  */
14
15
  /** Read `~/.cezar/ui-state.json` on demand — never cached, never throws.
15
16
  * Missing, unreadable, malformed, or non-object all degrade to `{}`.
@@ -1 +1 @@
1
- {"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../../src/workspace/ui-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;GASG;AAEH;;;;;;0FAM0F;AAC1F,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAI,GAAW,oBAAoB,EAAE;IAErC,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACjE,OAAO,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAC5E,CAAC,CAAE,MAA2B;YAC9B,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAA6D;IAE7D,MAAM,IAAI,GAAG,oBAAoB,EAAE,CAAC;IACpC,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC;IACzC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../../src/workspace/ui-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;GAUG;AAEH;;;;;;0FAM0F;AAC1F,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAI,GAAW,oBAAoB,EAAE;IAErC,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACjE,OAAO,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAC5E,CAAC,CAAE,MAA2B;YAC9B,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAA6D;IAE7D,MAAM,IAAI,GAAG,oBAAoB,EAAE,CAAC;IACpC,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC;IACzC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/cezar",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,8 +51,8 @@
51
51
  "zod": "^4.4.3"
52
52
  },
53
53
  "devDependencies": {
54
- "@open-mercato/cezar-api-client": "^0.9.2",
55
- "@open-mercato/cezar-contract": "^0.9.2",
54
+ "@open-mercato/cezar-api-client": "^0.9.3",
55
+ "@open-mercato/cezar-contract": "^0.9.3",
56
56
  "@types/node": "^20.14.0",
57
57
  "@types/ws": "^8.18.1",
58
58
  "esbuild": "^0.28.1",
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,_ as i,b as a,c as o,d as s,f as c,g as l,h as u,l as d,o as f,p as ee,s as te,u as ne,w as re,x as p,y as m}from"./centered-state-ZtnFHA-n.js";import{t as h}from"./utils-DsLuRXwV.js";var g=e(t(),1),_=n(),v=`Dialog`,[y,b]=a(v),[ie,x]=y(v),S=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=g.useRef(null),l=g.useRef(null),[d,f]=i({prop:r,defaultProp:a??!1,onChange:o,caller:v});return(0,_.jsx)(ie,{scope:t,triggerRef:c,contentRef:l,contentId:u(),titleId:u(),descriptionId:u(),open:d,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(e=>!e),[f]),modal:s,children:n})};S.displayName=v;var C=`DialogTrigger`,w=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=x(C,n),o=r(t,a.triggerRef);return(0,_.jsx)(p.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":B(a.open),...i,ref:o,onClick:m(e.onClick,a.onOpenToggle)})});w.displayName=C;var T=`DialogPortal`,[E,D]=y(T,{forceMount:void 0}),O=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=x(T,t);return(0,_.jsx)(E,{scope:t,forceMount:n,children:g.Children.map(r,e=>(0,_.jsx)(l,{present:n||a.open,children:(0,_.jsx)(ne,{asChild:!0,container:i,children:e})}))})};O.displayName=T;var k=`DialogOverlay`,A=g.forwardRef((e,t)=>{let n=D(k,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=x(k,e.__scopeDialog);return a.modal?(0,_.jsx)(l,{present:r||a.open,children:(0,_.jsx)(oe,{...i,ref:t})}):null});A.displayName=k;var ae=re(`DialogOverlay.RemoveScroll`),oe=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=x(k,n),s=r(t,ee());return(0,_.jsx)(o,{as:ae,allowPinchZoom:!0,shards:[a.contentRef],children:(0,_.jsx)(p.div,{"data-state":B(a.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})}),j=`DialogContent`,M=g.forwardRef((e,t)=>{let n=D(j,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=x(j,e.__scopeDialog);return(0,_.jsx)(l,{present:r||a.open,children:a.modal?(0,_.jsx)(se,{...i,ref:t}):(0,_.jsx)(ce,{...i,ref:t})})});M.displayName=j;var se=g.forwardRef((e,t)=>{let n=x(j,e.__scopeDialog),i=g.useRef(null),a=r(t,n.contentRef,i);return g.useEffect(()=>{let e=i.current;if(e)return te(e)},[]),(0,_.jsx)(N,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:m(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault())})}),ce=g.forwardRef((e,t)=>{let n=x(j,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return(0,_.jsx)(N,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),N=g.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=x(j,n);return d(),(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,_.jsx)(c,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":B(l.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),P=`DialogTitle`,F=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(P,n);return(0,_.jsx)(p.h2,{id:i.titleId,...r,ref:t})});F.displayName=P;var I=`DialogDescription`,L=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(I,n);return(0,_.jsx)(p.p,{id:i.descriptionId,...r,ref:t})});L.displayName=I;var R=`DialogClose`,z=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(R,n);return(0,_.jsx)(p.button,{type:`button`,...r,ref:t,onClick:m(e.onClick,()=>i.onOpenChange(!1))})});z.displayName=R;function B(e){return e?`open`:`closed`}var V=`AlertDialog`,[le,ue]=a(V,[b]),H=b(),U=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(S,{...r,...n,modal:!0})};U.displayName=V;var de=`AlertDialogTrigger`,fe=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(w,{...i,...r,ref:t})});fe.displayName=de;var pe=`AlertDialogPortal`,W=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(O,{...r,...n})};W.displayName=pe;var me=`AlertDialogOverlay`,G=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(A,{...i,...r,ref:t})});G.displayName=me;var K=`AlertDialogContent`,[he,ge]=le(K),q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:i,...a}=e,o=H(n),s=r(t,g.useRef(null)),c=g.useRef(null);return(0,_.jsx)(he,{scope:n,cancelRef:c,children:(0,_.jsx)(M,{role:`alertdialog`,...o,...a,ref:s,onOpenAutoFocus:m(a.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:i})})});q.displayName=K;var _e=`AlertDialogTitle`,J=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(F,{...i,...r,ref:t})});J.displayName=_e;var ve=`AlertDialogDescription`,Y=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(L,{...i,...r,ref:t})});Y.displayName=ve;var ye=`AlertDialogAction`,X=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(z,{...i,...r,ref:t})});X.displayName=ye;var Z=`AlertDialogCancel`,Q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...i}=e,{cancelRef:a}=ge(Z,n),o=H(n),s=r(t,a);return(0,_.jsx)(z,{...o,...i,ref:s})});Q.displayName=Z;var be=U,xe=W,Se=G,Ce=q,we=X,Te=Q,Ee=J,De=Y;function Oe({...e}){return(0,_.jsx)(be,{"data-slot":`alert-dialog`,...e})}function ke({...e}){return(0,_.jsx)(xe,{"data-slot":`alert-dialog-portal`,...e})}function $({className:e,...t}){return(0,_.jsx)(Se,{"data-slot":`alert-dialog-overlay`,className:h(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Ae({className:e,...t}){return(0,_.jsxs)(ke,{children:[(0,_.jsx)($,{}),(0,_.jsx)(Ce,{"data-slot":`alert-dialog-content`,className:h(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-md`,e),...t})]})}function je({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:h(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Me({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:h(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function Ne({className:e,...t}){return(0,_.jsx)(Ee,{"data-slot":`alert-dialog-title`,className:h(`text-lg leading-none font-semibold`,e),...t})}function Pe({className:e,...t}){return(0,_.jsx)(De,{"data-slot":`alert-dialog-description`,className:h(`text-sm text-muted-foreground`,e),...t})}function Fe({className:e,...t}){return(0,_.jsx)(we,{"data-slot":`alert-dialog-action`,className:h(f({variant:`contrast`}),e),...t})}function Ie({className:e,...t}){return(0,_.jsx)(Te,{"data-slot":`alert-dialog-cancel`,className:h(f({variant:`outline`}),e),...t})}export{Pe as a,Ne as c,M as d,L as f,w as g,F as h,Ae as i,S as l,O as m,Fe as n,Me as o,A as p,Ie as r,je as s,Oe as t,z as u};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,_ as i,b as a,c as o,d as s,f as c,g as l,h as u,l as d,o as f,p as ee,s as te,u as ne,w as re,x as p,y as m}from"./centered-state-BkAJVLJE.js";import{t as h}from"./utils-Wtkd5E6j.js";var g=e(t(),1),_=n(),v=`Dialog`,[y,b]=a(v),[ie,x]=y(v),S=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=g.useRef(null),l=g.useRef(null),[d,f]=i({prop:r,defaultProp:a??!1,onChange:o,caller:v});return(0,_.jsx)(ie,{scope:t,triggerRef:c,contentRef:l,contentId:u(),titleId:u(),descriptionId:u(),open:d,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(e=>!e),[f]),modal:s,children:n})};S.displayName=v;var C=`DialogTrigger`,w=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=x(C,n),o=r(t,a.triggerRef);return(0,_.jsx)(p.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":B(a.open),...i,ref:o,onClick:m(e.onClick,a.onOpenToggle)})});w.displayName=C;var T=`DialogPortal`,[E,D]=y(T,{forceMount:void 0}),O=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=x(T,t);return(0,_.jsx)(E,{scope:t,forceMount:n,children:g.Children.map(r,e=>(0,_.jsx)(l,{present:n||a.open,children:(0,_.jsx)(ne,{asChild:!0,container:i,children:e})}))})};O.displayName=T;var k=`DialogOverlay`,A=g.forwardRef((e,t)=>{let n=D(k,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=x(k,e.__scopeDialog);return a.modal?(0,_.jsx)(l,{present:r||a.open,children:(0,_.jsx)(oe,{...i,ref:t})}):null});A.displayName=k;var ae=re(`DialogOverlay.RemoveScroll`),oe=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=x(k,n),s=r(t,ee());return(0,_.jsx)(o,{as:ae,allowPinchZoom:!0,shards:[a.contentRef],children:(0,_.jsx)(p.div,{"data-state":B(a.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})}),j=`DialogContent`,M=g.forwardRef((e,t)=>{let n=D(j,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=x(j,e.__scopeDialog);return(0,_.jsx)(l,{present:r||a.open,children:a.modal?(0,_.jsx)(se,{...i,ref:t}):(0,_.jsx)(ce,{...i,ref:t})})});M.displayName=j;var se=g.forwardRef((e,t)=>{let n=x(j,e.__scopeDialog),i=g.useRef(null),a=r(t,n.contentRef,i);return g.useEffect(()=>{let e=i.current;if(e)return te(e)},[]),(0,_.jsx)(N,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:m(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault())})}),ce=g.forwardRef((e,t)=>{let n=x(j,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return(0,_.jsx)(N,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),N=g.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=x(j,n);return d(),(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,_.jsx)(c,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":B(l.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),P=`DialogTitle`,F=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(P,n);return(0,_.jsx)(p.h2,{id:i.titleId,...r,ref:t})});F.displayName=P;var I=`DialogDescription`,L=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(I,n);return(0,_.jsx)(p.p,{id:i.descriptionId,...r,ref:t})});L.displayName=I;var R=`DialogClose`,z=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(R,n);return(0,_.jsx)(p.button,{type:`button`,...r,ref:t,onClick:m(e.onClick,()=>i.onOpenChange(!1))})});z.displayName=R;function B(e){return e?`open`:`closed`}var V=`AlertDialog`,[le,ue]=a(V,[b]),H=b(),U=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(S,{...r,...n,modal:!0})};U.displayName=V;var de=`AlertDialogTrigger`,fe=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(w,{...i,...r,ref:t})});fe.displayName=de;var pe=`AlertDialogPortal`,W=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(O,{...r,...n})};W.displayName=pe;var me=`AlertDialogOverlay`,G=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(A,{...i,...r,ref:t})});G.displayName=me;var K=`AlertDialogContent`,[he,ge]=le(K),q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:i,...a}=e,o=H(n),s=r(t,g.useRef(null)),c=g.useRef(null);return(0,_.jsx)(he,{scope:n,cancelRef:c,children:(0,_.jsx)(M,{role:`alertdialog`,...o,...a,ref:s,onOpenAutoFocus:m(a.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:i})})});q.displayName=K;var _e=`AlertDialogTitle`,J=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(F,{...i,...r,ref:t})});J.displayName=_e;var ve=`AlertDialogDescription`,Y=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(L,{...i,...r,ref:t})});Y.displayName=ve;var ye=`AlertDialogAction`,X=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(z,{...i,...r,ref:t})});X.displayName=ye;var Z=`AlertDialogCancel`,Q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...i}=e,{cancelRef:a}=ge(Z,n),o=H(n),s=r(t,a);return(0,_.jsx)(z,{...o,...i,ref:s})});Q.displayName=Z;var be=U,xe=W,Se=G,Ce=q,we=X,Te=Q,Ee=J,De=Y;function Oe({...e}){return(0,_.jsx)(be,{"data-slot":`alert-dialog`,...e})}function ke({...e}){return(0,_.jsx)(xe,{"data-slot":`alert-dialog-portal`,...e})}function $({className:e,...t}){return(0,_.jsx)(Se,{"data-slot":`alert-dialog-overlay`,className:h(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Ae({className:e,...t}){return(0,_.jsxs)(ke,{children:[(0,_.jsx)($,{}),(0,_.jsx)(Ce,{"data-slot":`alert-dialog-content`,className:h(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-md`,e),...t})]})}function je({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:h(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Me({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:h(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function Ne({className:e,...t}){return(0,_.jsx)(Ee,{"data-slot":`alert-dialog-title`,className:h(`text-lg leading-none font-semibold`,e),...t})}function Pe({className:e,...t}){return(0,_.jsx)(De,{"data-slot":`alert-dialog-description`,className:h(`text-sm text-muted-foreground`,e),...t})}function Fe({className:e,...t}){return(0,_.jsx)(we,{"data-slot":`alert-dialog-action`,className:h(f({variant:`contrast`}),e),...t})}function Ie({className:e,...t}){return(0,_.jsx)(Te,{"data-slot":`alert-dialog-cancel`,className:h(f({variant:`outline`}),e),...t})}export{Pe as a,Ne as c,M as d,L as f,w as g,F as h,Ae as i,S as l,O as m,Fe as n,Me as o,A as p,Ie as r,je as s,Oe as t,z as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./utils-Wtkd5E6j.js";var t=e(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./utils-Wtkd5E6j.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);export{t};
@@ -0,0 +1,43 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i,c as a,d as o,i as s,o as c,r as l,s as u,t as d}from"./utils-Wtkd5E6j.js";import{i as f,r as p}from"./bundle-mjs-BT31bpU6.js";var m=/^[\w!#$%&'*.^`|~+-]+$/,h=(e,t,n={})=>{if(!m.test(e))throw Error(`Invalid cookie name`);let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`,`sameSite`,`priority`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},g=(e,t,n)=>(t=encodeURIComponent(t),h(e,t,n)),_=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),v=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},y=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},b=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},x=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function C(e,t){if(!S(e)&&!S(t))return t;let n={...e};for(let e in t){let r=t[e];S(n[e])&&S(r)?n[e]=C(n[e],r):n[e]=r}return n}var w=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return w(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),ee=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(g(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=x(a),a=v(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},te=(e,t)=>w(function n(r){let i=t?.buildSearchParams??y,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=_(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=v(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=x(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=b(r.args[0]&&r.args[0].param?v(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new ee(c,s,{buildSearchParams:i});if(s){t??={};let e={...r.args[1]},n=t.headers,i=e.headers;n&&i&&(e.headers=async()=>({...typeof n==`function`?await n():n,...typeof i==`function`?await i():i}));let a=C(t,e);return l.fetch(r.args[0],a)}return l},[]);function ne(e={}){let{baseUrl:t=``,token:n,headers:r,fetch:i}=e;return te(t,{headers:{...n?{Authorization:`Bearer ${n}`}:{},...r},...i?{fetch:i}:{}})}var T=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},re=new class extends T{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ie={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},E=new class{#e=ie;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ae(e){setTimeout(e,0)}var oe=typeof window>`u`||`Deno`in globalThis;function D(){}function se(e,t){return typeof e==`function`?e(t):e}function ce(e){return typeof e==`number`&&e>=0&&e!==1/0}function le(e,t){return Math.max(e+(t||0)-Date.now(),0)}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){return typeof e==`function`?e(t):e}function ue(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==fe(o,t.options))return!1}else if(!me(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function de(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(pe(t.options.mutationKey)!==pe(a))return!1}else if(!me(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function fe(e,t){return(t?.queryKeyHashFn||pe)(e)}function pe(e){return JSON.stringify(e,(e,t)=>ye(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function me(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>me(e[n],t[n])):!1}var he=Object.prototype.hasOwnProperty;function ge(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ve(e)&&ve(t);if(!r&&!(ye(e)&&ye(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:he.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ge(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function _e(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ve(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ye(e){if(!be(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!be(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function be(e){return Object.prototype.toString.call(e)===`[object Object]`}function xe(e){return new Promise(t=>{E.setTimeout(t,e)})}function Se(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ge(e,t)}function Ce(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function we(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Te=Symbol();function Ee(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Te?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function De(e,t){return typeof e==`function`?e(...t):!!e}function Oe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ke=(()=>{let e=()=>oe;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ae(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var je=ae;function Me(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=je,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var A=Me(),Ne=new class extends T{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Pe(e){return Math.min(1e3*2**e,3e4)}function Fe(e){return(e??`online`)!==`online`||Ne.isOnline()}var Ie=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Le(e){let t=!1,n=0,r,i=Ae(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Ie(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>re.isFocused()&&(e.networkMode===`always`||Ne.isOnline())&&e.canRun(),u=()=>Fe(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(ke.isServer()?0:3),o=e.retryDelay??Pe,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),xe(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Re=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ce(this.gcTime)&&(this.#e=E.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ke.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(E.clearTimeout(this.#e),this.#e=void 0)}};function ze(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Oe(e,()=>t.signal,()=>n=!0)},u=Ee(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?we:Ce;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ve:Be,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Be(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Be(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ve(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var He=class extends Re{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ge(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ge(this.options);e.data!==void 0&&(this.setState(We(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Se(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(D).catch(D):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>k(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Te||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>O(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!le(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ee(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ze(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Le({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ie&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ie){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ue(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...We(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),A.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ue(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function We(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ge(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ke=class extends T{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Ae(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Je(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ye(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ye(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof k(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!_e(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Xe(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||O(this.options.staleTime,this.#t)!==O(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Qe(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(D)),t}#g(){this.#b();let e=O(this.options.staleTime,this.#t);if(ke.isServer()||this.#r.isStale||!ce(e))return;let t=le(this.#r.dataUpdatedAt,e)+1;this.#d=E.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(ke.isServer()||k(this.options.enabled,this.#t)===!1||!ce(this.#p)||this.#p===0)&&(this.#f=E.setInterval(()=>{(this.options.refetchIntervalInBackground||re.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(E.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(E.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Je(e,t),o=i&&Xe(e,n,t,r);(a||o)&&(l={...l,...Ue(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Se(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Se(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ze(e,t),refetch:this.refetch,promise:this.#o,isEnabled:k(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=Ae();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!_e(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){A.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function qe(e,t){return k(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&k(t.retryOnMount,e)===!1)}function Je(e,t){return qe(e,t)||e.state.data!==void 0&&Ye(e,t,t.refetchOnMount)}function Ye(e,t,n){if(k(t.enabled,e)!==!1&&O(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ze(e,t)}return!1}function Xe(e,t,n,r){return(e!==t||k(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ze(e,n)}function Ze(e,t){return k(t.enabled,e)!==!1&&e.isStaleByTime(O(t.staleTime,e))}function Qe(e,t){return!_e(e.getCurrentResult(),t)}var $e=class extends Re{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||et(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Le({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),A.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function et(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var tt=class extends T{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),_e(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&pe(t.mutationKey)!==pe(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??et();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){A.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},j=e(t(),1),M=r(),nt=j.createContext(void 0),N=e=>{let t=j.useContext(nt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},rt=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,M.jsx)(nt.Provider,{value:e,children:t})),it=j.createContext(!1),at=()=>j.useContext(it);it.Provider;function ot(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var st=j.createContext(ot()),ct=()=>j.useContext(st),lt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?De(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ut=e=>{j.useEffect(()=>{e.clearReset()},[e])},dt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||De(n,[e.error,r])),ft=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},pt=(e,t)=>e.isLoading&&e.isFetching&&!t,mt=(e,t)=>e?.suspense&&t.isPending,ht=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function gt(e,t,n){let r=at(),i=ct(),a=N(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ft(o),lt(o,i,s),ut(i);let l=!a.getQueryCache().get(o.queryHash),[u]=j.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(j.useSyncExternalStore(j.useCallback(e=>{let t=f?u.subscribe(A.batchCalls(e)):D;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),j.useEffect(()=>{u.setOptions(o)},[o,u]),mt(o,d))throw ht(o,u,i);if(dt({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!ke.isServer()&&pt(d,r)&&(l?ht(o,u,i):s?.promise)?.catch(D).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function P(e,t){return gt(e,Ke,t)}function F(e,t){let n=N(t),[r]=j.useState(()=>new tt(n,e));j.useEffect(()=>{r.setOptions(e)},[r,e]);let i=j.useSyncExternalStore(j.useCallback(e=>r.subscribe(A.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=j.useCallback((e,t)=>{r.mutate(e,t).catch(D)},[r]);if(i.error&&De(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var _t=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,vt=/^[\\/]{2}/;function yt(e,t){return t+e.replace(/\\/g,`/`)}var bt=`popstate`;function xt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function St(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Tt(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Et(t)}return Ot(t,n,null,e)}function I(e,t){if(e===!1||e==null)throw Error(t)}function L(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Ct(){return Math.random().toString(36).substring(2,10)}function wt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Tt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Dt(t):t,state:n,key:t&&t.key||r||Ct(),mask:i}}function Et({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Dt(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ot(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=xt(e)?e:Tt(h.location,e,t);n&&n(r,e),l=u()+1;let d=wt(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=xt(e)?e:Tt(h.location,e,t);n&&n(r,e),l=u();let i=wt(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return kt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(bt,d),c=e,()=>{i.removeEventListener(bt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function kt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),I(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Et(t);return i=i.replace(/ $/,`%20`),!n&&vt.test(i)&&(i=r+i),new URL(i,r)}function At(e,t,n=`/`){return jt(e,t,n,!1)}function jt(e,t,n,r,i){let a=R((typeof t==`string`?Dt(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Nt(e),s=null,c=Xt(a);for(let e=0;s==null&&e<o.length;++e)s=Kt(o[e],c,r);return s}function Mt(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Nt(e){let t=Pt(e);return It(t),t}function Pt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;I(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=z([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(I(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Pt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Wt(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Yt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Ft(e.path))a(e,t,!0,n)}),t}function Ft(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Ft(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function It(e){e.sort((e,t)=>e.score===t.score?Gt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Lt=/^:[\w-]+$/,Rt=3,zt=2,Bt=1,Vt=10,Ht=-2,Ut=e=>e===`*`;function Wt(e,t){let n=e.split(`/`),r=n.length;return n.some(Ut)&&(r+=Ht),t&&(r+=zt),n.filter(e=>!Ut(e)).reduce((e,t)=>e+(Lt.test(t)?Rt:t===``?Bt:Vt),r)}function Gt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Kt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Jt(u,l,s.matcher,s.compiledParams):qt(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=qt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:z([a,d.pathname]),pathnameBase:on(z([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=z([a,d.pathnameBase]))}return o}function qt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Yt(e.path,e.caseSensitive,e.end);return Jt(e,t,n,r)}function Jt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Yt(e,t=!1,n=!0){L(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Xt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return L(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function R(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Zt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Dt(e):e,a;return n?(n=rn(n),a=n.startsWith(`/`)?Qt(n.substring(1),`/`):Qt(n,t)):a=t,{pathname:a,search:sn(r),hash:cn(i)}}function Qt(e,t){let n=an(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function $t(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function en(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function tn(e){let t=en(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function nn(e,t,n,r=!1){let i;typeof e==`string`?i=Dt(e):(i={...e},I(!i.pathname||!i.pathname.includes(`?`),$t(`?`,`pathname`,`search`,i)),I(!i.pathname||!i.pathname.includes(`#`),$t(`#`,`pathname`,`hash`,i)),I(!i.search||!i.search.includes(`#`),$t(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Zt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var rn=e=>e.replace(/[\\/]{2,}/g,`/`),z=e=>rn(e.join(`/`)),an=e=>e.replace(/\/+$/,``),on=e=>an(e).replace(/^\/*/,`/`),sn=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,cn=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ln=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function un(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function dn(e){return z(e.map(e=>e.route.path).filter(Boolean))||`/`}var fn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function pn(e,t){let n=e;if(typeof n!=`string`||!_t.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(fn)try{let e=new URL(window.location.href),r=vt.test(n)?new URL(yt(n,e.protocol)):new URL(n),a=R(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{L(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var mn=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(mn);var hn=[`GET`,...mn];new Set(hn);var gn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function _n(e){try{return gn.includes(new URL(e).protocol)}catch{return!1}}var vn=j.createContext(null);vn.displayName=`DataRouter`;var yn=j.createContext(null);yn.displayName=`DataRouterState`;var bn=j.createContext(!1);function xn(){return j.useContext(bn)}var Sn=j.createContext({isTransitioning:!1});Sn.displayName=`ViewTransition`;var Cn=j.createContext(new Map);Cn.displayName=`Fetchers`;var wn=j.createContext(null);wn.displayName=`Await`;var B=j.createContext(null);B.displayName=`Navigation`;var Tn=j.createContext(null);Tn.displayName=`Location`;var V=j.createContext({outlet:null,matches:[],isDataRoute:!1});V.displayName=`Route`;var En=j.createContext(null);En.displayName=`RouteError`;var Dn=`REACT_ROUTER_ERROR`,On=`REDIRECT`,kn=`ROUTE_ERROR_RESPONSE`;function An(e){if(e.startsWith(`${Dn}:${On}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function jn(e){if(e.startsWith(`${Dn}:${kn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new ln(t.status,t.statusText,t.data)}catch{}}function Mn(e,{relative:t}={}){I(H(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=j.useContext(B),{hash:i,pathname:a,search:o}=Bn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:z([n,a])),r.createHref({pathname:s,search:o,hash:i})}function H(){return j.useContext(Tn)!=null}function U(){return I(H(),`useLocation() may be used only in the context of a <Router> component.`),j.useContext(Tn).location}var Nn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Pn(e){j.useContext(B).static||j.useLayoutEffect(e)}function Fn(){let{isDataRoute:e}=j.useContext(V);return e?ar():In()}function In(){I(H(),`useNavigate() may be used only in the context of a <Router> component.`);let e=j.useContext(vn),{basename:t,navigator:n}=j.useContext(B),{matches:r}=j.useContext(V),{pathname:i}=U(),a=JSON.stringify(tn(r)),o=j.useRef(!1);return Pn(()=>{o.current=!0}),j.useCallback((r,s={})=>{if(L(o.current,Nn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=nn(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:z([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Ln=j.createContext(null);function Rn(e){let t=j.useContext(V).outlet;return j.useMemo(()=>t&&j.createElement(Ln.Provider,{value:e},t),[t,e])}function zn(){let{matches:e}=j.useContext(V);return e[e.length-1]?.params??{}}function Bn(e,{relative:t}={}){let{matches:n}=j.useContext(V),{pathname:r}=U(),i=JSON.stringify(tn(n));return j.useMemo(()=>nn(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Vn(e,t){return Hn(e,t)}function Hn(e,t,n){I(H(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=j.useContext(B),{matches:i}=j.useContext(V),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;sr(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
+
3
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=U(),d;if(t){let e=typeof t==`string`?Dt(t):t;I(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):At(e,{pathname:p});L(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),L(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Yn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:z([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:z([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?j.createElement(Tn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Un(){let e=ir(),t=un(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=j.createElement(j.Fragment,null,j.createElement(`p`,null,`💿 Hey developer 👋`),j.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,j.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,j.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),j.createElement(j.Fragment,null,j.createElement(`h2`,null,`Unexpected Application Error!`),j.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?j.createElement(`pre`,{style:i},n):null,o)}var Wn=j.createElement(Un,null),Gn=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=jn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:j.createElement(V.Provider,{value:this.props.routeContext},j.createElement(En.Provider,{value:e,children:this.props.component}));return this.context?j.createElement(qn,{error:e},t):t}};Gn.contextType=bn;var Kn=new WeakMap;function qn({children:e,error:t}){let{basename:n}=j.useContext(B);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=An(t.digest);if(e){let r=Kn.get(t);if(r)throw r;let i=pn(e.location,n),a=i.absoluteURL||i.to;if(_n(a))throw Error(`Invalid redirect location`);if(fn&&!Kn.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Kn.set(t,n),n}return j.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Jn({routeContext:e,match:t,children:n}){let r=j.useContext(vn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(V.Provider,{value:e},n)}function Yn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);I(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:dn(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Wn,o&&(s<0&&c===0?(sr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?j.createElement(n.route.Component,null):n.route.element?n.route.element:e,j.createElement(Jn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?j.createElement(Gn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Xn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zn(e){let t=j.useContext(vn);return I(t,Xn(e)),t}function Qn(e){let t=j.useContext(yn);return I(t,Xn(e)),t}function $n(e){let t=j.useContext(V);return I(t,Xn(e)),t}function er(e){let t=$n(e),n=t.matches[t.matches.length-1];return I(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function tr(){return er(`useRouteId`)}function nr(){let e=Qn(`useNavigation`);return j.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function rr(){let{matches:e,loaderData:t}=Qn(`useMatches`);return j.useMemo(()=>e.map(e=>Mt(e,t)),[e,t])}function ir(){let e=j.useContext(En),t=Qn(`useRouteError`),n=er(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ar(){let{router:e}=Zn(`useNavigate`),t=er(`useNavigate`),n=j.useRef(!1);return Pn(()=>{n.current=!0}),j.useCallback(async(r,i={})=>{L(n.current,Nn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var or={};function sr(e,t,n){!t&&!or[e]&&(or[e]=!0,L(!1,n))}j.memo(cr);function cr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Hn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function lr({to:e,replace:t,state:n,relative:r}){I(H(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=j.useContext(B);L(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=j.useContext(V),{pathname:o}=U(),s=Fn(),c=nn(e,tn(a),o,r===`path`),l=JSON.stringify(c);return j.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function ur(e){return Rn(e.context)}function dr(e){I(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function fr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){I(!H(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=j.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Dt(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=j.useMemo(()=>{let e=R(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return L(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:j.createElement(B.Provider,{value:c},j.createElement(Tn.Provider,{children:t,value:h}))}function pr({children:e,location:t}){return Vn(mr(e),t)}j.Component;function mr(e,t=[]){let n=[];return j.Children.forEach(e,(e,r)=>{if(!j.isValidElement(e))return;let i=[...t,r];if(e.type===j.Fragment){n.push.apply(n,mr(e.props.children,i));return}I(e.type===dr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),I(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=mr(e.props.children,i)),n.push(a)}),n}var hr=`get`,gr=`application/x-www-form-urlencoded`;function _r(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function vr(e){return _r(e)&&e.tagName.toLowerCase()===`button`}function yr(e){return _r(e)&&e.tagName.toLowerCase()===`form`}function br(e){return _r(e)&&e.tagName.toLowerCase()===`input`}function xr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Sr(e,t){return e.button===0&&(!t||t===`_self`)&&!xr(e)}function Cr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function wr(e,t){let n=Cr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Tr=null;function Er(){if(Tr===null)try{new FormData(document.createElement(`form`),0),Tr=!1}catch{Tr=!0}return Tr}var Dr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Or(e){return e!=null&&!Dr.has(e)?(L(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${gr}"`),null):e}function kr(e,t){let n,r,i,a,o;if(yr(e)){let o=e.getAttribute(`action`);r=o?R(o,t):null,n=e.getAttribute(`method`)||hr,i=Or(e.getAttribute(`enctype`))||gr,a=new FormData(e)}else if(vr(e)||br(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?R(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||hr,i=Or(e.getAttribute(`formenctype`))||Or(o.getAttribute(`enctype`))||gr,a=new FormData(o,e),!Er()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(_r(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=hr,r=null,i=gr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ar={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},jr=/[&><\u2028\u2029]/g;function Mr(e){return e.replace(jr,e=>Ar[e])}function Nr(e,t){if(e===!1||e==null)throw Error(t)}function Pr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&R(i.pathname,t)===`/`?i.pathname=`${an(t)}/_root.${r}`:i.pathname=`${an(i.pathname)}.${r}`,i}async function Fr(e,t){if(e.id in t)return t[e.id];try{let n=await f(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ir(e){return e!=null&&typeof e.page==`string`}function Lr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Rr(e,t,n){return Ur((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Fr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Lr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function zr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Br(e,t,{includeHydrateFallback:n}={}){return Vr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Vr(e){return[...new Set(e)]}function Hr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Ur(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ir(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Hr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Wr(){let e=j.useContext(vn);return Nr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Gr(){let e=j.useContext(yn);return Nr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Kr=j.createContext(void 0);Kr.displayName=`FrameworkContext`;function qr(){let e=j.useContext(Kr);return Nr(e,`You must render this element inside a <HydratedRouter> element`),e}function Jr(e,t){let n=j.useContext(Kr),[r,i]=j.useState(!1),[a,o]=j.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=j.useRef(null);j.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),j.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Yr(s,p),onBlur:Yr(c,m),onMouseEnter:Yr(l,p),onMouseLeave:Yr(u,m),onTouchStart:Yr(d,p)}]:[a,f,{}]:[!1,f,{}]}function Yr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Xr({page:e,...t}){let n=xn(),{nonce:r}=qr(),{router:i}=Wr(),a=j.useMemo(()=>At(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?j.createElement(Qr,{page:e,matches:a,...t}):j.createElement($r,{page:e,matches:a,...t})):null}function Zr(e){let{manifest:t,routeModules:n}=qr(),[r,i]=j.useState([]);return j.useEffect(()=>{let r=!1;return Rr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Qr({page:e,matches:t,...n}){let r=U(),{future:i}=qr(),{basename:a}=Wr(),o=j.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Pr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return j.createElement(j.Fragment,null,o.map(e=>j.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function $r({page:e,matches:t,...n}){let r=U(),{future:i,manifest:a,routeModules:o}=qr(),{basename:s}=Wr(),{loaderData:c,matches:l}=Gr(),u=j.useMemo(()=>zr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=j.useMemo(()=>zr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=j.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Pr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=j.useMemo(()=>Br(d,a),[d,a]),m=Zr(d);return j.createElement(j.Fragment,null,f.map(e=>j.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>j.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>j.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function ei(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}j.Component;var ti=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ti&&(window.__reactRouterVersion=`7.18.1`)}catch{}function ni({basename:e,children:t,useTransitions:n,window:r}){let i=j.useRef();i.current??=St({window:r,v5Compat:!0});let a=i.current,[o,s]=j.useState({action:a.action,location:a.location}),c=j.useCallback(e=>{n===!1?s(e):j.startTransition(()=>s(e))},[n]);return j.useLayoutEffect(()=>a.listen(c),[a,c]),j.createElement(fr,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function ri({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=j.useState({action:n.action,location:n.location}),o=j.useCallback(e=>{r===!1?a(e):j.startTransition(()=>a(e))},[r]);return j.useLayoutEffect(()=>n.listen(o),[n,o]),j.createElement(fr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}ri.displayName=`unstable_HistoryRouter`;var ii=j.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=j.useContext(B),v=typeof l==`string`&&_t.test(l),y=pn(l,h);l=y.to;let b=Mn(l,{relative:r}),x=U(),S=null;if(o){let e=nn(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:z([h,e.pathname])),S=g.createHref(e)}let[C,w,ee]=Jr(n,p),te=di(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function ne(t){e&&e(t),t.defaultPrevented||te(t)}let T=!(y.isExternal||i),re=j.createElement(`a`,{...p,...ee,href:(T?S:void 0)||y.absoluteURL||b,onClick:T?ne:e,ref:ei(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?j.createElement(j.Fragment,null,re,j.createElement(Xr,{page:b})):re});ii.displayName=`Link`;var ai=j.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Bn(a,{relative:c.relative}),d=U(),f=j.useContext(yn),{navigator:p,basename:m}=j.useContext(B),h=f!=null&&Si(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=R(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof i==`function`?i(S):i;return j.createElement(ii,{...c,"aria-current":C,className:w,ref:l,style:ee,to:a,viewTransition:o},typeof s==`function`?s(S):s)});ai.displayName=`NavLink`;var oi=j.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=hr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=j.useContext(B),g=hi(),_=gi(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&_t.test(s);return j.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?j.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});oi.displayName=`Form`;function si({getKey:e,storageKey:t,...n}){let r=j.useContext(Kr),{basename:i}=j.useContext(B),a=U(),o=rr();bi({getKey:e,storageKey:t});let s=j.useMemo(()=>{if(!r||!e)return null;let t=yi(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),j.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Mr(JSON.stringify(t||_i))}, ${Mr(JSON.stringify(s))})`}})}si.displayName=`ScrollRestoration`;function ci(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function li(e){let t=j.useContext(vn);return I(t,ci(e)),t}function ui(e){let t=j.useContext(yn);return I(t,ci(e)),t}function di(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Fn(),d=U(),f=Bn(e,{relative:o});return j.useCallback(p=>{if(Sr(p,t)){p.preventDefault();let t=n===void 0?Et(d)===Et(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?j.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function fi(e){L(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=j.useRef(Cr(e)),n=j.useRef(!1),r=U(),i=j.useMemo(()=>wr(r.search,n.current?null:t.current),[r.search]),a=Fn();return[i,j.useCallback((e,t)=>{let r=Cr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var pi=0,mi=()=>`__${String(++pi)}__`;function hi(){let{router:e}=li(`useSubmit`),{basename:t}=j.useContext(B),n=tr(),r=e.fetch,i=e.navigate;return j.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=kr(e,t);if(a.navigate===!1){let e=a.fetcherKey||mi();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function gi(e,{relative:t}={}){let{basename:n}=j.useContext(B),r=j.useContext(V);I(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Bn(e||`.`,{relative:t})},o=U();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:z([n,a.pathname])),Et(a)}var _i=`react-router-scroll-positions`,vi={};function yi(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:R(e.pathname,n)||e.pathname},t)),i??=e.key,i}function bi({getKey:e,storageKey:t}={}){let{router:n}=li(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=ui(`useScrollRestoration`),{basename:a}=j.useContext(B),o=U(),s=rr(),c=nr();j.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),xi(j.useCallback(()=>{if(c.state===`idle`){let t=yi(o,s,a,e);vi[t]=window.scrollY}try{sessionStorage.setItem(t||_i,JSON.stringify(vi))}catch(e){L(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(j.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||_i);e&&(vi=JSON.parse(e))}catch{}},[t]),j.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(vi,()=>window.scrollY,e?(t,n)=>yi(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),j.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{L(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function xi(e,t){let{capture:n}=t||{};j.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Si(e,{relative:t}={}){let n=j.useContext(Sn);I(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=li(`useViewTransitionState`),i=Bn(e,{relative:t});if(!n.isTransitioning)return!1;let a=R(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=R(n.nextLocation.pathname,r)||n.nextLocation.pathname;return qt(i.pathname,o)!=null||qt(i.pathname,a)!=null}var Ci=[`claude`,`codex`,`opencode`],wi=new Set([`connected`,`disconnected`,`not-installed`,`unknown`]);function Ti(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ei(e,t){if(!Ti(e))return null;let{provider:n,status:r,enabled:i,hint:a,authFailureId:o}=e;return typeof n!=`string`||!Ci.includes(n)||typeof r!=`string`||!wi.has(r)||t&&typeof i!=`boolean`||!t&&i!==void 0&&typeof i!=`boolean`||a!==void 0&&typeof a!=`string`||o!==void 0&&(typeof o!=`string`||o.length<1||o.length>128||r!==`disconnected`)?null:{provider:n,status:r,...typeof i==`boolean`?{enabled:i}:{},...a===void 0?{}:{hint:a},...o===void 0?{}:{authFailureId:o}}}function Di(e){return Ei(e,!1)}function Oi(e,t){if(!Ti(e)||!Array.isArray(e.providers))return null;let n=[],r=new Set;for(let i of e.providers){let e=Ei(i,t);if(e===null||r.has(e.provider))return null;r.add(e.provider),n.push(e)}return n}function W(e){let t=Oi(e,!0);if(t===null||t.length!==Ci.length)return null;let n=new Map(t.map(e=>[e.provider,e]));return Ci.some(e=>!n.has(e))?null:Ci.map(e=>n.get(e))}function ki(e){let t=W(e);if(t===null)throw Error(`Invalid provider status response`);return{providers:t}}function Ai(e,t){let n=W(e);if(n!==null)return{providers:n.map(e=>e.provider===t.provider?{provider:t.provider,status:t.status,enabled:t.enabled??e.enabled,...t.hint===void 0?{}:{hint:t.hint},...t.authFailureId===void 0?{}:{authFailureId:t.authFailureId}}:e)}}function ji(e,t,n,r){let i=W(e),a=W(t),o=W(n);if(o===null||a===null)return n;if(i===null)return{providers:a};let s=new Map(i.map(e=>[e.provider,e])),c=new Map(a.map(e=>[e.provider,e]));return{providers:o.map(e=>{let t=s.get(e.provider),n=c.get(e.provider);if(t===void 0||n===void 0)return n??e;let i=r!==void 0&&n.authFailureId===r&&e.authFailureId===void 0;return r!==void 0&&n.authFailureId!==void 0&&n.authFailureId!==r&&e.authFailureId===void 0?n:Mi(t,n)?e:i?{...e,enabled:n.enabled}:n})}}function Mi(e,t){return e.provider===t.provider&&e.status===t.status&&e.enabled===t.enabled&&e.hint===t.hint&&e.authFailureId===t.authFailureId}function Ni(e){let t=W(e);if(t===null)return[];let n=new Set(t.filter(e=>e.enabled&&e.status===`connected`).map(e=>e.provider));return Ci.filter(e=>n.has(e))}function Pi(e,t){return W(e)?.find(e=>e.provider===t)}var Fi=class extends Error{status;manual;command;exists;constructor(e,t,n={}){super(t,n.cause===void 0?void 0:{cause:n.cause}),this.name=`ApiError`,this.status=e,this.manual=n.manual,this.command=n.command,this.exists=n.exists}};function Ii(e){try{return JSON.parse(e)}catch{return}}function Li(e){return typeof e==`string`?e:void 0}function Ri(e,t,n){let r=Ii(n),i=r&&typeof r==`object`?r:{};return new Fi(e,Li(i.error)??`${e} ${t||`request failed`}`.trim(),{manual:Li(i.manual),command:Li(i.command),exists:typeof i.exists==`boolean`?i.exists:void 0})}var G=ne({fetch:(e,t)=>Hi(zi(String(e)),t)});function zi(e){let t=Vi(e.endsWith(`?`)?e.slice(0,-1):e);return t.startsWith(`/`)?`${c()}${t}`:t}var Bi=`${s}/p/default`;function Vi(e){if(u()!==null||!e.startsWith(Bi))return e;let t=e.slice(Bi.length);return t===``||t.startsWith(`/`)||t.startsWith(`?`)?`${s}${t}`:e}var K=e=>({init:{signal:e?.signal}});async function q(e,t){let n=await e.text();if(!e.ok)throw Ri(e.status,e.statusText,n);let r=Ii(n);if(r===void 0)throw new Fi(e.status,`the cezar server answered ${t} with a non-JSON body`);return r}async function Hi(e,t){try{return await fetch(e,{...t,credentials:`include`})}catch(t){throw t instanceof DOMException&&t.name===`AbortError`?t:new Fi(0,`cannot reach the cezar server (${e})`,{cause:t})}}async function Ui(e,t){return Hi(i(e),t)}async function Wi(e,t={}){let n=new Headers(t.headers);n.set(`accept`,`text/plain`);let r=await Ui(e,{...t,headers:n}),i=await r.text();if(!r.ok)throw Ri(r.status,r.statusText,i);return i}var J=(e,t=``)=>`/runs/${encodeURIComponent(e)}${t}`;async function Gi(e){return q(await G.api.v1.health.$get({},K(e)),`/health`)}async function Ki(e){return q(await G.api.v1.models.$get({query:{runner:`codex`}},K(e)),`/models`)}async function qi(e=!1,t){return ki(await q(await G.api.v1.providers.status.$get({query:e?{refresh:`1`}:{}},K(t)),`/providers/status`))}async function Ji(e){return q(await G.api.v1.p[`:projectId`][`launch-key`].$get({param:{projectId:a()}},K(e)),`/launch-key`)}async function Yi(e){return q(await G.api.v1.projects.$get({},K(e)),`/projects`)}async function Xi(e,t){return q(await G.api.v1.fs.browse.$get({query:{path:e===``?void 0:e}},K(t)),`/fs/browse`)}async function Zi(e){return q(await G.api.v1.p[`:projectId`].runs.$get({param:{projectId:a()}},K(e)),`/runs`)}async function Qi(e,t){return q(await G.api.v1.p[`:projectId`].runs.$get({param:{projectId:e}},K(t)),`/runs`)}async function $i(e,t){return q(await G.api.v1.p[`:projectId`].runs[`:id`].$get({param:{projectId:a(),id:encodeURIComponent(e)}},K(t)),J(e))}async function ea(e){return q(await G.api.v1.p[`:projectId`][`ui-state`].$get({param:{projectId:a()}},K(e)),`/ui-state`)}async function ta(e){return q(await G.api.v1.p[`:projectId`].workflows.$get({param:{projectId:a()}},K(e)),`/workflows`)}async function na(e){return q(await G.api.v1.p[`:projectId`].skills.$get({param:{projectId:a()},query:{}},K(e)),`/skills`)}async function ra(e){return q(await G.api.v1.p[`:projectId`].skills.$get({param:{projectId:a()},query:{wait:`1`}},K(e)),`/skills`)}async function ia(){return q(await G.api.v1.p[`:projectId`].skills.refresh.$post({param:{projectId:a()}}),`/skills/refresh`)}async function aa(e){return q(await G.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:a()},query:{}},K(e)),`/skills/importable`)}async function oa(e){return q(await G.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:a()},query:{wait:`1`}},K(e)),`/skills/importable`)}async function sa(e){return q(await G.api.v1.p[`:projectId`].todos.$get({param:{projectId:a()}},K(e)),`/todos`)}async function ca(e){return q(await G.api.v1.p[`:projectId`].repo.$get({param:{projectId:a()}},K(e)),`/repo`)}async function la(e){return q(await G.api.v1.p[`:projectId`].config.$get({param:{projectId:a()}},K(e)),`/config`)}async function ua(e={}){return q(await G.api.v1.p[`:projectId`][`agent-config`].$get({param:{projectId:a()}},K(e)),`/agent-config`)}async function da(e,t={}){return q(await G.api.v1.p[`:projectId`][`agent-config`][`:id`].$get({param:{projectId:a(),id:encodeURIComponent(e)}},K(t)),`/agent-config/${encodeURIComponent(e)}`)}async function fa(e,t){return q(await G.api.v1.p[`:projectId`][`agent-config`][`:id`].$put({param:{projectId:a(),id:encodeURIComponent(e)},json:t}),`/agent-config/${encodeURIComponent(e)}`)}async function pa(e){return q(await G.api.v1.p[`:projectId`].repo.changes.$get({param:{projectId:a()}},K(e)),`/repo/changes`)}async function ma(e,t){return q(await G.api.v1.p[`:projectId`].repo.commit[`:sha`].$get({param:{projectId:a(),sha:encodeURIComponent(e)},query:{structured:`1`}},K(t)),`/repo/commit/:sha`)}async function ha(e,t){return q(await G.api.v1.p[`:projectId`].runs[`:id`].commits.$get({param:{projectId:a(),id:encodeURIComponent(e)}},K(t)),J(e,`/commits`))}async function ga(e,t,n){return q(await G.api.v1.p[`:projectId`].runs[`:id`].commit[`:sha`].$get({param:{projectId:a(),id:encodeURIComponent(e),sha:encodeURIComponent(t)}},K(n)),J(e,`/commit/${encodeURIComponent(t)}`))}async function _a(e={},t){return q(await G.api.v1.p[`:projectId`].github.$get({param:{projectId:a()},query:{limit:e.limit===void 0?void 0:String(e.limit),refresh:e.refresh?`1`:void 0}},K(t)),`/github`)}async function va(e,t){return q(await G.api.v1.p[`:projectId`].github.checks.$get({param:{projectId:a()},query:{prs:e.join(`,`)}},K(t)),`/github/checks`)}async function ya(e,t,n={},r){return q(await G.api.v1.p[`:projectId`].github.comments[`:kind`][`:number`].$get({param:{projectId:a(),kind:e,number:String(t)},query:{refresh:n.refresh?`1`:void 0}},K(r)),`/github/comments/${e}/${t}`)}async function ba(e,t={},n){return q(await G.api.v1.p[`:projectId`].github.prs[`:number`][`merge-state`].$get({param:{projectId:a(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},K(n)),`/github/prs/${e}/merge-state`)}async function xa(e,t){return q(await G.api.v1.p[`:projectId`].github.prs[`:number`].merge.$post({param:{projectId:a(),number:String(e)},json:t}),`/github/prs/:number/merge`)}async function Sa(e,t={},n){return q(await G.api.v1.p[`:projectId`].github.prs[`:number`].changes.$get({param:{projectId:a(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},K(n)),`/github/prs/${e}/changes`)}function Ca(e,t){return Wi(J(e,`/diff`),{method:`GET`,signal:t?.signal})}function wa(e,t){return Wi(J(e,`/handoff`),{method:`GET`,signal:t?.signal})}async function Ta(e,t){return q(await G.api.v1.p[`:projectId`].runs[`:id`].changes.$get({param:{projectId:a(),id:encodeURIComponent(e)}},K(t)),J(e,`/changes`))}async function Ea(e,t,n){return q(await G.api.v1.p[`:projectId`].runs[`:id`].files.$get({param:{projectId:a(),id:encodeURIComponent(e)},query:{path:t}},K(n)),`/runs/:id/files`)}function Da(e,t){return i(J(e,`/files?path=${encodeURIComponent(t)}&raw=1`))}async function Oa(e,t){return q(await G.api.v1.p[`:projectId`].groups[`:groupId`].$get({param:{projectId:a(),groupId:encodeURIComponent(e)}},K(t)),`/groups/${encodeURIComponent(e)}`)}async function ka(e){return q(await G.api.v1.providers.connect.$post({json:{provider:e}}),`/providers/connect`)}async function Aa(e,t){return ki(await q(await G.api.v1.providers[`:provider`].enabled.$put({param:{provider:e},json:{enabled:t}}),`/providers/${encodeURIComponent(e)}/enabled`))}async function ja(e,t){return ki(await q(await G.api.v1.providers[`:provider`].retry.$post({param:{provider:e},json:{authFailureId:t}}),`/providers/${encodeURIComponent(e)}/retry`))}async function Ma(e){let t=`/projects`,n=await Ui(t,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({root:e})}),r=await n.text(),i=Ii(r),a=i?.project;if((n.ok||n.status===409)&&a!=null)return i;throw n.ok?new Fi(n.status,`the cezar server answered ${t} without a project`):Ri(n.status,n.statusText,r)}async function Na(e){return q(await G.api.v1.projects.checkout.$post({json:e}),`/projects/checkout`)}async function Pa(e){return q(await G.api.v1.projects[`:projectId`].$delete({param:{projectId:encodeURIComponent(e)}}),`/projects/${encodeURIComponent(e)}`)}async function Fa(e,t){return q(await G.api.v1.projects[`:projectId`].$patch({param:{projectId:encodeURIComponent(e)},json:t}),`/projects/${encodeURIComponent(e)}`)}async function Ia(e){return q(await G.api.v1.p[`:projectId`].runs.$post({param:{projectId:a()},json:e}),`/runs`)}async function La(e){return q(await G.api.v1.p[`:projectId`].runs[`:id`].cancel.$post({param:{projectId:a(),id:encodeURIComponent(e)}}),J(e,`/cancel`))}async function Ra(e,t=!0){return q(await G.api.v1.p[`:projectId`].runs[`:id`].archive.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{archived:t}}),J(e,`/archive`))}async function za(){return q(await G.api.v1.p[`:projectId`].runs[`archive-finished`].$post({param:{projectId:a()}}),`/runs/archive-finished`)}async function Ba(e){return q(await G.api.v1.p[`:projectId`].runs[`:id`].read.$post({param:{projectId:a(),id:encodeURIComponent(e)}}),J(e,`/read`))}async function Va(){return q(await G.api.v1.p[`:projectId`].runs[`read-all`].$post({param:{projectId:a()}}),`/runs/read-all`)}async function Ha(e){return q(await G.api.v1.p[`:projectId`].runs[`:id`].finish.$post({param:{projectId:a(),id:encodeURIComponent(e)}}),J(e,`/finish`))}async function Ua(e,t={}){let n={...t.text===void 0?{}:{text:t.text},...t.images===void 0?{}:{images:t.images},...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model}};return q(await G.api.v1.p[`:projectId`].runs[`:id`].continue.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:n}),J(e,`/continue`))}async function Wa(e){return q(await G.api.v1.p[`:projectId`].runs[`:id`].pr.$post({param:{projectId:a(),id:encodeURIComponent(e)}}),J(e,`/pr`))}async function Ga(e,t){return q(await G.api.v1.p[`:projectId`].runs[`:id`].$patch({param:{projectId:a(),id:encodeURIComponent(e)},json:t}),J(e))}async function Ka(e){return q(await G.api.v1.p[`:projectId`].runs[`:id`].$delete({param:{projectId:a(),id:encodeURIComponent(e)}}),J(e))}async function qa(e){return q(await G.api.v1.p[`:projectId`].todos[`:id`].$delete({param:{projectId:a(),id:encodeURIComponent(e)}}),`/todos/${encodeURIComponent(e)}`)}async function Ja(e,t={}){let n={...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model},...t.prompt===void 0?{}:{prompt:t.prompt}};return q(await G.api.v1.p[`:projectId`].todos[`:id`].start.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:Object.keys(n).length>0?n:void 0}),`/todos/${encodeURIComponent(e)}/start`)}async function Ya(e,t){return q(await G.api.v1.p[`:projectId`].groups[`:groupId`].pick.$post({param:{projectId:a(),groupId:encodeURIComponent(e)},json:{runId:t}}),`/groups/${encodeURIComponent(e)}/pick`)}async function Xa(e){return q(await G.api.v1.p[`:projectId`].runs[`:id`][`open-in-cli`].$post({param:{projectId:a(),id:encodeURIComponent(e)}}),J(e,`/open-in-cli`))}async function Za(e){return q(await G.api.v1.p[`:projectId`][`open-targets`].$get({param:{projectId:a()}},K(e)),`/open-targets`)}async function Qa(e,t){return q(await G.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{target:t}}),J(e,`/open-in`))}async function $a(e,t){return q(await G.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{target:`default`,path:t}}),J(e,`/open-in`))}async function eo(e,t){return q(await G.api.v1.p[`:projectId`].runs[`:id`].git.commit.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{message:t}}),J(e,`/git/commit`))}async function to(e){return q(await G.api.v1.p[`:projectId`].runs[`:id`].git.push.$post({param:{projectId:a(),id:encodeURIComponent(e)}}),J(e,`/git/push`))}async function no(e,t){return q(await G.api.v1.p[`:projectId`].runs[`:id`].messages.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{text:t.text??``,images:t.images??[]}}),J(e,`/messages`))}async function ro(e,t,n){return q(await G.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$patch({param:{projectId:a(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)},json:n}),J(e,`/queued-messages/${encodeURIComponent(t)}`))}async function io(e,t){return q(await G.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$delete({param:{projectId:a(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)}}),J(e,`/queued-messages/${encodeURIComponent(t)}`))}async function ao(e){return q(await G.api.v1.p[`:projectId`].repo.branch.$post({param:{projectId:a()},json:e}),`/repo/branch`)}async function oo(e){return q(await G.api.v1.p[`:projectId`].plan.$post({param:{projectId:a()},json:{task:e}}),`/plan`)}async function so(e){return q(await G.api.v1.p[`:projectId`].automations.$get({param:{projectId:a()}},K(e)),`/automations`)}async function co(e){return q(await G.api.v1.p[`:projectId`].automations.$post({param:{projectId:a()},json:e}),`/automations`)}async function lo(e,t){return q(await G.api.v1.p[`:projectId`].automations[`:id`].$put({param:{projectId:a(),id:encodeURIComponent(e)},json:t}),`/automations/${encodeURIComponent(e)}`)}async function uo(e,t){let n={projectId:a(),id:encodeURIComponent(e)},r=`/automations/${encodeURIComponent(e)}/${t?`enable`:`pause`}`;return q(t?await G.api.v1.p[`:projectId`].automations[`:id`].enable.$post({param:n}):await G.api.v1.p[`:projectId`].automations[`:id`].pause.$post({param:n}),r)}async function fo(e,t){return q(await G.api.v1.p[`:projectId`].automations[`:id`].check.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{mode:t}}),`/automations/${encodeURIComponent(e)}/check`)}async function po(e,t){return q(await G.api.v1[`automation-checks`][`:checkId`].$get({param:{checkId:encodeURIComponent(e)}},K(t)),`/automation-checks/${encodeURIComponent(e)}`)}async function mo(e,t){return q(await G.api.v1.p[`:projectId`][`automation-log`].$get({param:{projectId:a()},query:{automationId:e}},K(t)),`/automation-log?automationId=${encodeURIComponent(e)}`)}async function ho(e){return q(await G.api.v1.p[`:projectId`].workflows.$post({param:{projectId:a()},json:e}),`/workflows`)}async function go(e){return q(await G.api.v1.p[`:projectId`].workflows.parse.$post({param:{projectId:a()},json:{yaml:e}}),`/workflows/parse`)}async function _o(e){return q(await G.api.v1.p[`:projectId`].workflows[`:name`].$delete({param:{projectId:a(),name:encodeURIComponent(e)}}),`/workflows/${encodeURIComponent(e)}`)}async function vo(e){return q(await G.api.v1.p[`:projectId`][`ui-state`].$put({param:{projectId:a()},json:e}),`/ui-state`)}async function yo(e){return q(await G.api.v1.workspace[`ui-state`].$get({},K(e)),`/workspace/ui-state`)}async function bo(e){return q(await G.api.v1.workspace[`ui-state`].$put({json:e}),`/workspace/ui-state`)}async function xo(e){return q(await G.api.v1.workspace.config.$get({},K(e)),`/workspace/config`)}async function So(e,t){return q(await G.api.v1.workspace[`skills-update`].$get({query:{projectId:e}},K(t)),`/workspace/skills-update?projectId=${encodeURIComponent(e)}`)}async function Co(e){return q(await G.api.v1.workspace[`skills-update`].check.$post({json:{projectId:e}}),`/workspace/skills-update/check`)}async function wo(e){return q(await G.api.v1.workspace[`skills-update`].apply.$post({json:{projectId:e}}),`/workspace/skills-update/apply`)}async function To(e){return q(await G.api.v1.workspace.config.$put({json:e}),`/workspace/config`)}async function Eo(e){return q(await G.api.v1.p[`:projectId`].config.$put({param:{projectId:a()},json:e}),`/config`)}async function Do(e){return q(await G.api.v1.p[`:projectId`].worktrees.$get({param:{projectId:a()}},K(e)),`/worktrees`)}async function Oo(){return q(await G.api.v1.p[`:projectId`].worktrees.reclaim.$post({param:{projectId:a()},json:{}}),`/worktrees/reclaim`)}async function ko(e){return q(await G.api.v1.p[`:projectId`].runs[`:id`][`remove-worktree`].$post({param:{projectId:a(),id:encodeURIComponent(e)}}),J(e,`/remove-worktree`))}var Ao={projectId:null,apiBase:s},jo=(0,j.createContext)(Ao);function Mo(){return(0,j.useContext)(jo)}function No({projectId:e,children:t}){u()!==e&&o(e),(0,j.useEffect)(()=>{o(e)},[e]),(0,j.useEffect)(()=>()=>o(null),[]);let n=(0,j.useMemo)(()=>e===null?Ao:{projectId:e,apiBase:`${s}/p/${encodeURIComponent(e)}`},[e]);return(0,M.jsx)(jo.Provider,{value:n,children:t})}var Po=[`Needs you`,`Working`,`Recent`,`Archived`],Fo={waiting:0,review:1,running:2,queued:3},Io=e=>Fo[e.status]??9;function Lo(e,t){return t===`archived`?`Archived`:e.status===`waiting`||e.status===`review`?`Needs you`:e.status===`running`||e.status===`queued`?`Working`:`Recent`}function Ro(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function zo(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function Bo(e,t){return t!==void 0&&zo(e).ref===t}function Vo(e){return e.title.replace(/ \([A-C]\)$/,``)}function Ho(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function Uo(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,t)=>{let n=Io(e)-Io(t);return n===0?t.createdAt.localeCompare(e.createdAt):n})}function Wo(e,t){let n=Ho(e),r=Uo(e,t),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])},o=new Set;for(let e of r){if(e.groupId){if(o.has(e.groupId))continue;o.add(e.groupId);let n=r.filter(t=>t.groupId===e.groupId).sort((e,t)=>(e.variant??``).localeCompare(t.variant??``));if(n.length>1){a(Lo(e,t),{kind:`group`,groupId:e.groupId,title:Vo(e),members:n});continue}}a(Lo(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null})}return Po.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function Go(e,t){let n=[],r=t;for(let t of e){if(r<=0)break;let e=t.rows.slice(0,r);r-=e.length,n.push({label:t.label,rows:e})}return n}function Ko(e){let t=0,n=0,r=0;for(let i of e){if(i.archived){n+=1;continue}t+=1,(i.status===`waiting`||i.status===`review`)&&(r+=1)}return{active:t,archived:n,waiting:r}}var qo=new Set([`running`,`waiting`]),Jo=new Set([`done`,`failed`,`review`,`cancelled`]),Yo=new Set([`done`,`failed`,`cancelled`]);function Xo(e){return e?e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} kB`:``}function Zo(e){return e?`$${e>=10?e.toFixed(0):e.toFixed(2)}`:``}function Qo(e){if(e.workflow===`(planned)`||e.workflow===`(inbox)`){let t=e.steps.find(e=>e.kind===`agent`);if(t?.name)return t.name}return e.workflow}function $o(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[Ro(e),e.branch??``,e.workflow,Qo(e)].some(e=>e.toLowerCase().includes(n))):[...e]}function es(e){return e.filter(e=>!e.archived&&Yo.has(e.status)).length}function ts(e){if(!e)return;let t=e.trim().replace(/\/+$/,``),n=/^(?:https?|ssh|git|git\+ssh):\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/.exec(t),r=n?null:/^(?:[^@/:]+@)?([^:/]+):(.+)$/.exec(t),i=n??r;if(!i)return;let[,a,o]=i;if(!o||a?.toLowerCase()!==`github.com`)return;let s=o.replace(/\.git$/i,``).split(`/`).filter(Boolean),c=s[s.length-2],l=s[s.length-1];return c&&l?`https://github.com/${c}/${l}`:void 0}function ns(e){if(e.pullRequestUrl)return e.pullRequestUrl;if(!(e.markerRefs?.issue!==void 0&&e.markerRefs?.pr===void 0))return e.referencedPullRequestUrl}function rs(e,t){if(e.referencedIssueUrl)return e.referencedIssueUrl;let n=e.markerRefs?.issue??e.issueNumber;if(!(!n||!t))return`${t}/issues/${n}`}function is(e){let t=ns(e),n=t?Number(as(t)):e.prNumber;if(n&&Number.isInteger(n))return{kind:`PR`,number:n,...t?{url:t}:{}};let r=rs(e),i=e.issueNumber??(r?Number(as(r)):void 0);if(i&&Number.isInteger(i))return{kind:`Issue`,number:i,...r?{url:r}:{}}}function as(e){let t=e.split(`/`).pop()??``;return/^\d+$/.test(t)?t:null}function os(e,t){let n=qo.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:Xo(n.rssBytes),kind:`live`}};let r=Xo(e.peakRssBytes);return{cpu:{text:``,kind:`none`},mem:r?{text:`peak ${r}`,kind:`peak`,title:`peak — run finished${e.peakProcCount?` · ${e.peakProcCount} procs`:``}`}:{text:``,kind:`none`}}}function ss(e,t){let n=e.filter(e=>t===`archived`?e.archived:!e.archived),r=new Map;for(let e of n){if(!e.groupId)continue;let t=r.get(e.groupId);t?t.push(e):r.set(e.groupId,[e])}return[...r.entries()].flatMap(([e,t])=>{let n=t[0];return!n||t.length<2||!t.every(e=>Jo.has(e.status))?[]:[{groupId:e,title:Vo(n),count:t.length}]})}var cs=`/api/v1/ws`,ls=3e3,us=1e3,ds=7e4,fs=0,ps=1;function ms(e){let t=new Map,n=null,r,i,a,o=()=>{clearTimeout(a),a=setTimeout(()=>{a=void 0,n?.close()},ds)},s=()=>e??`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}${cs}`,c=e=>{n?.readyState===ps&&n.send(JSON.stringify(e))},l=()=>{let e=globalThis.WebSocket;if(typeof e!=`function`||n&&(n.readyState===fs||n.readyState===ps))return;let i=new e(s());n=i,i.addEventListener(`open`,()=>{if(i===n){o();for(let e of t.keys())c({type:`subscribe`,topic:e})}}),i.addEventListener(`message`,e=>{if(i!==n)return;o();let r;try{r=JSON.parse(e.data)}catch{return}if(typeof r!=`object`||!r)return;let{type:a,topic:s,data:c}=r;if(a!==`event`||typeof s!=`string`)return;let l=t.get(s);if(l)for(let e of[...l])e(c)}),i.addEventListener(`close`,()=>{i===n&&(n=null,clearTimeout(a),a=void 0,t.size>0&&r===void 0&&(r=setTimeout(()=>{r=void 0,t.size>0&&l()},ls)))}),i.addEventListener(`error`,()=>void 0)};return{subscribe(e,o){let s=t.get(e);s||(s=new Set,t.set(e,s));let u=s.size===0;s.add(o),clearTimeout(i),i=void 0,n?u&&c({type:`subscribe`,topic:e}):(clearTimeout(r),r=void 0,l());let d=!0;return()=>{d&&(d=!1,s.delete(o),!(s.size>0)&&(t.delete(e),c({type:`unsubscribe`,topic:e}),t.size===0&&i===void 0&&(i=setTimeout(()=>{i=void 0,!(t.size>0)&&(clearTimeout(r),r=void 0,clearTimeout(a),a=void 0,n?.close(),n=null)},us))))}}}}var hs=null;function gs(e,t){return hs??=ms(),hs.subscribe(e,t)}var Y={get health(){return[a(),`health`]},runs:{get all(){return[a(),`runs`]},list:()=>[a(),`runs`,`list`],detail:e=>[a(),`runs`,`detail`,e],diff:e=>[a(),`runs`,`diff`,e],changes:e=>[a(),`runs`,`changes`,e],file:(e,t)=>[a(),`runs`,`files`,e,t],handoff:e=>[a(),`runs`,`handoff`,e],commits:e=>[a(),`runs`,`commits`,e],commit:(e,t)=>[a(),`runs`,`commit`,e,t]},groups:{detail:e=>[a(),`groups`,e]},get todos(){return[a(),`todos`]},get workflows(){return[a(),`workflows`]},get skills(){return[a(),`skills`]},get skillsReady(){return[a(),`skills`,`ready`]},get importableSkills(){return[a(),`skills`,`importable`]},get importableSkillsReady(){return[a(),`skills`,`importable`,`ready`]},get launchKey(){return[a(),`launch-key`]},get repo(){return[a(),`repo`]},get repoChanges(){return[a(),`repo`,`changes`]},repoCommit:e=>[a(),`repo`,`commit`,e],get uiState(){return[a(),`ui-state`]},get config(){return[a(),`config`]},get agentConfig(){return[a(),`agent-config`]},agentConfigFile:e=>[a(),`agent-config`,`file`,e],get worktrees(){return[a(),`worktrees`]},github:(e={})=>[a(),`github`,e.limit??null],githubChecks:e=>[a(),`github`,`checks`,[...e].sort((e,t)=>e-t).join(`,`)],githubComments:(e,t)=>[a(),`github`,`comments`,e,t],githubMergeState:e=>[a(),`github`,`merge-state`,e],get openTargets(){return[a(),`open-targets`]}},X={models:e=>[`workspace`,`models`,e],providerStatus:[`workspace`,`providers`,`status`],projects:[`workspace`,`projects`],uiState:[`workspace`,`ui-state`],config:[`workspace`,`config`],skillsUpdate:e=>[`workspace`,`skills-update`,e],fsBrowseRoot:[`workspace`,`fs-browse`],fsBrowse:e=>[...X.fsBrowseRoot,e]};function _s(e=!0){return P({queryKey:X.models(`codex`),queryFn:({signal:e})=>Ki({signal:e}),staleTime:300*1e3,enabled:e})}function vs(){let e=N();return P({queryKey:X.providerStatus,queryFn:async({signal:t})=>{let n=e.getQueryData(X.providerStatus),r=await qi(!1,{signal:t});return ji(n,e.getQueryData(X.providerStatus),r)},staleTime:5*6e4,refetchInterval:!1,refetchOnWindowFocus:!0})}function ys(){let e=N();return F({mutationFn:()=>qi(!0),onMutate:()=>e.getQueryData(X.providerStatus),onSuccess:(t,n,r)=>e.setQueryData(X.providerStatus,e=>ji(r,e,t))})}function bs(){let e=N();return F({mutationFn:({provider:e,authFailureId:t})=>ja(e,t),onMutate:()=>e.getQueryData(X.providerStatus),onSuccess:(t,n,r)=>{e.setQueryData(X.providerStatus,e=>ji(r,e,t,n.authFailureId))}})}function xs(){return P({queryKey:X.projects,queryFn:({signal:e})=>Yi({signal:e})})}function Ss(e){return P({queryKey:X.fsBrowse(e),queryFn:({signal:t})=>Xi(e??void 0,{signal:t}),retry:!1})}function Cs(){let e=N();return F({mutationFn:e=>Ma(e),onSuccess:()=>e.invalidateQueries({queryKey:X.projects})})}function ws(){let e=N();return F({mutationFn:e=>Pa(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:X.projects})})}function Ts(){let e=N();return F({mutationFn:e=>Fa(e.id,{maxParallel:e.maxParallel}),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:X.projects})})}function Es(){let e=N();return F({mutationFn:e=>Na(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:X.projects})})}function Ds(){let e=N();(0,j.useEffect)(()=>{let t,n=()=>{let n=e.getQueryData(Y.health)?.capabilities?.localHandoff===!0;n&&t===void 0?t=gs(`health`,t=>{e.setQueryData(Y.health,t)}):!n&&t!==void 0&&(t(),t=void 0)};n();let r=e.getQueryCache().subscribe(n);return()=>{r(),t?.()}},[e])}function Os(){return P({queryKey:Y.health,queryFn:({signal:e})=>Gi({signal:e})})}function ks(){let e=Os().data,{projectId:t}=Mo();return t===null||t===e?.bootProject?ts(e?.repo?.remote):void 0}function As(){return P({queryKey:Y.openTargets,queryFn:({signal:e})=>Za({signal:e}),staleTime:5*6e4})}function js(){return P({queryKey:Y.runs.list(),queryFn:({signal:e})=>Zi({signal:e})})}function Ms(e,t=!0,n=!1){return P({queryKey:[n?`default`:e,`runs`,`list`],queryFn:({signal:t})=>Qi(e,{signal:t}),enabled:t})}function Ns(e){return P({queryKey:Y.runs.detail(e??``),queryFn:({signal:t})=>$i(e,{signal:t}),enabled:!!e})}function Ps(e){return P({queryKey:Y.runs.diff(e??``),queryFn:({signal:t})=>Ca(e,{signal:t}),enabled:!!e})}function Fs(e,t=!1){return P({queryKey:Y.runs.changes(e??``),queryFn:({signal:t})=>Ta(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?4e3:!1,refetchOnWindowFocus:!0,staleTime:0})}function Is(e,t){return P({queryKey:Y.runs.file(e??``,t??``),queryFn:({signal:n})=>Ea(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function Ls(e){return P({queryKey:Y.groups.detail(e??``),queryFn:({signal:t})=>Oa(e,{signal:t}),enabled:!!e})}function Rs(e,t=!1){return P({queryKey:Y.runs.commits(e??``),queryFn:({signal:t})=>ha(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?5e3:!1})}function zs(e,t){return P({queryKey:Y.runs.commit(e??``,t??``),queryFn:({signal:n})=>ga(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function Bs(e,t=!0){return P({queryKey:Y.runs.handoff(e??``),queryFn:({signal:t})=>wa(e,{signal:t}),enabled:!!e&&t})}function Vs(e=!0){return P({queryKey:Y.todos,queryFn:({signal:e})=>sa({signal:e}),enabled:e})}function Hs(){return P({queryKey:Y.workflows,queryFn:({signal:e})=>ta({signal:e})})}function Us(e=!0){let t=N(),n=Y.skills,r=n[0],i=P({queryKey:n,queryFn:({signal:e})=>na({signal:e}),enabled:e}),a=P({queryKey:Y.skillsReady,queryFn:({signal:e})=>ra({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,j.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`],a.data)},[t,a.data,r]),i}function Ws(e=!0){let t=N(),n=Y.importableSkills,r=n[0],i=P({queryKey:n,queryFn:({signal:e})=>aa({signal:e}),enabled:e}),a=P({queryKey:Y.importableSkillsReady,queryFn:({signal:e})=>oa({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,j.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`,`importable`],a.data)},[t,a.data,r]),i}function Gs(){return P({queryKey:Y.launchKey,queryFn:({signal:e})=>Ji({signal:e}),staleTime:1/0})}function Ks(){return P({queryKey:Y.repo,queryFn:({signal:e})=>ca({signal:e})})}function qs(){return P({queryKey:Y.repoChanges,queryFn:({signal:e})=>pa({signal:e}),retry:!1})}function Js(e){return P({queryKey:Y.repoCommit(e??``),queryFn:({signal:t})=>ma(e,{signal:t}),enabled:!!e,retry:!1})}function Ys(){return P({queryKey:Y.config,queryFn:({signal:e})=>la({signal:e})})}function Xs(){return P({queryKey:Y.worktrees,queryFn:({signal:e})=>Do({signal:e})})}function Zs(){return P({queryKey:Y.uiState,queryFn:({signal:e})=>ea({signal:e})})}function Qs(){return P({queryKey:Y.agentConfig,queryFn:({signal:e})=>ua({signal:e})})}function $s(e){return P({queryKey:Y.agentConfigFile(e??``),queryFn:({signal:t})=>da(e,{signal:t}),enabled:e!==null})}function ec(e){let t=N(),n=Y.agentConfig,r=Y.agentConfigFile(e);return F({mutationFn:t=>fa(e,t),onSuccess:e=>{t.setQueryData(r,e),t.invalidateQueries({queryKey:n})}})}function tc(){return P({queryKey:X.uiState,queryFn:({signal:e})=>yo({signal:e})})}function nc(){return P({queryKey:X.config,queryFn:({signal:e})=>xo({signal:e})})}function rc(e,t=!0){return P({queryKey:X.skillsUpdate(e),queryFn:({signal:t})=>So(e,{signal:t}),enabled:t,refetchInterval:e=>{let t=e.state.data?.status;return t===void 0||t===`idle`||t===`checking`||t===`updating`?6e4:!1}})}function ic(e){let t=N();return F({mutationFn:t=>Ga(e,t),onSuccess:()=>t.invalidateQueries({queryKey:Y.runs.all})})}function ac(){let e=N();return F({mutationFn:e=>Ba(e),onMutate:async t=>{await e.cancelQueries({queryKey:Y.runs.list()}),await e.cancelQueries({queryKey:Y.runs.detail(t)});let n=e.getQueryData(Y.runs.list()),r=e.getQueryData(Y.runs.detail(t)),i=new Date().toISOString();return e.setQueryData(Y.runs.list(),e=>e?.map(e=>e.id===t?{...e,seenAt:i}:e)),e.setQueryData(Y.runs.detail(t),e=>e&&{...e,seenAt:i}),{prevList:n,prevDetail:r,id:t}},onError:(t,n,r)=>{r?.prevList&&e.setQueryData(Y.runs.list(),r.prevList),r?.prevDetail&&e.setQueryData(Y.runs.detail(n),r.prevDetail)},onSuccess:t=>{e.setQueryData(Y.runs.list(),e=>e?.map(e=>e.id===t.id?t:e)),e.setQueryData(Y.runs.detail(t.id),t)}})}function oc(e){let t=N();return F({mutationFn:t=>no(e,t),onSuccess:()=>t.invalidateQueries({queryKey:Y.runs.all}),onError:e=>{e instanceof Fi&&e.status===409&&t.invalidateQueries({queryKey:Y.runs.all})}})}function sc(e){let t=N();return F({mutationFn:(t={})=>Ua(e,t),onSuccess:()=>t.invalidateQueries({queryKey:Y.runs.all})})}function cc(e){let t=N();return F({mutationFn:({msgId:t,message:n})=>ro(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:Y.runs.all})})}function lc(e){let t=N();return F({mutationFn:t=>io(e,t),onSuccess:()=>t.invalidateQueries({queryKey:Y.runs.all})})}function uc(e={},t=!0){return P({queryKey:Y.github(e),queryFn:({signal:t})=>_a({limit:e.limit},{signal:t}),enabled:t})}function dc(e,t=!0){return P({queryKey:Y.githubChecks(e),queryFn:({signal:t})=>va(e,{signal:t}),enabled:t&&e.length>0,staleTime:6e4})}function fc(e,t,n=!0){return P({queryKey:Y.githubComments(e,t),queryFn:({signal:n})=>ya(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}function pc(e){return P({queryKey:[`github`,`pr-changes`,e??0],queryFn:({signal:t})=>Sa(e,{},{signal:t}),enabled:e!==void 0,staleTime:6e4,retry:!1})}var mc=l(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),hc=l(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),gc=e(n(),1),_c=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,vc=p,yc=(e,t)=>n=>{if(t?.variants==null)return vc(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=_c(t)||_c(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 vc(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)};function bc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function xc(...e){return t=>{let n=!1,r=e.map(e=>{let r=bc(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():bc(e[t],null)}}}}function Sc(...e){return j.useCallback(xc(...e),e)}function Cc(e){let t=j.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];jc(r)&&typeof Fc==`function`&&(r=Fc(r._payload)),j.Children.forEach(r,e=>{if(kc(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;jc(n)&&typeof Fc==`function`&&(n=Fc(n._payload)),a=Ec(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=j.cloneElement(a,void 0,s):!o&&j.Children.count(r)===1&&j.isValidElement(r)&&(a=r);let c=a?Oc(a):void 0,l=Sc(n,c);if(!a){if(r||r===0)throw Error(o?Pc(e):Nc(e));return r}let u=Dc(i,a.props??{});return a.type!==j.Fragment&&(u.ref=n?l:c),j.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var wc=Cc(`Slot`),Tc=Symbol.for(`radix.slottable`),Ec=(e,t)=>{if(`child`in e.props){let t=e.props.child;return j.isValidElement(t)?j.cloneElement(t,void 0,e.props.children(t.props.children)):null}return j.isValidElement(t)?t:null};function Dc(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(` `))}return{...e,...n}}function Oc(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)}function kc(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Tc}var Ac=Symbol.for(`react.lazy`);function jc(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ac&&`_payload`in e&&Mc(e._payload)}function Mc(e){return typeof e==`object`&&!!e&&`then`in e}var Nc=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Pc=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Fc=j.use,Ic=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Cc(`Primitive.${t}`),r=j.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Lc(e,t){e&&gc.flushSync(()=>e.dispatchEvent(t))}function Rc(e,t=[]){let n=[];function r(t,r){let i=j.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=j.useMemo(()=>o,Object.values(o));return(0,M.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=j.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>j.createContext(e));return function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,zc(i,...t)]}function zc(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function Bc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var Vc=globalThis?.document?j.useLayoutEffect:()=>{},Hc=j.useInsertionEffect||Vc;function Uc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Wc({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=j.useRef(e!==void 0);j.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,j.useCallback(t=>{if(s){let n=Gc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Wc({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return Hc(()=>{a.current=t},[t]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Gc(e){return typeof e==`function`}function Kc(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}var qc=e=>{let{present:t,children:n}=e,r=Jc(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=Xc(r.ref,Qc(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null};qc.displayName=`Presence`;function Jc(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),o=j.useRef(void 0),[s,c]=Kc(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{s===`mounted`?(a.current=o.current??Zc(r.current),o.current=void 0):a.current=`none`},[s]),Vc(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Zc(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]),Vc(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Zc(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)})}},s=e=>{e.target===t&&(a.current=Zc(r.current))};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)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:j.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Zc(t)}else r.current=null;n(e)},[])}}function Yc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Xc(...e){let t=j.useRef(e);return t.current=e,j.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Yc(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():Yc(n[e],null)}}},[])}function Zc(e){return e?.animationName||`none`}function Qc(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)}var $c=j.useId||(()=>void 0),el=0;function tl(e){let[t,n]=j.useState($c());return Vc(()=>{e||n(e=>e??String(el++))},[e]),e||(t?`radix-${t}`:``)}function Z(e){let t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>((...e)=>t.current?.(...e)),[])}var nl=`DismissableLayer`,rl=`dismissableLayer.update`,il=`dismissableLayer.pointerDownOutside`,al=`dismissableLayer.focusOutside`,ol,sl=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),cl=j.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=j.useContext(sl),[d,f]=j.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=j.useState({}),h=Sc(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=j.useRef(!1),C=pl(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:j.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=ml(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),ee=d?y===g.length-1:!1,te=Z(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return j.useEffect(()=>{if(ee)return p.addEventListener(`keydown`,te,{capture:!0}),()=>p.removeEventListener(`keydown`,te,{capture:!0})},[p,ee,te]),j.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ol=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),hl(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ol))}},[d,p,n,u]),j.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),hl())},[d,u]),j.useEffect(()=>{let e=()=>m({});return document.addEventListener(rl,e),()=>document.removeEventListener(rl,e)},[]),(0,M.jsx)(Ic.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Bc(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Bc(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Bc(e.onPointerDownCapture,C.onPointerDownCapture)})});cl.displayName=nl;var ll=`DismissableLayerBranch`,ul=j.forwardRef((e,t)=>{let n=j.useContext(sl),r=j.useRef(null),i=Sc(t,r);return j.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,M.jsx)(Ic.div,{...e,ref:i})});ul.displayName=ll;function dl(){let e=j.useContext(sl),[t,n]=j.useState(null);return j.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var fl=()=>!0;function pl(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=fl}=t,s=Z(e),c=j.useRef(!1),l=j.useRef(!1),u=j.useRef(new Map),d=j.useRef(()=>{});return j.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}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)}function p(e){l.current&&u.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||gl(il,s,p,{discrete:!0})};if(!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},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:()=>c.current=!0}}function ml(e,t=globalThis?.document){let n=Z(e),r=j.useRef(!1);return j.useEffect(()=>{let e=e=>{e.target&&!r.current&&gl(al,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hl(){let e=new CustomEvent(rl);document.dispatchEvent(e)}function gl(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?Lc(i,a):i.dispatchEvent(a)}var _l=`focusScope.autoFocusOnMount`,vl=`focusScope.autoFocusOnUnmount`,yl={bubbles:!1,cancelable:!0},bl=`FocusScope`,xl=j.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=j.useState(null),l=Z(i),u=Z(a),d=j.useRef(null),f=Sc(t,c),p=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Q(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Q(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Q(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),j.useEffect(()=>{if(s){Ol.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(_l,yl);s.addEventListener(_l,l),s.dispatchEvent(t),t.defaultPrevented||(Sl(jl(wl(s)),{select:!0}),document.activeElement===e&&Q(s))}return()=>{s.removeEventListener(_l,l),setTimeout(()=>{let t=new CustomEvent(vl,yl);s.addEventListener(vl,u),s.dispatchEvent(t),t.defaultPrevented||Q(e??document.body,{select:!0}),s.removeEventListener(vl,u),Ol.remove(p)},0)}}},[s,l,u,p]);let m=j.useCallback(e=>{if(!n&&!r||p.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]=Cl(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Q(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Q(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,M.jsx)(Ic.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});xl.displayName=bl;function Sl(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Q(r,{select:t}),document.activeElement!==n)return}function Cl(e){let t=wl(e);return[Tl(t,e),Tl(t.reverse(),e)]}function wl(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tl(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):El(r,{upTo:t})))return r}function El(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}function Dl(e){return e instanceof HTMLInputElement&&`select`in e}function Q(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Dl(e)&&t&&e.select()}}var Ol=kl();function kl(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Al(e,t),e.unshift(t)},remove(t){e=Al(e,t),e[0]?.resume()}}}function Al(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jl(e){return e.filter(e=>e.tagName!==`A`)}var Ml=`Portal`,Nl=j.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=j.useState(!1);Vc(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?gc.createPortal((0,M.jsx)(Ic.div,{...r,ref:t}),o):null});Nl.displayName=Ml;var Pl=0,Fl=null;function Il(){j.useEffect(()=>{Fl||={start:Ll(),end:Ll()};let{start:e,end:t}=Fl;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Pl++,()=>{Pl===1&&(Fl?.start.remove(),Fl?.end.remove(),Fl=null),Pl=Math.max(0,Pl-1)}},[])}function Ll(){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}var $=function(){return $=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},$.apply(this,arguments)};function Rl(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 zl(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 Bl=`right-scroll-bar-position`,Vl=`width-before-scroll-bar`,Hl=`with-scroll-bars-hidden`,Ul=`--removed-body-scroll-bar-size`;function Wl(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Gl(e,t){var n=(0,j.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 Kl=typeof window<`u`?j.useLayoutEffect:j.useEffect,ql=new WeakMap;function Jl(e,t){var n=Gl(t||null,function(t){return e.forEach(function(e){return Wl(e,t)})});return Kl(function(){var t=ql.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Wl(e,null)}),i.forEach(function(e){r.has(e)||Wl(e,a)})}ql.set(n,e)},[e]),n}function Yl(e){return e}function Xl(e,t){t===void 0&&(t=Yl);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 Zl(e){e===void 0&&(e={});var t=Xl(null);return t.options=$({async:!0,ssr:!1},e),t}var Ql=function(e){var t=e.sideCar,n=Rl(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 j.createElement(r,$({},n))};Ql.isSideCarExport=!0;function $l(e,t){return e.useMedium(t),Ql}var eu=Zl(),tu=function(){},nu=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:tu,onWheelCapture:tu,onTouchMoveCapture:tu}),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,v=_===void 0?`div`:_,y=e.gapMode,b=Rl(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Jl([n,t]),C=$($({},b),i);return j.createElement(j.Fragment,null,u&&j.createElement(x,{sideCar:eu,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?j.cloneElement(j.Children.only(s),$($({},C),{ref:S})):j.createElement(v,$({},C,{className:c,ref:S}),s))});nu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},nu.classNames={fullWidth:Vl,zeroRight:Bl};var ru,iu=function(){if(ru)return ru;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function au(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=iu();return t&&e.setAttribute(`nonce`,t),e}function ou(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function su(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var cu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=au())&&(ou(t,n),su(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lu=function(){var e=cu();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uu=function(){var e=lu();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},du={left:0,top:0,right:0,gap:0},fu=function(e){return parseInt(e||``,10)||0},pu=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[fu(n),fu(r),fu(i)]},mu=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return du;var t=pu(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])}},hu=uu(),gu=`data-scroll-locked`,_u=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
4
+ .${Hl} {
5
+ overflow: hidden ${r};
6
+ padding-right: ${s}px ${r};
7
+ }
8
+ body[${gu}] {
9
+ overflow: hidden ${r};
10
+ overscroll-behavior: contain;
11
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
12
+ padding-left: ${i}px;
13
+ padding-top: ${a}px;
14
+ padding-right: ${o}px;
15
+ margin-left:0;
16
+ margin-top:0;
17
+ margin-right: ${s}px ${r};
18
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
19
+ }
20
+
21
+ .${Bl} {
22
+ right: ${s}px ${r};
23
+ }
24
+
25
+ .${Vl} {
26
+ margin-right: ${s}px ${r};
27
+ }
28
+
29
+ .${Bl} .${Bl} {
30
+ right: 0 ${r};
31
+ }
32
+
33
+ .${Vl} .${Vl} {
34
+ margin-right: 0 ${r};
35
+ }
36
+
37
+ body[${gu}] {
38
+ ${Ul}: ${s}px;
39
+ }
40
+ `},vu=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},yu=function(){j.useEffect(function(){return document.body.setAttribute(gu,(vu()+1).toString()),function(){var e=vu()-1;e<=0?document.body.removeAttribute(gu):document.body.setAttribute(gu,e.toString())}},[])},bu=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;yu();var a=j.useMemo(function(){return mu(i)},[i]);return j.createElement(hu,{styles:_u(a,!t,i,n?``:`!important`)})},xu=!1;if(typeof window<`u`)try{var Su=Object.defineProperty({},"passive",{get:function(){return xu=!0,!0}});window.addEventListener(`test`,Su,Su),window.removeEventListener(`test`,Su,Su)}catch{xu=!1}var Cu=xu?{passive:!1}:!1,wu=function(e){return e.tagName===`TEXTAREA`},Tu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!wu(e)&&n[t]===`visible`)},Eu=function(e){return Tu(e,`overflowY`)},Du=function(e){return Tu(e,`overflowX`)},Ou=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ju(e,r)){var i=Mu(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ku=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Au=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ju=function(e,t){return e===`v`?Eu(t):Du(t)},Mu=function(e,t){return e===`v`?ku(t):Au(t)},Nu=function(e,t){return e===`h`&&t===`rtl`?-1:1},Pu=function(e,t,n,r,i){var a=Nu(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Mu(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ju(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Fu=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Iu=function(e){return[e.deltaX,e.deltaY]},Lu=function(e){return e&&`current`in e?e.current:e},Ru=function(e,t){return e[0]===t[0]&&e[1]===t[1]},zu=function(e){return`
41
+ .block-interactivity-${e} {pointer-events: none;}
42
+ .allow-interactivity-${e} {pointer-events: all;}
43
+ `},Bu=0,Vu=[];function Hu(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),i=j.useState(Bu++)[0],a=j.useState(uu)[0],o=j.useRef(e);j.useEffect(function(){o.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=zl([e.lockRef.current],(e.shards||[]).map(Lu),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=j.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Fu(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ou(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ou(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Pu(h,t,e,h===`h`?s:c,!0)},[]),c=j.useCallback(function(e){var n=e;if(!(!Vu.length||Vu[Vu.length-1]!==a)){var r=`deltaY`in n?Iu(n):Fu(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ru(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Lu).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=j.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Uu(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=j.useCallback(function(e){n.current=Fu(e),r.current=void 0},[]),d=j.useCallback(function(t){l(t.type,Iu(t),t.target,s(t,e.lockRef.current))},[]),f=j.useCallback(function(t){l(t.type,Fu(t),t.target,s(t,e.lockRef.current))},[]);j.useEffect(function(){return Vu.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Cu),document.addEventListener(`touchmove`,c,Cu),document.addEventListener(`touchstart`,u,Cu),function(){Vu=Vu.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Cu),document.removeEventListener(`touchmove`,c,Cu),document.removeEventListener(`touchstart`,u,Cu)}},[]);var p=e.removeScrollBar,m=e.inert;return j.createElement(j.Fragment,null,m?j.createElement(a,{styles:zu(i)}):null,p?j.createElement(bu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Uu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Wu=$l(eu,Hu),Gu=j.forwardRef(function(e,t){return j.createElement(nu,$({},e,{ref:t,sideCar:Wu}))});Gu.classNames=nu.classNames;var Ku=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},qu=new WeakMap,Ju=new WeakMap,Yu={},Xu=0,Zu=function(e){return e&&(e.host||Zu(e.parentNode))},Qu=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Zu(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},$u=function(e,t,n,r){var i=Qu(t,Array.isArray(e)?e:[e]);Yu[n]||(Yu[n]=new WeakMap);var a=Yu[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(qu.get(e)||0)+1,l=(a.get(e)||0)+1;qu.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ju.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Xu++,function(){o.forEach(function(e){var t=qu.get(e)-1,i=a.get(e)-1;qu.set(e,t),a.set(e,i),t||(Ju.has(e)||e.removeAttribute(r),Ju.delete(e)),i||e.removeAttribute(n)}),Xu--,Xu||(qu=new WeakMap,qu=new WeakMap,Ju=new WeakMap,Yu={})}},ed=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ku(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),$u(r,i,n,`aria-hidden`)):function(){return null}},td=yc(`inline-flex shrink-0 items-center justify-center gap-[7px] rounded-md font-semibold whitespace-nowrap transition-[background-color,border-color,opacity,filter] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:brightness-[0.96]`,contrast:`bg-contrast text-contrast-foreground hover:brightness-[0.96]`,outline:`border border-border bg-card hover:bg-muted`,ghost:`text-muted-foreground hover:bg-muted hover:text-foreground`,"danger-ghost":`text-danger hover:bg-danger/10`},size:{default:`h-9 px-3.5 text-[13.5px]`,sm:`h-[30px] rounded-sm px-2.5 text-[12.5px]`,icon:`size-9`,"icon-sm":`size-[30px] rounded-sm`}},defaultVariants:{variant:`primary`,size:`default`}});function nd({className:e,variant:t=`primary`,size:n=`default`,asChild:r=!1,...i}){return(0,M.jsx)(r?wc:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:d(td({variant:t,size:n,className:e})),...i})}var rd=5e3,id=[],ad=1,od=new Set;function sd(e){id=e;for(let e of od)e()}function cd(e){return od.add(e),()=>od.delete(e)}function ld(e,t={}){let n={id:ad++,message:e,tone:t.tone??`default`};sd([...id,n]),setTimeout(()=>sd(id.filter(e=>e.id!==n.id)),rd)}function ud(){let e=(0,j.useSyncExternalStore)(cd,()=>id);return e.length===0?null:(0,M.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed inset-x-0 bottom-[calc(16px+env(safe-area-inset-bottom))] z-50 flex flex-col items-center gap-2 px-4`,children:e.map(e=>(0,M.jsx)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,className:d(`pointer-events-auto max-w-full rounded-md px-3.5 py-2.5 text-[13px] font-medium shadow-modal`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:e.message},e.id))})}var dd={primary:`border-primary/25 bg-primary/15 text-primary`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function fd({icon:e,tone:t=`neutral`,title:n,subtitle:r,children:i,actions:a,backdrop:o=!1,heading:s=`h1`,className:c}){return(0,M.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":t,className:d(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,c),children:[o?(0,M.jsx)(hd,{}):null,(0,M.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,M.jsx)(`div`,{"data-slot":`centered-state-tile`,className:d(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,dd[t]),children:e}),(0,M.jsx)(s,{className:`text-2xl font-semibold text-balance text-foreground`,children:n}),r?(0,M.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:r}):null,i?(0,M.jsx)(`div`,{className:`w-full pt-2`,children:i}):null,a?(0,M.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:a}):null]})]})}var pd=[{top:`6%`,left:`14%`,size:2,tone:`violet`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`violet`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`violet`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`violet`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`violet`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`violet`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`violet`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`violet`,opacity:.22}],md={violet:`bg-violet`,primary:`bg-primary`,pending:`bg-pending`};function hd({className:e}){return(0,M.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:d(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,e),children:pd.map((e,t)=>(0,M.jsx)(`span`,{className:d(`absolute rounded-[1px] motion-safe:animate-pulse`,e.size===3?`size-[3px]`:`size-0.5`,md[e.tone]),style:{top:e.top,left:e.left,opacity:e.opacity,animationDuration:`3.5s`,animationDelay:`${t%5*700}ms`}},t))})}export{vs as $,ni as $n,wo as $t,Y as A,go as An,ss as At,fc as B,ia as Bn,Qo as Bt,wc as C,Ji as Cn,ue as Cr,Ts as Ct,yc as D,$a as Dn,Te as Dr,Xs as Dt,Sc as E,xa as En,O as Er,tc as Et,sc as F,Eo as Fn,as as Ft,Ws as G,Aa as Gn,Ho as Gt,Ls as H,qa as Hn,Wo as Ht,cc as I,vo as In,rs as It,As as J,Ai as Jn,Uo as Jt,Gs as K,Ja as Kn,Bo as Kt,Ss as L,To as Ln,ns as Lt,$s as M,Ya as Mn,es as Mt,Es as N,oo as Nn,Zo as Nt,hc as O,Qa as On,re as Or,X as Ot,Ys as P,to as Pn,Xo as Pt,xs as Q,Ni as Qn,Fi as Qt,uc as R,bo as Rn,is as Rt,Lc as S,ba as Sn,de as Sr,Zs as St,xc as T,Va as Tn,me as Tr,nc as Tt,Os as U,Da as Un,Vo as Ut,pc as V,ko as Vn,Go as Vt,Ds as W,uo as Wn,Ko as Wt,ks as X,ki as Xn,No as Xt,ic as Y,Di as Yn,zo as Yt,Ms as Z,Pi as Zn,Mo as Zt,Uc as _,mo as _n,Ne as _r,js as _t,nd as a,eo as an,pr as ar,Ks as at,Rc as b,ya as bn,pe as br,rc as bt,Gu as c,co as cn,Fn as cr,bs as ct,xl as d,Wa as dn,F as dr,zs as dt,za as en,ii as er,ec as et,cl as f,ho as fn,P as fr,Rs as ft,qc as g,po as gn,He as gr,_s as gt,tl as h,Ha as hn,$e as hr,Bs as ht,ld as i,Co as in,dr as ir,lc as it,Qs as j,Ga as jn,$o as jt,mc as k,Xa as kn,T as kr,Jo as kt,Il as l,ao as ln,zn as lr,Ns as lt,Z as m,_o as mn,N as mr,Is as mt,hd as n,La as nn,lr as nr,Cs as nt,td as o,ka as on,qt as or,qs as ot,dl as p,Ka as pn,rt as pr,Ps as pt,ac as q,lo as qn,Ro as qt,ud as r,fo as rn,ur as rr,ws as rt,ed as s,Ua as sn,U as sr,Js as st,fd as t,Ra as tn,ai as tr,ys as tt,Nl as u,Ia as un,fi as ur,Fs as ut,Vc as v,so as vn,A as vr,oc as vt,Cc as w,Ea as wn,D as wr,Hs as wt,Ic as x,Sa as xn,fe as xr,Vs as xt,Bc as y,_a as yn,se as yr,Us as yt,dc as z,Oo as zn,os as zt};
@@ -0,0 +1 @@
1
+ import{r as e}from"./utils-Wtkd5E6j.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./utils-Wtkd5E6j.js";var t=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
@@ -1 +1 @@
1
- import{r as e}from"./utils-DsLuRXwV.js";var t=e(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]);export{t};
1
+ import{r as e}from"./utils-Wtkd5E6j.js";var t=e(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]);export{t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,_ as i,b as a,g as o,h as s,v as c,x as l,y as u}from"./centered-state-ZtnFHA-n.js";var d=e(t(),1),f=n(),p=`Collapsible`,[m,h]=a(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:o,onOpenChange:c,...u}=e,[m,h]=i({prop:r,defaultProp:a??!1,onChange:c,caller:p});return(0,f.jsx)(g,{scope:n,disabled:o,contentId:s(),open:m,onOpenToggle:d.useCallback(()=>h(e=>!e),[h]),children:(0,f.jsx)(l.div,{"data-state":w(m),"data-disabled":o?``:void 0,...u,ref:t})})});v.displayName=p;var y=`CollapsibleTrigger`,b=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=_(y,n);return(0,f.jsx)(l.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":w(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:u(e.onClick,i.onOpenToggle)})});b.displayName=y;var x=`CollapsibleContent`,S=d.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=_(x,e.__scopeCollapsible);return(0,f.jsx)(o,{present:n||i.open,children:({present:e})=>(0,f.jsx)(C,{...r,ref:t,present:e})})});S.displayName=x;var C=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:i,children:a,...o}=e,s=_(x,n),[u,p]=d.useState(i),m=d.useRef(null),h=r(t,m),g=d.useRef(0),v=g.current,y=d.useRef(0),b=y.current,S=s.open||u,C=d.useRef(S),T=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),c(()=>{let e=m.current;if(e){T.current=T.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();g.current=t.height,y.current=t.width,C.current||(e.style.transitionDuration=T.current.transitionDuration,e.style.animationName=T.current.animationName),p(i)}},[s.open,i]),(0,f.jsx)(l.div,{"data-state":w(s.open),"data-disabled":s.disabled?``:void 0,id:s.contentId,hidden:!S,...o,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:S&&a})});function w(e){return e?`open`:`closed`}var T=v;function E({...e}){return(0,f.jsx)(T,{"data-slot":`collapsible`,...e})}function D({...e}){return(0,f.jsx)(b,{"data-slot":`collapsible-trigger`,...e})}function O({...e}){return(0,f.jsx)(S,{"data-slot":`collapsible-content`,...e})}export{O as n,D as r,E as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,_ as i,b as a,g as o,h as s,v as c,x as l,y as u}from"./centered-state-BkAJVLJE.js";var d=e(t(),1),f=n(),p=`Collapsible`,[m,h]=a(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:o,onOpenChange:c,...u}=e,[m,h]=i({prop:r,defaultProp:a??!1,onChange:c,caller:p});return(0,f.jsx)(g,{scope:n,disabled:o,contentId:s(),open:m,onOpenToggle:d.useCallback(()=>h(e=>!e),[h]),children:(0,f.jsx)(l.div,{"data-state":w(m),"data-disabled":o?``:void 0,...u,ref:t})})});v.displayName=p;var y=`CollapsibleTrigger`,b=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=_(y,n);return(0,f.jsx)(l.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":w(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:u(e.onClick,i.onOpenToggle)})});b.displayName=y;var x=`CollapsibleContent`,S=d.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=_(x,e.__scopeCollapsible);return(0,f.jsx)(o,{present:n||i.open,children:({present:e})=>(0,f.jsx)(C,{...r,ref:t,present:e})})});S.displayName=x;var C=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:i,children:a,...o}=e,s=_(x,n),[u,p]=d.useState(i),m=d.useRef(null),h=r(t,m),g=d.useRef(0),v=g.current,y=d.useRef(0),b=y.current,S=s.open||u,C=d.useRef(S),T=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),c(()=>{let e=m.current;if(e){T.current=T.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();g.current=t.height,y.current=t.width,C.current||(e.style.transitionDuration=T.current.transitionDuration,e.style.animationName=T.current.animationName),p(i)}},[s.open,i]),(0,f.jsx)(l.div,{"data-state":w(s.open),"data-disabled":s.disabled?``:void 0,id:s.contentId,hidden:!S,...o,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:S&&a})});function w(e){return e?`open`:`closed`}var T=v;function E({...e}){return(0,f.jsx)(T,{"data-slot":`collapsible`,...e})}function D({...e}){return(0,f.jsx)(b,{"data-slot":`collapsible-trigger`,...e})}function O({...e}){return(0,f.jsx)(S,{"data-slot":`collapsible-content`,...e})}export{O as n,D as r,E as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DsLuRXwV.js";import{t as i}from"./project-router-Cx8NPoqn.js";import{t as a}from"./lib-BQXq3kEf.js";var o=e(t(),1),s=n(),c=41;function l({slot:e,commits:t,className:n}){let i=t.length>150,l=(0,o.useRef)(null),d=(0,o.useRef)(null),[f,p]=(0,o.useState)(0);(0,o.useLayoutEffect)(()=>{if(!i)return;let e=()=>{let e=l.current,t=d.current;!e||!t||p(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[i]);let m=t.map(e=>(0,s.jsx)(u,{commit:e},e.sha));return(0,s.jsx)(`div`,{ref:e=>{l.current=e,e&&(d.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":i,className:r(`flex flex-col divide-y divide-border px-2 py-1 md:px-4`,n),children:i?(0,s.jsx)(a,{scrollRef:d,startMargin:f,itemSize:c,children:m}):m})}function u({commit:e}){return(0,s.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_41px] [content-visibility:auto]`,children:(0,s.jsxs)(i,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:`flex min-w-0 items-baseline gap-3 rounded-sm px-2 py-2.5 hover:bg-muted`,children:[(0,s.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),(0,s.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:e.subject}),(0,s.jsxs)(`span`,{className:`hidden shrink-0 text-[11px] text-soft-foreground sm:inline`,children:[e.author,` · `,e.when]})]})})}export{l as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-Wtkd5E6j.js";import{t as i}from"./project-router-DudOmkHf.js";import{t as a}from"./lib-BQXq3kEf.js";var o=e(t(),1),s=n(),c=41;function l({slot:e,commits:t,className:n}){let i=t.length>150,l=(0,o.useRef)(null),d=(0,o.useRef)(null),[f,p]=(0,o.useState)(0);(0,o.useLayoutEffect)(()=>{if(!i)return;let e=()=>{let e=l.current,t=d.current;!e||!t||p(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[i]);let m=t.map(e=>(0,s.jsx)(u,{commit:e},e.sha));return(0,s.jsx)(`div`,{ref:e=>{l.current=e,e&&(d.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":i,className:r(`flex flex-col divide-y divide-border px-2 py-1 md:px-4`,n),children:i?(0,s.jsx)(a,{scrollRef:d,startMargin:f,itemSize:c,children:m}):m})}function u({commit:e}){return(0,s.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_41px] [content-visibility:auto]`,children:(0,s.jsxs)(i,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:`flex min-w-0 items-baseline gap-3 rounded-sm px-2 py-2.5 hover:bg-muted`,children:[(0,s.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),(0,s.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:e.subject}),(0,s.jsxs)(`span`,{className:`hidden shrink-0 text-[11px] text-soft-foreground sm:inline`,children:[e.author,` · `,e.when]})]})})}export{l as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,An as i,H as a,Nt as o,U as s,Ut as c,Xt as l,_t as u,a as d,fr as f,i as p,k as m,kt as h,lr as g,sr as _,t as v}from"./centered-state-ZtnFHA-n.js";import{t as y}from"./utils-DsLuRXwV.js";import{t as b}from"./chevron-right-G4caF2QV.js";import{t as x}from"./search-x-X3EpVhgs.js";import{n as S,r as C,t as w}from"./collapsible-B0JVzd0B.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./alert-dialog-ghffK6g9.js";import{c as N,t as P}from"./project-router-Cx8NPoqn.js";import{a as F,n as I,r as L,t as R}from"./pill-Dvs-P0xy.js";import{t as z}from"./markdown-BGBOGCA_.js";import{m as B,v as V}from"./index-DiawI6RX.js";import{t as H}from"./run-diff-EcOkf3ti.js";var U=e(t(),1),W=n();function G(){let{groupId:e}=_(),t=a(e),n=I(s().data),i=f();if((0,U.useEffect)(()=>{e&&i.invalidateQueries({queryKey:r.groups.detail(e)})},[i,e,(u().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,W.jsx)(B,{});if(t.isError){let e=t.error instanceof l&&t.error.status===404;return(0,W.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,W.jsx)(v,{icon:e?(0,W.jsx)(x,{}):(0,W.jsx)(V,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load the variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,W.jsx)(d,{asChild:!0,variant:`outline`,children:(0,W.jsx)(P,{to:`/`,children:`Back to tasks`})})})})}return(0,W.jsx)(K,{groupId:e,variants:t.data.runs,showTokens:n.tokens,showCost:n.cost})}function K({groupId:e,variants:t,showTokens:n,showCost:a}){let o=N(),s=f(),[l,u]=(0,U.useState)(null),d=t.every(e=>h.has(e.status)),_=t[0]?c(t[0]):``,v=g({mutationFn:t=>i(e,t),onSuccess:(t,n)=>{s.invalidateQueries({queryKey:r.runs.all}),s.invalidateQueries({queryKey:r.groups.detail(e)}),o(`/tasks/${t.winner?.id??n}`)},onError:e=>p(e.message,{tone:`danger`})});return(0,W.jsxs)(`div`,{"data-route":`compare`,className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-5 md:px-6`,children:[(0,W.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,W.jsx)(V,{className:`size-5 shrink-0 text-violet`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate`,title:_,children:_})]}),(0,W.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[t.length,` variants of the same task, each in its own worktree — pick the diff you want to keep. The others are cancelled and archived, their worktrees and branches removed.`]})]}),(0,W.jsx)(`div`,{"data-slot":`compare-columns`,className:y(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,W.jsx)(q,{variant:e,allTerminal:d,pickPending:v.isPending,onPick:()=>u(e),showTokens:n,showCost:a},e.id))}),(0,W.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-2`,children:t.map(e=>(0,W.jsx)(J,{variant:e},e.id))}),(0,W.jsx)(M,{open:l!==null,onOpenChange:e=>!e&&u(null),children:(0,W.jsxs)(D,{children:[(0,W.jsxs)(j,{children:[(0,W.jsxs)(E,{children:[`Pick variant `,l?.variant,`?`]}),(0,W.jsxs)(T,{children:[`Variant `,l?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,W.jsxs)(k,{children:[(0,W.jsx)(A,{children:`Keep comparing`}),(0,W.jsxs)(O,{"data-slot":`confirm-pick`,onClick:()=>{l&&v.mutate(l.id),u(null)},children:[(0,W.jsx)(m,{"aria-hidden":`true`}),`Pick variant `,l?.variant]})]})]})})]})}function q({variant:e,allTerminal:t,pickPending:n,onPick:r,showTokens:i,showCost:a}){let s=F(e),c=o(e.costUsd),l=e.inputTokens!==void 0||e.outputTokens!==void 0;return(0,W.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-xs font-semibold text-violet`,children:e.variant}),(0,W.jsx)(R,{dot:s.tone,pulse:s.pulse,children:s.label}),i&&l||a&&c?(0,W.jsxs)(`span`,{"data-slot":`variant-token-metrics`,className:`ml-auto flex shrink-0 items-center gap-1.5 text-[11px] text-soft-foreground`,children:[i?(0,W.jsx)(L,{inputTokens:e.inputTokens,outputTokens:e.outputTokens}):null,i&&l&&a&&c?(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`·`}):null,a&&c?(0,W.jsx)(`span`,{className:`font-mono tabular-nums`,children:c}):null]}):null]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,W.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,W.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,W.jsx)(z,{children:e.handoffExcerpt})}):(0,W.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,W.jsxs)(d,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,W.jsx)(m,{"aria-hidden":`true`}),`Pick this one`]})]})}function J({variant:e}){let[t,n]=(0,U.useState)(!1);return(0,W.jsxs)(w,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,W.jsxs)(C,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,W.jsx)(b,{className:y(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,W.jsx)(S,{children:(0,W.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,W.jsx)(H,{runId:e.id})})})]})}export{G as CompareVariantsRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,H as i,Mn as a,Nt as o,Qt as s,U as c,Ut as l,_t as u,a as d,dr as f,i as p,k as m,kt as h,lr as g,mr as _,t as v}from"./centered-state-BkAJVLJE.js";import{t as y}from"./utils-Wtkd5E6j.js";import{t as b}from"./chevron-right-CxAoD1eD.js";import{t as x}from"./search-x-BgxaJgro.js";import{n as S,r as C,t as w}from"./collapsible-BlF-7CeC.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./alert-dialog-V9cigyAO.js";import{c as N,t as P}from"./project-router-DudOmkHf.js";import{a as F,n as I,r as L,t as R}from"./pill-t97MvPW_.js";import{t as z}from"./markdown-q9lm7kQ2.js";import{m as B,v as V}from"./index-BmHHLbwc.js";import{t as H}from"./run-diff-BLoKEnTx.js";var U=e(t(),1),W=n();function G(){let{groupId:e}=g(),t=i(e),n=I(c().data),a=_();if((0,U.useEffect)(()=>{e&&a.invalidateQueries({queryKey:r.groups.detail(e)})},[a,e,(u().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,W.jsx)(B,{});if(t.isError){let e=t.error instanceof s&&t.error.status===404;return(0,W.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,W.jsx)(v,{icon:e?(0,W.jsx)(x,{}):(0,W.jsx)(V,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load the variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,W.jsx)(d,{asChild:!0,variant:`outline`,children:(0,W.jsx)(P,{to:`/`,children:`Back to tasks`})})})})}return(0,W.jsx)(K,{groupId:e,variants:t.data.runs,showTokens:n.tokens,showCost:n.cost})}function K({groupId:e,variants:t,showTokens:n,showCost:i}){let o=N(),s=_(),[c,u]=(0,U.useState)(null),d=t.every(e=>h.has(e.status)),g=t[0]?l(t[0]):``,v=f({mutationFn:t=>a(e,t),onSuccess:(t,n)=>{s.invalidateQueries({queryKey:r.runs.all}),s.invalidateQueries({queryKey:r.groups.detail(e)}),o(`/tasks/${t.winner?.id??n}`)},onError:e=>p(e.message,{tone:`danger`})});return(0,W.jsxs)(`div`,{"data-route":`compare`,className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-5 md:px-6`,children:[(0,W.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,W.jsx)(V,{className:`size-5 shrink-0 text-violet`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate`,title:g,children:g})]}),(0,W.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[t.length,` variants of the same task, each in its own worktree — pick the diff you want to keep. The others are cancelled and archived, their worktrees and branches removed.`]})]}),(0,W.jsx)(`div`,{"data-slot":`compare-columns`,className:y(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,W.jsx)(q,{variant:e,allTerminal:d,pickPending:v.isPending,onPick:()=>u(e),showTokens:n,showCost:i},e.id))}),(0,W.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-2`,children:t.map(e=>(0,W.jsx)(J,{variant:e},e.id))}),(0,W.jsx)(M,{open:c!==null,onOpenChange:e=>!e&&u(null),children:(0,W.jsxs)(D,{children:[(0,W.jsxs)(j,{children:[(0,W.jsxs)(E,{children:[`Pick variant `,c?.variant,`?`]}),(0,W.jsxs)(T,{children:[`Variant `,c?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,W.jsxs)(k,{children:[(0,W.jsx)(A,{children:`Keep comparing`}),(0,W.jsxs)(O,{"data-slot":`confirm-pick`,onClick:()=>{c&&v.mutate(c.id),u(null)},children:[(0,W.jsx)(m,{"aria-hidden":`true`}),`Pick variant `,c?.variant]})]})]})})]})}function q({variant:e,allTerminal:t,pickPending:n,onPick:r,showTokens:i,showCost:a}){let s=F(e),c=o(e.costUsd),l=e.inputTokens!==void 0||e.outputTokens!==void 0;return(0,W.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-xs font-semibold text-violet`,children:e.variant}),(0,W.jsx)(R,{dot:s.tone,pulse:s.pulse,children:s.label}),i&&l||a&&c?(0,W.jsxs)(`span`,{"data-slot":`variant-token-metrics`,className:`ml-auto flex shrink-0 items-center gap-1.5 text-[11px] text-soft-foreground`,children:[i?(0,W.jsx)(L,{inputTokens:e.inputTokens,outputTokens:e.outputTokens}):null,i&&l&&a&&c?(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`·`}):null,a&&c?(0,W.jsx)(`span`,{className:`font-mono tabular-nums`,children:c}):null]}):null]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,W.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,W.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,W.jsx)(z,{children:e.handoffExcerpt})}):(0,W.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,W.jsxs)(d,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,W.jsx)(m,{"aria-hidden":`true`}),`Pick this one`]})]})}function J({variant:e}){let[t,n]=(0,U.useState)(!1);return(0,W.jsxs)(w,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,W.jsxs)(C,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,W.jsx)(b,{className:y(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,W.jsx)(S,{children:(0,W.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,W.jsx)(H,{runId:e.id})})})]})}export{G as CompareVariantsRoute};