dorkos 0.131.0 → 0.133.0

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 (344) hide show
  1. package/dist/bin/cli.js +499 -314
  2. package/dist/browser/fresh-verifier.mjs +13 -13
  3. package/dist/browser/native/darwin-supervisor-worker.mjs +3 -3
  4. package/dist/browser/native/package-manifest.json +1 -1
  5. package/dist/browser/source-manifest.json +1 -1
  6. package/dist/client/assets/{AboutPage-BZ2LLJ0k.js → AboutPage-D-EHHVPa.js} +1 -1
  7. package/dist/client/assets/{ActivityErrorState-BnqAwUiy.js → ActivityErrorState-BTHnE1vP.js} +1 -1
  8. package/dist/client/assets/{ActivityPage-BlZKrSVo.js → ActivityPage-BfSLPIdR.js} +1 -1
  9. package/dist/client/assets/{ActivityRow-Ch8HxQ2m.js → ActivityRow-PwUBjQw8.js} +1 -1
  10. package/dist/client/assets/{AdapterIcon-CfocFMw-.js → AdapterIcon-DgkNN6bi.js} +1 -1
  11. package/dist/client/assets/{AdapterSetupWizard-Dtjx1Oad.js → AdapterSetupWizard-DX0dzp7q.js} +2 -2
  12. package/dist/client/assets/{AgentOptionRow-BGRvUeF7.js → AgentOptionRow-ApuDEKqq.js} +1 -1
  13. package/dist/client/assets/{AgentPicker-BcURPZQp.js → AgentPicker-BDci-9aL.js} +1 -1
  14. package/dist/client/assets/{AgentRequestCard-kNq5A_IN.js → AgentRequestCard-B2gxCMGi.js} +3 -3
  15. package/dist/client/assets/{AppearancePage-Cd-k7dcc.js → AppearancePage-8SVnFe0k.js} +1 -1
  16. package/dist/client/assets/ApplyToOverridesDialog-CnL1ubxL.js +1 -0
  17. package/dist/client/assets/{AttentionSignalRow-QY8AIjf9.js → AttentionSignalRow-CCKhUtil.js} +1 -1
  18. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Cgkvajbw.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-B7wFPzG4.js} +3 -3
  19. package/dist/client/assets/BindingDialog-C4BHVXno.js +1 -0
  20. package/dist/client/assets/{BlintzCanvas-CMzZnmWK.js → BlintzCanvas-7E5uwVms.js} +3 -3
  21. package/dist/client/assets/{CanvasCsvContent-uxMaHePf.js → CanvasCsvContent-l7lfyDGn.js} +4 -4
  22. package/dist/client/assets/CanvasFileContent-Bqd0IEfK.js +2 -0
  23. package/dist/client/assets/CanvasModel3dContent-DqL0Sy4r.js +2 -0
  24. package/dist/client/assets/{ChannelComposer-BAg0a29Q.js → ChannelComposer-CAYvz_ZB.js} +12 -17
  25. package/dist/client/assets/{ChatAppsOff-DD28V0vX.js → ChatAppsOff-CNeKBVNz.js} +2 -2
  26. package/dist/client/assets/{CodeMirrorDiff-CyoduBgM.js → CodeMirrorDiff-BZRcNFsS.js} +1 -1
  27. package/dist/client/assets/{CodeMirrorEditor-DGccoZ8Q.js → CodeMirrorEditor-DD5tArRn.js} +1 -1
  28. package/dist/client/assets/{ComputerResourceView-Dk98shko.js → ComputerResourceView-BUmsVssG.js} +1 -1
  29. package/dist/client/assets/{ComputerViewer-Broprz4q.js → ComputerViewer-BKMR5LkF.js} +1 -1
  30. package/dist/client/assets/{ConnectionAccessLists-C_qLz8GJ.js → ConnectionAccessLists-DYUiFmPY.js} +1 -1
  31. package/dist/client/assets/{ConnectionsPage-CmGgGmDO.js → ConnectionsPage-DR2Kfm9Q.js} +2 -2
  32. package/dist/client/assets/{ConventionPage-BxWLIUUC.js → ConventionPage-Do6q8873.js} +2 -2
  33. package/dist/client/assets/{ExtensionPageRoute-CyfIRaGs.js → ExtensionPageRoute-CP7NM7fw.js} +2 -2
  34. package/dist/client/assets/{FeatureDisabledState-By2dhVpu.js → FeatureDisabledState-Bi23k3rg.js} +1 -1
  35. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-B6wKQpLR.js → FloatingTanStackRouterDevtools-CqogiFob-lRlmDXYz.js} +1 -1
  36. package/dist/client/assets/{ForwardConsentHost-kDdpyBgA.js → ForwardConsentHost-DSR1pEEK.js} +1 -1
  37. package/dist/client/assets/HandlePage-aHId3bYX.js +1 -0
  38. package/dist/client/assets/HeartbeatPage-BTNVcHOI.js +1 -0
  39. package/dist/client/assets/{KeyEntry-Ctc1zp2J.js → KeyEntry-67acsEG2.js} +1 -1
  40. package/dist/client/assets/{LexicalField-7zd4B8f1.js → LexicalField-Cb68LIar.js} +2 -2
  41. package/dist/client/assets/{ManagesPage-BG1TIMP3.js → ManagesPage-ChPlBF42.js} +1 -1
  42. package/dist/client/assets/{Marketplace-C9r4jRJf.js → Marketplace-CzPhJEE1.js} +4 -4
  43. package/dist/client/assets/{MarketplaceSourcesView-C01Cdrge.js → MarketplaceSourcesView-CmQgxQmU.js} +1 -1
  44. package/dist/client/assets/{McpAppFrame-Dm7MqOhc.js → McpAppFrame-z5JUaCSA.js} +2 -2
  45. package/dist/client/assets/{McpSigninBody-CsXP_7lE.js → McpSigninBody-ZrnzwrOH.js} +1 -1
  46. package/dist/client/assets/{Model3dViewer-DOl8ZkrU.js → Model3dViewer-HJpWK-JI.js} +1 -1
  47. package/dist/client/assets/NamePage-C7F-SotG.js +1 -0
  48. package/dist/client/assets/{NewDirectMessageMenu-Dj-Qw8zA.js → NewDirectMessageMenu-CjBjzsDe.js} +1 -1
  49. package/dist/client/assets/{NotificationsPage-UExs4YE2.js → NotificationsPage-DwNUI0Z3.js} +1 -1
  50. package/dist/client/assets/{OpenMeshSwitch-Dx3M3wwS.js → OpenMeshSwitch-RNAZY1vn.js} +2 -2
  51. package/dist/client/assets/{OperatorIdentityForm-Bz5570RF.js → OperatorIdentityForm-B7S2C_eT.js} +1 -1
  52. package/dist/client/assets/PermissionHistory-D0chstxf.js +1 -0
  53. package/dist/client/assets/PermissionsPage-ToK0DZVV.js +1 -0
  54. package/dist/client/assets/{PersonalityPopover-Do-k_Hhw.js → PersonalityPopover-BvMtUQRM.js} +1 -1
  55. package/dist/client/assets/PhotoPage-Cqo3PNO_.js +1 -0
  56. package/dist/client/assets/{PreviewRefusedNotice-B-yyzQZP.js → PreviewRefusedNotice-DzbkMrUo.js} +1 -1
  57. package/dist/client/assets/{ProfileFields-DiarOK2y.js → ProfileFields-DU8dTGHT.js} +1 -1
  58. package/dist/client/assets/{ProfilePanelContainer-33Xkwoc3.js → ProfilePanelContainer-BfT-ufV7.js} +1 -1
  59. package/dist/client/assets/{ProfileRolePicker-BI6T4hj8.js → ProfileRolePicker-DrOtV-0N.js} +1 -1
  60. package/dist/client/assets/{PromptSuggestionChips-v5MScpZF.js → PromptSuggestionChips-CEnhme_V.js} +1 -1
  61. package/dist/client/assets/{ReportsToPopover-BALADuTO.js → ReportsToPopover-CwjpR1Tw.js} +1 -1
  62. package/dist/client/assets/{RoomSurface-BatV7gf5.js → RoomSurface-CChzNJKw.js} +1 -1
  63. package/dist/client/assets/{RoomsPage-DCCC3Dst.js → RoomsPage-Dbf6ijKr.js} +1 -1
  64. package/dist/client/assets/{RunsOnPopover-C7hMPyrb.js → RunsOnPopover-Bh5sSsSC.js} +1 -1
  65. package/dist/client/assets/{RuntimeConnectFlow-Dc5a8dlJ.js → RuntimeConnectFlow-BYQnY5vv.js} +1 -1
  66. package/dist/client/assets/{RuntimeSetupDialog-w90VGjJ4.js → RuntimeSetupDialog-DTO5v0dP.js} +1 -1
  67. package/dist/client/assets/{SeenDevices-BIMmbMWC.js → SeenDevices-cuY7ASEy.js} +3 -3
  68. package/dist/client/assets/{SessionsPage-0lwvSYHB.js → SessionsPage-BrqpVx-t.js} +1 -1
  69. package/dist/client/assets/{SettingsDialog-CrP6JzPg.js → SettingsDialog-DCAZX_1d.js} +4 -4
  70. package/dist/client/assets/{SkillsPage-BDgKWTfe.js → SkillsPage-D5who_ZH.js} +1 -1
  71. package/dist/client/assets/TaskDialogWrapper-BJ6XtOC5.js +1 -0
  72. package/dist/client/assets/TasksEmptyState-B3SjsxQa.js +3 -0
  73. package/dist/client/assets/{TasksPage-DjGbMGvn.js → TasksPage-B72w7J87.js} +1 -1
  74. package/dist/client/assets/{TeamComputerEntry-B_sM9Fik.js → TeamComputerEntry-B9ma5j-X.js} +1 -1
  75. package/dist/client/assets/TodoPromiseList-DDKWAfmv.js +1 -0
  76. package/dist/client/assets/TodoPromisesPage-BNXpvXzS.js +1 -0
  77. package/dist/client/assets/{ToolsPage-CeETRCd8.js → ToolsPage-DbJykCG3.js} +2 -2
  78. package/dist/client/assets/{TopologyGraph-CnpH2NjE.js → TopologyGraph-DKZS3nlr.js} +3 -3
  79. package/dist/client/assets/{TourHost-BQHrS47S.js → TourHost-Bw3Uoea5.js} +1 -1
  80. package/dist/client/assets/{UnlinkDialog-DOQLeNx4.js → UnlinkDialog-B-XCFNSd.js} +1 -1
  81. package/dist/client/assets/{UnreadDivider-DhyK6uGG.js → UnreadDivider-1aPVzwd7.js} +1 -1
  82. package/dist/client/assets/{WidgetErrorCard-Bwlfu514.js → WidgetErrorCard-C5ieVv_9.js} +6 -6
  83. package/dist/client/assets/{WithheldExtensionsNotice-BDc-CM2t.js → WithheldExtensionsNotice-CCO4ClRZ.js} +1 -1
  84. package/dist/client/assets/{WorkQueuePage-iO_DO1YK.js → WorkQueuePage-BbPKNwDg.js} +1 -1
  85. package/dist/client/assets/WorkView-BRcytACJ.js +51 -0
  86. package/dist/client/assets/_shell-EwFeSIGp.js +80 -0
  87. package/dist/client/assets/{_shell._home-BWi5YPaR.js → _shell._home-DD2mg-iK.js} +1 -1
  88. package/dist/client/assets/{_shell._home.activity-BU1NIGb7.js → _shell._home.activity-Z1QuU2M4.js} +1 -1
  89. package/dist/client/assets/_shell._home.index-BzTYr8Bw.js +3 -0
  90. package/dist/client/assets/_shell._home.tasks-BtC85Iut.js +1 -0
  91. package/dist/client/assets/{_shell._home.workspaces-wbnqJ58w.js → _shell._home.workspaces-qMG5OJYR.js} +1 -1
  92. package/dist/client/assets/{_shell.channels-D1KdvWZF.js → _shell.channels-BE4EK-iM.js} +2 -2
  93. package/dist/client/assets/_shell.connections-CBx0ogzx.js +1 -0
  94. package/dist/client/assets/{_shell.feedback-requests-DzHWC1fJ.js → _shell.feedback-requests-CwKSkkuD.js} +2 -2
  95. package/dist/client/assets/_shell.marketplace-CgWBUKSA.js +1 -0
  96. package/dist/client/assets/_shell.marketplace_.sources-8HZpKFDI.js +1 -0
  97. package/dist/client/assets/_shell.session-D6HcVbnm.js +1 -0
  98. package/dist/client/assets/{_shell.team-BMNSUpQQ.js → _shell.team-Dm5a4f8_.js} +4 -4
  99. package/dist/client/assets/_shell.threads-BavVtQOE.js +1 -0
  100. package/dist/client/assets/_shell.todos-B6uWr0zA.js +6 -0
  101. package/dist/client/assets/_shell.x._extensionId-DaELdkCH.js +1 -0
  102. package/dist/client/assets/_shell.x._extensionId_._-DaELdkCH.js +1 -0
  103. package/dist/client/assets/{abnfDiagram-WEYOIA3C-Co2k29JX.js → abnfDiagram-WEYOIA3C-Bu2T3jVw.js} +1 -1
  104. package/dist/client/assets/{access-copy-D6BUySpp.js → access-copy-tkiFMhRf.js} +1 -1
  105. package/dist/client/assets/{arc-DLZZpkuJ.js → arc-5q4SfXO9.js} +1 -1
  106. package/dist/client/assets/{architectureDiagram-ZHVYKT53-ClS9xqK5.js → architectureDiagram-ZHVYKT53-BnDMOBhV.js} +1 -1
  107. package/dist/client/assets/{banner-B8iMuXCP.js → banner-CSKUrrI0.js} +2 -2
  108. package/dist/client/assets/{blockDiagram-RJAE7QA3-DheoOELu.js → blockDiagram-RJAE7QA3-CtushlEs.js} +1 -1
  109. package/dist/client/assets/{c4Diagram-XDPPPE54-VWWZJ5x4.js → c4Diagram-XDPPPE54-7L-qYwKH.js} +1 -1
  110. package/dist/client/assets/channel-A3XT7_2L.js +1 -0
  111. package/dist/client/assets/{chunk-2E7WHVMD-BqPLJVkv.js → chunk-2E7WHVMD-ksBVyqQ3.js} +1 -1
  112. package/dist/client/assets/{chunk-2Q5K7J3B-DZn6OnKe.js → chunk-2Q5K7J3B-Bfqdkihb.js} +1 -1
  113. package/dist/client/assets/{chunk-4EMNKR2T-Dl9Poajp.js → chunk-4EMNKR2T-Brf2dH9x.js} +1 -1
  114. package/dist/client/assets/{chunk-55XCU76K-RoKuZPUc.js → chunk-55XCU76K-BlE7Cq40.js} +1 -1
  115. package/dist/client/assets/{chunk-5VM5RSS4-DV_1XHtU.js → chunk-5VM5RSS4-Bkgg3j7L.js} +1 -1
  116. package/dist/client/assets/{chunk-JWPE2WC7-B_IuS45y.js → chunk-JWPE2WC7-B9TRpN4O.js} +1 -1
  117. package/dist/client/assets/{chunk-VQ5W62QI-DkLNi45x.js → chunk-VQ5W62QI-ZoILnIYi.js} +1 -1
  118. package/dist/client/assets/{chunk-XXDRQBXY-ISM-1Dpw.js → chunk-XXDRQBXY-r2xNhaKz.js} +1 -1
  119. package/dist/client/assets/{chunk-ZCHMQSOR-MKaLMW8o.js → chunk-ZCHMQSOR-DfV3cF7d.js} +2 -2
  120. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-CIWuu4ht.js → classDiagram-v2-4MYWR3UA-VOVqMNNP.js} +1 -1
  121. package/dist/client/assets/{command-CxGYZKco.js → command-CaUEAy3b.js} +1 -1
  122. package/dist/client/assets/{copy-button-DjAoGwds.js → copy-button-BOznikwM.js} +1 -1
  123. package/dist/client/assets/{cose-bilkent-JH36ORCC-HiCifRyi.js → cose-bilkent-JH36ORCC-CAdBvyLz.js} +1 -1
  124. package/dist/client/assets/{cpu-DHHTTvp_.js → cpu-j9vX9Wfk.js} +1 -1
  125. package/dist/client/assets/{cynefin-EF2NZ3EQ-DjJGZrPz.js → cynefin-EF2NZ3EQ-DcH1A9Oo.js} +1 -1
  126. package/dist/client/assets/{cynefinDiagram-WF24UDRP-DE2NdiJ2.js → cynefinDiagram-WF24UDRP-DJuKBXHi.js} +1 -1
  127. package/dist/client/assets/{dagre-NK4GIZVX-C6gDOD26.js → dagre-NK4GIZVX-D099H_0S.js} +1 -1
  128. package/dist/client/assets/{detail-row-CjwI1iuc.js → detail-row-Crl89jnh.js} +1 -1
  129. package/dist/client/assets/{diagram-CBK3MWTC-38LckcsL.js → diagram-CBK3MWTC-Cd_4W9XO.js} +1 -1
  130. package/dist/client/assets/{diagram-I5XIIV2D--8L6D9Ra.js → diagram-I5XIIV2D-Bc7aQKt3.js} +1 -1
  131. package/dist/client/assets/{diagram-ODIL2UCW-DGC2Inhd.js → diagram-ODIL2UCW-awVJZ4Bg.js} +1 -1
  132. package/dist/client/assets/{diagram-PFBEJUXE-BDHp0AyR.js → diagram-PFBEJUXE-dhsj9aeU.js} +1 -1
  133. package/dist/client/assets/{diagram-RJA3I4VV-uBatJYPi.js → diagram-RJA3I4VV-Dm59CbiV.js} +1 -1
  134. package/dist/client/assets/{diagram-TYUNFSNR-C8e1EH9X.js → diagram-TYUNFSNR-BhvcIjA9.js} +1 -1
  135. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-DimRzU5B.js → ebnfDiagram-V4P3TTPT-C4wT_MTC.js} +1 -1
  136. package/dist/client/assets/{elk-QONTBCTQ-Dz6_Y2-G.js → elk-QONTBCTQ-CPI0zjmW.js} +1 -1
  137. package/dist/client/assets/{empty-state-saV209Il.js → empty-state-BHcmkSzu.js} +1 -1
  138. package/dist/client/assets/{erDiagram-KYQIGQAA-JeuTF8w6.js → erDiagram-KYQIGQAA-C_vGcbOB.js} +1 -1
  139. package/dist/client/assets/{execution-config-ClQZyDs9.js → execution-config-BS5rtvTZ.js} +1 -1
  140. package/dist/client/assets/{file-BIF-4ARS.js → file-CQGljfDT.js} +1 -1
  141. package/dist/client/assets/{file-exclamation-point-DxadH2b-.js → file-exclamation-point-B0a55VME.js} +1 -1
  142. package/dist/client/assets/{file-text-C_NPIQr4.js → file-text-Cycq_S0e.js} +1 -1
  143. package/dist/client/assets/{find-latest-widget-fence-CXai_zs0.js → find-latest-widget-fence-B6sJdG3Q.js} +4 -4
  144. package/dist/client/assets/{flowDiagram-IUGLLWBU-9FHDdK4j.js → flowDiagram-IUGLLWBU-_VNfmnxx.js} +1 -1
  145. package/dist/client/assets/{form-D3VdAYl4.js → form-BL14vwyB.js} +1 -1
  146. package/dist/client/assets/{format-cron-BqRDcFZM.js → format-cron-meJMgYNe.js} +1 -1
  147. package/dist/client/assets/{ganttDiagram-R7GPNTJY-CLMuXlHt.js → ganttDiagram-R7GPNTJY-o0gGU7X_.js} +1 -1
  148. package/dist/client/assets/{git-branch-Df7a5_fb.js → git-branch-CsLE6G0Y.js} +1 -1
  149. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-sE7Rlpr6.js → gitGraphDiagram-PDYL7XHY-DjXjUpJo.js} +1 -1
  150. package/dist/client/assets/{graph-iNVyFhBQ.js → graph-BMYee_VK.js} +1 -1
  151. package/dist/client/assets/{heart-BHMhDZ0K.js → heart-Cn3a-UQI.js} +1 -1
  152. package/dist/client/assets/{highlighted-body-KPVGNVTW-VvvsrJbu.js → highlighted-body-KPVGNVTW-DsX5yCC0.js} +1 -1
  153. package/dist/client/assets/{image-lightbox-CGEIRguA.js → image-lightbox-BZ_eBZgA.js} +1 -1
  154. package/dist/client/assets/{image-off-C5-TmSq8.js → image-off-DjR7LI5G.js} +1 -1
  155. package/dist/client/assets/{index-C3zS0ghJ.js → index-1MwES_vb.js} +1 -1
  156. package/dist/client/assets/{index-ClyRhxV_.js → index-47--OGKJ.js} +1 -1
  157. package/dist/client/assets/{index-CTgUh4p3.js → index-4rSR8lau.js} +1 -1
  158. package/dist/client/assets/{index-D9bEy8X-.js → index-B4TxpTKD.js} +1 -1
  159. package/dist/client/assets/{index-Dw-4S640.js → index-B8LqLhq7.js} +1 -1
  160. package/dist/client/assets/index-BJRgbiEd.js +1 -0
  161. package/dist/client/assets/{index-DWZ5M321.js → index-BOCclWF3.js} +1 -1
  162. package/dist/client/assets/index-BR1m9FON.js +1066 -0
  163. package/dist/client/assets/index-BcFn_S6b.js +1 -0
  164. package/dist/client/assets/{index-DRtg_sGG.js → index-BcnwvTnt.js} +1 -1
  165. package/dist/client/assets/index-BdVQOlVQ.css +1 -0
  166. package/dist/client/assets/{index-DEvpdTo6.js → index-BmKHO-FD.js} +1 -1
  167. package/dist/client/assets/{index-Bd0PAkxf.js → index-BsZkXHsH.js} +1 -1
  168. package/dist/client/assets/{index-Cudi8rs6.js → index-BxWr8Mrf.js} +1 -1
  169. package/dist/client/assets/index-C5EvpXcq.js +1 -0
  170. package/dist/client/assets/{index-CExh9cKN.js → index-Cb_p_ynP.js} +1 -1
  171. package/dist/client/assets/{index-YZbu9tke.js → index-CczLBUKI.js} +1 -1
  172. package/dist/client/assets/{index-264YDu-W.js → index-Cf4Gtxf9.js} +1 -1
  173. package/dist/client/assets/{index-Dpu2CORc.js → index-CfKSlYjb.js} +1 -1
  174. package/dist/client/assets/{index-Bzm9YMbr.js → index-Cgjq7a-8.js} +1 -1
  175. package/dist/client/assets/{index-Ci_J5Q-6.js → index-CpWxcN5D.js} +1 -1
  176. package/dist/client/assets/{index-BK5QrGfQ.js → index-Cv67OXfk.js} +1 -1
  177. package/dist/client/assets/{index-Di-MIFQG.js → index-D5Qmx1JR.js} +3 -3
  178. package/dist/client/assets/{index-LPrq0pOA.js → index-DARchye_.js} +1 -1
  179. package/dist/client/assets/{index-DMwivStD.js → index-DFb4kOjm.js} +2 -2
  180. package/dist/client/assets/{index-WeLoaNzW.js → index-DLN0kcME.js} +1 -1
  181. package/dist/client/assets/{index-BMLCfTba.js → index-DMSSN08i.js} +1 -1
  182. package/dist/client/assets/{index-Y6BDhuGt.js → index-DQ8uADJF.js} +1 -1
  183. package/dist/client/assets/index-DZhMvc9m.js +1 -0
  184. package/dist/client/assets/{index-CLsoFUml.js → index-Dfko0tSp.js} +1 -1
  185. package/dist/client/assets/{index-BgdYXP8E.js → index-DiM3QX-4.js} +3 -3
  186. package/dist/client/assets/{index-BxFLHNLg.js → index-DlvUENo4.js} +1 -1
  187. package/dist/client/assets/{index-BLUUshO9.js → index-DqZmnJED.js} +1 -1
  188. package/dist/client/assets/{index-D_bAtIJZ.js → index-DrlB9RSk.js} +1 -1
  189. package/dist/client/assets/{index-CgWzzIbx.js → index-H4e5Wpmi.js} +1 -1
  190. package/dist/client/assets/{index-k67dvyau.js → index-Joav7LQU.js} +1 -1
  191. package/dist/client/assets/{index-B0FHRkHM.js → index-KganLhU1.js} +2 -2
  192. package/dist/client/assets/{index-DFkofTx1.js → index-Kt6r3DQg.js} +1 -1
  193. package/dist/client/assets/{index-B8I1k-z9.js → index-Z2ApBQt4.js} +1 -1
  194. package/dist/client/assets/index-dY7IFpet.js +1 -0
  195. package/dist/client/assets/{index-DYVNSRDk.js → index-faSyUc2q.js} +1 -1
  196. package/dist/client/assets/{index-BgRYuqWs.js → index-gmyiXkmr.js} +1 -1
  197. package/dist/client/assets/{index-BZTLFzJp.js → index-o6kGmVGx.js} +1 -1
  198. package/dist/client/assets/{index-C_0JoCV6.js → index-vHKVYcH7.js} +1 -1
  199. package/dist/client/assets/{index.esm-CYmalBux.js → index.esm-CJIDYBqd.js} +1 -1
  200. package/dist/client/assets/{infoDiagram-MVDRKAX5-0aR9wjgO.js → infoDiagram-MVDRKAX5-B1mMyUlp.js} +1 -1
  201. package/dist/client/assets/{inline-code-DyTKSC5b.js → inline-code-mh48Uhbi.js} +1 -1
  202. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-D1lN8x2t.js → ishikawaDiagram-HPEHV2GE-efEMQ0_X.js} +1 -1
  203. package/dist/client/assets/{journeyDiagram-BOSHW7O7-CkXITXiJ.js → journeyDiagram-BOSHW7O7-DSAywiVk.js} +1 -1
  204. package/dist/client/assets/{kanban-definition-FNSA4HC5-ge33IiSq.js → kanban-definition-FNSA4HC5-B9pbU4zK.js} +1 -1
  205. package/dist/client/assets/{layers-Bx3K7OUm.js → layers-B0Z5Od3N.js} +1 -1
  206. package/dist/client/assets/{lightbulb-C5LvXkvM.js → lightbulb-Cfb5ecEd.js} +1 -1
  207. package/dist/client/assets/{link-2-Bj0_Zkvr.js → link-2-Dzy5BUL3.js} +1 -1
  208. package/dist/client/assets/{list-runtime-types-VNj1C8TB.js → list-runtime-types-DLmjtBMq.js} +1 -1
  209. package/dist/client/assets/{markdown-content-BRaPEOC7.js → markdown-content-DhAtZOfj.js} +1 -1
  210. package/dist/client/assets/{mention-pill-B_MiJWfo.js → mention-pill-DmA8FxL4.js} +1 -1
  211. package/dist/client/assets/{mermaid.core-B2hil_4a.js → mermaid.core-DUIkdbeL.js} +4 -4
  212. package/dist/client/assets/{message-square-off-T33FHpr7.js → message-square-off-BowIzJUV.js} +1 -1
  213. package/dist/client/assets/{mindmap-definition-6OY57UG3-Bu_Ia4Xz.js → mindmap-definition-6OY57UG3-Dz7ZOR4C.js} +1 -1
  214. package/dist/client/assets/{more-details-oDazWBxm.js → more-details-DV7LmY0E.js} +1 -1
  215. package/dist/client/assets/{owner-notice-VepbAQhj.js → owner-notice-DdFc2P8z.js} +1 -1
  216. package/dist/client/assets/{package-DBsl3ao5.js → package-BhKXbvU_.js} +1 -1
  217. package/dist/client/assets/{page-container-Bkarym6m.js → page-container-0sWZ3xh9.js} +1 -1
  218. package/dist/client/assets/{pane-resize-handle-gBlb5k1v.js → pane-resize-handle-Bjy4udre.js} +1 -1
  219. package/dist/client/assets/{paperclip-BeFttiUK.js → paperclip-C-7LhBfl.js} +1 -1
  220. package/dist/client/assets/{path-input-NY_yCBHb.js → path-input-BPVyI72G.js} +1 -1
  221. package/dist/client/assets/{pegDiagram-ECIUJNBX-0KmJlW0E.js → pegDiagram-ECIUJNBX-C4EOP-Fa.js} +1 -1
  222. package/dist/client/assets/{pieDiagram-GNMPY74T-IjeZXicv.js → pieDiagram-GNMPY74T-CQ1OxRkv.js} +1 -1
  223. package/dist/client/assets/{plug-CTqOZ7cA.js → plug-CIZ-wWL8.js} +1 -1
  224. package/dist/client/assets/{primer-trigger-CjaGrT2u.js → primer-trigger-XA5fLzR5.js} +2 -2
  225. package/dist/client/assets/{profile-errors-B8XkL2Rp.js → profile-errors-C1XACbc9.js} +1 -1
  226. package/dist/client/assets/{progress-Cr-4myw6.js → progress-BA2JPtb6.js} +1 -1
  227. package/dist/client/assets/{quadrantDiagram-D57K4MC3-CP6kLJKa.js → quadrantDiagram-D57K4MC3-Cw4BdkpS.js} +1 -1
  228. package/dist/client/assets/{query-error-state-DvhY-YKM.js → query-error-state-Cm-Lozlb.js} +1 -1
  229. package/dist/client/assets/{radio-CmDmmJy6.js → radio-DQ29H26H.js} +1 -1
  230. package/dist/client/assets/{railroadDiagram-Y72NRBL7-Bcto__oE.js → railroadDiagram-Y72NRBL7-CSKtYLmm.js} +1 -1
  231. package/dist/client/assets/registry-Tbt9pcZl.js +39 -0
  232. package/dist/client/assets/registry-jD9zw538.js +1 -0
  233. package/dist/client/assets/{relay-trace-schemas-ZLR1S8ft.js → relay-trace-schemas-4AAUf-Zl.js} +2 -2
  234. package/dist/client/assets/{repeat-DVTM8et8.js → repeat-B8g-x-Sc.js} +1 -1
  235. package/dist/client/assets/{requirementDiagram-EQYSW5RA-DNJrds3m.js → requirementDiagram-EQYSW5RA-BPSBZr7X.js} +1 -1
  236. package/dist/client/assets/{room-files-source-9Wdtc-bG.js → room-files-source-BkiK4-ZI.js} +2 -2
  237. package/dist/client/assets/{rotate-ccw-clock-qJSWqifh.js → rotate-ccw-clock-DRtL-2nr.js} +1 -1
  238. package/dist/client/assets/{rotate-cw-uoeBxIeM.js → rotate-cw-BbHkWN-J.js} +1 -1
  239. package/dist/client/assets/{sankeyDiagram-SY24JHO5-DNlU7xGI.js → sankeyDiagram-SY24JHO5-DVlHablQ.js} +1 -1
  240. package/dist/client/assets/{scroll-area-B1d3NfEn.js → scroll-area-DAC7NrVU.js} +1 -1
  241. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-CRk71coF.js → sequenceDiagram-BLEHNHQU--wZkN8xk.js} +1 -1
  242. package/dist/client/assets/{shield-x-BpQmg1qz.js → shield-x-CEWfkzDN.js} +1 -1
  243. package/dist/client/assets/{signed-in-CTmJ3OqM.js → signed-in-CMhCR-m8.js} +1 -1
  244. package/dist/client/assets/{sizeCapture-INFHLROL-cihX3QNq.js → sizeCapture-INFHLROL-CLXc7d3S.js} +1 -1
  245. package/dist/client/assets/{soul-file-BwiyiI5v.js → soul-file-CbX7rNqz.js} +1 -1
  246. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-BAwwRsnH.js → stateDiagram-v2-A6IESKWZ-5xa1FM_X.js} +1 -1
  247. package/dist/client/assets/{swimlanes-B3ENRKFQ-CpDB6CUC.js → swimlanes-B3ENRKFQ-DKgxJxjE.js} +1 -1
  248. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-f6MOc3pl.js +8 -0
  249. package/dist/client/assets/{table-dWrfPeX-.js → table-D0EJT0uP.js} +1 -1
  250. package/dist/client/assets/{tabs-D4txthOi.js → tabs-Ctjzrm8t.js} +1 -1
  251. package/dist/client/assets/{timeline-definition-JXYKGLGB-RDrKgCoU.js → timeline-definition-JXYKGLGB-B9P7ituI.js} +1 -1
  252. package/dist/client/assets/trust-dial-D__tIhzt.js +11 -0
  253. package/dist/client/assets/{trust-posture-atZIh8tf.js → trust-posture-DaHHtOZn.js} +1 -1
  254. package/dist/client/assets/{unplug-CnevV4yX.js → unplug-B-ipHefz.js} +1 -1
  255. package/dist/client/assets/{unverified-catalog-notice-BQwT36FA.js → unverified-catalog-notice-C8swqaTn.js} +1 -1
  256. package/dist/client/assets/{use-bindings-CltfjAWW.js → use-bindings-gLHRNAFU.js} +1 -1
  257. package/dist/client/assets/{use-composer-prefs-D-Zlt6z2.js → use-composer-prefs-CjpxcBIe.js} +1 -1
  258. package/dist/client/assets/{use-connector-management-C3CLnOOt.js → use-connector-management-BLiCJMgU.js} +1 -1
  259. package/dist/client/assets/{use-deep-link-scroll-DQlz-scx.js → use-deep-link-scroll-r2nKjzA-.js} +1 -1
  260. package/dist/client/assets/{use-delete-binding-D73CLm_7.js → use-delete-binding-BSiOik_K.js} +1 -1
  261. package/dist/client/assets/{use-dev-links-BqVFsMKU.js → use-dev-links-DXcIlMf-.js} +1 -1
  262. package/dist/client/assets/use-direct-message-panel-BbH8N4mE.js +1 -0
  263. package/dist/client/assets/{use-external-adapter-catalog-DrnksH0t.js → use-external-adapter-catalog-mmKni5ui.js} +1 -1
  264. package/dist/client/assets/{use-filter-state-D4i-hDOk.js → use-filter-state-CiPZ0AIH.js} +2 -2
  265. package/dist/client/assets/{use-full-activity-feed-DdDsRg8s.js → use-full-activity-feed-DXroUzfN.js} +1 -1
  266. package/dist/client/assets/use-is-below-desktop-LUZL5z5t.js +1 -0
  267. package/dist/client/assets/{use-mesh-topology-B7aLtPkZ.js → use-mesh-topology-upehQ5Cv.js} +1 -1
  268. package/dist/client/assets/{use-mounted-ref-DSSTCJfY.js → use-mounted-ref-IHwyriaF.js} +1 -1
  269. package/dist/client/assets/{use-notification-prefs-DaF3kwmq.js → use-notification-prefs-BHOK2P2l.js} +1 -1
  270. package/dist/client/assets/use-pending-read-mVsOBTzn.js +1 -0
  271. package/dist/client/assets/{use-personality-commit-D5b90JPX.js → use-personality-commit-Chf3UX8P.js} +1 -1
  272. package/dist/client/assets/{use-promo-activation-CPAOQpfe.js → use-promo-activation-Dlw6bg7G.js} +2 -2
  273. package/dist/client/assets/{use-promo-dismissals-Bx1gz1R1.js → use-promo-dismissals-Dx_fli7I.js} +1 -1
  274. package/dist/client/assets/{use-pulse-freshness-DeulB37O.js → use-pulse-freshness-CG_I6a-O.js} +1 -1
  275. package/dist/client/assets/{use-room-follow-claim-Dwke6RFQ.js → use-room-follow-claim-Bgrpr3bO.js} +1 -1
  276. package/dist/client/assets/{use-room-sessions-iepVrIMm.js → use-room-sessions-DecGrP3E.js} +1 -1
  277. package/dist/client/assets/{use-roving-tab-list-pCPKNQKv.js → use-roving-tab-list-CDkh-Ujm.js} +1 -1
  278. package/dist/client/assets/{use-session-canvas-BvvO-_V1.js → use-session-canvas-tvLLPQcm.js} +6 -6
  279. package/dist/client/assets/{use-status-budget-Bs7MMriS.js → use-status-budget-BBl2yxLR.js} +2 -2
  280. package/dist/client/assets/{use-todos-C-eREuDS.js → use-todos-BzRauzdQ.js} +1 -1
  281. package/dist/client/assets/{use-transform-lj3TkjYO.js → use-transform-DzJeHpxm.js} +1 -1
  282. package/dist/client/assets/{use-unclaimed-chats-BF3-0jHC.js → use-unclaimed-chats--HZdmq4F.js} +1 -1
  283. package/dist/client/assets/use-update-config-DjL7-nUR.js +1 -0
  284. package/dist/client/assets/{useMutationState-B_x_4f2K.js → useMutationState-DIywUTDG.js} +1 -1
  285. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-DBsRYa4J.js → usecaseDiagram-WPOLBNNX-C9aLJ03F.js} +1 -1
  286. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-rFAXvcQI.js → vennDiagram-Q3Y3IDCW-ChBIWbL0.js} +1 -1
  287. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-bI0JZkO3.js → wardleyDiagram-IVAIDKWA-DvQDOaTm.js} +1 -1
  288. package/dist/client/assets/{xychartDiagram-4URNHDU4-DZUd8iln.js → xychartDiagram-4URNHDU4-8FxLPP2c.js} +1 -1
  289. package/dist/client/assets/zap-DSllMMHe.js +6 -0
  290. package/dist/client/index.html +2 -2
  291. package/dist/drizzle/20261104060919_package_approval_request.sql +1 -0
  292. package/dist/drizzle/20261104081935_hook_decline_review.sql +3 -0
  293. package/dist/drizzle/20261107183323_dor3933_todos_rename.sql +64 -0
  294. package/dist/drizzle/20261108014418_dor3938_cross_agent_writer.sql +4 -0
  295. package/dist/drizzle/meta/20261104060919_snapshot.json +14889 -0
  296. package/dist/drizzle/meta/20261104081935_snapshot.json +14910 -0
  297. package/dist/drizzle/meta/20261107183323_snapshot.json +14910 -0
  298. package/dist/drizzle/meta/20261108014418_snapshot.json +14938 -0
  299. package/dist/drizzle/meta/_journal.json +28 -0
  300. package/dist/server/index.js +24875 -21931
  301. package/dist/server/index.js.map +2 -2
  302. package/package.json +5 -5
  303. package/dist/client/assets/ApplyToOverridesDialog-DE9VVQCA.js +0 -1
  304. package/dist/client/assets/BindingDialog-C_yflKOE.js +0 -1
  305. package/dist/client/assets/CanvasFileContent-C3ZKszxn.js +0 -2
  306. package/dist/client/assets/CanvasModel3dContent-CsNUuaj6.js +0 -2
  307. package/dist/client/assets/CommitmentList-DOvfnyDA.js +0 -1
  308. package/dist/client/assets/CommitmentsPage-D81vxHUk.js +0 -1
  309. package/dist/client/assets/HandlePage-vsG04kBg.js +0 -1
  310. package/dist/client/assets/HeartbeatPage-CMj1SS30.js +0 -1
  311. package/dist/client/assets/NamePage-DdX2yQ5f.js +0 -1
  312. package/dist/client/assets/PermissionHistory-Bhl2kr1R.js +0 -1
  313. package/dist/client/assets/PermissionsPage-DUbenFkt.js +0 -1
  314. package/dist/client/assets/PhotoPage-CExABoHA.js +0 -1
  315. package/dist/client/assets/TaskDialogWrapper-BVb8gAr0.js +0 -1
  316. package/dist/client/assets/TasksEmptyState-RkUEEU2r.js +0 -3
  317. package/dist/client/assets/WorkView-BDk_vwu3.js +0 -51
  318. package/dist/client/assets/_shell-CMNFxZKJ.js +0 -80
  319. package/dist/client/assets/_shell._home.index-BjR-d3_s.js +0 -3
  320. package/dist/client/assets/_shell._home.tasks-CqURPMQD.js +0 -1
  321. package/dist/client/assets/_shell.connections-D3gJrBTQ.js +0 -1
  322. package/dist/client/assets/_shell.marketplace-HdefWdN_.js +0 -1
  323. package/dist/client/assets/_shell.marketplace_.sources-wAZKfDQF.js +0 -1
  324. package/dist/client/assets/_shell.session-C0utZeSI.js +0 -1
  325. package/dist/client/assets/_shell.threads-TvzYRNMt.js +0 -1
  326. package/dist/client/assets/_shell.todos-sOFmsIPE.js +0 -6
  327. package/dist/client/assets/_shell.x._extensionId-DiEQZIvl.js +0 -1
  328. package/dist/client/assets/_shell.x._extensionId_._-DiEQZIvl.js +0 -1
  329. package/dist/client/assets/channel-B0WiEIVe.js +0 -1
  330. package/dist/client/assets/index-BwTGkJbK.js +0 -1071
  331. package/dist/client/assets/index-CCHGVclj.js +0 -1
  332. package/dist/client/assets/index-CiUmx-i3.js +0 -1
  333. package/dist/client/assets/index-Dd4JoHFP.js +0 -1
  334. package/dist/client/assets/index-DlmGvYpy.js +0 -1
  335. package/dist/client/assets/index-EXJsA5kw.js +0 -1
  336. package/dist/client/assets/index-MpS13vhQ.css +0 -1
  337. package/dist/client/assets/registry-BQTcAm5U.js +0 -39
  338. package/dist/client/assets/registry-HencHRXy.js +0 -1
  339. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-nJfOIWYW.js +0 -8
  340. package/dist/client/assets/use-direct-message-panel-B3qfpDjY.js +0 -1
  341. package/dist/client/assets/use-is-below-desktop-BXHT3oPL.js +0 -1
  342. package/dist/client/assets/use-local-browser-DDWknHZE.js +0 -1
  343. package/dist/client/assets/use-pending-read-uvmEJ7H9.js +0 -1
  344. package/dist/client/assets/use-update-config-D-OGlXGR.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TopologyGraph-CnpH2NjE.js","assets/index-BwTGkJbK.js","assets/index-MpS13vhQ.css","assets/transform-BqqRT-Iy.js","assets/value-wA6veExk.js","assets/heart-BHMhDZ0K.js","assets/AdapterIcon-CfocFMw-.js","assets/relay-trace-schemas-ZLR1S8ft.js","assets/form-D3VdAYl4.js","assets/BindingDialog-C_yflKOE.js","assets/use-bindings-CltfjAWW.js","assets/trust-posture-atZIh8tf.js","assets/session-strategy-labels-C7Wduch3.js","assets/_commonjs-dynamic-modules-TDtrdbi3.js","assets/use-mesh-topology-B7aLtPkZ.js","assets/empty-state-saV209Il.js","assets/query-error-state-DvhY-YKM.js","assets/use-delete-binding-D73CLm_7.js","assets/use-pending-read-uvmEJ7H9.js","assets/use-filter-state-D4i-hDOk.js","assets/scroll-area-B1d3NfEn.js","assets/OpenMeshSwitch-Dx3M3wwS.js","assets/table-dWrfPeX-.js","assets/page-container-Bkarym6m.js","assets/profile-errors-B8XkL2Rp.js","assets/CommitmentList-DOvfnyDA.js","assets/TeamComputerEntry-B_sM9Fik.js","assets/ComputerViewer-Broprz4q.js","assets/TopologyGraph-C7eadB24.css"])))=>i.map(i=>d[i]);
2
- import{O as jt,r as y,af as Ke,j as i,G as z,_ as $,cG as _t,B as I,am as H,kS as Ye,ba as ce,a2 as A,a0 as Nt,kT as Ft,ak as Mt,ev as Xe,al as Pt,kU as $t,a4 as We,cA as Qe,a5 as It,kV as Se,kW as At,z as Ze,kX as te,ff as Vt,a6 as Et,aJ as Dt,kY as Je,kZ as K,c7 as et,k_ as kt,k$ as zt,l0 as Tt,e as E,fk as G,l1 as _e,l2 as bt,l3 as Lt,l4 as Gt,eV as Ht,l5 as Ot,f as tt,l6 as Bt,x as J,eG as qt,fc as Ne,h5 as Ut,U as Kt,C as Yt,l7 as nt,bc as Xt,fE as Wt,eE as Fe,ex as Me,ey as Pe,ez as $e,eA as Ie,eB as Ae,l8 as ne,c0 as Qt,X as Ce,t as st,bm as Zt,g as ot,l9 as Jt,la as en,ek as tn,lb as nn,fl as sn,Z as ge,lc as on,e9 as rn,I as an,ld as ln,d as un,ei as dn,dd as cn,gk as gn,gw as fn,o as mn,le as pn,dn as Ve,l as Y,ag as hn,ah as xn,a$ as vn}from"./index-BwTGkJbK.js";import{u as rt}from"./use-pending-read-uvmEJ7H9.js";import{Q as it}from"./query-error-state-DvhY-YKM.js";import{u as at}from"./use-mesh-topology-B7aLtPkZ.js";import{S as Sn,u as Cn}from"./use-filter-state-D4i-hDOk.js";import{S as wn}from"./scroll-area-B1d3NfEn.js";import{u as Rn,a as yn,O as Ee,b as jn}from"./OpenMeshSwitch-Dx3M3wwS.js";import{T as _n,d as Nn,b as X,e as De,a as Fn,c as ke}from"./table-dWrfPeX-.js";import{E as lt}from"./empty-state-saV209Il.js";import{P as Mn}from"./page-container-Bkarym6m.js";import{e as Pn,i as $n}from"./profile-errors-B8XkL2Rp.js";import{r as In,C as An}from"./CommitmentList-DOvfnyDA.js";import{T as Vn}from"./TeamComputerEntry-B_sM9Fik.js";/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TopologyGraph-DKZS3nlr.js","assets/index-BR1m9FON.js","assets/index-BdVQOlVQ.css","assets/transform-BqqRT-Iy.js","assets/value-wA6veExk.js","assets/heart-Cn3a-UQI.js","assets/zap-DSllMMHe.js","assets/AdapterIcon-DgkNN6bi.js","assets/relay-trace-schemas-4AAUf-Zl.js","assets/form-BL14vwyB.js","assets/BindingDialog-C4BHVXno.js","assets/use-bindings-gLHRNAFU.js","assets/trust-posture-DaHHtOZn.js","assets/trust-dial-D__tIhzt.js","assets/session-strategy-labels-C7Wduch3.js","assets/_commonjs-dynamic-modules-TDtrdbi3.js","assets/use-mesh-topology-upehQ5Cv.js","assets/empty-state-BHcmkSzu.js","assets/query-error-state-Cm-Lozlb.js","assets/use-delete-binding-BSiOik_K.js","assets/use-pending-read-mVsOBTzn.js","assets/use-filter-state-CiPZ0AIH.js","assets/scroll-area-DAC7NrVU.js","assets/OpenMeshSwitch-RNAZY1vn.js","assets/table-D0EJT0uP.js","assets/page-container-0sWZ3xh9.js","assets/profile-errors-C1XACbc9.js","assets/TodoPromiseList-DDKWAfmv.js","assets/TeamComputerEntry-B9ma5j-X.js","assets/ComputerViewer-BKMR5LkF.js","assets/TopologyGraph-C7eadB24.css"])))=>i.map(i=>d[i]);
2
+ import{O as jt,r as y,af as Ke,j as i,G as z,_ as $,cF as _t,B as I,am as G,kV as Ye,b9 as ce,a2 as A,a0 as Nt,kW as Ft,ak as Mt,eu as Xe,al as Pt,kX as $t,a4 as We,cz as Qe,a5 as It,kY as Se,kZ as At,z as Ze,k_ as te,fm as Vt,a6 as Et,aJ as Dt,k$ as Je,l0 as K,c6 as et,l1 as kt,l2 as zt,l3 as Tt,e as E,fr as H,l4 as _e,l5 as bt,l6 as Lt,l7 as Ht,f0 as Gt,l8 as Ot,f as tt,l9 as Bt,x as J,eN as qt,fj as Ne,eE as Ut,U as Kt,C as Yt,la as nt,bb as Xt,fL as Wt,eL as Fe,ew as Me,ex as Pe,ey as $e,ez as Ie,eA as Ae,lb as ne,b$ as Qt,X as Ce,t as st,bl as Zt,g as ot,lc as Jt,ld as en,ej as tn,le as nn,fs as sn,Z as ge,lf as on,e8 as rn,I as an,lg as ln,d as un,eh as dn,dc as cn,gr as gn,gA as fn,o as mn,lh as pn,dm as Ve,l as Y,ag as hn,ah as xn,a_ as vn}from"./index-BR1m9FON.js";import{u as rt}from"./use-pending-read-mVsOBTzn.js";import{Q as it}from"./query-error-state-Cm-Lozlb.js";import{u as at}from"./use-mesh-topology-upehQ5Cv.js";import{S as Sn,u as Cn}from"./use-filter-state-CiPZ0AIH.js";import{S as wn}from"./scroll-area-DAC7NrVU.js";import{u as Rn,a as yn,O as Ee,b as jn}from"./OpenMeshSwitch-RNAZY1vn.js";import{T as _n,d as Nn,b as X,e as De,a as Fn,c as ke}from"./table-D0EJT0uP.js";import{E as lt}from"./empty-state-BHcmkSzu.js";import{P as Mn}from"./page-container-0sWZ3xh9.js";import{e as Pn,i as $n}from"./profile-errors-C1XACbc9.js";import{r as In,T as An}from"./TodoPromiseList-DDKWAfmv.js";import{T as Vn}from"./TeamComputerEntry-B9ma5j-X.js";/**
3
3
  * @license lucide-react v1.48.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
@@ -16,7 +16,7 @@ import{O as jt,r as y,af as Ke,j as i,G as z,_ as $,cG as _t,B as I,am as H,kS a
16
16
  */function T(e,s){return typeof e=="function"?e(s):e}function P(e,s){return t=>{s.setState(n=>({...n,[e]:T(t,n[e])}))}}function ee(e){return e instanceof Function}function Dn(e){return Array.isArray(e)&&e.every(s=>typeof s=="number")}function kn(e,s){const t=[],n=o=>{o.forEach(r=>{t.push(r);const a=s(r);a!=null&&a.length&&n(a)})};return n(e),t}function S(e,s,t){let n=[],o;return r=>{let a;t.key&&t.debug&&(a=Date.now());const l=e(r);if(!(l.length!==n.length||l.some((f,h)=>n[h]!==f)))return o;n=l;let d;if(t.key&&t.debug&&(d=Date.now()),o=s(...l),t==null||t.onChange==null||t.onChange(o),t.key&&t.debug&&t!=null&&t.debug()){const f=Math.round((Date.now()-a)*100)/100,h=Math.round((Date.now()-d)*100)/100,g=h/16,c=(p,m)=>{for(p=String(p);p.length<m;)p=" "+p;return p};console.info(`%c⏱ ${c(h,5)} /${c(f,5)} ms`,`
17
17
  font-size: .6rem;
18
18
  font-weight: bold;
19
- color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t==null?void 0:t.key)}return o}}function C(e,s,t,n){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[s]},key:!1,onChange:n}}function zn(e,s,t,n){const o=()=>{var a;return(a=r.getValue())!=null?a:e.options.renderFallbackValue},r={id:`${s.id}_${t.id}`,row:s,column:t,getValue:()=>s.getValue(n),renderValue:o,getContext:S(()=>[e,t,s,r],(a,l,u,d)=>({table:a,column:l,row:u,cell:d,getValue:d.getValue,renderValue:d.renderValue}),C(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(r,t,s,e)},{}),r}function Tn(e,s,t,n){var o,r;const l={...e._getDefaultColumnDef(),...s},u=l.accessorKey;let d=(o=(r=l.id)!=null?r:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof l.header=="string"?l.header:void 0,f;if(l.accessorFn?f=l.accessorFn:u&&(u.includes(".")?f=g=>{let c=g;for(const m of u.split(".")){var p;c=(p=c)==null?void 0:p[m]}return c}:f=g=>g[l.accessorKey]),!d)throw new Error;let h={id:`${String(d)}`,accessorFn:f,parent:n,depth:t,columnDef:l,columns:[],getFlatColumns:S(()=>[!0],()=>{var g;return[h,...(g=h.columns)==null?void 0:g.flatMap(c=>c.getFlatColumns())]},C(e.options,"debugColumns")),getLeafColumns:S(()=>[e._getOrderColumnsFn()],g=>{var c;if((c=h.columns)!=null&&c.length){let p=h.columns.flatMap(m=>m.getLeafColumns());return g(p)}return[h]},C(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(h,e);return h}const M="debugHeaders";function ze(e,s,t){var n;let r={id:(n=t.id)!=null?n:s.id,column:s,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],l=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(l),a.push(u)};return l(r),a},getContext:()=>({table:e,header:r,column:s})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(r,e)}),r}const bn={createTable:e=>{e.getHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(s,t,n,o)=>{var r,a;const l=(r=n==null?void 0:n.map(h=>t.find(g=>g.id===h)).filter(Boolean))!=null?r:[],u=(a=o==null?void 0:o.map(h=>t.find(g=>g.id===h)).filter(Boolean))!=null?a:[],d=t.filter(h=>!(n!=null&&n.includes(h.id))&&!(o!=null&&o.includes(h.id)));return W(s,[...l,...d,...u],e)},C(e.options,M)),e.getCenterHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(s,t,n,o)=>(t=t.filter(r=>!(n!=null&&n.includes(r.id))&&!(o!=null&&o.includes(r.id))),W(s,t,e,"center")),C(e.options,M)),e.getLeftHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(s,t,n)=>{var o;const r=(o=n==null?void 0:n.map(a=>t.find(l=>l.id===a)).filter(Boolean))!=null?o:[];return W(s,r,e,"left")},C(e.options,M)),e.getRightHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(s,t,n)=>{var o;const r=(o=n==null?void 0:n.map(a=>t.find(l=>l.id===a)).filter(Boolean))!=null?o:[];return W(s,r,e,"right")},C(e.options,M)),e.getFooterGroups=S(()=>[e.getHeaderGroups()],s=>[...s].reverse(),C(e.options,M)),e.getLeftFooterGroups=S(()=>[e.getLeftHeaderGroups()],s=>[...s].reverse(),C(e.options,M)),e.getCenterFooterGroups=S(()=>[e.getCenterHeaderGroups()],s=>[...s].reverse(),C(e.options,M)),e.getRightFooterGroups=S(()=>[e.getRightHeaderGroups()],s=>[...s].reverse(),C(e.options,M)),e.getFlatHeaders=S(()=>[e.getHeaderGroups()],s=>s.map(t=>t.headers).flat(),C(e.options,M)),e.getLeftFlatHeaders=S(()=>[e.getLeftHeaderGroups()],s=>s.map(t=>t.headers).flat(),C(e.options,M)),e.getCenterFlatHeaders=S(()=>[e.getCenterHeaderGroups()],s=>s.map(t=>t.headers).flat(),C(e.options,M)),e.getRightFlatHeaders=S(()=>[e.getRightHeaderGroups()],s=>s.map(t=>t.headers).flat(),C(e.options,M)),e.getCenterLeafHeaders=S(()=>[e.getCenterFlatHeaders()],s=>s.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,M)),e.getLeftLeafHeaders=S(()=>[e.getLeftFlatHeaders()],s=>s.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,M)),e.getRightLeafHeaders=S(()=>[e.getRightFlatHeaders()],s=>s.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,M)),e.getLeafHeaders=S(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(s,t,n)=>{var o,r,a,l,u,d;return[...(o=(r=s[0])==null?void 0:r.headers)!=null?o:[],...(a=(l=t[0])==null?void 0:l.headers)!=null?a:[],...(u=(d=n[0])==null?void 0:d.headers)!=null?u:[]].map(f=>f.getLeafHeaders()).flat()},C(e.options,M))}};function W(e,s,t,n){var o,r;let a=0;const l=function(g,c){c===void 0&&(c=1),a=Math.max(a,c),g.filter(p=>p.getIsVisible()).forEach(p=>{var m;(m=p.columns)!=null&&m.length&&l(p.columns,c+1)},0)};l(e);let u=[];const d=(g,c)=>{const p={depth:c,id:[n,`${c}`].filter(Boolean).join("_"),headers:[]},m=[];g.forEach(x=>{const v=[...m].reverse()[0],w=x.column.depth===p.depth;let R,j=!1;if(w&&x.column.parent?R=x.column.parent:(R=x.column,j=!0),v&&(v==null?void 0:v.column)===R)v.subHeaders.push(x);else{const _=ze(t,R,{id:[n,c,R.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:j,placeholderId:j?`${m.filter(V=>V.column===R).length}`:void 0,depth:c,index:m.length});_.subHeaders.push(x),m.push(_)}p.headers.push(x),x.headerGroup=p}),u.push(p),c>0&&d(m,c-1)},f=s.map((g,c)=>ze(t,g,{depth:a,index:c}));d(f,a-1),u.reverse();const h=g=>g.filter(p=>p.column.getIsVisible()).map(p=>{let m=0,x=0,v=[0];p.subHeaders&&p.subHeaders.length?(v=[],h(p.subHeaders).forEach(R=>{let{colSpan:j,rowSpan:_}=R;m+=j,v.push(_)})):m=1;const w=Math.min(...v);return x=x+w,p.colSpan=m,p.rowSpan=x,{colSpan:m,rowSpan:x}});return h((o=(r=u[0])==null?void 0:r.headers)!=null?o:[]),u}const Ln=(e,s,t,n,o,r,a)=>{let l={id:s,index:n,original:t,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(l._valuesCache.hasOwnProperty(u))return l._valuesCache[u];const d=e.getColumn(u);if(d!=null&&d.accessorFn)return l._valuesCache[u]=d.accessorFn(l.original,n),l._valuesCache[u]},getUniqueValues:u=>{if(l._uniqueValuesCache.hasOwnProperty(u))return l._uniqueValuesCache[u];const d=e.getColumn(u);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(l._uniqueValuesCache[u]=d.columnDef.getUniqueValues(l.original,n),l._uniqueValuesCache[u]):(l._uniqueValuesCache[u]=[l.getValue(u)],l._uniqueValuesCache[u])},renderValue:u=>{var d;return(d=l.getValue(u))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>kn(l.subRows,u=>u.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let u=[],d=l;for(;;){const f=d.getParentRow();if(!f)break;u.push(f),d=f}return u.reverse()},getAllCells:S(()=>[e.getAllLeafColumns()],u=>u.map(d=>zn(e,l,d,d.id)),C(e.options,"debugRows")),_getAllCellsByColumnId:S(()=>[l.getAllCells()],u=>u.reduce((d,f)=>(d[f.column.id]=f,d),{}),C(e.options,"debugRows"))};for(let u=0;u<e._features.length;u++){const d=e._features[u];d==null||d.createRow==null||d.createRow(l,e)}return l},Gn={createColumn:(e,s)=>{e._getFacetedRowModel=s.options.getFacetedRowModel&&s.options.getFacetedRowModel(s,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():s.getPreFilteredRowModel(),e._getFacetedUniqueValues=s.options.getFacetedUniqueValues&&s.options.getFacetedUniqueValues(s,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=s.options.getFacetedMinMaxValues&&s.options.getFacetedMinMaxValues(s,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},dt=(e,s,t)=>{var n,o;const r=t==null||(n=t.toString())==null?void 0:n.toLowerCase();return!!(!((o=e.getValue(s))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(r))};dt.autoRemove=e=>D(e);const ct=(e,s,t)=>{var n;return!!(!((n=e.getValue(s))==null||(n=n.toString())==null)&&n.includes(t))};ct.autoRemove=e=>D(e);const gt=(e,s,t)=>{var n;return((n=e.getValue(s))==null||(n=n.toString())==null?void 0:n.toLowerCase())===(t==null?void 0:t.toLowerCase())};gt.autoRemove=e=>D(e);const ft=(e,s,t)=>{var n;return(n=e.getValue(s))==null?void 0:n.includes(t)};ft.autoRemove=e=>D(e);const mt=(e,s,t)=>!t.some(n=>{var o;return!((o=e.getValue(s))!=null&&o.includes(n))});mt.autoRemove=e=>D(e)||!(e!=null&&e.length);const pt=(e,s,t)=>t.some(n=>{var o;return(o=e.getValue(s))==null?void 0:o.includes(n)});pt.autoRemove=e=>D(e)||!(e!=null&&e.length);const ht=(e,s,t)=>e.getValue(s)===t;ht.autoRemove=e=>D(e);const xt=(e,s,t)=>e.getValue(s)==t;xt.autoRemove=e=>D(e);const we=(e,s,t)=>{let[n,o]=t;const r=e.getValue(s);return r>=n&&r<=o};we.resolveFilterValue=e=>{let[s,t]=e,n=typeof s!="number"?parseFloat(s):s,o=typeof t!="number"?parseFloat(t):t,r=s===null||Number.isNaN(n)?-1/0:n,a=t===null||Number.isNaN(o)?1/0:o;if(r>a){const l=r;r=a,a=l}return[r,a]};we.autoRemove=e=>D(e)||D(e[0])&&D(e[1]);const k={includesString:dt,includesStringSensitive:ct,equalsString:gt,arrIncludes:ft,arrIncludesAll:mt,arrIncludesSome:pt,equals:ht,weakEquals:xt,inNumberRange:we};function D(e){return e==null||e===""}const Hn={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:P("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,s)=>{e.getAutoFilterFn=()=>{const t=s.getCoreRowModel().flatRows[0],n=t==null?void 0:t.getValue(e.id);return typeof n=="string"?k.includesString:typeof n=="number"?k.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?k.equals:Array.isArray(n)?k.arrIncludes:k.weakEquals},e.getFilterFn=()=>{var t,n;return ee(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(n=s.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?t:k[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,n,o;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((n=s.options.enableColumnFilters)!=null?n:!0)&&((o=s.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=s.getState().columnFilters)==null||(t=t.find(n=>n.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,n;return(t=(n=s.getState().columnFilters)==null?void 0:n.findIndex(o=>o.id===e.id))!=null?t:-1},e.setFilterValue=t=>{s.setColumnFilters(n=>{const o=e.getFilterFn(),r=n==null?void 0:n.find(f=>f.id===e.id),a=T(t,r?r.value:void 0);if(Te(o,a,e)){var l;return(l=n==null?void 0:n.filter(f=>f.id!==e.id))!=null?l:[]}const u={id:e.id,value:a};if(r){var d;return(d=n==null?void 0:n.map(f=>f.id===e.id?u:f))!=null?d:[]}return n!=null&&n.length?[...n,u]:[u]})}},createRow:(e,s)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=s=>{const t=e.getAllLeafColumns(),n=o=>{var r;return(r=T(s,o))==null?void 0:r.filter(a=>{const l=t.find(u=>u.id===a.id);if(l){const u=l.getFilterFn();if(Te(u,a.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=s=>{var t,n;e.setColumnFilters(s?[]:(t=(n=e.initialState)==null?void 0:n.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Te(e,s,t){return(e&&e.autoRemove?e.autoRemove(s,t):!1)||typeof s>"u"||typeof s=="string"&&!s}const On=(e,s,t)=>t.reduce((n,o)=>{const r=o.getValue(e);return n+(typeof r=="number"?r:0)},0),Bn=(e,s,t)=>{let n;return t.forEach(o=>{const r=o.getValue(e);r!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}),n},qn=(e,s,t)=>{let n;return t.forEach(o=>{const r=o.getValue(e);r!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}),n},Un=(e,s,t)=>{let n,o;return t.forEach(r=>{const a=r.getValue(e);a!=null&&(n===void 0?a>=a&&(n=o=a):(n>a&&(n=a),o<a&&(o=a)))}),[n,o]},Kn=(e,s)=>{let t=0,n=0;if(s.forEach(o=>{let r=o.getValue(e);r!=null&&(r=+r)>=r&&(++t,n+=r)}),t)return n/t},Yn=(e,s)=>{if(!s.length)return;const t=s.map(r=>r.getValue(e));if(!Dn(t))return;if(t.length===1)return t[0];const n=Math.floor(t.length/2),o=t.sort((r,a)=>r-a);return t.length%2!==0?o[n]:(o[n-1]+o[n])/2},Xn=(e,s)=>Array.from(new Set(s.map(t=>t.getValue(e))).values()),Wn=(e,s)=>new Set(s.map(t=>t.getValue(e))).size,Qn=(e,s)=>s.length,se={sum:On,min:Bn,max:qn,extent:Un,mean:Kn,median:Yn,unique:Xn,uniqueCount:Wn,count:Qn},Zn={getDefaultColumnDef:()=>({aggregatedCell:e=>{var s,t;return(s=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?s:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:P("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,s)=>{e.toggleGrouping=()=>{s.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(n=>n!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,n;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((n=s.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=s.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=s.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=s.getCoreRowModel().flatRows[0],n=t==null?void 0:t.getValue(e.id);if(typeof n=="number")return se.sum;if(Object.prototype.toString.call(n)==="[object Date]")return se.extent},e.getAggregationFn=()=>{var t,n;if(!e)throw new Error;return ee(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(n=s.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?t:se[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=s=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(s),e.resetGrouping=s=>{var t,n;e.setGrouping(s?[]:(t=(n=e.initialState)==null?void 0:n.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,s)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const n=s.getColumn(t);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[t]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,s,t,n)=>{e.getIsGrouped=()=>s.getIsGrouped()&&s.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&s.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=t.subRows)!=null&&o.length)}}};function Jn(e,s,t){if(!(s!=null&&s.length)||!t)return e;const n=e.filter(r=>!s.includes(r.id));return t==="remove"?n:[...s.map(r=>e.find(a=>a.id===r)).filter(Boolean),...n]}const es={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:P("columnOrder",e)}),createColumn:(e,s)=>{e.getIndex=S(t=>[U(s,t)],t=>t.findIndex(n=>n.id===e.id),C(s.options,"debugColumns")),e.getIsFirstColumn=t=>{var n;return((n=U(s,t)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=t=>{var n;const o=U(s,t);return((n=o[o.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=s=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(s),e.resetColumnOrder=s=>{var t;e.setColumnOrder(s?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=S(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(s,t,n)=>o=>{let r=[];if(!(s!=null&&s.length))r=o;else{const a=[...s],l=[...o];for(;l.length&&a.length;){const u=a.shift(),d=l.findIndex(f=>f.id===u);d>-1&&r.push(l.splice(d,1)[0])}r=[...r,...l]}return Jn(r,t,n)},C(e.options,"debugTable"))}},oe=()=>({left:[],right:[]}),ts={getInitialState:e=>({columnPinning:oe(),...e}),getDefaultOptions:e=>({onColumnPinningChange:P("columnPinning",e)}),createColumn:(e,s)=>{e.pin=t=>{const n=e.getLeafColumns().map(o=>o.id).filter(Boolean);s.setColumnPinning(o=>{var r,a;if(t==="right"){var l,u;return{left:((l=o==null?void 0:o.left)!=null?l:[]).filter(h=>!(n!=null&&n.includes(h))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(h=>!(n!=null&&n.includes(h))),...n]}}if(t==="left"){var d,f;return{left:[...((d=o==null?void 0:o.left)!=null?d:[]).filter(h=>!(n!=null&&n.includes(h))),...n],right:((f=o==null?void 0:o.right)!=null?f:[]).filter(h=>!(n!=null&&n.includes(h)))}}return{left:((r=o==null?void 0:o.left)!=null?r:[]).filter(h=>!(n!=null&&n.includes(h))),right:((a=o==null?void 0:o.right)!=null?a:[]).filter(h=>!(n!=null&&n.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var o,r,a;return((o=n.columnDef.enablePinning)!=null?o:!0)&&((r=(a=s.options.enableColumnPinning)!=null?a:s.options.enablePinning)!=null?r:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(l=>l.id),{left:n,right:o}=s.getState().columnPinning,r=t.some(l=>n==null?void 0:n.includes(l)),a=t.some(l=>o==null?void 0:o.includes(l));return r?"left":a?"right":!1},e.getPinnedIndex=()=>{var t,n;const o=e.getIsPinned();return o?(t=(n=s.getState().columnPinning)==null||(n=n[o])==null?void 0:n.indexOf(e.id))!=null?t:-1:0}},createRow:(e,s)=>{e.getCenterVisibleCells=S(()=>[e._getAllVisibleCells(),s.getState().columnPinning.left,s.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(a=>!r.includes(a.column.id))},C(s.options,"debugRows")),e.getLeftVisibleCells=S(()=>[e._getAllVisibleCells(),s.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(a=>a.column.id===r)).filter(Boolean).map(r=>({...r,position:"left"})),C(s.options,"debugRows")),e.getRightVisibleCells=S(()=>[e._getAllVisibleCells(),s.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(a=>a.column.id===r)).filter(Boolean).map(r=>({...r,position:"right"})),C(s.options,"debugRows"))},createTable:e=>{e.setColumnPinning=s=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(s),e.resetColumnPinning=s=>{var t,n;return e.setColumnPinning(s?oe():(t=(n=e.initialState)==null?void 0:n.columnPinning)!=null?t:oe())},e.getIsSomeColumnsPinned=s=>{var t;const n=e.getState().columnPinning;if(!s){var o,r;return!!((o=n.left)!=null&&o.length||(r=n.right)!=null&&r.length)}return!!((t=n[s])!=null&&t.length)},e.getLeftLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(s,t)=>(t??[]).map(n=>s.find(o=>o.id===n)).filter(Boolean),C(e.options,"debugColumns")),e.getRightLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(s,t)=>(t??[]).map(n=>s.find(o=>o.id===n)).filter(Boolean),C(e.options,"debugColumns")),e.getCenterLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(s,t,n)=>{const o=[...t??[],...n??[]];return s.filter(r=>!o.includes(r.id))},C(e.options,"debugColumns"))}};function ns(e){return e||(typeof document<"u"?document:null)}const Q={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},re=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ss={getDefaultColumnDef:()=>Q,getInitialState:e=>({columnSizing:{},columnSizingInfo:re(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:P("columnSizing",e),onColumnSizingInfoChange:P("columnSizingInfo",e)}),createColumn:(e,s)=>{e.getSize=()=>{var t,n,o;const r=s.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:Q.minSize,(n=r??e.columnDef.size)!=null?n:Q.size),(o=e.columnDef.maxSize)!=null?o:Q.maxSize)},e.getStart=S(t=>[t,U(s,t),s.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((o,r)=>o+r.getSize(),0),C(s.options,"debugColumns")),e.getAfter=S(t=>[t,U(s,t),s.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((o,r)=>o+r.getSize(),0),C(s.options,"debugColumns")),e.resetSize=()=>{s.setColumnSizing(t=>{let{[e.id]:n,...o}=t;return o})},e.getCanResize=()=>{var t,n;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((n=s.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>s.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,s)=>{e.getSize=()=>{let t=0;const n=o=>{if(o.subHeaders.length)o.subHeaders.forEach(n);else{var r;t+=(r=o.column.getSize())!=null?r:0}};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const n=s.getColumn(e.column.id),o=n==null?void 0:n.getCanResize();return r=>{if(!n||!o||(r.persist==null||r.persist(),ie(r)&&r.touches&&r.touches.length>1))return;const a=e.getSize(),l=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[n.id,n.getSize()]],u=ie(r)?Math.round(r.touches[0].clientX):r.clientX,d={},f=(v,w)=>{typeof w=="number"&&(s.setColumnSizingInfo(R=>{var j,_;const V=s.options.columnResizeDirection==="rtl"?-1:1,O=(w-((j=R==null?void 0:R.startOffset)!=null?j:0))*V,N=Math.max(O/((_=R==null?void 0:R.startSize)!=null?_:0),-.999999);return R.columnSizingStart.forEach(F=>{let[L,je]=F;d[L]=Math.round(Math.max(je+je*N,0)*100)/100}),{...R,deltaOffset:O,deltaPercentage:N}}),(s.options.columnResizeMode==="onChange"||v==="end")&&s.setColumnSizing(R=>({...R,...d})))},h=v=>f("move",v),g=v=>{f("end",v),s.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=ns(t),p={moveHandler:v=>h(v.clientX),upHandler:v=>{c==null||c.removeEventListener("mousemove",p.moveHandler),c==null||c.removeEventListener("mouseup",p.upHandler),g(v.clientX)}},m={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),h(v.touches[0].clientX),!1),upHandler:v=>{var w;c==null||c.removeEventListener("touchmove",m.moveHandler),c==null||c.removeEventListener("touchend",m.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),g((w=v.touches[0])==null?void 0:w.clientX)}},x=os()?{passive:!1}:!1;ie(r)?(c==null||c.addEventListener("touchmove",m.moveHandler,x),c==null||c.addEventListener("touchend",m.upHandler,x)):(c==null||c.addEventListener("mousemove",p.moveHandler,x),c==null||c.addEventListener("mouseup",p.upHandler,x)),s.setColumnSizingInfo(v=>({...v,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=s=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(s),e.setColumnSizingInfo=s=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(s),e.resetColumnSizing=s=>{var t;e.setColumnSizing(s?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=s=>{var t;e.setColumnSizingInfo(s?re():(t=e.initialState.columnSizingInfo)!=null?t:re())},e.getTotalSize=()=>{var s,t;return(s=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((n,o)=>n+o.getSize(),0))!=null?s:0},e.getLeftTotalSize=()=>{var s,t;return(s=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((n,o)=>n+o.getSize(),0))!=null?s:0},e.getCenterTotalSize=()=>{var s,t;return(s=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((n,o)=>n+o.getSize(),0))!=null?s:0},e.getRightTotalSize=()=>{var s,t;return(s=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((n,o)=>n+o.getSize(),0))!=null?s:0}}};let Z=null;function os(){if(typeof Z=="boolean")return Z;let e=!1;try{const s={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,s),window.removeEventListener("test",t)}catch{e=!1}return Z=e,Z}function ie(e){return e.type==="touchstart"}const rs={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:P("columnVisibility",e)}),createColumn:(e,s)=>{e.toggleVisibility=t=>{e.getCanHide()&&s.setColumnVisibility(n=>({...n,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,n;const o=e.columns;return(t=o.length?o.some(r=>r.getIsVisible()):(n=s.getState().columnVisibility)==null?void 0:n[e.id])!=null?t:!0},e.getCanHide=()=>{var t,n;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((n=s.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,s)=>{e._getAllVisibleCells=S(()=>[e.getAllCells(),s.getState().columnVisibility],t=>t.filter(n=>n.column.getIsVisible()),C(s.options,"debugRows")),e.getVisibleCells=S(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,n,o)=>[...t,...n,...o],C(s.options,"debugRows"))},createTable:e=>{const s=(t,n)=>S(()=>[n(),n().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(r=>r.getIsVisible==null?void 0:r.getIsVisible()),C(e.options,"debugColumns"));e.getVisibleFlatColumns=s("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=s("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=s("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=s("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=s("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=(n=t)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,r)=>({...o,[r.id]:t||!(r.getCanHide!=null&&r.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible((n=t.target)==null?void 0:n.checked)}}};function U(e,s){return s?s==="center"?e.getCenterVisibleLeafColumns():s==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const is={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},as={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:P("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:s=>{var t;const n=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[s.id])==null?void 0:t.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,s)=>{e.getCanGlobalFilter=()=>{var t,n,o,r;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((n=s.options.enableGlobalFilter)!=null?n:!0)&&((o=s.options.enableFilters)!=null?o:!0)&&((r=s.options.getColumnCanGlobalFilter==null?void 0:s.options.getColumnCanGlobalFilter(e))!=null?r:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>k.includesString,e.getGlobalFilterFn=()=>{var s,t;const{globalFilterFn:n}=e.options;return ee(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(s=(t=e.options.filterFns)==null?void 0:t[n])!=null?s:k[n]},e.setGlobalFilter=s=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(s)},e.resetGlobalFilter=s=>{e.setGlobalFilter(s?void 0:e.initialState.globalFilter)}}},ls={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:P("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let s=!1,t=!1;e._autoResetExpanded=()=>{var n,o;if(!s){e._queue(()=>{s=!0});return}if((n=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var o,r;e.setExpanded(n?{}:(o=(r=e.initialState)==null?void 0:r.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(r=>{const a=r.split(".");n=Math.max(n,a.length)}),n},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,s)=>{e.toggleExpanded=t=>{s.setExpanded(n=>{var o;const r=n===!0?!0:!!(n!=null&&n[e.id]);let a={};if(n===!0?Object.keys(s.getRowModel().rowsById).forEach(l=>{a[l]=!0}):a=n,t=(o=t)!=null?o:!r,!r&&t)return{...a,[e.id]:!0};if(r&&!t){const{[e.id]:l,...u}=a;return u}return n})},e.getIsExpanded=()=>{var t;const n=s.getState().expanded;return!!((t=s.options.getIsRowExpanded==null?void 0:s.options.getIsRowExpanded(e))!=null?t:n===!0||n!=null&&n[e.id])},e.getCanExpand=()=>{var t,n,o;return(t=s.options.getRowCanExpand==null?void 0:s.options.getRowCanExpand(e))!=null?t:((n=s.options.enableExpanding)!=null?n:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let t=!0,n=e;for(;t&&n.parentId;)n=s.getRow(n.parentId,!0),t=n.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},fe=0,me=10,ae=()=>({pageIndex:fe,pageSize:me}),us={getInitialState:e=>({...e,pagination:{...ae(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:P("pagination",e)}),createTable:e=>{let s=!1,t=!1;e._autoResetPageIndex=()=>{var n,o;if(!s){e._queue(()=>{s=!0});return}if((n=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=n=>{const o=r=>T(n,r);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=n=>{var o;e.setPagination(n?ae():(o=e.initialState.pagination)!=null?o:ae())},e.setPageIndex=n=>{e.setPagination(o=>{let r=T(n,o.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,a)),{...o,pageIndex:r}})},e.resetPageIndex=n=>{var o,r;e.setPageIndex(n?fe:(o=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageIndex)!=null?o:fe)},e.resetPageSize=n=>{var o,r;e.setPageSize(n?me:(o=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageSize)!=null?o:me)},e.setPageSize=n=>{e.setPagination(o=>{const r=Math.max(1,T(n,o.pageSize)),a=o.pageSize*o.pageIndex,l=Math.floor(a/r);return{...o,pageIndex:l,pageSize:r}})},e.setPageCount=n=>e.setPagination(o=>{var r;let a=T(n,(r=e.options.pageCount)!=null?r:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),e.getPageOptions=S(()=>[e.getPageCount()],n=>{let o=[];return n&&n>0&&(o=[...new Array(n)].fill(null).map((r,a)=>a)),o},C(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:n<o-1},e.previousPage=()=>e.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},le=()=>({top:[],bottom:[]}),ds={getInitialState:e=>({rowPinning:le(),...e}),getDefaultOptions:e=>({onRowPinningChange:P("rowPinning",e)}),createRow:(e,s)=>{e.pin=(t,n,o)=>{const r=n?e.getLeafRows().map(u=>{let{id:d}=u;return d}):[],a=o?e.getParentRows().map(u=>{let{id:d}=u;return d}):[],l=new Set([...a,e.id,...r]);s.setRowPinning(u=>{var d,f;if(t==="bottom"){var h,g;return{top:((h=u==null?void 0:u.top)!=null?h:[]).filter(m=>!(l!=null&&l.has(m))),bottom:[...((g=u==null?void 0:u.bottom)!=null?g:[]).filter(m=>!(l!=null&&l.has(m))),...Array.from(l)]}}if(t==="top"){var c,p;return{top:[...((c=u==null?void 0:u.top)!=null?c:[]).filter(m=>!(l!=null&&l.has(m))),...Array.from(l)],bottom:((p=u==null?void 0:u.bottom)!=null?p:[]).filter(m=>!(l!=null&&l.has(m)))}}return{top:((d=u==null?void 0:u.top)!=null?d:[]).filter(m=>!(l!=null&&l.has(m))),bottom:((f=u==null?void 0:u.bottom)!=null?f:[]).filter(m=>!(l!=null&&l.has(m)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:n,enablePinning:o}=s.options;return typeof n=="function"?n(e):(t=n??o)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:n,bottom:o}=s.getState().rowPinning,r=t.some(l=>n==null?void 0:n.includes(l)),a=t.some(l=>o==null?void 0:o.includes(l));return r?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var t,n;const o=e.getIsPinned();if(!o)return-1;const r=(t=o==="top"?s.getTopRows():s.getBottomRows())==null?void 0:t.map(a=>{let{id:l}=a;return l});return(n=r==null?void 0:r.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=s=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(s),e.resetRowPinning=s=>{var t,n;return e.setRowPinning(s?le():(t=(n=e.initialState)==null?void 0:n.rowPinning)!=null?t:le())},e.getIsSomeRowsPinned=s=>{var t;const n=e.getState().rowPinning;if(!s){var o,r;return!!((o=n.top)!=null&&o.length||(r=n.bottom)!=null&&r.length)}return!!((t=n[s])!=null&&t.length)},e._getPinnedRows=(s,t,n)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(t??[]).map(a=>{const l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(t??[]).map(a=>s.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:n}))},e.getTopRows=S(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(s,t)=>e._getPinnedRows(s,t,"top"),C(e.options,"debugRows")),e.getBottomRows=S(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(s,t)=>e._getPinnedRows(s,t,"bottom"),C(e.options,"debugRows")),e.getCenterRows=S(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(s,t,n)=>{const o=new Set([...t??[],...n??[]]);return s.filter(r=>!o.has(r.id))},C(e.options,"debugRows"))}},cs={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:P("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=s=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(s),e.resetRowSelection=s=>{var t;return e.setRowSelection(s?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=s=>{e.setRowSelection(t=>{s=typeof s<"u"?s:!e.getIsAllRowsSelected();const n={...t},o=e.getPreGroupedRowModel().flatRows;return s?o.forEach(r=>{r.getCanSelect()&&(n[r.id]=!0)}):o.forEach(r=>{delete n[r.id]}),n})},e.toggleAllPageRowsSelected=s=>e.setRowSelection(t=>{const n=typeof s<"u"?s:!e.getIsAllPageRowsSelected(),o={...t};return e.getRowModel().rows.forEach(r=>{pe(o,r.id,n,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=S(()=>[e.getState().rowSelection,e.getCoreRowModel()],(s,t)=>Object.keys(s).length?ue(e,t):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getFilteredSelectedRowModel=S(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(s,t)=>Object.keys(s).length?ue(e,t):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getGroupedSelectedRowModel=S(()=>[e.getState().rowSelection,e.getSortedRowModel()],(s,t)=>Object.keys(s).length?ue(e,t):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const s=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let n=!!(s.length&&Object.keys(t).length);return n&&s.some(o=>o.getCanSelect()&&!t[o.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const s=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:t}=e.getState();let n=!!s.length;return n&&s.some(o=>!t[o.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var s;const t=Object.keys((s=e.getState().rowSelection)!=null?s:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const s=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:s.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>s=>{e.toggleAllRowsSelected(s.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>s=>{e.toggleAllPageRowsSelected(s.target.checked)}},createRow:(e,s)=>{e.toggleSelected=(t,n)=>{const o=e.getIsSelected();s.setRowSelection(r=>{var a;if(t=typeof t<"u"?t:!o,e.getCanSelect()&&o===t)return r;const l={...r};return pe(l,e.id,t,(a=n==null?void 0:n.selectChildren)!=null?a:!0,s),l})},e.getIsSelected=()=>{const{rowSelection:t}=s.getState();return Re(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=s.getState();return he(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=s.getState();return he(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof s.options.enableRowSelection=="function"?s.options.enableRowSelection(e):(t=s.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof s.options.enableSubRowSelection=="function"?s.options.enableSubRowSelection(e):(t=s.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof s.options.enableMultiRowSelection=="function"?s.options.enableMultiRowSelection(e):(t=s.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected((o=n.target)==null?void 0:o.checked)}}}},pe=(e,s,t,n,o)=>{var r;const a=o.getRow(s,!0);t?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[s]=!0)):delete e[s],n&&(r=a.subRows)!=null&&r.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>pe(e,l.id,t,n,o))};function ue(e,s){const t=e.getState().rowSelection,n=[],o={},r=function(a,l){return a.map(u=>{var d;const f=Re(u,t);if(f&&(n.push(u),o[u.id]=u),(d=u.subRows)!=null&&d.length&&(u={...u,subRows:r(u.subRows)}),f)return u}).filter(Boolean)};return{rows:r(s.rows),flatRows:n,rowsById:o}}function Re(e,s){var t;return(t=s[e.id])!=null?t:!1}function he(e,s,t){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let o=!0,r=!1;return e.subRows.forEach(a=>{if(!(r&&!o)&&(a.getCanSelect()&&(Re(a,s)?r=!0:o=!1),a.subRows&&a.subRows.length)){const l=he(a,s);l==="all"?r=!0:(l==="some"&&(r=!0),o=!1)}}),o?"all":r?"some":!1}const xe=/([0-9]+)/gm,gs=(e,s,t)=>vt(b(e.getValue(t)).toLowerCase(),b(s.getValue(t)).toLowerCase()),fs=(e,s,t)=>vt(b(e.getValue(t)),b(s.getValue(t))),ms=(e,s,t)=>ye(b(e.getValue(t)).toLowerCase(),b(s.getValue(t)).toLowerCase()),ps=(e,s,t)=>ye(b(e.getValue(t)),b(s.getValue(t))),hs=(e,s,t)=>{const n=e.getValue(t),o=s.getValue(t);return n>o?1:n<o?-1:0},xs=(e,s,t)=>ye(e.getValue(t),s.getValue(t));function ye(e,s){return e===s?0:e>s?1:-1}function b(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function vt(e,s){const t=e.split(xe).filter(Boolean),n=s.split(xe).filter(Boolean);for(;t.length&&n.length;){const o=t.shift(),r=n.shift(),a=parseInt(o,10),l=parseInt(r,10),u=[a,l].sort();if(isNaN(u[0])){if(o>r)return 1;if(r>o)return-1;continue}if(isNaN(u[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return t.length-n.length}const B={alphanumeric:gs,alphanumericCaseSensitive:fs,text:ms,textCaseSensitive:ps,datetime:hs,basic:xs},vs={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:P("sorting",e),isMultiSortEvent:s=>s.shiftKey}),createColumn:(e,s)=>{e.getAutoSortingFn=()=>{const t=s.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const o of t){const r=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(r)==="[object Date]")return B.datetime;if(typeof r=="string"&&(n=!0,r.split(xe).length>1))return B.alphanumeric}return n?B.text:B.basic},e.getAutoSortDir=()=>{const t=s.getFilteredRowModel().flatRows[0];return typeof(t==null?void 0:t.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,n;if(!e)throw new Error;return ee(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(n=s.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?t:B[e.columnDef.sortingFn]},e.toggleSorting=(t,n)=>{const o=e.getNextSortingOrder(),r=typeof t<"u"&&t!==null;s.setSorting(a=>{const l=a==null?void 0:a.find(c=>c.id===e.id),u=a==null?void 0:a.findIndex(c=>c.id===e.id);let d=[],f,h=r?t:o==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&n?l?f="toggle":f="add":a!=null&&a.length&&u!==a.length-1?f="replace":l?f="toggle":f="replace",f==="toggle"&&(r||o||(f="remove")),f==="add"){var g;d=[...a,{id:e.id,desc:h}],d.splice(0,d.length-((g=s.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else f==="toggle"?d=a.map(c=>c.id===e.id?{...c,desc:h}:c):f==="remove"?d=a.filter(c=>c.id!==e.id):d=[{id:e.id,desc:h}];return d})},e.getFirstSortDir=()=>{var t,n;return((t=(n=e.columnDef.sortDescFirst)!=null?n:s.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var n,o;const r=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==r&&((n=s.options.enableSortingRemoval)==null||n)&&(!(t&&(o=s.options.enableMultiRemove)!=null)||o)?!1:a==="desc"?"asc":"desc":r},e.getCanSort=()=>{var t,n;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((n=s.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,n;return(t=(n=e.columnDef.enableMultiSort)!=null?n:s.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const n=(t=s.getState().sorting)==null?void 0:t.find(o=>o.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,n;return(t=(n=s.getState().sorting)==null?void 0:n.findIndex(o=>o.id===e.id))!=null?t:-1},e.clearSorting=()=>{s.setSorting(t=>t!=null&&t.length?t.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return n=>{t&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?s.options.isMultiSortEvent==null?void 0:s.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=s=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(s),e.resetSorting=s=>{var t,n;e.setSorting(s?[]:(t=(n=e.initialState)==null?void 0:n.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Ss=[bn,rs,es,ts,Gn,Hn,is,as,vs,Zn,ls,us,ds,cs,ss];function Cs(e){var s,t;const n=[...Ss,...(s=e._features)!=null?s:[]];let o={_features:n};const r=o._features.reduce((g,c)=>Object.assign(g,c.getDefaultOptions==null?void 0:c.getDefaultOptions(o)),{}),a=g=>o.options.mergeOptions?o.options.mergeOptions(r,g):{...r,...g};let u={...{},...(t=e.initialState)!=null?t:{}};o._features.forEach(g=>{var c;u=(c=g.getInitialState==null?void 0:g.getInitialState(u))!=null?c:u});const d=[];let f=!1;const h={_features:n,options:{...r,...e},initialState:u,_queue:g=>{d.push(g),f||(f=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();f=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{o.setState(o.initialState)},setOptions:g=>{const c=T(g,o.options);o.options=a(c)},getState:()=>o.options.state,setState:g=>{o.options.onStateChange==null||o.options.onStateChange(g)},_getRowId:(g,c,p)=>{var m;return(m=o.options.getRowId==null?void 0:o.options.getRowId(g,c,p))!=null?m:`${p?[p.id,c].join("."):c}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(g,c)=>{let p=(c?o.getPrePaginationRowModel():o.getRowModel()).rowsById[g];if(!p&&(p=o.getCoreRowModel().rowsById[g],!p))throw new Error;return p},_getDefaultColumnDef:S(()=>[o.options.defaultColumn],g=>{var c;return g=(c=g)!=null?c:{},{header:p=>{const m=p.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:p=>{var m,x;return(m=(x=p.renderValue())==null||x.toString==null?void 0:x.toString())!=null?m:null},...o._features.reduce((p,m)=>Object.assign(p,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...g}},C(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:S(()=>[o._getColumnDefs()],g=>{const c=function(p,m,x){return x===void 0&&(x=0),p.map(v=>{const w=Tn(o,v,x,m),R=v;return w.columns=R.columns?c(R.columns,w,x+1):[],w})};return c(g)},C(e,"debugColumns")),getAllFlatColumns:S(()=>[o.getAllColumns()],g=>g.flatMap(c=>c.getFlatColumns()),C(e,"debugColumns")),_getAllFlatColumnsById:S(()=>[o.getAllFlatColumns()],g=>g.reduce((c,p)=>(c[p.id]=p,c),{}),C(e,"debugColumns")),getAllLeafColumns:S(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(g,c)=>{let p=g.flatMap(m=>m.getLeafColumns());return c(p)},C(e,"debugColumns")),getColumn:g=>o._getAllFlatColumnsById()[g]};Object.assign(o,h);for(let g=0;g<o._features.length;g++){const c=o._features[g];c==null||c.createTable==null||c.createTable(o)}return o}function ws(){return e=>S(()=>[e.options.data],s=>{const t={rows:[],flatRows:[],rowsById:{}},n=function(o,r,a){r===void 0&&(r=0);const l=[];for(let d=0;d<o.length;d++){const f=Ln(e,e._getRowId(o[d],d,a),o[d],d,r,void 0,a==null?void 0:a.id);if(t.flatRows.push(f),t.rowsById[f.id]=f,l.push(f),e.options.getSubRows){var u;f.originalSubRows=e.options.getSubRows(o[d],d),(u=f.originalSubRows)!=null&&u.length&&(f.subRows=n(f.originalSubRows,r+1,f))}}return l};return t.rows=n(s),t},C(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}/**
19
+ color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t==null?void 0:t.key)}return o}}function C(e,s,t,n){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[s]},key:!1,onChange:n}}function zn(e,s,t,n){const o=()=>{var a;return(a=r.getValue())!=null?a:e.options.renderFallbackValue},r={id:`${s.id}_${t.id}`,row:s,column:t,getValue:()=>s.getValue(n),renderValue:o,getContext:S(()=>[e,t,s,r],(a,l,u,d)=>({table:a,column:l,row:u,cell:d,getValue:d.getValue,renderValue:d.renderValue}),C(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(r,t,s,e)},{}),r}function Tn(e,s,t,n){var o,r;const l={...e._getDefaultColumnDef(),...s},u=l.accessorKey;let d=(o=(r=l.id)!=null?r:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof l.header=="string"?l.header:void 0,f;if(l.accessorFn?f=l.accessorFn:u&&(u.includes(".")?f=g=>{let c=g;for(const m of u.split(".")){var p;c=(p=c)==null?void 0:p[m]}return c}:f=g=>g[l.accessorKey]),!d)throw new Error;let h={id:`${String(d)}`,accessorFn:f,parent:n,depth:t,columnDef:l,columns:[],getFlatColumns:S(()=>[!0],()=>{var g;return[h,...(g=h.columns)==null?void 0:g.flatMap(c=>c.getFlatColumns())]},C(e.options,"debugColumns")),getLeafColumns:S(()=>[e._getOrderColumnsFn()],g=>{var c;if((c=h.columns)!=null&&c.length){let p=h.columns.flatMap(m=>m.getLeafColumns());return g(p)}return[h]},C(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(h,e);return h}const M="debugHeaders";function ze(e,s,t){var n;let r={id:(n=t.id)!=null?n:s.id,column:s,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],l=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(l),a.push(u)};return l(r),a},getContext:()=>({table:e,header:r,column:s})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(r,e)}),r}const bn={createTable:e=>{e.getHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(s,t,n,o)=>{var r,a;const l=(r=n==null?void 0:n.map(h=>t.find(g=>g.id===h)).filter(Boolean))!=null?r:[],u=(a=o==null?void 0:o.map(h=>t.find(g=>g.id===h)).filter(Boolean))!=null?a:[],d=t.filter(h=>!(n!=null&&n.includes(h.id))&&!(o!=null&&o.includes(h.id)));return W(s,[...l,...d,...u],e)},C(e.options,M)),e.getCenterHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(s,t,n,o)=>(t=t.filter(r=>!(n!=null&&n.includes(r.id))&&!(o!=null&&o.includes(r.id))),W(s,t,e,"center")),C(e.options,M)),e.getLeftHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(s,t,n)=>{var o;const r=(o=n==null?void 0:n.map(a=>t.find(l=>l.id===a)).filter(Boolean))!=null?o:[];return W(s,r,e,"left")},C(e.options,M)),e.getRightHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(s,t,n)=>{var o;const r=(o=n==null?void 0:n.map(a=>t.find(l=>l.id===a)).filter(Boolean))!=null?o:[];return W(s,r,e,"right")},C(e.options,M)),e.getFooterGroups=S(()=>[e.getHeaderGroups()],s=>[...s].reverse(),C(e.options,M)),e.getLeftFooterGroups=S(()=>[e.getLeftHeaderGroups()],s=>[...s].reverse(),C(e.options,M)),e.getCenterFooterGroups=S(()=>[e.getCenterHeaderGroups()],s=>[...s].reverse(),C(e.options,M)),e.getRightFooterGroups=S(()=>[e.getRightHeaderGroups()],s=>[...s].reverse(),C(e.options,M)),e.getFlatHeaders=S(()=>[e.getHeaderGroups()],s=>s.map(t=>t.headers).flat(),C(e.options,M)),e.getLeftFlatHeaders=S(()=>[e.getLeftHeaderGroups()],s=>s.map(t=>t.headers).flat(),C(e.options,M)),e.getCenterFlatHeaders=S(()=>[e.getCenterHeaderGroups()],s=>s.map(t=>t.headers).flat(),C(e.options,M)),e.getRightFlatHeaders=S(()=>[e.getRightHeaderGroups()],s=>s.map(t=>t.headers).flat(),C(e.options,M)),e.getCenterLeafHeaders=S(()=>[e.getCenterFlatHeaders()],s=>s.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,M)),e.getLeftLeafHeaders=S(()=>[e.getLeftFlatHeaders()],s=>s.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,M)),e.getRightLeafHeaders=S(()=>[e.getRightFlatHeaders()],s=>s.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,M)),e.getLeafHeaders=S(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(s,t,n)=>{var o,r,a,l,u,d;return[...(o=(r=s[0])==null?void 0:r.headers)!=null?o:[],...(a=(l=t[0])==null?void 0:l.headers)!=null?a:[],...(u=(d=n[0])==null?void 0:d.headers)!=null?u:[]].map(f=>f.getLeafHeaders()).flat()},C(e.options,M))}};function W(e,s,t,n){var o,r;let a=0;const l=function(g,c){c===void 0&&(c=1),a=Math.max(a,c),g.filter(p=>p.getIsVisible()).forEach(p=>{var m;(m=p.columns)!=null&&m.length&&l(p.columns,c+1)},0)};l(e);let u=[];const d=(g,c)=>{const p={depth:c,id:[n,`${c}`].filter(Boolean).join("_"),headers:[]},m=[];g.forEach(x=>{const v=[...m].reverse()[0],w=x.column.depth===p.depth;let R,j=!1;if(w&&x.column.parent?R=x.column.parent:(R=x.column,j=!0),v&&(v==null?void 0:v.column)===R)v.subHeaders.push(x);else{const _=ze(t,R,{id:[n,c,R.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:j,placeholderId:j?`${m.filter(V=>V.column===R).length}`:void 0,depth:c,index:m.length});_.subHeaders.push(x),m.push(_)}p.headers.push(x),x.headerGroup=p}),u.push(p),c>0&&d(m,c-1)},f=s.map((g,c)=>ze(t,g,{depth:a,index:c}));d(f,a-1),u.reverse();const h=g=>g.filter(p=>p.column.getIsVisible()).map(p=>{let m=0,x=0,v=[0];p.subHeaders&&p.subHeaders.length?(v=[],h(p.subHeaders).forEach(R=>{let{colSpan:j,rowSpan:_}=R;m+=j,v.push(_)})):m=1;const w=Math.min(...v);return x=x+w,p.colSpan=m,p.rowSpan=x,{colSpan:m,rowSpan:x}});return h((o=(r=u[0])==null?void 0:r.headers)!=null?o:[]),u}const Ln=(e,s,t,n,o,r,a)=>{let l={id:s,index:n,original:t,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(l._valuesCache.hasOwnProperty(u))return l._valuesCache[u];const d=e.getColumn(u);if(d!=null&&d.accessorFn)return l._valuesCache[u]=d.accessorFn(l.original,n),l._valuesCache[u]},getUniqueValues:u=>{if(l._uniqueValuesCache.hasOwnProperty(u))return l._uniqueValuesCache[u];const d=e.getColumn(u);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(l._uniqueValuesCache[u]=d.columnDef.getUniqueValues(l.original,n),l._uniqueValuesCache[u]):(l._uniqueValuesCache[u]=[l.getValue(u)],l._uniqueValuesCache[u])},renderValue:u=>{var d;return(d=l.getValue(u))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>kn(l.subRows,u=>u.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let u=[],d=l;for(;;){const f=d.getParentRow();if(!f)break;u.push(f),d=f}return u.reverse()},getAllCells:S(()=>[e.getAllLeafColumns()],u=>u.map(d=>zn(e,l,d,d.id)),C(e.options,"debugRows")),_getAllCellsByColumnId:S(()=>[l.getAllCells()],u=>u.reduce((d,f)=>(d[f.column.id]=f,d),{}),C(e.options,"debugRows"))};for(let u=0;u<e._features.length;u++){const d=e._features[u];d==null||d.createRow==null||d.createRow(l,e)}return l},Hn={createColumn:(e,s)=>{e._getFacetedRowModel=s.options.getFacetedRowModel&&s.options.getFacetedRowModel(s,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():s.getPreFilteredRowModel(),e._getFacetedUniqueValues=s.options.getFacetedUniqueValues&&s.options.getFacetedUniqueValues(s,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=s.options.getFacetedMinMaxValues&&s.options.getFacetedMinMaxValues(s,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},dt=(e,s,t)=>{var n,o;const r=t==null||(n=t.toString())==null?void 0:n.toLowerCase();return!!(!((o=e.getValue(s))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(r))};dt.autoRemove=e=>D(e);const ct=(e,s,t)=>{var n;return!!(!((n=e.getValue(s))==null||(n=n.toString())==null)&&n.includes(t))};ct.autoRemove=e=>D(e);const gt=(e,s,t)=>{var n;return((n=e.getValue(s))==null||(n=n.toString())==null?void 0:n.toLowerCase())===(t==null?void 0:t.toLowerCase())};gt.autoRemove=e=>D(e);const ft=(e,s,t)=>{var n;return(n=e.getValue(s))==null?void 0:n.includes(t)};ft.autoRemove=e=>D(e);const mt=(e,s,t)=>!t.some(n=>{var o;return!((o=e.getValue(s))!=null&&o.includes(n))});mt.autoRemove=e=>D(e)||!(e!=null&&e.length);const pt=(e,s,t)=>t.some(n=>{var o;return(o=e.getValue(s))==null?void 0:o.includes(n)});pt.autoRemove=e=>D(e)||!(e!=null&&e.length);const ht=(e,s,t)=>e.getValue(s)===t;ht.autoRemove=e=>D(e);const xt=(e,s,t)=>e.getValue(s)==t;xt.autoRemove=e=>D(e);const we=(e,s,t)=>{let[n,o]=t;const r=e.getValue(s);return r>=n&&r<=o};we.resolveFilterValue=e=>{let[s,t]=e,n=typeof s!="number"?parseFloat(s):s,o=typeof t!="number"?parseFloat(t):t,r=s===null||Number.isNaN(n)?-1/0:n,a=t===null||Number.isNaN(o)?1/0:o;if(r>a){const l=r;r=a,a=l}return[r,a]};we.autoRemove=e=>D(e)||D(e[0])&&D(e[1]);const k={includesString:dt,includesStringSensitive:ct,equalsString:gt,arrIncludes:ft,arrIncludesAll:mt,arrIncludesSome:pt,equals:ht,weakEquals:xt,inNumberRange:we};function D(e){return e==null||e===""}const Gn={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:P("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,s)=>{e.getAutoFilterFn=()=>{const t=s.getCoreRowModel().flatRows[0],n=t==null?void 0:t.getValue(e.id);return typeof n=="string"?k.includesString:typeof n=="number"?k.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?k.equals:Array.isArray(n)?k.arrIncludes:k.weakEquals},e.getFilterFn=()=>{var t,n;return ee(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(n=s.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?t:k[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,n,o;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((n=s.options.enableColumnFilters)!=null?n:!0)&&((o=s.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=s.getState().columnFilters)==null||(t=t.find(n=>n.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,n;return(t=(n=s.getState().columnFilters)==null?void 0:n.findIndex(o=>o.id===e.id))!=null?t:-1},e.setFilterValue=t=>{s.setColumnFilters(n=>{const o=e.getFilterFn(),r=n==null?void 0:n.find(f=>f.id===e.id),a=T(t,r?r.value:void 0);if(Te(o,a,e)){var l;return(l=n==null?void 0:n.filter(f=>f.id!==e.id))!=null?l:[]}const u={id:e.id,value:a};if(r){var d;return(d=n==null?void 0:n.map(f=>f.id===e.id?u:f))!=null?d:[]}return n!=null&&n.length?[...n,u]:[u]})}},createRow:(e,s)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=s=>{const t=e.getAllLeafColumns(),n=o=>{var r;return(r=T(s,o))==null?void 0:r.filter(a=>{const l=t.find(u=>u.id===a.id);if(l){const u=l.getFilterFn();if(Te(u,a.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=s=>{var t,n;e.setColumnFilters(s?[]:(t=(n=e.initialState)==null?void 0:n.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Te(e,s,t){return(e&&e.autoRemove?e.autoRemove(s,t):!1)||typeof s>"u"||typeof s=="string"&&!s}const On=(e,s,t)=>t.reduce((n,o)=>{const r=o.getValue(e);return n+(typeof r=="number"?r:0)},0),Bn=(e,s,t)=>{let n;return t.forEach(o=>{const r=o.getValue(e);r!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}),n},qn=(e,s,t)=>{let n;return t.forEach(o=>{const r=o.getValue(e);r!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}),n},Un=(e,s,t)=>{let n,o;return t.forEach(r=>{const a=r.getValue(e);a!=null&&(n===void 0?a>=a&&(n=o=a):(n>a&&(n=a),o<a&&(o=a)))}),[n,o]},Kn=(e,s)=>{let t=0,n=0;if(s.forEach(o=>{let r=o.getValue(e);r!=null&&(r=+r)>=r&&(++t,n+=r)}),t)return n/t},Yn=(e,s)=>{if(!s.length)return;const t=s.map(r=>r.getValue(e));if(!Dn(t))return;if(t.length===1)return t[0];const n=Math.floor(t.length/2),o=t.sort((r,a)=>r-a);return t.length%2!==0?o[n]:(o[n-1]+o[n])/2},Xn=(e,s)=>Array.from(new Set(s.map(t=>t.getValue(e))).values()),Wn=(e,s)=>new Set(s.map(t=>t.getValue(e))).size,Qn=(e,s)=>s.length,se={sum:On,min:Bn,max:qn,extent:Un,mean:Kn,median:Yn,unique:Xn,uniqueCount:Wn,count:Qn},Zn={getDefaultColumnDef:()=>({aggregatedCell:e=>{var s,t;return(s=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?s:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:P("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,s)=>{e.toggleGrouping=()=>{s.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(n=>n!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,n;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((n=s.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=s.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=s.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=s.getCoreRowModel().flatRows[0],n=t==null?void 0:t.getValue(e.id);if(typeof n=="number")return se.sum;if(Object.prototype.toString.call(n)==="[object Date]")return se.extent},e.getAggregationFn=()=>{var t,n;if(!e)throw new Error;return ee(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(n=s.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?t:se[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=s=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(s),e.resetGrouping=s=>{var t,n;e.setGrouping(s?[]:(t=(n=e.initialState)==null?void 0:n.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,s)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const n=s.getColumn(t);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[t]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,s,t,n)=>{e.getIsGrouped=()=>s.getIsGrouped()&&s.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&s.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=t.subRows)!=null&&o.length)}}};function Jn(e,s,t){if(!(s!=null&&s.length)||!t)return e;const n=e.filter(r=>!s.includes(r.id));return t==="remove"?n:[...s.map(r=>e.find(a=>a.id===r)).filter(Boolean),...n]}const es={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:P("columnOrder",e)}),createColumn:(e,s)=>{e.getIndex=S(t=>[U(s,t)],t=>t.findIndex(n=>n.id===e.id),C(s.options,"debugColumns")),e.getIsFirstColumn=t=>{var n;return((n=U(s,t)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=t=>{var n;const o=U(s,t);return((n=o[o.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=s=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(s),e.resetColumnOrder=s=>{var t;e.setColumnOrder(s?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=S(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(s,t,n)=>o=>{let r=[];if(!(s!=null&&s.length))r=o;else{const a=[...s],l=[...o];for(;l.length&&a.length;){const u=a.shift(),d=l.findIndex(f=>f.id===u);d>-1&&r.push(l.splice(d,1)[0])}r=[...r,...l]}return Jn(r,t,n)},C(e.options,"debugTable"))}},oe=()=>({left:[],right:[]}),ts={getInitialState:e=>({columnPinning:oe(),...e}),getDefaultOptions:e=>({onColumnPinningChange:P("columnPinning",e)}),createColumn:(e,s)=>{e.pin=t=>{const n=e.getLeafColumns().map(o=>o.id).filter(Boolean);s.setColumnPinning(o=>{var r,a;if(t==="right"){var l,u;return{left:((l=o==null?void 0:o.left)!=null?l:[]).filter(h=>!(n!=null&&n.includes(h))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(h=>!(n!=null&&n.includes(h))),...n]}}if(t==="left"){var d,f;return{left:[...((d=o==null?void 0:o.left)!=null?d:[]).filter(h=>!(n!=null&&n.includes(h))),...n],right:((f=o==null?void 0:o.right)!=null?f:[]).filter(h=>!(n!=null&&n.includes(h)))}}return{left:((r=o==null?void 0:o.left)!=null?r:[]).filter(h=>!(n!=null&&n.includes(h))),right:((a=o==null?void 0:o.right)!=null?a:[]).filter(h=>!(n!=null&&n.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var o,r,a;return((o=n.columnDef.enablePinning)!=null?o:!0)&&((r=(a=s.options.enableColumnPinning)!=null?a:s.options.enablePinning)!=null?r:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(l=>l.id),{left:n,right:o}=s.getState().columnPinning,r=t.some(l=>n==null?void 0:n.includes(l)),a=t.some(l=>o==null?void 0:o.includes(l));return r?"left":a?"right":!1},e.getPinnedIndex=()=>{var t,n;const o=e.getIsPinned();return o?(t=(n=s.getState().columnPinning)==null||(n=n[o])==null?void 0:n.indexOf(e.id))!=null?t:-1:0}},createRow:(e,s)=>{e.getCenterVisibleCells=S(()=>[e._getAllVisibleCells(),s.getState().columnPinning.left,s.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(a=>!r.includes(a.column.id))},C(s.options,"debugRows")),e.getLeftVisibleCells=S(()=>[e._getAllVisibleCells(),s.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(a=>a.column.id===r)).filter(Boolean).map(r=>({...r,position:"left"})),C(s.options,"debugRows")),e.getRightVisibleCells=S(()=>[e._getAllVisibleCells(),s.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(a=>a.column.id===r)).filter(Boolean).map(r=>({...r,position:"right"})),C(s.options,"debugRows"))},createTable:e=>{e.setColumnPinning=s=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(s),e.resetColumnPinning=s=>{var t,n;return e.setColumnPinning(s?oe():(t=(n=e.initialState)==null?void 0:n.columnPinning)!=null?t:oe())},e.getIsSomeColumnsPinned=s=>{var t;const n=e.getState().columnPinning;if(!s){var o,r;return!!((o=n.left)!=null&&o.length||(r=n.right)!=null&&r.length)}return!!((t=n[s])!=null&&t.length)},e.getLeftLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(s,t)=>(t??[]).map(n=>s.find(o=>o.id===n)).filter(Boolean),C(e.options,"debugColumns")),e.getRightLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(s,t)=>(t??[]).map(n=>s.find(o=>o.id===n)).filter(Boolean),C(e.options,"debugColumns")),e.getCenterLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(s,t,n)=>{const o=[...t??[],...n??[]];return s.filter(r=>!o.includes(r.id))},C(e.options,"debugColumns"))}};function ns(e){return e||(typeof document<"u"?document:null)}const Q={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},re=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ss={getDefaultColumnDef:()=>Q,getInitialState:e=>({columnSizing:{},columnSizingInfo:re(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:P("columnSizing",e),onColumnSizingInfoChange:P("columnSizingInfo",e)}),createColumn:(e,s)=>{e.getSize=()=>{var t,n,o;const r=s.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:Q.minSize,(n=r??e.columnDef.size)!=null?n:Q.size),(o=e.columnDef.maxSize)!=null?o:Q.maxSize)},e.getStart=S(t=>[t,U(s,t),s.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((o,r)=>o+r.getSize(),0),C(s.options,"debugColumns")),e.getAfter=S(t=>[t,U(s,t),s.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((o,r)=>o+r.getSize(),0),C(s.options,"debugColumns")),e.resetSize=()=>{s.setColumnSizing(t=>{let{[e.id]:n,...o}=t;return o})},e.getCanResize=()=>{var t,n;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((n=s.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>s.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,s)=>{e.getSize=()=>{let t=0;const n=o=>{if(o.subHeaders.length)o.subHeaders.forEach(n);else{var r;t+=(r=o.column.getSize())!=null?r:0}};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const n=s.getColumn(e.column.id),o=n==null?void 0:n.getCanResize();return r=>{if(!n||!o||(r.persist==null||r.persist(),ie(r)&&r.touches&&r.touches.length>1))return;const a=e.getSize(),l=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[n.id,n.getSize()]],u=ie(r)?Math.round(r.touches[0].clientX):r.clientX,d={},f=(v,w)=>{typeof w=="number"&&(s.setColumnSizingInfo(R=>{var j,_;const V=s.options.columnResizeDirection==="rtl"?-1:1,O=(w-((j=R==null?void 0:R.startOffset)!=null?j:0))*V,N=Math.max(O/((_=R==null?void 0:R.startSize)!=null?_:0),-.999999);return R.columnSizingStart.forEach(F=>{let[L,je]=F;d[L]=Math.round(Math.max(je+je*N,0)*100)/100}),{...R,deltaOffset:O,deltaPercentage:N}}),(s.options.columnResizeMode==="onChange"||v==="end")&&s.setColumnSizing(R=>({...R,...d})))},h=v=>f("move",v),g=v=>{f("end",v),s.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=ns(t),p={moveHandler:v=>h(v.clientX),upHandler:v=>{c==null||c.removeEventListener("mousemove",p.moveHandler),c==null||c.removeEventListener("mouseup",p.upHandler),g(v.clientX)}},m={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),h(v.touches[0].clientX),!1),upHandler:v=>{var w;c==null||c.removeEventListener("touchmove",m.moveHandler),c==null||c.removeEventListener("touchend",m.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),g((w=v.touches[0])==null?void 0:w.clientX)}},x=os()?{passive:!1}:!1;ie(r)?(c==null||c.addEventListener("touchmove",m.moveHandler,x),c==null||c.addEventListener("touchend",m.upHandler,x)):(c==null||c.addEventListener("mousemove",p.moveHandler,x),c==null||c.addEventListener("mouseup",p.upHandler,x)),s.setColumnSizingInfo(v=>({...v,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=s=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(s),e.setColumnSizingInfo=s=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(s),e.resetColumnSizing=s=>{var t;e.setColumnSizing(s?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=s=>{var t;e.setColumnSizingInfo(s?re():(t=e.initialState.columnSizingInfo)!=null?t:re())},e.getTotalSize=()=>{var s,t;return(s=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((n,o)=>n+o.getSize(),0))!=null?s:0},e.getLeftTotalSize=()=>{var s,t;return(s=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((n,o)=>n+o.getSize(),0))!=null?s:0},e.getCenterTotalSize=()=>{var s,t;return(s=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((n,o)=>n+o.getSize(),0))!=null?s:0},e.getRightTotalSize=()=>{var s,t;return(s=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((n,o)=>n+o.getSize(),0))!=null?s:0}}};let Z=null;function os(){if(typeof Z=="boolean")return Z;let e=!1;try{const s={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,s),window.removeEventListener("test",t)}catch{e=!1}return Z=e,Z}function ie(e){return e.type==="touchstart"}const rs={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:P("columnVisibility",e)}),createColumn:(e,s)=>{e.toggleVisibility=t=>{e.getCanHide()&&s.setColumnVisibility(n=>({...n,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,n;const o=e.columns;return(t=o.length?o.some(r=>r.getIsVisible()):(n=s.getState().columnVisibility)==null?void 0:n[e.id])!=null?t:!0},e.getCanHide=()=>{var t,n;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((n=s.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,s)=>{e._getAllVisibleCells=S(()=>[e.getAllCells(),s.getState().columnVisibility],t=>t.filter(n=>n.column.getIsVisible()),C(s.options,"debugRows")),e.getVisibleCells=S(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,n,o)=>[...t,...n,...o],C(s.options,"debugRows"))},createTable:e=>{const s=(t,n)=>S(()=>[n(),n().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(r=>r.getIsVisible==null?void 0:r.getIsVisible()),C(e.options,"debugColumns"));e.getVisibleFlatColumns=s("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=s("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=s("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=s("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=s("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=(n=t)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,r)=>({...o,[r.id]:t||!(r.getCanHide!=null&&r.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible((n=t.target)==null?void 0:n.checked)}}};function U(e,s){return s?s==="center"?e.getCenterVisibleLeafColumns():s==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const is={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},as={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:P("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:s=>{var t;const n=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[s.id])==null?void 0:t.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,s)=>{e.getCanGlobalFilter=()=>{var t,n,o,r;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((n=s.options.enableGlobalFilter)!=null?n:!0)&&((o=s.options.enableFilters)!=null?o:!0)&&((r=s.options.getColumnCanGlobalFilter==null?void 0:s.options.getColumnCanGlobalFilter(e))!=null?r:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>k.includesString,e.getGlobalFilterFn=()=>{var s,t;const{globalFilterFn:n}=e.options;return ee(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(s=(t=e.options.filterFns)==null?void 0:t[n])!=null?s:k[n]},e.setGlobalFilter=s=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(s)},e.resetGlobalFilter=s=>{e.setGlobalFilter(s?void 0:e.initialState.globalFilter)}}},ls={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:P("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let s=!1,t=!1;e._autoResetExpanded=()=>{var n,o;if(!s){e._queue(()=>{s=!0});return}if((n=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var o,r;e.setExpanded(n?{}:(o=(r=e.initialState)==null?void 0:r.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(r=>{const a=r.split(".");n=Math.max(n,a.length)}),n},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,s)=>{e.toggleExpanded=t=>{s.setExpanded(n=>{var o;const r=n===!0?!0:!!(n!=null&&n[e.id]);let a={};if(n===!0?Object.keys(s.getRowModel().rowsById).forEach(l=>{a[l]=!0}):a=n,t=(o=t)!=null?o:!r,!r&&t)return{...a,[e.id]:!0};if(r&&!t){const{[e.id]:l,...u}=a;return u}return n})},e.getIsExpanded=()=>{var t;const n=s.getState().expanded;return!!((t=s.options.getIsRowExpanded==null?void 0:s.options.getIsRowExpanded(e))!=null?t:n===!0||n!=null&&n[e.id])},e.getCanExpand=()=>{var t,n,o;return(t=s.options.getRowCanExpand==null?void 0:s.options.getRowCanExpand(e))!=null?t:((n=s.options.enableExpanding)!=null?n:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let t=!0,n=e;for(;t&&n.parentId;)n=s.getRow(n.parentId,!0),t=n.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},fe=0,me=10,ae=()=>({pageIndex:fe,pageSize:me}),us={getInitialState:e=>({...e,pagination:{...ae(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:P("pagination",e)}),createTable:e=>{let s=!1,t=!1;e._autoResetPageIndex=()=>{var n,o;if(!s){e._queue(()=>{s=!0});return}if((n=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=n=>{const o=r=>T(n,r);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=n=>{var o;e.setPagination(n?ae():(o=e.initialState.pagination)!=null?o:ae())},e.setPageIndex=n=>{e.setPagination(o=>{let r=T(n,o.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,a)),{...o,pageIndex:r}})},e.resetPageIndex=n=>{var o,r;e.setPageIndex(n?fe:(o=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageIndex)!=null?o:fe)},e.resetPageSize=n=>{var o,r;e.setPageSize(n?me:(o=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageSize)!=null?o:me)},e.setPageSize=n=>{e.setPagination(o=>{const r=Math.max(1,T(n,o.pageSize)),a=o.pageSize*o.pageIndex,l=Math.floor(a/r);return{...o,pageIndex:l,pageSize:r}})},e.setPageCount=n=>e.setPagination(o=>{var r;let a=T(n,(r=e.options.pageCount)!=null?r:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),e.getPageOptions=S(()=>[e.getPageCount()],n=>{let o=[];return n&&n>0&&(o=[...new Array(n)].fill(null).map((r,a)=>a)),o},C(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:n<o-1},e.previousPage=()=>e.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},le=()=>({top:[],bottom:[]}),ds={getInitialState:e=>({rowPinning:le(),...e}),getDefaultOptions:e=>({onRowPinningChange:P("rowPinning",e)}),createRow:(e,s)=>{e.pin=(t,n,o)=>{const r=n?e.getLeafRows().map(u=>{let{id:d}=u;return d}):[],a=o?e.getParentRows().map(u=>{let{id:d}=u;return d}):[],l=new Set([...a,e.id,...r]);s.setRowPinning(u=>{var d,f;if(t==="bottom"){var h,g;return{top:((h=u==null?void 0:u.top)!=null?h:[]).filter(m=>!(l!=null&&l.has(m))),bottom:[...((g=u==null?void 0:u.bottom)!=null?g:[]).filter(m=>!(l!=null&&l.has(m))),...Array.from(l)]}}if(t==="top"){var c,p;return{top:[...((c=u==null?void 0:u.top)!=null?c:[]).filter(m=>!(l!=null&&l.has(m))),...Array.from(l)],bottom:((p=u==null?void 0:u.bottom)!=null?p:[]).filter(m=>!(l!=null&&l.has(m)))}}return{top:((d=u==null?void 0:u.top)!=null?d:[]).filter(m=>!(l!=null&&l.has(m))),bottom:((f=u==null?void 0:u.bottom)!=null?f:[]).filter(m=>!(l!=null&&l.has(m)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:n,enablePinning:o}=s.options;return typeof n=="function"?n(e):(t=n??o)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:n,bottom:o}=s.getState().rowPinning,r=t.some(l=>n==null?void 0:n.includes(l)),a=t.some(l=>o==null?void 0:o.includes(l));return r?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var t,n;const o=e.getIsPinned();if(!o)return-1;const r=(t=o==="top"?s.getTopRows():s.getBottomRows())==null?void 0:t.map(a=>{let{id:l}=a;return l});return(n=r==null?void 0:r.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=s=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(s),e.resetRowPinning=s=>{var t,n;return e.setRowPinning(s?le():(t=(n=e.initialState)==null?void 0:n.rowPinning)!=null?t:le())},e.getIsSomeRowsPinned=s=>{var t;const n=e.getState().rowPinning;if(!s){var o,r;return!!((o=n.top)!=null&&o.length||(r=n.bottom)!=null&&r.length)}return!!((t=n[s])!=null&&t.length)},e._getPinnedRows=(s,t,n)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(t??[]).map(a=>{const l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(t??[]).map(a=>s.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:n}))},e.getTopRows=S(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(s,t)=>e._getPinnedRows(s,t,"top"),C(e.options,"debugRows")),e.getBottomRows=S(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(s,t)=>e._getPinnedRows(s,t,"bottom"),C(e.options,"debugRows")),e.getCenterRows=S(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(s,t,n)=>{const o=new Set([...t??[],...n??[]]);return s.filter(r=>!o.has(r.id))},C(e.options,"debugRows"))}},cs={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:P("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=s=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(s),e.resetRowSelection=s=>{var t;return e.setRowSelection(s?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=s=>{e.setRowSelection(t=>{s=typeof s<"u"?s:!e.getIsAllRowsSelected();const n={...t},o=e.getPreGroupedRowModel().flatRows;return s?o.forEach(r=>{r.getCanSelect()&&(n[r.id]=!0)}):o.forEach(r=>{delete n[r.id]}),n})},e.toggleAllPageRowsSelected=s=>e.setRowSelection(t=>{const n=typeof s<"u"?s:!e.getIsAllPageRowsSelected(),o={...t};return e.getRowModel().rows.forEach(r=>{pe(o,r.id,n,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=S(()=>[e.getState().rowSelection,e.getCoreRowModel()],(s,t)=>Object.keys(s).length?ue(e,t):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getFilteredSelectedRowModel=S(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(s,t)=>Object.keys(s).length?ue(e,t):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getGroupedSelectedRowModel=S(()=>[e.getState().rowSelection,e.getSortedRowModel()],(s,t)=>Object.keys(s).length?ue(e,t):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const s=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let n=!!(s.length&&Object.keys(t).length);return n&&s.some(o=>o.getCanSelect()&&!t[o.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const s=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:t}=e.getState();let n=!!s.length;return n&&s.some(o=>!t[o.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var s;const t=Object.keys((s=e.getState().rowSelection)!=null?s:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const s=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:s.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>s=>{e.toggleAllRowsSelected(s.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>s=>{e.toggleAllPageRowsSelected(s.target.checked)}},createRow:(e,s)=>{e.toggleSelected=(t,n)=>{const o=e.getIsSelected();s.setRowSelection(r=>{var a;if(t=typeof t<"u"?t:!o,e.getCanSelect()&&o===t)return r;const l={...r};return pe(l,e.id,t,(a=n==null?void 0:n.selectChildren)!=null?a:!0,s),l})},e.getIsSelected=()=>{const{rowSelection:t}=s.getState();return Re(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=s.getState();return he(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=s.getState();return he(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof s.options.enableRowSelection=="function"?s.options.enableRowSelection(e):(t=s.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof s.options.enableSubRowSelection=="function"?s.options.enableSubRowSelection(e):(t=s.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof s.options.enableMultiRowSelection=="function"?s.options.enableMultiRowSelection(e):(t=s.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected((o=n.target)==null?void 0:o.checked)}}}},pe=(e,s,t,n,o)=>{var r;const a=o.getRow(s,!0);t?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[s]=!0)):delete e[s],n&&(r=a.subRows)!=null&&r.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>pe(e,l.id,t,n,o))};function ue(e,s){const t=e.getState().rowSelection,n=[],o={},r=function(a,l){return a.map(u=>{var d;const f=Re(u,t);if(f&&(n.push(u),o[u.id]=u),(d=u.subRows)!=null&&d.length&&(u={...u,subRows:r(u.subRows)}),f)return u}).filter(Boolean)};return{rows:r(s.rows),flatRows:n,rowsById:o}}function Re(e,s){var t;return(t=s[e.id])!=null?t:!1}function he(e,s,t){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let o=!0,r=!1;return e.subRows.forEach(a=>{if(!(r&&!o)&&(a.getCanSelect()&&(Re(a,s)?r=!0:o=!1),a.subRows&&a.subRows.length)){const l=he(a,s);l==="all"?r=!0:(l==="some"&&(r=!0),o=!1)}}),o?"all":r?"some":!1}const xe=/([0-9]+)/gm,gs=(e,s,t)=>vt(b(e.getValue(t)).toLowerCase(),b(s.getValue(t)).toLowerCase()),fs=(e,s,t)=>vt(b(e.getValue(t)),b(s.getValue(t))),ms=(e,s,t)=>ye(b(e.getValue(t)).toLowerCase(),b(s.getValue(t)).toLowerCase()),ps=(e,s,t)=>ye(b(e.getValue(t)),b(s.getValue(t))),hs=(e,s,t)=>{const n=e.getValue(t),o=s.getValue(t);return n>o?1:n<o?-1:0},xs=(e,s,t)=>ye(e.getValue(t),s.getValue(t));function ye(e,s){return e===s?0:e>s?1:-1}function b(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function vt(e,s){const t=e.split(xe).filter(Boolean),n=s.split(xe).filter(Boolean);for(;t.length&&n.length;){const o=t.shift(),r=n.shift(),a=parseInt(o,10),l=parseInt(r,10),u=[a,l].sort();if(isNaN(u[0])){if(o>r)return 1;if(r>o)return-1;continue}if(isNaN(u[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return t.length-n.length}const B={alphanumeric:gs,alphanumericCaseSensitive:fs,text:ms,textCaseSensitive:ps,datetime:hs,basic:xs},vs={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:P("sorting",e),isMultiSortEvent:s=>s.shiftKey}),createColumn:(e,s)=>{e.getAutoSortingFn=()=>{const t=s.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const o of t){const r=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(r)==="[object Date]")return B.datetime;if(typeof r=="string"&&(n=!0,r.split(xe).length>1))return B.alphanumeric}return n?B.text:B.basic},e.getAutoSortDir=()=>{const t=s.getFilteredRowModel().flatRows[0];return typeof(t==null?void 0:t.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,n;if(!e)throw new Error;return ee(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(n=s.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?t:B[e.columnDef.sortingFn]},e.toggleSorting=(t,n)=>{const o=e.getNextSortingOrder(),r=typeof t<"u"&&t!==null;s.setSorting(a=>{const l=a==null?void 0:a.find(c=>c.id===e.id),u=a==null?void 0:a.findIndex(c=>c.id===e.id);let d=[],f,h=r?t:o==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&n?l?f="toggle":f="add":a!=null&&a.length&&u!==a.length-1?f="replace":l?f="toggle":f="replace",f==="toggle"&&(r||o||(f="remove")),f==="add"){var g;d=[...a,{id:e.id,desc:h}],d.splice(0,d.length-((g=s.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else f==="toggle"?d=a.map(c=>c.id===e.id?{...c,desc:h}:c):f==="remove"?d=a.filter(c=>c.id!==e.id):d=[{id:e.id,desc:h}];return d})},e.getFirstSortDir=()=>{var t,n;return((t=(n=e.columnDef.sortDescFirst)!=null?n:s.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var n,o;const r=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==r&&((n=s.options.enableSortingRemoval)==null||n)&&(!(t&&(o=s.options.enableMultiRemove)!=null)||o)?!1:a==="desc"?"asc":"desc":r},e.getCanSort=()=>{var t,n;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((n=s.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,n;return(t=(n=e.columnDef.enableMultiSort)!=null?n:s.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const n=(t=s.getState().sorting)==null?void 0:t.find(o=>o.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,n;return(t=(n=s.getState().sorting)==null?void 0:n.findIndex(o=>o.id===e.id))!=null?t:-1},e.clearSorting=()=>{s.setSorting(t=>t!=null&&t.length?t.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return n=>{t&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?s.options.isMultiSortEvent==null?void 0:s.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=s=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(s),e.resetSorting=s=>{var t,n;e.setSorting(s?[]:(t=(n=e.initialState)==null?void 0:n.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Ss=[bn,rs,es,ts,Hn,Gn,is,as,vs,Zn,ls,us,ds,cs,ss];function Cs(e){var s,t;const n=[...Ss,...(s=e._features)!=null?s:[]];let o={_features:n};const r=o._features.reduce((g,c)=>Object.assign(g,c.getDefaultOptions==null?void 0:c.getDefaultOptions(o)),{}),a=g=>o.options.mergeOptions?o.options.mergeOptions(r,g):{...r,...g};let u={...{},...(t=e.initialState)!=null?t:{}};o._features.forEach(g=>{var c;u=(c=g.getInitialState==null?void 0:g.getInitialState(u))!=null?c:u});const d=[];let f=!1;const h={_features:n,options:{...r,...e},initialState:u,_queue:g=>{d.push(g),f||(f=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();f=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{o.setState(o.initialState)},setOptions:g=>{const c=T(g,o.options);o.options=a(c)},getState:()=>o.options.state,setState:g=>{o.options.onStateChange==null||o.options.onStateChange(g)},_getRowId:(g,c,p)=>{var m;return(m=o.options.getRowId==null?void 0:o.options.getRowId(g,c,p))!=null?m:`${p?[p.id,c].join("."):c}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(g,c)=>{let p=(c?o.getPrePaginationRowModel():o.getRowModel()).rowsById[g];if(!p&&(p=o.getCoreRowModel().rowsById[g],!p))throw new Error;return p},_getDefaultColumnDef:S(()=>[o.options.defaultColumn],g=>{var c;return g=(c=g)!=null?c:{},{header:p=>{const m=p.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:p=>{var m,x;return(m=(x=p.renderValue())==null||x.toString==null?void 0:x.toString())!=null?m:null},...o._features.reduce((p,m)=>Object.assign(p,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...g}},C(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:S(()=>[o._getColumnDefs()],g=>{const c=function(p,m,x){return x===void 0&&(x=0),p.map(v=>{const w=Tn(o,v,x,m),R=v;return w.columns=R.columns?c(R.columns,w,x+1):[],w})};return c(g)},C(e,"debugColumns")),getAllFlatColumns:S(()=>[o.getAllColumns()],g=>g.flatMap(c=>c.getFlatColumns()),C(e,"debugColumns")),_getAllFlatColumnsById:S(()=>[o.getAllFlatColumns()],g=>g.reduce((c,p)=>(c[p.id]=p,c),{}),C(e,"debugColumns")),getAllLeafColumns:S(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(g,c)=>{let p=g.flatMap(m=>m.getLeafColumns());return c(p)},C(e,"debugColumns")),getColumn:g=>o._getAllFlatColumnsById()[g]};Object.assign(o,h);for(let g=0;g<o._features.length;g++){const c=o._features[g];c==null||c.createTable==null||c.createTable(o)}return o}function ws(){return e=>S(()=>[e.options.data],s=>{const t={rows:[],flatRows:[],rowsById:{}},n=function(o,r,a){r===void 0&&(r=0);const l=[];for(let d=0;d<o.length;d++){const f=Ln(e,e._getRowId(o[d],d,a),o[d],d,r,void 0,a==null?void 0:a.id);if(t.flatRows.push(f),t.rowsById[f.id]=f,l.push(f),e.options.getSubRows){var u;f.originalSubRows=e.options.getSubRows(o[d],d),(u=f.originalSubRows)!=null&&u.length&&(f.subRows=n(f.originalSubRows,r+1,f))}}return l};return t.rows=n(s),t},C(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}/**
20
20
  * react-table
21
21
  *
22
22
  * Copyright (c) TanStack
@@ -25,4 +25,4 @@ import{O as jt,r as y,af as Ke,j as i,G as z,_ as $,cG as _t,B as I,am as H,kS a
25
25
  * LICENSE.md file in the root directory of this source tree.
26
26
  *
27
27
  * @license MIT
28
- */function be(e,s){return e?Rs(e)?y.createElement(e,s):e:null}function Rs(e){return ys(e)||typeof e=="function"||js(e)}function ys(e){return typeof e=="function"&&(()=>{const s=Object.getPrototypeOf(e);return s.prototype&&s.prototype.isReactComponent})()}function js(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function _s(e){const s={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=y.useState(()=>({current:Cs(s)})),[n,o]=y.useState(()=>t.current.initialState);return t.current.setOptions(r=>({...r,...e,state:{...n,...e.state},onStateChange:a=>{o(a),e.onStateChange==null||e.onStateChange(a)}})),t.current}function Ns(e){if("id"in e&&e.id)return e.id;if("accessorKey"in e&&typeof e.accessorKey=="string")return e.accessorKey}function Fs({columns:e,data:s,emptyMessage:t="No results.",tableOptions:n,groupBy:o,className:r,tableClassName:a}){var p;const l=Ke(),u=y.useMemo(()=>{var x;if(!l)return{};const m={};for(const v of e){const w=Ns(v);w&&((x=v.meta)!=null&&x.hideOnMobile)&&(m[w]=!1)}return m},[e,l]),d=y.useMemo(()=>{var m;return{...u,...((m=n==null?void 0:n.state)==null?void 0:m.columnVisibility)??{}}},[u,(p=n==null?void 0:n.state)==null?void 0:p.columnVisibility]),f=_s({data:s,columns:e,getCoreRowModel:ws(),...n,state:{...n==null?void 0:n.state,columnVisibility:d}}),h=f.getRowModel().rows,g=f.getVisibleLeafColumns().length,c=y.useMemo(()=>{if(!o)return new Map;const m=new Map;for(const x of h){const v=o.key(x.original);m.set(v,(m.get(v)??0)+1)}return m},[o,h]);return i.jsx("div",{"data-slot":"data-table",className:z("rounded-md border",r),children:i.jsxs(_n,{className:a,children:[i.jsx(Nn,{children:f.getHeaderGroups().map(m=>i.jsx(X,{children:m.headers.map(x=>{var v;return i.jsx(De,{className:(v=x.column.columnDef.meta)==null?void 0:v.headClassName,children:x.isPlaceholder?null:be(x.column.columnDef.header,x.getContext())},x.id)})},m.id))}),i.jsx(Fn,{children:h.length?h.map((m,x)=>{const v=o==null?void 0:o.key(m.original),w=x>0?o==null?void 0:o.key(h[x-1].original):void 0,R=v!==void 0&&v!==w;return i.jsxs(y.Fragment,{children:[R&&i.jsx(X,{"data-slot":"data-table-group-header",className:"bg-muted/40 hover:bg-muted/40",children:i.jsx(De,{colSpan:g,className:"h-8",children:o==null?void 0:o.header(v,c.get(v)??0)})}),i.jsx(X,{"data-state":m.getIsSelected()?"selected":void 0,children:m.getVisibleCells().map(j=>{var _;return i.jsx(ke,{className:(_=j.column.columnDef.meta)==null?void 0:_.cellClassName,children:be(j.column.columnDef.cell,j.getContext())},j.id)})})]},m.id)}):i.jsx(X,{children:i.jsx(ke,{colSpan:g,className:"h-24 text-center",children:t})})})]})})}function Ms({onClearFilters:e,filterDescription:s}){return i.jsxs($.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[i.jsx(Sn,{className:"text-muted-foreground/50 size-10"}),i.jsx("p",{className:"text-muted-foreground text-sm",children:s?`No agents match ${s}`:"No agents match your filters"}),i.jsx(I,{variant:"outline",size:"sm",onClick:e,children:"Clear filters"})]})}function Ps({peopleOnly:e}){return i.jsxs($.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},className:"flex flex-col items-center justify-center gap-2 py-12 text-center","data-slot":"agent-roster-filter-empty",children:[i.jsx(_t,{className:"text-muted-foreground/50 size-10"}),i.jsx("p",{className:"text-muted-foreground max-w-xs text-sm",children:e?"This table lists agents. Switch to Cards to see people.":"No agents match this filter. Change it in Cards."})]})}const Le=["needs-you","working","quiet"],$s=1440*60*1e3;function Is(e,s=Date.now()){const t=Date.parse(e);return Number.isNaN(t)?!0:s-t>=$s}const As=30,Vs=25,Es=20,Ds=20,ks=10,zs=0;function ve(e){const{healthStatus:s,taskCount:t,chatState:n}=e;return s==="unreachable"?{group:"needs-you",severity:As}:n==="needs-attention"?{group:"needs-you",severity:Vs}:s==="stale"&&t>0&&e.isPastOnboardingGrace?{group:"needs-you",severity:Es}:n==="active"?{group:"working",severity:Ds}:s==="active"?{group:"working",severity:ks}:{group:"quiet",severity:zs}}function Ge(e){if(!e)return Number.NEGATIVE_INFINITY;const s=Date.parse(e);return Number.isNaN(s)?Number.NEGATIVE_INFINITY:s}function Ts(e,s){const t=ve(e),n=ve(s),o=Le.indexOf(t.group)-Le.indexOf(n.group);if(o!==0)return o;const r=n.severity-t.severity;if(r!==0)return r;const a=Ge(s.lastSeenAt)-Ge(e.lastSeenAt);return a!==0?a:H(e).localeCompare(H(s))}function bs(e,s="asc"){const t=s==="desc"?-1:1;return[...e].sort((n,o)=>t*Ts(n,o))}const Ls={"needs-you":{label:"Needs you",toneClass:"text-destructive"},working:{label:"Working",toneClass:"text-foreground"},quiet:{label:"Quiet",toneClass:"text-muted-foreground"}};function Gs(e,s,t){if(!t)return e;if(t.kind==="people")return[];if(!(t.owner!==void 0||(t.q??"").trim()!==""))return e;const o=s.filter(a=>a.kind==="agent");if(o.length===0)return e;const r=new Set(Ye(o,t).map(a=>a.id));return e.filter(a=>r.has(a.id))}const He=32,Hs=5,St="Checked in",Os={heartbeat:"Checked in",message_sent:"Got a message",response_complete:"Finished a reply"};function Bs(e,s){return s===null&&e==="stale"}function Oe(e){return e.length<2||e.length>Hs?!1:e===e.toUpperCase()&&new RegExp("\\p{Lu}","u").test(e)}function qs(e){const s=Os[e.trim().toLowerCase()];if(s)return s;const t=e.replace(/[^\p{L}\p{N}]+/gu," ").trim().split(" ").filter(Boolean).map(a=>Oe(a)?a:a.toLowerCase());if(t.length===0)return St;const n=t[0];t[0]=Oe(n)?n:n.replace(/^./u,a=>a.toUpperCase());const o=t.join(" "),r=Array.from(o);return r.length<=He?o:`${r.slice(0,He-1).join("").trimEnd()}…`}function Be(e){const s=e.filter(t=>!!t);return s.length>0?s.join(" · "):null}function Us(e){const{healthStatus:s,lastSeenAt:t,lastSeenEvent:n,chatState:o}=e,r=t?ce(t):null,a=n?qs(n):null;return s==="unreachable"?{primary:"Can’t be reached",secondary:Be([a,r??"never seen"]),toneClass:"text-destructive"}:o==="needs-attention"?{primary:"A chat needs you",secondary:Be([a,r]),toneClass:"text-destructive"}:Bs(s,t)?o==="active"?{primary:"Active in a chat",secondary:null,toneClass:"text-foreground"}:{primary:"Not used yet",secondary:null,toneClass:"text-muted-foreground"}:{primary:a??St,secondary:r,toneClass:s==="active"?"text-foreground":"text-muted-foreground"}}function Ks(e){if(!e)return null;const s=e.split("/").filter(Boolean);return s.length<=2?e:s.slice(-2).join("/")}function Ys({row:e,onOpen:s}){const{color:t,emoji:n}=Mt(e),o=Ks(e.projectPath),r=Xe(e.runtime).label;return i.jsxs("button",{type:"button",className:"flex w-full min-w-0 items-center gap-2 text-left",onClick:s,children:[i.jsx(Pt,{color:t,emoji:n,size:"xs"}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-sm font-medium hover:underline",children:H(e)}),i.jsxs("span",{className:"text-muted-foreground block truncate text-xs",children:[o??r,o&&i.jsxs("span",{className:"hidden md:inline",children:[" · ",r]})]})]}),e.isDefault&&i.jsxs(A,{size:"xs",variant:"outline",className:"shrink-0 max-md:border-0 max-md:px-0 max-md:py-0",children:[i.jsx($t,{className:"size-2.5 fill-current md:mr-0.5"}),i.jsx("span",{className:"sr-only md:not-sr-only",children:"Default"})]})]})}function Xs({row:e}){const{primary:s,secondary:t,toneClass:n}=Us(e);return i.jsxs("span",{className:"block min-w-0",children:[i.jsx("span",{className:z("block truncate text-sm",n),children:s}),t&&i.jsx("span",{className:"text-muted-foreground block truncate text-xs tabular-nums",children:t})]})}function Ws(e){return[{accessorKey:"name",header:"Agent",meta:{headClassName:"w-[42%] md:w-[38%]",cellClassName:"overflow-hidden"},cell:({row:s})=>i.jsx(Ys,{row:s.original,onOpen:()=>e.onNavigate(s.original.projectPath??"")})},{accessorKey:"lastSeenEvent",header:"Activity",meta:{headClassName:"truncate",cellClassName:"truncate"},cell:({row:s})=>i.jsx(Xs,{row:s.original})},{id:"managedBy",header:"Managed by",meta:{hideOnMobile:!0,headClassName:"w-[140px]",cellClassName:"overflow-hidden"},cell:({row:s})=>{const t=s.original.managedBy;return i.jsx("span",{"data-slot":"agent-managed-by",className:"text-muted-foreground block truncate text-xs",children:t??"—"})}},{accessorKey:"taskCount",header:"Scheduled",meta:{hideOnMobile:!0,headClassName:"w-[110px]"},cell:({row:s})=>{const t=s.original.taskCount;return t===0?i.jsx("span",{className:"text-muted-foreground text-xs",children:"—"}):i.jsxs(A,{variant:"outline",className:"whitespace-nowrap",children:[t," ",t===1?"schedule":"schedules"]})}},{id:"actions",header:"",meta:{headClassName:"w-[88px]"},cell:({row:s})=>{const t=s.original;return i.jsxs("div",{className:"flex items-center justify-end gap-1",children:[i.jsx(I,{variant:"ghost",size:"sm",className:"size-8 p-0",onClick:n=>{n.stopPropagation(),e.onNavigate(t.projectPath??"")},"aria-label":`Open chat with ${H(t)}`,children:i.jsx(Nt,{className:"size-4"})}),i.jsx(I,{variant:"ghost",size:"sm",className:"size-8 p-0",onClick:n=>{n.stopPropagation(),e.onViewProfile(t.projectPath??"")},"aria-label":`Open ${H(t)}’s profile`,children:i.jsx(Ft,{className:"size-4"})})]})}}]}function Qs({group:e,count:s}){const{label:t,toneClass:n}=Ls[e];return i.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-semibold tracking-wide uppercase",children:[e==="needs-you"&&i.jsx(We,{className:z("size-3.5",n)}),i.jsx("span",{className:n,children:t}),i.jsx("span",{className:"text-muted-foreground font-normal tabular-nums",children:s})]})}function Zs({rows:e,grouped:s,callbacks:t}){const n=y.useMemo(()=>Ws(t),[t]),o=y.useMemo(()=>s?{key:r=>ve(r).group,header:(r,a)=>i.jsx(Qs,{group:r,count:a})}:void 0,[s]);return i.jsx(Fs,{columns:n,data:e,groupBy:o,emptyMessage:"No agents registered.",className:"border-0",tableClassName:"table-fixed"})}function Js({agents:e,isLoading:s,rosterFilters:t}){var O;const n=Qe(),o=It(),{open:r}=Se(),a=At(),l=Cn(te,{debounce:{search:200}}),{data:u}=Ze(),d=y.useMemo(()=>(u==null?void 0:u.members)??[],[u]),f=y.useMemo(()=>Gs(e,d,t),[e,d,t]),h=y.useMemo(()=>[...new Set(f.map(N=>N.namespace).filter(N=>!!N))],[f]),g=!l.sortField||l.sortField===_e,c=y.useMemo(()=>g?te.applyFilters(f,l.values):Vt(f,te,l.values,Lt,{field:l.sortField,direction:l.sortDirection}),[f,g,l.values,l.sortField,l.sortDirection]),p=y.useMemo(()=>e.map(N=>N.projectPath).filter(N=>!!N),[e]),m=Rn(p),{data:x}=Et({queryKey:Dt.current(),queryFn:()=>o.getConfig(),staleTime:3e4}),v=y.useMemo(()=>{const N=new Map;for(const F of d){if(F.kind!=="agent")continue;const L=Je(F,d);L&&N.set(F.id,K(L))}return N},[d]),w=y.useMemo(()=>{const N=c.map(F=>{var L;return{...F,chatState:(F.projectPath?m[F.projectPath]:void 0)??"fresh",isPastOnboardingGrace:Is(F.registeredAt),isDefault:((L=x==null?void 0:x.agents)==null?void 0:L.defaultAgent)===F.name,managedBy:v.get(F.id)??null}});return g?bs(N,l.sortDirection):N},[c,m,(O=x==null?void 0:x.agents)==null?void 0:O.defaultAgent,v,g,l.sortDirection]),R=y.useCallback(N=>{const F=a.get(N);if(F===void 0){et.getState().openProfileDocked(N);return}r(F)},[a,r]),j=y.useCallback(N=>{kt(o,N).then(F=>n(F)).catch(F=>{zt(o,F),Tt(N)})},[n,o]),_=y.useMemo(()=>({onNavigate:j,onViewProfile:R}),[j,R]);function V(){return f.length===0&&e.length>0?i.jsx(Ps,{peopleOnly:(t==null?void 0:t.kind)==="people"}):c.length===0&&f.length>0?i.jsx(Ms,{onClearFilters:l.clearAll,filterDescription:l.describeActive()}):i.jsx(Zs,{rows:w,grouped:g,callbacks:_})}return s?i.jsx("div",{className:"space-y-3 p-4 sm:px-6",children:Array.from({length:3}).map((N,F)=>i.jsx(E,{className:"h-14 w-full rounded-xl"},F))}):i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsxs(G,{state:l,className:"sm:px-6",children:[i.jsx(G.Search,{placeholder:"Filter agents…"}),i.jsx(G.Primary,{name:"status"}),i.jsx(G.AddFilter,{dynamicOptions:{namespace:h}}),i.jsx(G.Sort,{options:bt,defaultField:_e}),i.jsx(G.ResultCount,{count:c.length,total:f.length,noun:"agent"}),i.jsx(G.ActiveFilters,{})]}),i.jsx(wn,{className:"min-h-0 flex-1",children:i.jsx("div",{className:"px-4 pb-4 sm:px-6",children:V()})})]})}const eo={animate:{transition:{staggerChildren:.1}}},to={initial:{opacity:0},animate:{opacity:.2,transition:{duration:.3}}};function de(){return i.jsxs($.div,{variants:to,className:"rounded-xl border border-dashed px-4 py-3",children:[i.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[i.jsx(E,{className:"size-3 rounded-full"}),i.jsx(E,{className:"h-3 w-32"}),i.jsx(E,{className:"h-3 w-16"}),i.jsx(E,{className:"ml-auto h-3 w-10"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(E,{className:"h-2.5 w-48"}),i.jsx(E,{className:"h-2.5 w-20"})]})]})}function Ct(){const e=Gt(n=>n.open),s=Ht(n=>n.open),t=Ot();return i.jsxs("div",{className:"relative w-full max-w-2xl px-4",children:[i.jsxs($.div,{variants:eo,initial:"initial",animate:"animate",className:"space-y-3",children:[i.jsx(de,{}),i.jsx(de,{}),i.jsx(de,{})]}),i.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:t?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-lg font-semibold",children:"No agents yet"}),i.jsxs(I,{size:"sm",className:"gap-1.5",onClick:()=>s(),children:[i.jsx(tt,{className:"size-3.5"}),"Create agent"]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-lg font-semibold",children:"Bring in existing projects"}),i.jsxs(I,{size:"sm",className:"gap-1.5",onClick:e,children:[i.jsx(En,{className:"size-3.5"}),"Search for projects"]})]})})]})}function no(){const{data:e,isLoading:s}=Bt(),t=(e==null?void 0:e.denied)??[];return s?i.jsx("div",{className:"flex items-center justify-center p-8",children:i.jsx(J,{size:"md",className:"text-muted-foreground",label:"Loading blocked paths"})}):t.length===0?i.jsx(lt,{icon:qt,headline:"No blocked paths",description:"Folders you block from scans show up here."}):i.jsx("div",{className:"space-y-2 p-4",children:t.map(n=>i.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border px-4 py-3",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate font-mono text-sm",title:n.path,children:n.path}),n.reason&&i.jsx("p",{className:"text-muted-foreground truncate text-xs",title:n.reason,children:n.reason})]}),i.jsx(A,{variant:"outline",className:"shrink-0",children:n.deniedBy})]},n.path))})}function so({namespace:e,agentCount:s,agents:t}){const[n,o]=y.useState(!1);return i.jsxs("div",{className:"rounded-xl border",children:[i.jsxs("button",{type:"button",onClick:()=>o(!n),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-4 py-3 text-left transition-colors duration-150",children:[n?i.jsx(Kt,{className:"size-4"}):i.jsx(Yt,{className:"size-4"}),i.jsx("span",{className:"text-sm font-medium",children:e}),i.jsxs(A,{variant:"secondary",className:"ml-auto",children:[s," agent",s!==1?"s":""]})]}),n&&i.jsx("div",{className:"space-y-2 border-t px-4 py-2",children:t.map(r=>i.jsx("div",{className:"flex items-center justify-between py-1",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm",children:H(r)}),i.jsx(A,{variant:"outline",children:nt(r.runtime)})]})},r.id))})]})}function oo({sourceNamespace:e,targetNamespace:s,action:t,origin:n,onRemove:o}){const r=n==="default";return i.jsxs("div",{className:"flex items-center justify-between rounded-lg border px-3 py-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx("span",{className:"font-mono",children:e}),i.jsx("span",{className:"text-muted-foreground",children:"→"}),i.jsx("span",{className:"font-mono",children:s}),i.jsx(A,{variant:t==="allow"?"default":"destructive",children:t}),r&&i.jsx(A,{tone:"neutral",variant:"outline",children:"built-in"})]}),r?i.jsx("span",{className:"text-muted-foreground flex size-8 items-center justify-center",title:"Built-in rule, always enforced. Not removable",children:i.jsx(Xt,{className:"size-4","aria-hidden":"true"})}):i.jsx(I,{type:"button",variant:"ghost",size:"icon-sm",onClick:o,className:"text-muted-foreground hover:bg-destructive/10 hover:text-destructive","aria-label":`Remove access from ${e} to ${s}`,children:i.jsx(Wt,{})})]})}const wt="acl-open-mesh-explanation";function ro({namespaces:e,onAdd:s,isPending:t,inert:n}){const[o,r]=y.useState(""),[a,l]=y.useState("");function u(f){f.preventDefault(),!n&&o&&a&&o!==a&&(s(o,a),r(""),l(""))}const d=n?{"aria-disabled":!0,"aria-describedby":wt}:{};return i.jsxs("form",{onSubmit:u,className:"flex items-end gap-2",children:[i.jsxs("div",{className:"flex-1 space-y-1",children:[i.jsx(Fe,{htmlFor:"acl-source",className:"text-muted-foreground text-xs font-medium",children:"Source"}),i.jsxs(Me,{value:o,onValueChange:n?()=>{}:r,children:[i.jsx(Pe,{id:"acl-source",className:"w-full aria-disabled:pointer-events-none aria-disabled:opacity-50",...d,children:i.jsx($e,{placeholder:"Pick a project"})}),i.jsx(Ie,{children:e.map(f=>i.jsx(Ae,{value:f,children:f},f))})]})]}),i.jsxs("div",{className:"flex-1 space-y-1",children:[i.jsx(Fe,{htmlFor:"acl-target",className:"text-muted-foreground text-xs font-medium",children:"Target"}),i.jsxs(Me,{value:a,onValueChange:n?()=>{}:l,children:[i.jsx(Pe,{id:"acl-target",className:"w-full aria-disabled:pointer-events-none aria-disabled:opacity-50",...d,children:i.jsx($e,{placeholder:"Pick a project"})}),i.jsx(Ie,{children:e.map(f=>i.jsx(Ae,{value:f,children:f},f))})]})]}),i.jsxs(I,{type:"submit",className:"aria-disabled:pointer-events-none aria-disabled:opacity-50",disabled:!n&&(t||!o||!a||o===a),...d,children:[t?i.jsx(J,{}):i.jsx(tt,{}),"Allow access"]})]})}function io({onGoToDiscovery:e}={}){const{data:s,isLoading:t}=at(),{mutate:n,isPending:o}=yn();if(t)return i.jsx("div",{className:"flex items-center justify-center p-8",children:i.jsx(J,{size:"md",className:"text-muted-foreground"})});const r=(s==null?void 0:s.namespaces)??[],a=(s==null?void 0:s.openMesh)??!1,l=((s==null?void 0:s.accessRules)??[]).filter(d=>!(d.origin==="explicit"&&d.sourceNamespace===Ne&&d.targetNamespace===Ne)),u=r.map(d=>d.namespace);return r.length===0?i.jsxs("div",{className:"space-y-6 p-4",children:[i.jsx(Ee,{}),i.jsx(lt,{icon:Ut,headline:"You need agents in more than one project",description:"Add agents from a second folder to let two projects talk.",action:e?{label:"Go to Discovery",onClick:e}:void 0})]}):i.jsxs("div",{className:"space-y-6 p-4",children:[i.jsx(Ee,{}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-muted-foreground text-sm font-medium",children:"Projects"}),r.map(d=>i.jsx(so,{namespace:d.namespace,agentCount:d.agentCount,agents:d.agents},d.namespace))]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-muted-foreground text-sm font-medium",children:"Cross-project access rules"}),l.length===0?i.jsx("p",{className:"text-muted-foreground text-xs",children:"No rules yet. Agents only talk within their own project."}):i.jsx("div",{className:"space-y-1",children:l.map(d=>i.jsx(oo,{sourceNamespace:d.sourceNamespace,targetNamespace:d.targetNamespace,action:d.action,origin:d.origin,onRemove:()=>n({sourceNamespace:d.sourceNamespace,targetNamespace:d.targetNamespace,action:"deny"})},`${d.sourceNamespace}-${d.targetNamespace}-${d.action}-${d.origin}`))})]}),u.length>=2&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-muted-foreground text-sm font-medium",children:"Allow cross-project access"}),a&&i.jsx("p",{id:wt,className:"text-muted-foreground text-xs",children:"Already allowed by the switch above. Turn it off to pick pairs."}),i.jsx(ro,{namespaces:u,isPending:o,inert:a,onAdd:(d,f)=>n({sourceNamespace:d,targetNamespace:f,action:"allow"})})]})]})}const Rt={active:{label:"Active",dot:ne.working},inactive:{label:"Inactive",dot:ne["needs-you"]},stale:{label:"Stale",dot:"bg-muted-foreground/50"},unreachable:{label:"Unreachable",dot:ne.error}};function ao(e){return e in Rt}function qe({onClick:e}){return i.jsx("button",{type:"button",onClick:e,"aria-label":"Close detail panel",className:"text-muted-foreground hover:text-foreground",children:i.jsx(Ce,{className:"size-(--size-icon-sm)"})})}function Ue({agentId:e,onClose:s}){const{data:t,isLoading:n}=jn(e),{open:o}=Se();if(n)return i.jsx("div",{className:"flex w-64 items-center justify-center border-l p-4",children:i.jsx("span",{className:"text-muted-foreground text-sm",children:"Loading…"})});if(!t)return i.jsxs("div",{className:"w-64 border-l p-4",children:[i.jsx("div",{className:"flex justify-end",children:i.jsx(qe,{onClick:s})}),i.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Agent not found"})]});const r=ao(t.status)?t.status:"stale",a=Rt[r];return i.jsxs("div",{className:"w-64 overflow-y-auto border-l p-4",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsx("h3",{className:"truncate text-sm font-semibold",children:t.name}),i.jsx(qe,{onClick:s})]}),i.jsxs("div",{className:"space-y-3 text-xs",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:z("h-2.5 w-2.5 rounded-full",a.dot),"aria-hidden":"true"}),i.jsx("span",{children:a.label})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Last seen: "}),i.jsx("span",{children:t.lastSeenAt?ce(t.lastSeenAt):"Never"})]}),t.lastSeenEvent&&i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Last event: "}),i.jsx("span",{children:t.lastSeenEvent})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Runs on: "}),i.jsx(A,{size:"xs",variant:"secondary",children:nt(t.runtime)})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Registered: "}),i.jsx("span",{children:t.registeredAt?ce(t.registeredAt):"Unknown"})]}),Array.isArray(t.capabilities)&&t.capabilities.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground mb-1 block",children:"Capabilities:"}),i.jsx("div",{className:"flex flex-wrap gap-1",children:t.capabilities.map(l=>i.jsx(A,{size:"xs",variant:"outline",children:l},l))})]})]}),i.jsx("div",{className:"mt-4 space-y-2 border-t pt-3",children:i.jsxs("button",{type:"button",onClick:()=>o(e),className:"hover:bg-muted inline-flex w-full items-center justify-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors duration-150",children:[i.jsx(Qt,{className:"size-3.5"}),"View profile"]})})]})}function lo(){return i.jsx(io,{})}function uo(e){var s;if(e.agent){const t=Xe(e.agent.runtime).label;return e.agent.model?`${t} · ${e.agent.model}`:t}return(s=e.person)!=null&&s.role?e.person.role:e.origin==="local"?"On this machine":`On ${en(e.origin.platform)}`}const co={layout:"position",initial:{opacity:0,scale:.97},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.97,transition:{duration:.15}},transition:{layout:{type:"spring",stiffness:280,damping:32},duration:.2,ease:[0,0,.2,1]}};function go({member:e,owner:s,onSelectOwner:t,onOpenProfile:n,onSetLinkedToMe:o,linkPending:r=!1,linkError:a,ownedAgentCount:l,layoutAnimated:u=!1,ref:d,className:f}){var p,m,x;const h=st(e),g=Zt(e),c=(p=e.person)==null?void 0:p.linkedToYou;return i.jsxs($.article,{ref:d,...u?co:{},"data-slot":"team-member-card","data-member-id":e.id,"data-layout-animated":String(u),style:{"--identity-color":h.color},className:z("bg-card shadow-soft relative flex items-start gap-3 rounded-lg border p-4","border-[color-mix(in_oklch,var(--identity-color)_var(--identity-border-strength),hsl(var(--border)))]","[--identity-border-strength:0%]",n&&["transition-[box-shadow,border-color,translate,scale] duration-(--identity-settle) ease-(--identity-ease-standard)","hover:shadow-elevated hover:-translate-y-px","hover:[--identity-border-strength:var(--identity-border-mix)]","has-[[data-slot=team-member-open]:focus-visible]:shadow-elevated has-[[data-slot=team-member-open]:focus-visible]:-translate-y-px","has-[[data-slot=team-member-open]:focus-visible]:[--identity-border-strength:var(--identity-border-mix)]","active:translate-y-0 active:scale-[0.99] active:duration-(--identity-press)",Jt,"has-[[data-card-aside]:hover]:shadow-soft has-[[data-card-aside]:hover]:translate-y-0 has-[[data-card-aside]:hover]:[--identity-border-strength:0%]","has-[[data-card-aside]:focus-visible]:shadow-soft has-[[data-card-aside]:focus-visible]:translate-y-0 has-[[data-card-aside]:focus-visible]:[--identity-border-strength:0%]","[&:has([data-card-aside]:hover)_[data-slot=identity-badge]]:scale-100 [&:has([data-card-aside]:hover)_[data-slot=identity-badge]]:rotate-0","[&:has([data-card-aside]:focus-visible)_[data-slot=identity-badge]]:scale-100 [&:has([data-card-aside]:focus-visible)_[data-slot=identity-badge]]:rotate-0","has-[[data-card-aside]:active]:scale-100"],f),children:[i.jsx(ot,{size:"md",kind:h.kind,color:h.color,emoji:h.emoji,imageUrl:h.imageUrl,fallback:h.fallback,origin:h.origin}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1",children:[i.jsx("h3",{className:"min-w-0 truncate text-sm font-medium",children:n?i.jsx("button",{type:"button","data-slot":"team-member-open",onClick:()=>n(e.id),"aria-label":`Open ${e.displayName}’s profile`,className:"focus-ring max-w-full truncate rounded text-left after:absolute after:inset-0 after:rounded-lg after:content-['']",children:e.displayName}):e.displayName}),e.isSelf&&i.jsx(A,{size:"xs",variant:"secondary",children:"you"}),((m=e.agent)==null?void 0:m.isDefault)&&i.jsx(A,{size:"xs",variant:"outline",children:"default"}),c&&i.jsx(A,{size:"xs",variant:"secondary",children:"also you"})]}),e.handle!==null&&i.jsxs("p",{"data-slot":"team-member-handle",className:"text-muted-foreground truncate text-xs",children:["@",e.handle]}),g&&i.jsx("p",{"data-slot":"team-member-name-source",className:"text-muted-foreground truncate text-xs",children:g}),i.jsx("p",{className:"text-muted-foreground mt-1.5 truncate text-xs",children:uo(e)}),((x=e.agent)==null?void 0:x.recentlyActive)&&i.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Active in the last hour"}),c!==void 0&&o&&i.jsx("button",{type:"button","data-slot":"team-member-link-to-me","data-card-aside":"",disabled:r,onClick:()=>o(e.id,!c),"aria-label":c?`Stop treating ${e.displayName} as you`:`Tell DorkOS that ${e.displayName} is you`,className:"text-muted-foreground hover:text-foreground focus-visible:text-foreground focus-ring relative mt-1.5 block w-fit max-w-full truncate rounded text-xs underline-offset-2 transition-[color] duration-(--identity-answer) ease-(--identity-ease-standard) hover:underline focus-visible:underline disabled:pointer-events-none disabled:opacity-60",children:c?"Not me":"This is me"}),a&&i.jsx("p",{role:"alert","data-slot":"team-member-link-error",className:"text-destructive relative mt-1 text-xs",children:a}),s&&t&&i.jsxs("div",{className:"relative mt-1.5 flex w-fit max-w-full items-baseline",children:[i.jsxs("button",{type:"button","data-slot":"team-member-owner","data-card-aside":"",onClick:()=>t(s.id),"aria-label":`Show only ${s.displayName} and their agents`,className:"text-muted-foreground hover:text-foreground focus-visible:text-foreground focus-ring peer/owner relative min-w-0 truncate rounded text-xs underline-offset-2 transition-[color] duration-(--identity-answer) ease-(--identity-ease-standard) hover:underline focus-visible:underline",children:["by ",K(s)]}),l!==void 0&&l>0&&i.jsxs("span",{"aria-hidden":!0,"data-slot":"team-member-owner-count",className:"text-muted-foreground pointer-events-none absolute top-0 left-full ml-1 hidden text-xs whitespace-nowrap opacity-0 transition-opacity duration-(--identity-answer) ease-(--identity-ease-standard) peer-hover/owner:opacity-100 peer-focus-visible/owner:opacity-100 [@media(hover:hover)]:block",children:["· ",l," ",l===1?"agent":"agents"]})]})]})]})}const fo=120;function mo({memberCount:e,reducedMotion:s}){return!s&&e<=fo}const yt="grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3";function po({owner:e,onSelectOwner:s,ref:t}){const n=st(e),o="col-span-full mt-3 flex min-w-0 items-center first:mt-0",r=i.jsxs(i.Fragment,{children:[i.jsx(ot,{size:"xs",kind:n.kind,color:n.color,emoji:n.emoji,imageUrl:n.imageUrl,fallback:n.fallback,origin:n.origin}),i.jsx("span",{className:"truncate text-sm font-medium",children:e.displayName}),i.jsx("span",{className:"text-muted-foreground truncate text-xs",children:K(e)})]});return s?i.jsx("h2",{ref:t,className:o,children:i.jsx("button",{type:"button",onClick:()=>s(e.id),className:"focus-ring flex min-w-0 items-center gap-2 rounded",children:r})}):i.jsx("h2",{ref:t,className:z(o,"gap-2"),children:r})}function ho({members:e,roster:s,grouped:t,onSelectOwner:n,onOpenProfile:o,onSetLinkedToMe:r,identityLinkState:a,className:l}){const u=tn(),d=mo({memberCount:e.length,reducedMotion:u===!0}),f=(g,c)=>{const p=c?Je(g,s):void 0;return i.jsx(go,{member:g,owner:p,ownedAgentCount:p?on(p.id,s):void 0,onSelectOwner:c?n:void 0,onOpenProfile:o,onSetLinkedToMe:r,linkPending:(a==null?void 0:a.pendingId)===g.id,...(a==null?void 0:a.errorId)===g.id&&a.errorMessage?{linkError:a.errorMessage}:{},layoutAnimated:d},g.id)},h=t?nn(e,s).flatMap(g=>[g.owner?i.jsx(po,{owner:g.owner,onSelectOwner:n},`cluster:${g.owner.id}`):i.jsx("h2",{className:"text-muted-foreground col-span-full mt-3 text-sm font-medium first:mt-0",children:"No owner"},"cluster:__unowned"),...g.members.map(c=>f(c,!1))]):e.map(g=>f(g,!0));return i.jsx("div",{"data-slot":t?"team-roster-groups":"team-roster-grid","data-testid":sn.teamRoster,"data-layout-animated":String(d),className:z(yt,l),children:i.jsx(ge,{mode:"popLayout",initial:!1,children:h})})}const xo=6;function vo({count:e=xo}={}){return i.jsx("div",{className:yt,"aria-busy":"true","aria-label":"Loading the team",children:Array.from({length:e}).map((s,t)=>i.jsxs("div",{className:"bg-card shadow-soft flex items-start gap-3 rounded-lg border p-4",children:[i.jsx(E,{className:"size-9 shrink-0 rounded-full"}),i.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[i.jsx(E,{className:"h-4 w-24"}),i.jsx(E,{className:"h-3 w-16"}),i.jsx(E,{className:"h-3 w-32"})]})]},t))})}const So=[{value:"all",label:"All"},{value:"people",label:"People"},{value:"agents",label:"Agents"}];function Co({filters:e,onFiltersChange:s,people:t,className:n}){const o=e.owner?t.find(r=>r.id===e.owner):void 0;return i.jsxs("div",{className:z("space-y-3",n),children:[i.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto pb-0.5",children:[i.jsx("div",{role:"group","aria-label":"Filter by kind",className:"flex items-center gap-1.5",children:So.map(r=>i.jsx(I,{type:"button",size:"xs",variant:e.kind===r.value?"default":"outline","aria-pressed":e.kind===r.value,onClick:()=>s({kind:r.value}),className:"shrink-0",children:r.label},r.value))}),t.length>1&&i.jsx("div",{role:"group","aria-label":"Filter by person",className:"flex items-center gap-1.5",children:t.map(r=>i.jsx(I,{type:"button",size:"xs",variant:e.owner===r.id?"default":"outline","aria-pressed":e.owner===r.id,"aria-label":`Show only ${r.displayName} and their agents`,onClick:()=>s({owner:e.owner===r.id?void 0:r.id}),className:"max-w-40 shrink-0 truncate",children:K(r)},r.id))})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i.jsx(I,{type:"button",size:"xs",variant:e.group==="manager"?"default":"outline","aria-pressed":e.group==="manager",onClick:()=>s({group:e.group==="manager"?"none":"manager"}),className:"shrink-0",children:"Group by owner"}),i.jsxs("div",{className:"relative flex-1 sm:w-56 sm:flex-none",children:[i.jsx(rn,{"aria-hidden":!0,className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2"}),i.jsx(an,{type:"search","aria-label":"Search the team",placeholder:"Search",value:e.q??"",onChange:r=>s({q:r.target.value===""?void 0:r.target.value}),className:"h-8 pl-8 text-xs"})]})]})]}),o&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("p",{className:"text-muted-foreground text-xs",children:["Showing ",K(o)," and their agents"]}),i.jsxs(I,{type:"button",size:"xs",variant:"ghost",onClick:()=>s({owner:void 0}),children:[i.jsx(Ce,{"aria-hidden":!0,className:"size-3"}),"Clear"]})]})]})}const wo={agents:"Couldn’t read all your agents. Showing the rest.",authors:"Couldn’t read everyone on this install. Showing the rest.",account:"Couldn’t read your account, so your own name may be missing.",claims:"Couldn’t tell which of your agents are working right now.",rooms:"Couldn’t read your rooms, so where agents work may be missing.",sessions:"Couldn’t read recent chats, so “last active” may be missing."};function Ro(e){return wo[e]??"Some of your team couldn’t be loaded."}function yo({warnings:e,className:s}){const[t,n]=y.useState(!1);return!e||e.length===0||t?null:i.jsxs("div",{role:"status","data-slot":"team-roster-warnings",className:z("border-status-warning/40 bg-status-warning/10 flex items-start gap-2 rounded-lg border px-3 py-2",s),children:[i.jsx(We,{"aria-hidden":!0,className:"text-status-warning mt-0.5 size-4 shrink-0"}),i.jsx("ul",{className:"min-w-0 flex-1 space-y-0.5 text-xs",children:e.map(o=>i.jsx("li",{children:Ro(o.source)},o.source))}),i.jsx(I,{type:"button",size:"xs",variant:"ghost","aria-label":"Dismiss",onClick:()=>n(!0),className:"-my-0.5 shrink-0",children:i.jsx(Ce,{"aria-hidden":!0,className:"size-3"})})]})}function jo({filters:e,onFiltersChange:s}){const[t,n]=y.useState(ln),o=e??t,r=j=>{e!==void 0?s(j):n(_=>({..._,...j}))},{open:a}=Se(),l=Pn(),{data:u,isLoading:d,isError:f,refetch:h}=Ze(),g=rt(d),c=y.useMemo(()=>(u==null?void 0:u.members)??[],[u]),p=y.useMemo(()=>Ye(c,o),[c,o]),m=y.useMemo(()=>c.filter(j=>j.kind==="human"),[c]),x=c.some(j=>j.kind==="agent"),v=y.useMemo(()=>In(c),[c]),w=y.useMemo(()=>{const j=new Set(c.filter(_=>{const V=un(_,c);return V==="managed"||V==="system"}).flatMap(_=>{var V;return(V=_.agent)!=null&&V.manifestId?[_.agent.manifestId]:[]}));return _=>j.has(_.agentId)},[c]),R=o.kind!=="all"||o.owner!==void 0||(o.q??"")!=="";return f?i.jsx(it,{className:"h-full",title:"Couldn’t load your team",description:"The DorkOS server didn’t answer. Check that it’s running.",onRetry:()=>void h()}):i.jsxs(Mn,{width:"full",className:"flex flex-col gap-4",children:[i.jsx(yo,{warnings:u==null?void 0:u.warnings}),i.jsx(Co,{filters:o,onFiltersChange:r,people:m}),g?i.jsx(vo,{}):p.length>0?i.jsx(ho,{members:p,roster:c,grouped:o.group==="manager",onSelectOwner:j=>r({owner:j}),onOpenProfile:a,onSetLinkedToMe:(j,_)=>l.mutate({memberId:j,linked:_}),identityLinkState:{...l.isPending&&l.variables?{pendingId:l.variables.memberId}:{},...l.isError&&l.variables?{errorId:l.variables.memberId,errorMessage:$n(l.error,l.variables.linked)}:{}}}):i.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:R?"Nobody here matches that.":"Nobody to show yet."}),!g&&c.length>0&&!x&&i.jsx("div",{className:"flex justify-center py-6",children:i.jsx(Ct,{})}),!g&&x&&i.jsxs("section",{"aria-labelledby":"team-commitments",className:"flex flex-col gap-2 pt-2",children:[i.jsx("h2",{id:"team-commitments",className:"text-sm font-medium",children:"Commitments"}),i.jsx(An,{nameOf:v,canChange:w})]})]})}const _o=y.lazy(()=>vn(()=>import("./TopologyGraph-CnpH2NjE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28])).then(e=>({default:e.TopologyGraph}))),No=.15,q={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:No}};function Fo(){return i.jsxs(i.Fragment,{children:[i.jsx(dn,{children:"Team"}),i.jsx(Mo,{})]})}function Mo(){const e=cn({from:"/_shell/team"}),s=Qe(),t=Ke(),n=gn(),[,o]=fn(),r=mn(),{data:a,isLoading:l,isError:u,refetch:d}=at(),f=rt(l),h=pn(e.view),g=e.agent,c=y.useMemo(()=>({kind:e.kind,owner:e.owner,group:e.group,q:e.q}),[e.kind,e.owner,e.group,e.q]);function p(w){s({...Y.team(),search:R=>({...R,...w})})}function m(){s({...Y.team(),search:w=>({...w,agent:void 0})})}const x=y.useMemo(()=>(a==null?void 0:a.namespaces.flatMap(w=>w.agents))??[],[a]),v=x.length===0&&!f&&!u&&(h==="table"||h==="topology");return u&&h!=="cards"?i.jsx(it,{className:"h-full",title:"Couldn’t load agents",description:"The DorkOS server didn’t answer. Check that it’s running.",onRetry:()=>void d()}):v?i.jsx("div",{className:"flex h-full flex-col items-center justify-center",children:i.jsx(Ct,{})}):i.jsx("div",{className:"flex h-full flex-col",children:i.jsxs(ge,{mode:"wait",initial:!1,children:[h==="cards"&&i.jsx($.div,{...q,className:"flex h-full flex-col",children:i.jsx(jo,{filters:c,onFiltersChange:p})},"view-cards"),h==="table"&&i.jsx($.div,{...q,className:"flex h-full flex-col",children:i.jsx(Js,{agents:x,isLoading:f,rosterFilters:c})},"view-table"),h==="topology"&&i.jsx($.div,{...q,className:"relative flex-1 overflow-hidden",children:i.jsxs("div",{className:"flex h-full",children:[i.jsx($.div,{layout:!0,className:"min-w-0 flex-1",transition:Ve.glide,children:i.jsx("div",{className:"absolute inset-0",children:i.jsx(y.Suspense,{fallback:i.jsxs("div",{className:"text-muted-foreground flex h-full items-center justify-center text-sm",children:[i.jsx(J,{className:"mr-2"}),"Loading topology…"]}),children:i.jsx(_o,{onSelectAgent:w=>void s({...Y.team(),search:R=>({...R,agent:w})}),onViewProfile:(w,R)=>{et.getState().openProfileDocked(R)},onOpenChat:w=>{var j;const R=(j=x.find(_=>_.projectPath===w))==null?void 0:j.effectiveRuntimeId;R?r(w,{runtime:R}):o(w)},onOpenAdapterCatalog:()=>n(),onGoToDiscovery:()=>void s({...Y.team(),search:w=>({...w,view:"table"})})})})})}),t?i.jsx(hn,{open:!!g,onOpenChange:w=>!w&&m(),children:i.jsx(xn,{children:g&&i.jsx(Ue,{agentId:g,onClose:m})})}):i.jsx(ge,{children:g&&i.jsx($.div,{initial:{width:0,opacity:0},animate:{width:256,opacity:1},exit:{width:0,opacity:0},transition:Ve.glide,className:"bg-background overflow-y-auto border-l",children:i.jsx(Ue,{agentId:g,onClose:m})})})]})},"view-topology"),h==="denied"&&i.jsx($.div,{...q,children:i.jsx(no,{})},"view-denied"),h==="access"&&i.jsx($.div,{...q,children:i.jsx(lo,{})},"view-access")]})})}function Po(){return i.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto",children:[i.jsx(Vn,{}),i.jsx("div",{className:"min-h-0 flex-1",children:i.jsx(Fo,{})})]})}const Oo=Object.freeze(Object.defineProperty({__proto__:null,component:Po},Symbol.toStringTag,{value:"Module"}));export{Rt as H,Oo as _};
28
+ */function be(e,s){return e?Rs(e)?y.createElement(e,s):e:null}function Rs(e){return ys(e)||typeof e=="function"||js(e)}function ys(e){return typeof e=="function"&&(()=>{const s=Object.getPrototypeOf(e);return s.prototype&&s.prototype.isReactComponent})()}function js(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function _s(e){const s={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=y.useState(()=>({current:Cs(s)})),[n,o]=y.useState(()=>t.current.initialState);return t.current.setOptions(r=>({...r,...e,state:{...n,...e.state},onStateChange:a=>{o(a),e.onStateChange==null||e.onStateChange(a)}})),t.current}function Ns(e){if("id"in e&&e.id)return e.id;if("accessorKey"in e&&typeof e.accessorKey=="string")return e.accessorKey}function Fs({columns:e,data:s,emptyMessage:t="No results.",tableOptions:n,groupBy:o,className:r,tableClassName:a}){var p;const l=Ke(),u=y.useMemo(()=>{var x;if(!l)return{};const m={};for(const v of e){const w=Ns(v);w&&((x=v.meta)!=null&&x.hideOnMobile)&&(m[w]=!1)}return m},[e,l]),d=y.useMemo(()=>{var m;return{...u,...((m=n==null?void 0:n.state)==null?void 0:m.columnVisibility)??{}}},[u,(p=n==null?void 0:n.state)==null?void 0:p.columnVisibility]),f=_s({data:s,columns:e,getCoreRowModel:ws(),...n,state:{...n==null?void 0:n.state,columnVisibility:d}}),h=f.getRowModel().rows,g=f.getVisibleLeafColumns().length,c=y.useMemo(()=>{if(!o)return new Map;const m=new Map;for(const x of h){const v=o.key(x.original);m.set(v,(m.get(v)??0)+1)}return m},[o,h]);return i.jsx("div",{"data-slot":"data-table",className:z("rounded-md border",r),children:i.jsxs(_n,{className:a,children:[i.jsx(Nn,{children:f.getHeaderGroups().map(m=>i.jsx(X,{children:m.headers.map(x=>{var v;return i.jsx(De,{className:(v=x.column.columnDef.meta)==null?void 0:v.headClassName,children:x.isPlaceholder?null:be(x.column.columnDef.header,x.getContext())},x.id)})},m.id))}),i.jsx(Fn,{children:h.length?h.map((m,x)=>{const v=o==null?void 0:o.key(m.original),w=x>0?o==null?void 0:o.key(h[x-1].original):void 0,R=v!==void 0&&v!==w;return i.jsxs(y.Fragment,{children:[R&&i.jsx(X,{"data-slot":"data-table-group-header",className:"bg-muted/40 hover:bg-muted/40",children:i.jsx(De,{colSpan:g,className:"h-8",children:o==null?void 0:o.header(v,c.get(v)??0)})}),i.jsx(X,{"data-state":m.getIsSelected()?"selected":void 0,children:m.getVisibleCells().map(j=>{var _;return i.jsx(ke,{className:(_=j.column.columnDef.meta)==null?void 0:_.cellClassName,children:be(j.column.columnDef.cell,j.getContext())},j.id)})})]},m.id)}):i.jsx(X,{children:i.jsx(ke,{colSpan:g,className:"h-24 text-center",children:t})})})]})})}function Ms({onClearFilters:e,filterDescription:s}){return i.jsxs($.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[i.jsx(Sn,{className:"text-muted-foreground/50 size-10"}),i.jsx("p",{className:"text-muted-foreground text-sm",children:s?`No agents match ${s}`:"No agents match your filters"}),i.jsx(I,{variant:"outline",size:"sm",onClick:e,children:"Clear filters"})]})}function Ps({peopleOnly:e}){return i.jsxs($.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},className:"flex flex-col items-center justify-center gap-2 py-12 text-center","data-slot":"agent-roster-filter-empty",children:[i.jsx(_t,{className:"text-muted-foreground/50 size-10"}),i.jsx("p",{className:"text-muted-foreground max-w-xs text-sm",children:e?"This table lists agents. Switch to Cards to see people.":"No agents match this filter. Change it in Cards."})]})}const Le=["needs-you","working","quiet"],$s=1440*60*1e3;function Is(e,s=Date.now()){const t=Date.parse(e);return Number.isNaN(t)?!0:s-t>=$s}const As=30,Vs=25,Es=20,Ds=20,ks=10,zs=0;function ve(e){const{healthStatus:s,taskCount:t,chatState:n}=e;return s==="unreachable"?{group:"needs-you",severity:As}:n==="needs-attention"?{group:"needs-you",severity:Vs}:s==="stale"&&t>0&&e.isPastOnboardingGrace?{group:"needs-you",severity:Es}:n==="active"?{group:"working",severity:Ds}:s==="active"?{group:"working",severity:ks}:{group:"quiet",severity:zs}}function He(e){if(!e)return Number.NEGATIVE_INFINITY;const s=Date.parse(e);return Number.isNaN(s)?Number.NEGATIVE_INFINITY:s}function Ts(e,s){const t=ve(e),n=ve(s),o=Le.indexOf(t.group)-Le.indexOf(n.group);if(o!==0)return o;const r=n.severity-t.severity;if(r!==0)return r;const a=He(s.lastSeenAt)-He(e.lastSeenAt);return a!==0?a:G(e).localeCompare(G(s))}function bs(e,s="asc"){const t=s==="desc"?-1:1;return[...e].sort((n,o)=>t*Ts(n,o))}const Ls={"needs-you":{label:"Needs you",toneClass:"text-destructive"},working:{label:"Working",toneClass:"text-foreground"},quiet:{label:"Quiet",toneClass:"text-muted-foreground"}};function Hs(e,s,t){if(!t)return e;if(t.kind==="people")return[];if(!(t.owner!==void 0||(t.q??"").trim()!==""))return e;const o=s.filter(a=>a.kind==="agent");if(o.length===0)return e;const r=new Set(Ye(o,t).map(a=>a.id));return e.filter(a=>r.has(a.id))}const Ge=32,Gs=5,St="Checked in",Os={heartbeat:"Checked in",message_sent:"Got a message",response_complete:"Finished a reply"};function Bs(e,s){return s===null&&e==="stale"}function Oe(e){return e.length<2||e.length>Gs?!1:e===e.toUpperCase()&&new RegExp("\\p{Lu}","u").test(e)}function qs(e){const s=Os[e.trim().toLowerCase()];if(s)return s;const t=e.replace(/[^\p{L}\p{N}]+/gu," ").trim().split(" ").filter(Boolean).map(a=>Oe(a)?a:a.toLowerCase());if(t.length===0)return St;const n=t[0];t[0]=Oe(n)?n:n.replace(/^./u,a=>a.toUpperCase());const o=t.join(" "),r=Array.from(o);return r.length<=Ge?o:`${r.slice(0,Ge-1).join("").trimEnd()}…`}function Be(e){const s=e.filter(t=>!!t);return s.length>0?s.join(" · "):null}function Us(e){const{healthStatus:s,lastSeenAt:t,lastSeenEvent:n,chatState:o}=e,r=t?ce(t):null,a=n?qs(n):null;return s==="unreachable"?{primary:"Can’t be reached",secondary:Be([a,r??"never seen"]),toneClass:"text-destructive"}:o==="needs-attention"?{primary:"A chat needs you",secondary:Be([a,r]),toneClass:"text-destructive"}:Bs(s,t)?o==="active"?{primary:"Active in a chat",secondary:null,toneClass:"text-foreground"}:{primary:"Not used yet",secondary:null,toneClass:"text-muted-foreground"}:{primary:a??St,secondary:r,toneClass:s==="active"?"text-foreground":"text-muted-foreground"}}function Ks(e){if(!e)return null;const s=e.split("/").filter(Boolean);return s.length<=2?e:s.slice(-2).join("/")}function Ys({row:e,onOpen:s}){const{color:t,emoji:n}=Mt(e),o=Ks(e.projectPath),r=Xe(e.runtime).label;return i.jsxs("button",{type:"button",className:"flex w-full min-w-0 items-center gap-2 text-left",onClick:s,children:[i.jsx(Pt,{color:t,emoji:n,size:"xs"}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-sm font-medium hover:underline",children:G(e)}),i.jsxs("span",{className:"text-muted-foreground block truncate text-xs",children:[o??r,o&&i.jsxs("span",{className:"hidden md:inline",children:[" · ",r]})]})]}),e.isDefault&&i.jsxs(A,{size:"xs",variant:"outline",className:"shrink-0 max-md:border-0 max-md:px-0 max-md:py-0",children:[i.jsx($t,{className:"size-2.5 fill-current md:mr-0.5"}),i.jsx("span",{className:"sr-only md:not-sr-only",children:"Default"})]})]})}function Xs({row:e}){const{primary:s,secondary:t,toneClass:n}=Us(e);return i.jsxs("span",{className:"block min-w-0",children:[i.jsx("span",{className:z("block truncate text-sm",n),children:s}),t&&i.jsx("span",{className:"text-muted-foreground block truncate text-xs tabular-nums",children:t})]})}function Ws(e){return[{accessorKey:"name",header:"Agent",meta:{headClassName:"w-[42%] md:w-[38%]",cellClassName:"overflow-hidden"},cell:({row:s})=>i.jsx(Ys,{row:s.original,onOpen:()=>e.onNavigate(s.original.projectPath??"")})},{accessorKey:"lastSeenEvent",header:"Activity",meta:{headClassName:"truncate",cellClassName:"truncate"},cell:({row:s})=>i.jsx(Xs,{row:s.original})},{id:"managedBy",header:"Managed by",meta:{hideOnMobile:!0,headClassName:"w-[140px]",cellClassName:"overflow-hidden"},cell:({row:s})=>{const t=s.original.managedBy;return i.jsx("span",{"data-slot":"agent-managed-by",className:"text-muted-foreground block truncate text-xs",children:t??"—"})}},{accessorKey:"taskCount",header:"Scheduled",meta:{hideOnMobile:!0,headClassName:"w-[110px]"},cell:({row:s})=>{const t=s.original.taskCount;return t===0?i.jsx("span",{className:"text-muted-foreground text-xs",children:"—"}):i.jsxs(A,{variant:"outline",className:"whitespace-nowrap",children:[t," ",t===1?"schedule":"schedules"]})}},{id:"actions",header:"",meta:{headClassName:"w-[88px]"},cell:({row:s})=>{const t=s.original;return i.jsxs("div",{className:"flex items-center justify-end gap-1",children:[i.jsx(I,{variant:"ghost",size:"sm",className:"size-8 p-0",onClick:n=>{n.stopPropagation(),e.onNavigate(t.projectPath??"")},"aria-label":`Open chat with ${G(t)}`,children:i.jsx(Nt,{className:"size-4"})}),i.jsx(I,{variant:"ghost",size:"sm",className:"size-8 p-0",onClick:n=>{n.stopPropagation(),e.onViewProfile(t.projectPath??"")},"aria-label":`Open ${G(t)}’s profile`,children:i.jsx(Ft,{className:"size-4"})})]})}}]}function Qs({group:e,count:s}){const{label:t,toneClass:n}=Ls[e];return i.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-semibold tracking-wide uppercase",children:[e==="needs-you"&&i.jsx(We,{className:z("size-3.5",n)}),i.jsx("span",{className:n,children:t}),i.jsx("span",{className:"text-muted-foreground font-normal tabular-nums",children:s})]})}function Zs({rows:e,grouped:s,callbacks:t}){const n=y.useMemo(()=>Ws(t),[t]),o=y.useMemo(()=>s?{key:r=>ve(r).group,header:(r,a)=>i.jsx(Qs,{group:r,count:a})}:void 0,[s]);return i.jsx(Fs,{columns:n,data:e,groupBy:o,emptyMessage:"No agents registered.",className:"border-0",tableClassName:"table-fixed"})}function Js({agents:e,isLoading:s,rosterFilters:t}){var O;const n=Qe(),o=It(),{open:r}=Se(),a=At(),l=Cn(te,{debounce:{search:200}}),{data:u}=Ze(),d=y.useMemo(()=>(u==null?void 0:u.members)??[],[u]),f=y.useMemo(()=>Hs(e,d,t),[e,d,t]),h=y.useMemo(()=>[...new Set(f.map(N=>N.namespace).filter(N=>!!N))],[f]),g=!l.sortField||l.sortField===_e,c=y.useMemo(()=>g?te.applyFilters(f,l.values):Vt(f,te,l.values,Lt,{field:l.sortField,direction:l.sortDirection}),[f,g,l.values,l.sortField,l.sortDirection]),p=y.useMemo(()=>e.map(N=>N.projectPath).filter(N=>!!N),[e]),m=Rn(p),{data:x}=Et({queryKey:Dt.current(),queryFn:()=>o.getConfig(),staleTime:3e4}),v=y.useMemo(()=>{const N=new Map;for(const F of d){if(F.kind!=="agent")continue;const L=Je(F,d);L&&N.set(F.id,K(L))}return N},[d]),w=y.useMemo(()=>{const N=c.map(F=>{var L;return{...F,chatState:(F.projectPath?m[F.projectPath]:void 0)??"fresh",isPastOnboardingGrace:Is(F.registeredAt),isDefault:((L=x==null?void 0:x.agents)==null?void 0:L.defaultAgent)===F.name,managedBy:v.get(F.id)??null}});return g?bs(N,l.sortDirection):N},[c,m,(O=x==null?void 0:x.agents)==null?void 0:O.defaultAgent,v,g,l.sortDirection]),R=y.useCallback(N=>{const F=a.get(N);if(F===void 0){et.getState().openProfileDocked(N);return}r(F)},[a,r]),j=y.useCallback(N=>{kt(o,N).then(F=>n(F)).catch(F=>{zt(o,F),Tt(N)})},[n,o]),_=y.useMemo(()=>({onNavigate:j,onViewProfile:R}),[j,R]);function V(){return f.length===0&&e.length>0?i.jsx(Ps,{peopleOnly:(t==null?void 0:t.kind)==="people"}):c.length===0&&f.length>0?i.jsx(Ms,{onClearFilters:l.clearAll,filterDescription:l.describeActive()}):i.jsx(Zs,{rows:w,grouped:g,callbacks:_})}return s?i.jsx("div",{className:"space-y-3 p-4 sm:px-6",children:Array.from({length:3}).map((N,F)=>i.jsx(E,{className:"h-14 w-full rounded-xl"},F))}):i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsxs(H,{state:l,className:"sm:px-6",children:[i.jsx(H.Search,{placeholder:"Filter agents…"}),i.jsx(H.Primary,{name:"status"}),i.jsx(H.AddFilter,{dynamicOptions:{namespace:h}}),i.jsx(H.Sort,{options:bt,defaultField:_e}),i.jsx(H.ResultCount,{count:c.length,total:f.length,noun:"agent"}),i.jsx(H.ActiveFilters,{})]}),i.jsx(wn,{className:"min-h-0 flex-1",children:i.jsx("div",{className:"px-4 pb-4 sm:px-6",children:V()})})]})}const eo={animate:{transition:{staggerChildren:.1}}},to={initial:{opacity:0},animate:{opacity:.2,transition:{duration:.3}}};function de(){return i.jsxs($.div,{variants:to,className:"rounded-xl border border-dashed px-4 py-3",children:[i.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[i.jsx(E,{className:"size-3 rounded-full"}),i.jsx(E,{className:"h-3 w-32"}),i.jsx(E,{className:"h-3 w-16"}),i.jsx(E,{className:"ml-auto h-3 w-10"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(E,{className:"h-2.5 w-48"}),i.jsx(E,{className:"h-2.5 w-20"})]})]})}function Ct(){const e=Ht(n=>n.open),s=Gt(n=>n.open),t=Ot();return i.jsxs("div",{className:"relative w-full max-w-2xl px-4",children:[i.jsxs($.div,{variants:eo,initial:"initial",animate:"animate",className:"space-y-3",children:[i.jsx(de,{}),i.jsx(de,{}),i.jsx(de,{})]}),i.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:t?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-lg font-semibold",children:"No agents yet"}),i.jsxs(I,{size:"sm",className:"gap-1.5",onClick:()=>s(),children:[i.jsx(tt,{className:"size-3.5"}),"Create agent"]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-lg font-semibold",children:"Bring in existing projects"}),i.jsxs(I,{size:"sm",className:"gap-1.5",onClick:e,children:[i.jsx(En,{className:"size-3.5"}),"Search for projects"]})]})})]})}function no(){const{data:e,isLoading:s}=Bt(),t=(e==null?void 0:e.denied)??[];return s?i.jsx("div",{className:"flex items-center justify-center p-8",children:i.jsx(J,{size:"md",className:"text-muted-foreground",label:"Loading blocked paths"})}):t.length===0?i.jsx(lt,{icon:qt,headline:"No blocked paths",description:"Folders you block from scans show up here."}):i.jsx("div",{className:"space-y-2 p-4",children:t.map(n=>i.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border px-4 py-3",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate font-mono text-sm",title:n.path,children:n.path}),n.reason&&i.jsx("p",{className:"text-muted-foreground truncate text-xs",title:n.reason,children:n.reason})]}),i.jsx(A,{variant:"outline",className:"shrink-0",children:n.deniedBy})]},n.path))})}function so({namespace:e,agentCount:s,agents:t}){const[n,o]=y.useState(!1);return i.jsxs("div",{className:"rounded-xl border",children:[i.jsxs("button",{type:"button",onClick:()=>o(!n),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-4 py-3 text-left transition-colors duration-150",children:[n?i.jsx(Kt,{className:"size-4"}):i.jsx(Yt,{className:"size-4"}),i.jsx("span",{className:"text-sm font-medium",children:e}),i.jsxs(A,{variant:"secondary",className:"ml-auto",children:[s," agent",s!==1?"s":""]})]}),n&&i.jsx("div",{className:"space-y-2 border-t px-4 py-2",children:t.map(r=>i.jsx("div",{className:"flex items-center justify-between py-1",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm",children:G(r)}),i.jsx(A,{variant:"outline",children:nt(r.runtime)})]})},r.id))})]})}function oo({sourceNamespace:e,targetNamespace:s,action:t,origin:n,onRemove:o}){const r=n==="default";return i.jsxs("div",{className:"flex items-center justify-between rounded-lg border px-3 py-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx("span",{className:"font-mono",children:e}),i.jsx("span",{className:"text-muted-foreground",children:"→"}),i.jsx("span",{className:"font-mono",children:s}),i.jsx(A,{variant:t==="allow"?"default":"destructive",children:t}),r&&i.jsx(A,{tone:"neutral",variant:"outline",children:"built-in"})]}),r?i.jsx("span",{className:"text-muted-foreground flex size-8 items-center justify-center",title:"Built-in rule, always enforced. Not removable",children:i.jsx(Xt,{className:"size-4","aria-hidden":"true"})}):i.jsx(I,{type:"button",variant:"ghost",size:"icon-sm",onClick:o,className:"text-muted-foreground hover:bg-destructive/10 hover:text-destructive","aria-label":`Remove access from ${e} to ${s}`,children:i.jsx(Wt,{})})]})}const wt="acl-open-mesh-explanation";function ro({namespaces:e,onAdd:s,isPending:t,inert:n}){const[o,r]=y.useState(""),[a,l]=y.useState("");function u(f){f.preventDefault(),!n&&o&&a&&o!==a&&(s(o,a),r(""),l(""))}const d=n?{"aria-disabled":!0,"aria-describedby":wt}:{};return i.jsxs("form",{onSubmit:u,className:"flex items-end gap-2",children:[i.jsxs("div",{className:"flex-1 space-y-1",children:[i.jsx(Fe,{htmlFor:"acl-source",className:"text-muted-foreground text-xs font-medium",children:"Source"}),i.jsxs(Me,{value:o,onValueChange:n?()=>{}:r,children:[i.jsx(Pe,{id:"acl-source",className:"w-full aria-disabled:pointer-events-none aria-disabled:opacity-50",...d,children:i.jsx($e,{placeholder:"Pick a project"})}),i.jsx(Ie,{children:e.map(f=>i.jsx(Ae,{value:f,children:f},f))})]})]}),i.jsxs("div",{className:"flex-1 space-y-1",children:[i.jsx(Fe,{htmlFor:"acl-target",className:"text-muted-foreground text-xs font-medium",children:"Target"}),i.jsxs(Me,{value:a,onValueChange:n?()=>{}:l,children:[i.jsx(Pe,{id:"acl-target",className:"w-full aria-disabled:pointer-events-none aria-disabled:opacity-50",...d,children:i.jsx($e,{placeholder:"Pick a project"})}),i.jsx(Ie,{children:e.map(f=>i.jsx(Ae,{value:f,children:f},f))})]})]}),i.jsxs(I,{type:"submit",className:"aria-disabled:pointer-events-none aria-disabled:opacity-50",disabled:!n&&(t||!o||!a||o===a),...d,children:[t?i.jsx(J,{}):i.jsx(tt,{}),"Allow access"]})]})}function io({onGoToDiscovery:e}={}){const{data:s,isLoading:t}=at(),{mutate:n,isPending:o}=yn();if(t)return i.jsx("div",{className:"flex items-center justify-center p-8",children:i.jsx(J,{size:"md",className:"text-muted-foreground"})});const r=(s==null?void 0:s.namespaces)??[],a=(s==null?void 0:s.openMesh)??!1,l=((s==null?void 0:s.accessRules)??[]).filter(d=>!(d.origin==="explicit"&&d.sourceNamespace===Ne&&d.targetNamespace===Ne)),u=r.map(d=>d.namespace);return r.length===0?i.jsxs("div",{className:"space-y-6 p-4",children:[i.jsx(Ee,{}),i.jsx(lt,{icon:Ut,headline:"You need agents in more than one project",description:"Add agents from a second folder to let two projects talk.",action:e?{label:"Go to Discovery",onClick:e}:void 0})]}):i.jsxs("div",{className:"space-y-6 p-4",children:[i.jsx(Ee,{}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-muted-foreground text-sm font-medium",children:"Projects"}),r.map(d=>i.jsx(so,{namespace:d.namespace,agentCount:d.agentCount,agents:d.agents},d.namespace))]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-muted-foreground text-sm font-medium",children:"Cross-project access rules"}),l.length===0?i.jsx("p",{className:"text-muted-foreground text-xs",children:"No rules yet. Agents only talk within their own project."}):i.jsx("div",{className:"space-y-1",children:l.map(d=>i.jsx(oo,{sourceNamespace:d.sourceNamespace,targetNamespace:d.targetNamespace,action:d.action,origin:d.origin,onRemove:()=>n({sourceNamespace:d.sourceNamespace,targetNamespace:d.targetNamespace,action:"deny"})},`${d.sourceNamespace}-${d.targetNamespace}-${d.action}-${d.origin}`))})]}),u.length>=2&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-muted-foreground text-sm font-medium",children:"Allow cross-project access"}),a&&i.jsx("p",{id:wt,className:"text-muted-foreground text-xs",children:"Already allowed by the switch above. Turn it off to pick pairs."}),i.jsx(ro,{namespaces:u,isPending:o,inert:a,onAdd:(d,f)=>n({sourceNamespace:d,targetNamespace:f,action:"allow"})})]})]})}const Rt={active:{label:"Active",dot:ne.working},inactive:{label:"Inactive",dot:ne["needs-you"]},stale:{label:"Stale",dot:"bg-muted-foreground/50"},unreachable:{label:"Unreachable",dot:ne.error}};function ao(e){return e in Rt}function qe({onClick:e}){return i.jsx("button",{type:"button",onClick:e,"aria-label":"Close detail panel",className:"text-muted-foreground hover:text-foreground",children:i.jsx(Ce,{className:"size-(--size-icon-sm)"})})}function Ue({agentId:e,onClose:s}){const{data:t,isLoading:n}=jn(e),{open:o}=Se();if(n)return i.jsx("div",{className:"flex w-64 items-center justify-center border-l p-4",children:i.jsx("span",{className:"text-muted-foreground text-sm",children:"Loading…"})});if(!t)return i.jsxs("div",{className:"w-64 border-l p-4",children:[i.jsx("div",{className:"flex justify-end",children:i.jsx(qe,{onClick:s})}),i.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Agent not found"})]});const r=ao(t.status)?t.status:"stale",a=Rt[r];return i.jsxs("div",{className:"w-64 overflow-y-auto border-l p-4",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsx("h3",{className:"truncate text-sm font-semibold",children:t.name}),i.jsx(qe,{onClick:s})]}),i.jsxs("div",{className:"space-y-3 text-xs",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:z("h-2.5 w-2.5 rounded-full",a.dot),"aria-hidden":"true"}),i.jsx("span",{children:a.label})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Last seen: "}),i.jsx("span",{children:t.lastSeenAt?ce(t.lastSeenAt):"Never"})]}),t.lastSeenEvent&&i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Last event: "}),i.jsx("span",{children:t.lastSeenEvent})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Runs on: "}),i.jsx(A,{size:"xs",variant:"secondary",children:nt(t.runtime)})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Registered: "}),i.jsx("span",{children:t.registeredAt?ce(t.registeredAt):"Unknown"})]}),Array.isArray(t.capabilities)&&t.capabilities.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground mb-1 block",children:"Capabilities:"}),i.jsx("div",{className:"flex flex-wrap gap-1",children:t.capabilities.map(l=>i.jsx(A,{size:"xs",variant:"outline",children:l},l))})]})]}),i.jsx("div",{className:"mt-4 space-y-2 border-t pt-3",children:i.jsxs("button",{type:"button",onClick:()=>o(e),className:"hover:bg-muted inline-flex w-full items-center justify-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors duration-150",children:[i.jsx(Qt,{className:"size-3.5"}),"View profile"]})})]})}function lo(){return i.jsx(io,{})}function uo(e){var s;if(e.agent){const t=Xe(e.agent.runtime).label;return e.agent.model?`${t} · ${e.agent.model}`:t}return(s=e.person)!=null&&s.role?e.person.role:e.origin==="local"?"On this machine":`On ${en(e.origin.platform)}`}const co={layout:"position",initial:{opacity:0,scale:.97},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.97,transition:{duration:.15}},transition:{layout:{type:"spring",stiffness:280,damping:32},duration:.2,ease:[0,0,.2,1]}};function go({member:e,owner:s,onSelectOwner:t,onOpenProfile:n,onSetLinkedToMe:o,linkPending:r=!1,linkError:a,ownedAgentCount:l,layoutAnimated:u=!1,ref:d,className:f}){var p,m,x;const h=st(e),g=Zt(e),c=(p=e.person)==null?void 0:p.linkedToYou;return i.jsxs($.article,{ref:d,...u?co:{},"data-slot":"team-member-card","data-member-id":e.id,"data-layout-animated":String(u),style:{"--identity-color":h.color},className:z("bg-card shadow-soft relative flex items-start gap-3 rounded-lg border p-4","border-[color-mix(in_oklch,var(--identity-color)_var(--identity-border-strength),hsl(var(--border)))]","[--identity-border-strength:0%]",n&&["transition-[box-shadow,border-color,translate,scale] duration-(--identity-settle) ease-(--identity-ease-standard)","hover:shadow-elevated hover:-translate-y-px","hover:[--identity-border-strength:var(--identity-border-mix)]","has-[[data-slot=team-member-open]:focus-visible]:shadow-elevated has-[[data-slot=team-member-open]:focus-visible]:-translate-y-px","has-[[data-slot=team-member-open]:focus-visible]:[--identity-border-strength:var(--identity-border-mix)]","active:translate-y-0 active:scale-[0.99] active:duration-(--identity-press)",Jt,"has-[[data-card-aside]:hover]:shadow-soft has-[[data-card-aside]:hover]:translate-y-0 has-[[data-card-aside]:hover]:[--identity-border-strength:0%]","has-[[data-card-aside]:focus-visible]:shadow-soft has-[[data-card-aside]:focus-visible]:translate-y-0 has-[[data-card-aside]:focus-visible]:[--identity-border-strength:0%]","[&:has([data-card-aside]:hover)_[data-slot=identity-badge]]:scale-100 [&:has([data-card-aside]:hover)_[data-slot=identity-badge]]:rotate-0","[&:has([data-card-aside]:focus-visible)_[data-slot=identity-badge]]:scale-100 [&:has([data-card-aside]:focus-visible)_[data-slot=identity-badge]]:rotate-0","has-[[data-card-aside]:active]:scale-100"],f),children:[i.jsx(ot,{size:"md",kind:h.kind,color:h.color,emoji:h.emoji,imageUrl:h.imageUrl,fallback:h.fallback,origin:h.origin}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1",children:[i.jsx("h3",{className:"min-w-0 truncate text-sm font-medium",children:n?i.jsx("button",{type:"button","data-slot":"team-member-open",onClick:()=>n(e.id),"aria-label":`Open ${e.displayName}’s profile`,className:"focus-ring max-w-full truncate rounded text-left after:absolute after:inset-0 after:rounded-lg after:content-['']",children:e.displayName}):e.displayName}),e.isSelf&&i.jsx(A,{size:"xs",variant:"secondary",children:"you"}),((m=e.agent)==null?void 0:m.isDefault)&&i.jsx(A,{size:"xs",variant:"outline",children:"default"}),c&&i.jsx(A,{size:"xs",variant:"secondary",children:"also you"})]}),e.handle!==null&&i.jsxs("p",{"data-slot":"team-member-handle",className:"text-muted-foreground truncate text-xs",children:["@",e.handle]}),g&&i.jsx("p",{"data-slot":"team-member-name-source",className:"text-muted-foreground truncate text-xs",children:g}),i.jsx("p",{className:"text-muted-foreground mt-1.5 truncate text-xs",children:uo(e)}),((x=e.agent)==null?void 0:x.recentlyActive)&&i.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Active in the last hour"}),c!==void 0&&o&&i.jsx("button",{type:"button","data-slot":"team-member-link-to-me","data-card-aside":"",disabled:r,onClick:()=>o(e.id,!c),"aria-label":c?`Stop treating ${e.displayName} as you`:`Tell DorkOS that ${e.displayName} is you`,className:"text-muted-foreground hover:text-foreground focus-visible:text-foreground focus-ring relative mt-1.5 block w-fit max-w-full truncate rounded text-xs underline-offset-2 transition-[color] duration-(--identity-answer) ease-(--identity-ease-standard) hover:underline focus-visible:underline disabled:pointer-events-none disabled:opacity-60",children:c?"Not me":"This is me"}),a&&i.jsx("p",{role:"alert","data-slot":"team-member-link-error",className:"text-destructive relative mt-1 text-xs",children:a}),s&&t&&i.jsxs("div",{className:"relative mt-1.5 flex w-fit max-w-full items-baseline",children:[i.jsxs("button",{type:"button","data-slot":"team-member-owner","data-card-aside":"",onClick:()=>t(s.id),"aria-label":`Show only ${s.displayName} and their agents`,className:"text-muted-foreground hover:text-foreground focus-visible:text-foreground focus-ring peer/owner relative min-w-0 truncate rounded text-xs underline-offset-2 transition-[color] duration-(--identity-answer) ease-(--identity-ease-standard) hover:underline focus-visible:underline",children:["by ",K(s)]}),l!==void 0&&l>0&&i.jsxs("span",{"aria-hidden":!0,"data-slot":"team-member-owner-count",className:"text-muted-foreground pointer-events-none absolute top-0 left-full ml-1 hidden text-xs whitespace-nowrap opacity-0 transition-opacity duration-(--identity-answer) ease-(--identity-ease-standard) peer-hover/owner:opacity-100 peer-focus-visible/owner:opacity-100 [@media(hover:hover)]:block",children:["· ",l," ",l===1?"agent":"agents"]})]})]})]})}const fo=120;function mo({memberCount:e,reducedMotion:s}){return!s&&e<=fo}const yt="grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3";function po({owner:e,onSelectOwner:s,ref:t}){const n=st(e),o="col-span-full mt-3 flex min-w-0 items-center first:mt-0",r=i.jsxs(i.Fragment,{children:[i.jsx(ot,{size:"xs",kind:n.kind,color:n.color,emoji:n.emoji,imageUrl:n.imageUrl,fallback:n.fallback,origin:n.origin}),i.jsx("span",{className:"truncate text-sm font-medium",children:e.displayName}),i.jsx("span",{className:"text-muted-foreground truncate text-xs",children:K(e)})]});return s?i.jsx("h2",{ref:t,className:o,children:i.jsx("button",{type:"button",onClick:()=>s(e.id),className:"focus-ring flex min-w-0 items-center gap-2 rounded",children:r})}):i.jsx("h2",{ref:t,className:z(o,"gap-2"),children:r})}function ho({members:e,roster:s,grouped:t,onSelectOwner:n,onOpenProfile:o,onSetLinkedToMe:r,identityLinkState:a,className:l}){const u=tn(),d=mo({memberCount:e.length,reducedMotion:u===!0}),f=(g,c)=>{const p=c?Je(g,s):void 0;return i.jsx(go,{member:g,owner:p,ownedAgentCount:p?on(p.id,s):void 0,onSelectOwner:c?n:void 0,onOpenProfile:o,onSetLinkedToMe:r,linkPending:(a==null?void 0:a.pendingId)===g.id,...(a==null?void 0:a.errorId)===g.id&&a.errorMessage?{linkError:a.errorMessage}:{},layoutAnimated:d},g.id)},h=t?nn(e,s).flatMap(g=>[g.owner?i.jsx(po,{owner:g.owner,onSelectOwner:n},`cluster:${g.owner.id}`):i.jsx("h2",{className:"text-muted-foreground col-span-full mt-3 text-sm font-medium first:mt-0",children:"No owner"},"cluster:__unowned"),...g.members.map(c=>f(c,!1))]):e.map(g=>f(g,!0));return i.jsx("div",{"data-slot":t?"team-roster-groups":"team-roster-grid","data-testid":sn.teamRoster,"data-layout-animated":String(d),className:z(yt,l),children:i.jsx(ge,{mode:"popLayout",initial:!1,children:h})})}const xo=6;function vo({count:e=xo}={}){return i.jsx("div",{className:yt,"aria-busy":"true","aria-label":"Loading the team",children:Array.from({length:e}).map((s,t)=>i.jsxs("div",{className:"bg-card shadow-soft flex items-start gap-3 rounded-lg border p-4",children:[i.jsx(E,{className:"size-9 shrink-0 rounded-full"}),i.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[i.jsx(E,{className:"h-4 w-24"}),i.jsx(E,{className:"h-3 w-16"}),i.jsx(E,{className:"h-3 w-32"})]})]},t))})}const So=[{value:"all",label:"All"},{value:"people",label:"People"},{value:"agents",label:"Agents"}];function Co({filters:e,onFiltersChange:s,people:t,className:n}){const o=e.owner?t.find(r=>r.id===e.owner):void 0;return i.jsxs("div",{className:z("space-y-3",n),children:[i.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto pb-0.5",children:[i.jsx("div",{role:"group","aria-label":"Filter by kind",className:"flex items-center gap-1.5",children:So.map(r=>i.jsx(I,{type:"button",size:"xs",variant:e.kind===r.value?"default":"outline","aria-pressed":e.kind===r.value,onClick:()=>s({kind:r.value}),className:"shrink-0",children:r.label},r.value))}),t.length>1&&i.jsx("div",{role:"group","aria-label":"Filter by person",className:"flex items-center gap-1.5",children:t.map(r=>i.jsx(I,{type:"button",size:"xs",variant:e.owner===r.id?"default":"outline","aria-pressed":e.owner===r.id,"aria-label":`Show only ${r.displayName} and their agents`,onClick:()=>s({owner:e.owner===r.id?void 0:r.id}),className:"max-w-40 shrink-0 truncate",children:K(r)},r.id))})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i.jsx(I,{type:"button",size:"xs",variant:e.group==="manager"?"default":"outline","aria-pressed":e.group==="manager",onClick:()=>s({group:e.group==="manager"?"none":"manager"}),className:"shrink-0",children:"Group by owner"}),i.jsxs("div",{className:"relative flex-1 sm:w-56 sm:flex-none",children:[i.jsx(rn,{"aria-hidden":!0,className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2"}),i.jsx(an,{type:"search","aria-label":"Search the team",placeholder:"Search",value:e.q??"",onChange:r=>s({q:r.target.value===""?void 0:r.target.value}),className:"h-8 pl-8 text-xs"})]})]})]}),o&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("p",{className:"text-muted-foreground text-xs",children:["Showing ",K(o)," and their agents"]}),i.jsxs(I,{type:"button",size:"xs",variant:"ghost",onClick:()=>s({owner:void 0}),children:[i.jsx(Ce,{"aria-hidden":!0,className:"size-3"}),"Clear"]})]})]})}const wo={agents:"Couldn’t read all your agents. Showing the rest.",authors:"Couldn’t read everyone on this install. Showing the rest.",account:"Couldn’t read your account, so your own name may be missing.",claims:"Couldn’t tell which of your agents are working right now.",rooms:"Couldn’t read your rooms, so where agents work may be missing.",sessions:"Couldn’t read recent chats, so “last active” may be missing."};function Ro(e){return wo[e]??"Some of your team couldn’t be loaded."}function yo({warnings:e,className:s}){const[t,n]=y.useState(!1);return!e||e.length===0||t?null:i.jsxs("div",{role:"status","data-slot":"team-roster-warnings",className:z("border-status-warning/40 bg-status-warning/10 flex items-start gap-2 rounded-lg border px-3 py-2",s),children:[i.jsx(We,{"aria-hidden":!0,className:"text-status-warning mt-0.5 size-4 shrink-0"}),i.jsx("ul",{className:"min-w-0 flex-1 space-y-0.5 text-xs",children:e.map(o=>i.jsx("li",{children:Ro(o.source)},o.source))}),i.jsx(I,{type:"button",size:"xs",variant:"ghost","aria-label":"Dismiss",onClick:()=>n(!0),className:"-my-0.5 shrink-0",children:i.jsx(Ce,{"aria-hidden":!0,className:"size-3"})})]})}function jo({filters:e,onFiltersChange:s}){const[t,n]=y.useState(ln),o=e??t,r=j=>{e!==void 0?s(j):n(_=>({..._,...j}))},{open:a}=Se(),l=Pn(),{data:u,isLoading:d,isError:f,refetch:h}=Ze(),g=rt(d),c=y.useMemo(()=>(u==null?void 0:u.members)??[],[u]),p=y.useMemo(()=>Ye(c,o),[c,o]),m=y.useMemo(()=>c.filter(j=>j.kind==="human"),[c]),x=c.some(j=>j.kind==="agent"),v=y.useMemo(()=>In(c),[c]),w=y.useMemo(()=>{const j=new Set(c.filter(_=>{const V=un(_,c);return V==="managed"||V==="system"}).flatMap(_=>{var V;return(V=_.agent)!=null&&V.manifestId?[_.agent.manifestId]:[]}));return _=>j.has(_.agentId)},[c]),R=o.kind!=="all"||o.owner!==void 0||(o.q??"")!=="";return f?i.jsx(it,{className:"h-full",title:"Couldn’t load your team",description:"The DorkOS server didn’t answer. Check that it’s running.",onRetry:()=>void h()}):i.jsxs(Mn,{width:"full",className:"flex flex-col gap-4",children:[i.jsx(yo,{warnings:u==null?void 0:u.warnings}),i.jsx(Co,{filters:o,onFiltersChange:r,people:m}),g?i.jsx(vo,{}):p.length>0?i.jsx(ho,{members:p,roster:c,grouped:o.group==="manager",onSelectOwner:j=>r({owner:j}),onOpenProfile:a,onSetLinkedToMe:(j,_)=>l.mutate({memberId:j,linked:_}),identityLinkState:{...l.isPending&&l.variables?{pendingId:l.variables.memberId}:{},...l.isError&&l.variables?{errorId:l.variables.memberId,errorMessage:$n(l.error,l.variables.linked)}:{}}}):i.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:R?"Nobody here matches that.":"Nobody to show yet."}),!g&&c.length>0&&!x&&i.jsx("div",{className:"flex justify-center py-6",children:i.jsx(Ct,{})}),!g&&x&&i.jsxs("section",{"aria-labelledby":"team-todo-promises",className:"flex flex-col gap-2 pt-2",children:[i.jsx("h2",{id:"team-todo-promises",className:"text-sm font-medium",children:"To-dos"}),i.jsx(An,{nameOf:v,canChange:w})]})]})}const _o=y.lazy(()=>vn(()=>import("./TopologyGraph-DKZS3nlr.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])).then(e=>({default:e.TopologyGraph}))),No=.15,q={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:No}};function Fo(){return i.jsxs(i.Fragment,{children:[i.jsx(dn,{children:"Team"}),i.jsx(Mo,{})]})}function Mo(){const e=cn({from:"/_shell/team"}),s=Qe(),t=Ke(),n=gn(),[,o]=fn(),r=mn(),{data:a,isLoading:l,isError:u,refetch:d}=at(),f=rt(l),h=pn(e.view),g=e.agent,c=y.useMemo(()=>({kind:e.kind,owner:e.owner,group:e.group,q:e.q}),[e.kind,e.owner,e.group,e.q]);function p(w){s({...Y.team(),search:R=>({...R,...w})})}function m(){s({...Y.team(),search:w=>({...w,agent:void 0})})}const x=y.useMemo(()=>(a==null?void 0:a.namespaces.flatMap(w=>w.agents))??[],[a]),v=x.length===0&&!f&&!u&&(h==="table"||h==="topology");return u&&h!=="cards"?i.jsx(it,{className:"h-full",title:"Couldn’t load agents",description:"The DorkOS server didn’t answer. Check that it’s running.",onRetry:()=>void d()}):v?i.jsx("div",{className:"flex h-full flex-col items-center justify-center",children:i.jsx(Ct,{})}):i.jsx("div",{className:"flex h-full flex-col",children:i.jsxs(ge,{mode:"wait",initial:!1,children:[h==="cards"&&i.jsx($.div,{...q,className:"flex h-full flex-col",children:i.jsx(jo,{filters:c,onFiltersChange:p})},"view-cards"),h==="table"&&i.jsx($.div,{...q,className:"flex h-full flex-col",children:i.jsx(Js,{agents:x,isLoading:f,rosterFilters:c})},"view-table"),h==="topology"&&i.jsx($.div,{...q,className:"relative flex-1 overflow-hidden",children:i.jsxs("div",{className:"flex h-full",children:[i.jsx($.div,{layout:!0,className:"min-w-0 flex-1",transition:Ve.glide,children:i.jsx("div",{className:"absolute inset-0",children:i.jsx(y.Suspense,{fallback:i.jsxs("div",{className:"text-muted-foreground flex h-full items-center justify-center text-sm",children:[i.jsx(J,{className:"mr-2"}),"Loading topology…"]}),children:i.jsx(_o,{onSelectAgent:w=>void s({...Y.team(),search:R=>({...R,agent:w})}),onViewProfile:(w,R)=>{et.getState().openProfileDocked(R)},onOpenChat:w=>{var j;const R=(j=x.find(_=>_.projectPath===w))==null?void 0:j.effectiveRuntimeId;R?r(w,{runtime:R}):o(w)},onOpenAdapterCatalog:()=>n(),onGoToDiscovery:()=>void s({...Y.team(),search:w=>({...w,view:"table"})})})})})}),t?i.jsx(hn,{open:!!g,onOpenChange:w=>!w&&m(),children:i.jsx(xn,{children:g&&i.jsx(Ue,{agentId:g,onClose:m})})}):i.jsx(ge,{children:g&&i.jsx($.div,{initial:{width:0,opacity:0},animate:{width:256,opacity:1},exit:{width:0,opacity:0},transition:Ve.glide,className:"bg-background overflow-y-auto border-l",children:i.jsx(Ue,{agentId:g,onClose:m})})})]})},"view-topology"),h==="denied"&&i.jsx($.div,{...q,children:i.jsx(no,{})},"view-denied"),h==="access"&&i.jsx($.div,{...q,children:i.jsx(lo,{})},"view-access")]})})}function Po(){return i.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto",children:[i.jsx(Vn,{}),i.jsx("div",{className:"min-h-0 flex-1",children:i.jsx(Fo,{})})]})}const Oo=Object.freeze(Object.defineProperty({__proto__:null,component:Po},Symbol.toStringTag,{value:"Module"}));export{Rt as H,Oo as _};
@@ -0,0 +1 @@
1
+ import{a5 as R,a6 as C,aQ as j,a7 as T,r as c,gG as S,gH as N,gI as A,j as t,G as M,e as x,gJ as k,gK as P,eh as q,B as v,gL as _,cz as B,gM as D,gN as F,l as b}from"./index-BR1m9FON.js";import{C as O,P as Q}from"./registry-Tbt9pcZl.js";import{t as H,u as K,a as L,A as z,R as G,C as $,b as J,c as Y,d as Z,e as U}from"./ChannelComposer-CAYvz_ZB.js";import{E as V}from"./empty-state-BHcmkSzu.js";import{P as W}from"./page-container-0sWZ3xh9.js";import"./use-todos-BzRauzdQ.js";import"./file-CQGljfDT.js";import"./file-drag-GDx2qhdk.js";import"./find-latest-widget-fence-B6sJdG3Q.js";import"./WidgetErrorCard-C5ieVv_9.js";import"./index-CpWxcN5D.js";import"./progress-BA2JPtb6.js";import"./markdown-content-DhAtZOfj.js";import"./table-D0EJT0uP.js";import"./zap-DSllMMHe.js";import"./package-BhKXbvU_.js";import"./heart-Cn3a-UQI.js";import"./git-branch-CsLE6G0Y.js";import"./file-text-Cycq_S0e.js";import"./paperclip-C-7LhBfl.js";import"./index-Cgjq7a-8.js";import"./RuntimeSetupDialog-DTO5v0dP.js";import"./inline-code-mh48Uhbi.js";import"./list-runtime-types-DLmjtBMq.js";import"./RuntimeConnectFlow-BYQnY5vv.js";import"./copy-button-BOznikwM.js";import"./useMutationState-DIywUTDG.js";import"./runtime-connect-Dn0T5YWv.js";import"./use-transform-DzJeHpxm.js";import"./repeat-B8g-x-Sc.js";import"./use-room-sessions-DecGrP3E.js";import"./format-duration-BCr6uzby.js";import"./mention-pill-DmA8FxL4.js";import"./rotate-ccw-clock-DRtL-2nr.js";import"./unplug-B-ipHefz.js";import"./message-square-off-BowIzJUV.js";import"./registry-jD9zw538.js";const X=3e4;function ee(){const e=R();return C({queryKey:j.threads(),queryFn:()=>e.listThreads(),staleTime:X})}function te(e){const o=T(),n=c.useRef(null);c.useEffect(()=>{if(e===void 0)return;const r=n.current,i=new Map(e.map(s=>[s.rootEntryId,s.lastActivityAt]));if(n.current=i,r===null)return;const a=new Set;for(const s of e){const d=r.get(s.rootEntryId);d!==void 0&&d!==s.lastActivityAt&&a.add(s.roomId)}for(const s of a)o.invalidateQueries({queryKey:j.entries(s)})},[e,o])}const y=12;function oe(e){const[o,n]=c.useState(y),[r,i]=c.useState(null),a=c.useRef(new Set),s=c.useMemo(()=>e.filter((p,m)=>m<o||a.current.has(p.rootEntryId)),[e,o]);c.useEffect(()=>{for(const p of s)a.current.add(p.rootEntryId)},[s]);const d=e.length>s.length,f=c.useCallback(()=>{const p=new Set(s.map(u=>u.rootEntryId)),m=e.filter(u=>!p.has(u.rootEntryId));m.length<=y&&m[0]!==void 0&&i(m[0].rootEntryId),n(u=>u+y)},[e,s]),h=c.useCallback(()=>i(null),[]);return{visible:s,hasMore:d,showMore:f,focusId:r,focused:h}}function re(e,o){const r=S(e).data;return c.useMemo(()=>{let i;const a=[];for(const s of r??[])s.id===o?i=s:H(s)===o&&a.push(s);return{root:i,latest:a.slice(-2),loaded:r!==void 0}},[r,o])}function se(e){var n;return e.target.closest('button, a, input, textarea, [role="button"], [role="menuitem"]')?!1:(((n=window.getSelection())==null?void 0:n.toString())??"")===""}function ne({thread:e,agents:o,onOpen:n}){const i=N(e.roomId).data,a=A({kind:e.roomKind,slug:e.roomSlug,title:e.roomTitle});return t.jsxs("article",{"aria-label":`Thread in ${a}`,"data-testid":"thread-card","data-thread-root":e.rootEntryId,className:"bg-card rounded-lg border",children:[t.jsxs("header",{className:"flex items-center gap-2 border-b px-4 py-2",children:[t.jsx("button",{type:"button",onClick:()=>n(e),className:M("focus-ring hover:text-foreground min-w-0 truncate rounded text-sm",e.unreadCount>0?"text-foreground font-semibold":"text-muted-foreground"),children:a}),e.unreadCount>0&&t.jsxs("span",{className:"text-primary shrink-0 text-xs font-medium",children:[e.unreadCount," new"]})]}),i===void 0?t.jsx(ie,{}):t.jsx(ae,{room:i,thread:e,agents:o,onOpen:n})]})}function ae({room:e,thread:o,agents:n,onOpen:r}){const{root:i,latest:a,loaded:s}=re(e.id,o.rootEntryId),d=K({room:e,threadRootId:o.rootEntryId}),f=k(e.id,o.rootEntryId),[h,p]=c.useState(!1),m=P(e.members,e.viewerAuthorId),u=c.useMemo(()=>L(e.members,e.formerAuthors),[e.members,e.formerAuthors]),w=c.useMemo(()=>new Map([...u].map(([l,E])=>[l,E.displayName])),[u]),g=Math.max(0,o.replyCount-a.length),I=l=>t.jsx(J,{roomId:e.id,entry:l,author:Y(Z(l,u),u,n.faces),authorRef:u.get(l.authorId),authors:u,viewerAuthorId:e.viewerAuthorId,authorNames:w,reactionFrequents:e.reactionFrequents,isMember:m,grouping:{position:"only"}},l.id);return t.jsx(z,{known:n,children:t.jsxs(O.Root,{surface:"room",capabilities:G,target:d.target,anchor:"rail",children:[t.jsxs("div",{className:"py-2",children:[i!==void 0?t.jsx("div",{"data-testid":"thread-card-root",className:"cursor-pointer",onClick:l=>{se(l)&&r(o)},children:I(i)}):t.jsx("button",{type:"button",onClick:()=>r(o),className:"focus-ring text-foreground hover:bg-accent/40 mx-2 block w-[calc(100%-1rem)] rounded px-2 py-1.5 text-left text-sm",children:s?o.rootPreview||"A message with no text":t.jsx(x,{className:"h-4 w-2/3"})}),g>0&&t.jsx("button",{type:"button","data-testid":"thread-card-more",onClick:()=>r(o),className:"focus-ring text-muted-foreground hover:text-foreground mx-[var(--msg-padding-x)] my-1 rounded text-xs",children:g===1?"1 more reply":`${g} more replies`}),a.map(I),f.map(l=>t.jsx(Q,{post:l,viewerAuthorId:e.viewerAuthorId},l.clientId))]}),m&&t.jsx("div",{className:"border-t",children:h?t.jsx($,{room:e,threadRootId:o.rootEntryId,attachments:d.attachments,focusOnMount:!0}):t.jsx("button",{type:"button","data-testid":"thread-card-reply",onClick:()=>p(!0),className:"focus-ring text-muted-foreground hover:text-foreground w-full rounded-b-lg px-4 py-2.5 text-left text-sm",children:"Reply…"})})]})})}function ie(){return t.jsxs("div",{className:"flex flex-col gap-2 px-4 py-3","aria-hidden":!0,children:[t.jsx(x,{className:"h-4 w-1/3"}),t.jsx(x,{className:"h-4 w-4/5"})]})}function de(){var n;const e=B(),o=((n=D().room)==null?void 0:n.id)??null;return c.useCallback(r=>{if(F.getState().openThread(r.roomId,r.rootEntryId,!1),r.roomId===o){e({...b.home(),search:{thread:r.rootEntryId}});return}e({...b.channels(),search:{id:r.roomId,thread:r.rootEntryId}})},[e,o])}const ce=[];function ue(){const e=ee(),o=U(),n=de(),r=oe(e.data??ce),i=c.useRef(null);te(e.data);const{focusId:a,focused:s}=r;return c.useEffect(()=>{var f,h;if(a===null)return;const d=(f=i.current)==null?void 0:f.querySelector(`[data-thread-root="${CSS.escape(a)}"]`);(h=d==null?void 0:d.querySelector("button"))==null||h.focus(),s()},[a,s]),t.jsxs(W,{width:"reading",children:[t.jsx("header",{className:"mb-4",children:t.jsx(q,{children:"Threads"})}),e.isPending?t.jsx("div",{className:"flex flex-col gap-3","aria-busy":!0,"data-testid":"threads-loading",children:[0,1,2].map(d=>t.jsx(x,{className:"h-32 w-full rounded-lg"},d))}):e.isError?t.jsxs("div",{className:"text-muted-foreground flex flex-col items-start gap-2 text-sm",children:[t.jsx("p",{children:"Couldn’t load your threads."}),t.jsx(v,{variant:"outline",size:"sm",onClick:()=>void e.refetch(),children:"Try again"})]}):e.data.length===0?t.jsx(V,{icon:_,headline:"No threads yet",description:"Reply to a message in any channel or DM, and the thread shows up here."}):t.jsxs(t.Fragment,{children:[t.jsx("ul",{ref:i,className:"flex flex-col gap-3","aria-label":"Your threads",children:r.visible.map(d=>t.jsx("li",{children:t.jsx(ne,{thread:d,agents:o,onOpen:n})},d.rootEntryId))}),r.hasMore&&t.jsx(v,{variant:"outline",size:"sm",className:"mt-3 self-start",onClick:r.showMore,children:"Show more"})]})]})}const Ye=ue;export{Ye as component};
@@ -0,0 +1,6 @@
1
+ import{O as me,a5 as he,a7 as pe,a8 as ge,aS as $,iu as xe,r as g,au as ye,iv as K,dR as ve,iw as we,af as je,j as n,G as S,_ as ke,B as M,ak as De,al as Se,am as ne,dn as be,dp as Te,a2 as Ne,dq as Me,J as Ce,ix as Ee,ej as Oe,dA as Re,dB as Ae,iy as Ie,iz as _e,en as Q,ge as Le,gf as Fe,U as ze,gh as Pe,iA as U,iB as G,iC as q,iD as H,gk as O,iE as V,iF as Be,gi as $e,iG as Ke,iH as Qe,iI as R,e as te,iJ as Ue,iK as Ge,iL as qe,iM as He,iN as Ve,c3 as We,cv as Xe,gI as Je,iO as se,iP as Ye,iQ as Ze,iR as en,iS as nn,eh as tn,iT as sn,iU as on}from"./index-BR1m9FON.js";import{E as an}from"./empty-state-BHcmkSzu.js";import{Q as rn}from"./query-error-state-Cm-Lozlb.js";import{u as cn}from"./use-todos-BzRauzdQ.js";import{P as W}from"./page-container-0sWZ3xh9.js";import{F as ln}from"./FeatureDisabledState-Bi23k3rg.js";import"./copy-button-BOznikwM.js";import"./inline-code-mh48Uhbi.js";/**
2
+ * @license lucide-react v1.48.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const oe={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};oe.node;const dn=me(oe);function un(){const e=he(),s=pe();return ge({mutationFn:async({changes:t})=>{const a=[];try{for(const r of t)await e.updateTodo(r.id,{rank:r.rank}),a.push(r)}catch(r){for(const o of a.reverse())await e.updateTodo(o.id,{rank:o.previous}).catch(()=>{});throw r}},meta:{errorLabel:"Couldn’t move the to-do. Try again.",isShownInline:t=>t.code===xe},onMutate:async({query:t,order:a,changes:r})=>{const o=$.list(t);await s.cancelQueries({queryKey:o});const l=s.getQueryData(o),u=new Map(r.map(d=>[d.id,d.rank])),h=new Map(a.map((d,c)=>[d,c]));return s.setQueryData(o,d=>d&&{...d,todos:d.todos.map(c=>u.has(c.id)?{...c,rank:u.get(c.id)}:c).sort((c,m)=>(h.get(c.id)??Number.MAX_SAFE_INTEGER)-(h.get(m.id)??Number.MAX_SAFE_INTEGER))}),{key:o,previous:l}},onError:(t,a,r)=>{r&&s.setQueryData(r.key,r.previous)},onSettled:()=>s.invalidateQueries({queryKey:$.all})})}const fn=2e3;function mn(e){const[s,t]=g.useState({}),a=g.useRef(new Map),r=g.useCallback(()=>{for(const c of a.current.values())clearTimeout(c);a.current.clear()},[]);g.useEffect(()=>r,[r]),g.useEffect(()=>{r(),t({})},[e,r]);const o=g.useCallback(c=>{const m=a.current.get(c);m!==void 0&&clearTimeout(m),a.current.delete(c)},[]),l=g.useCallback(c=>{o(c),t(m=>{if(!(c in m))return m;const f={...m};return delete f[c],f})},[o]),u=g.useCallback((c,m)=>{o(c.id),t(f=>({...f,[c.id]:{todo:{...c,state:"kept"},index:m,saving:!0}}))},[o]),h=g.useCallback(c=>{t(m=>{const f=m[c];return!f||f.todo.state!=="kept"?m:{...m,[c]:{...f,saving:!1}}}),o(c),a.current.set(c,setTimeout(()=>l(c),fn))},[l,o]),d=g.useCallback(c=>{o(c),t(m=>{const f=m[c];return f?{...m,[c]:{...f,todo:{...f.todo,state:"open"},saving:!0}}:m})},[o]);return{held:s,hold:u,saved:h,reopen:d,release:l}}function hn(e,s){const t=new Set(e.map(o=>o.id)),a=e.map(o=>{var l;return((l=s[o.id])==null?void 0:l.todo)??o}),r=Object.values(s).filter(o=>!t.has(o.todo.id)).sort((o,l)=>o.index-l.index);for(const o of r)a.splice(Math.min(o.index,a.length),0,o.todo);return a}const pn={view:"mine",due:"any",sort:"due",showDone:!1};function gn(e){return{view:e.view,...e.due!=="any"&&{due:e.due},...e.sort==="rank"&&{sort:"rank"},...e.showDone&&{showDone:!0}}}function xn(e=pn){const[s,t]=g.useState(e),a=g.useMemo(()=>gn(s),[s]);return{filters:s,query:a,set:(o,l)=>t(u=>({...u,[o]:l}))}}const yn="(pointer: coarse)";function ae(){return ye(yn)}const b="abcdefghijklmnopqrstuvwxyz",vn=b.length,X=-1;function J(e,s,t){if(e===null||s>=e.length)return t;const a=b.indexOf(e[s]);return a===-1?t:a}function wn(e,s){let t=s,a="";for(let o=0;a.length<K;o++){const l=J(e,o,X),u=J(t,o,vn);if(l===u){a+=b[l];continue}const h=Math.max(l+1,1),d=u-1;if(h<=d){a+=b[Math.floor((h+d)/2)];break}if(l===X&&u===0){a+=b[0];continue}a+=b[Math.max(l,0)],t=null}return a.length<=K&&(e===null||a>e)&&(s===null||a<s)?a:null}function jn(e,s,t){var u;if(s===t||s<0||t<0||s>=e.length||t>=e.length)return[];const a=[...e],[r]=a.splice(s,1);a.splice(t,0,r);const o=[];let l=null;for(let h=0;h<=t;h++){const d=a[h];if(h!==t&&d.rank!==null&&(l===null||d.rank>l)){l=d.rank;continue}const m=((u=a[h+1])==null?void 0:u.rank)??null,f=wn(l,m!==null&&(l===null||m>l)?m:null);if(f===null)return null;f!==d.rank&&o.push({id:d.id,rank:f,previous:d.rank}),l=f}return o}function kn(e,s,t){const a=un(),r=a.isPending;return{move:g.useCallback((l,u)=>{if(r)return!1;const h=jn(t,l,u);if(h===null)return ve.error("That to-do can’t move there. Try another spot."),!1;const d=t.map(f=>f.id),[c]=d.splice(l,1);d.splice(u,0,c);const m=s.map(f=>f.id).filter(f=>!d.includes(f));return a.mutate({query:e,order:[...d,...m],changes:h}),!0},[r,t,s,e,a]),moving:r}}const Dn=80;function Sn({todo:e,onComplete:s}){const t=e.state==="kept",a=e.state==="open"&&s!==void 0;return n.jsx("button",{type:"button",role:"checkbox","aria-checked":t,"aria-label":e.what,disabled:!a,onClick:a?s:void 0,className:"focus-ring flex size-11 shrink-0 items-center justify-center rounded-full md:size-7",children:n.jsx("span",{"aria-hidden":!0,className:S("flex size-4.5 items-center justify-center rounded-full border transition-colors duration-150",t?"bg-foreground border-foreground text-background":"border-muted-foreground/60",a&&"hover:border-foreground"),children:t&&n.jsx(Ce,{className:"size-3",strokeWidth:3})})})}function bn({agentId:e,agent:s}){const t=De({id:e,color:s==null?void 0:s.color,icon:s==null?void 0:s.icon});return n.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",children:[n.jsx(Se,{color:t.color,emoji:t.emoji,size:"xs"}),n.jsx("span",{className:"truncate",children:s?ne(s):e})]})}function Tn(e){if(e.state==="open")return[];const s=n.jsx("span",{children:e.state==="kept"?"Done":"Declined"},"outcome");return e.note?[s,n.jsx("span",{className:"min-w-0 truncate",title:e.note,children:e.note},"note")]:[s]}function Nn({parts:e}){return n.jsx("div",{className:"text-muted-foreground mt-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs",children:e.map((s,t)=>n.jsxs(g.Fragment,{children:[t>0&&n.jsx("span",{"aria-hidden":!0,children:"·"}),s]},t))})}function Mn(){return n.jsxs(be,{children:[n.jsx(Te,{asChild:!0,children:n.jsx(Ne,{size:"xs",tabIndex:0,className:"focus-ring",children:"Limited"})}),n.jsx(Me,{children:"Made or changed by someone DorkOS couldn’t confirm, so its agent has limited power."})]})}function Y({todo:e,agent:s,from:t,roomTitle:a,onComplete:r,onUndo:o,handle:l,rowRef:u,style:h,dragging:d=!1,pressToMove:c,trailing:m}){const f=we(e),T=e.state!=="open",D=je()&&e.state==="open"&&r!==void 0,k=e.overdue||f==="Due today",p=[];p.push(...Tn(e)),e.assignee.kind==="agent"&&p.push(n.jsx(bn,{agentId:e.assignee.agentId,...s?{agent:s}:{}})),f&&p.push(n.jsx("span",{className:S(k&&"text-foreground font-medium",e.overdue&&"text-destructive"),children:f})),p.push(n.jsxs("span",{children:["from ",t]}));const x=e.titleFromSource&&e.sourceAuthor?e.sourceAuthor:null;return(x||a)&&p.push(n.jsx("span",{className:"min-w-0 truncate",children:x&&a?`${x} in ${a}`:x?`said by ${x}`:a})),e.strangerBound&&e.assignee.kind==="agent"&&p.push(n.jsx(Mn,{})),n.jsxs("li",{ref:u,style:h,"data-slot":"todo-row","data-state":e.state,"data-overdue":e.overdue||void 0,className:S("group/row flex items-start gap-1 rounded-md py-1 pr-2",d&&"bg-card relative z-10 shadow-sm"),children:[l,n.jsx(Sn,{todo:e,...r?{onComplete:r}:{}}),n.jsxs(ke.div,{className:S("min-w-0 flex-1 py-2 md:py-1",c&&"select-none [-webkit-touch-callout:none]"),...c,"data-swipe-to-finish":D||void 0,drag:D?"x":!1,dragDirectionLock:!0,dragConstraints:{left:0,right:0},dragElastic:{left:0,right:.6},dragMomentum:!1,onDragEnd:(_,E)=>{D&&E.offset.x>Dn&&(r==null||r())},children:[n.jsxs("div",{className:"flex min-w-0 items-start gap-1.5",children:[n.jsx("p",{className:S("line-clamp-3 min-w-0 text-sm break-words",T&&"text-muted-foreground",e.state==="dropped"&&"line-through"),title:e.what,children:e.what}),o&&n.jsx(M,{size:"xs",variant:"ghost",className:"shrink-0 max-md:h-11 max-md:px-3",onClick:o,children:"Undo"})]}),n.jsx(Nn,{parts:p})]}),m]})}const Cn=e=>Ie({...e,wasDragging:!0});function C(e,s){return`${e}:${s===-1?"up":"down"}`}function En({sortable:e,onMove:s,reorder:t,...a}){const{setNodeRef:r,setActivatorNodeRef:o,attributes:l,listeners:u,transform:h,transition:d,isDragging:c}=Ee({id:a.todo.id,disabled:!e,animateLayoutChanges:Cn}),m=Oe(),f=ae();function T(p){var x;if(p.altKey&&(p.key==="ArrowUp"||p.key==="ArrowDown")){p.preventDefault(),s(p.key==="ArrowUp"?-1:1);return}(x=u==null?void 0:u.onKeyDown)==null||x.call(u,p)}if(!e)return n.jsx(Y,{...a});const{onComplete:D,...k}=a;return n.jsx(Y,{...t?k:a,rowRef:r,dragging:c,style:{transform:h?`translate3d(0, ${Math.round(h.y)}px, 0)`:void 0,transition:m?void 0:d},...f&&!t?{pressToMove:{onTouchStart:p=>{var x;return(x=u==null?void 0:u.onTouchStart)==null?void 0:x.call(u,p)}}}:{},...f?{}:{handle:n.jsx("button",{type:"button",ref:o,"data-todo-grip":a.todo.id,...l,...u,onKeyDown:T,"aria-label":`Move ${a.todo.what}`,"aria-keyshortcuts":"Alt+ArrowUp Alt+ArrowDown",className:"focus-ring text-muted-foreground hover:text-foreground flex size-7 shrink-0 cursor-grab touch-none items-center justify-center rounded-md opacity-0 transition-opacity group-hover/row:opacity-100 focus-visible:opacity-100",children:n.jsx(dn,{"aria-hidden":!0,className:"size-4"})})},...t?{trailing:n.jsxs("div",{className:"animate-in fade-in flex shrink-0 items-center duration-150 motion-reduce:animate-none",children:[n.jsx(Z,{todoId:a.todo.id,title:a.todo.what,by:-1,disabled:t.first,onMove:s}),n.jsx(Z,{todoId:a.todo.id,title:a.todo.what,by:1,disabled:t.last,onMove:s})]})}:{}})}function Z({todoId:e,title:s,by:t,disabled:a,onMove:r}){const o=t===-1?Re:Ae;return n.jsx(M,{type:"button",size:"icon-md",variant:"ghost","data-todo-move":C(e,t),"aria-label":`Move ${s} ${t===-1?"up":"down"}`,disabled:a,onClick:()=>r(t),className:"size-11 md:size-7",children:n.jsx(o,{"aria-hidden":!0,className:"size-4"})})}const I="data-todo-filter-trigger";function ee(e,s){return e.some(t=>t.value===s)}function On({filters:e,onChange:s,reorder:t}){if(t!=null&&t.active)return n.jsxs("div",{"data-slot":"todo-filter-bar",className:"flex min-w-0 items-center gap-1.5",children:[n.jsx("h2",{className:"min-w-0 flex-1 text-sm font-medium",children:"Reorder"}),n.jsx(M,{size:"sm",variant:"secondary",onClick:t.onDone,children:"Done"})]});const a=e.due!=="any"||e.sort!=="due"||e.showDone;return n.jsx(Rn,{filters:e,onChange:s,reorder:t,narrowed:a})}function Rn({filters:e,onChange:s,reorder:t,narrowed:a}){const r=g.useRef(!1);return n.jsxs("div",{"data-slot":"todo-filter-bar",className:"flex min-w-0 items-center gap-1.5",children:[n.jsx("div",{role:"group","aria-label":"Whose to-dos",className:"-my-1 flex min-w-0 scrollbar-none gap-1.5 overflow-x-auto px-0.5 py-1 max-md:[mask-image:linear-gradient(to_right,black_calc(100%-1.5rem),transparent)] max-md:pr-6",children:_e.map(o=>n.jsx(Q,{className:"shrink-0",pressed:e.view===o.value,onClick:()=>s("view",o.value),children:o.label},o.value))}),n.jsxs(Le,{children:[n.jsx(Fe,{asChild:!0,children:n.jsx(Q,{[I]:"",pressed:a,"aria-label":"Filter and sort",icon:ze,className:"shrink-0"})}),n.jsxs(Pe,{align:"start",className:"w-48",onCloseAutoFocus:o=>{r.current&&(r.current=!1,o.preventDefault())},children:[n.jsx(U,{children:"Due"}),n.jsx(G,{value:e.due,onValueChange:o=>{ee(q,o)&&s("due",o)},children:q.map(o=>n.jsx(H,{value:o.value,children:o.label},o.value))}),n.jsx(O,{}),n.jsx(U,{children:"Sort"}),n.jsx(G,{value:e.sort,onValueChange:o=>{ee(V,o)&&s("sort",o)},children:V.map(o=>n.jsx(H,{value:o.value,children:o.label},o.value))}),n.jsx(O,{}),n.jsx(Be,{checked:e.showDone,onCheckedChange:o=>s("showDone",o===!0),children:"Show done"}),(t==null?void 0:t.available)&&n.jsxs(n.Fragment,{children:[n.jsx(O,{}),n.jsx($e,{onSelect:()=>{r.current=!0,t.onStart()},children:"Reorder"})]})]})]})]})}function An(){const{data:e}=We(),{data:s}=Xe();return g.useMemo(()=>{const t=new Map;for(const r of(e==null?void 0:e.agents)??[])t.set(r.id,r);const a=new Map;for(const r of s??[])a.set(r.id,Je(r));return{agentOf:r=>t.get(r),agentName:r=>{const o=t.get(r);return o?ne(o):void 0},roomTitleOf:r=>r?a.get(r):void 0}},[e,s])}function In({onNewTodo:e}){var F,z;const{filters:s,query:t,set:a}=xn(),r=cn(t),o=Ke(),l=mn(JSON.stringify(t)),u=An(),h=g.useMemo(()=>{var i;return hn(((i=r.data)==null?void 0:i.todos)??[],l.held)},[r.data,l.held]),d=g.useMemo(()=>h.filter(i=>i.state==="open"&&!l.held[i.id]),[h,l.held]),c=s.sort==="rank"&&s.view==="mine"&&d.length>1,m=kn(t,h,d),[f,T]=g.useState(""),[D,k]=g.useState(!1);D&&!c&&k(!1);const p=D&&c,x=g.useRef(null);g.useEffect(()=>{const i=x.current;i&&(x.current=null,_n(i))},[d,p]);const _=ae(),E=Qe(R(nn,{activationConstraint:{distance:4}}),R(en,{activationConstraint:{delay:300,tolerance:8}}),R(Ze,{coordinateGetter:Ye}));function re(){k(!0);const i=d[0];i&&(x.current=A(C(i.id,1)))}function ie(){k(!1),x.current=`[${I}]`}g.useEffect(()=>{if(!p)return;function i(y){y.key!=="Escape"||y.defaultPrevented||(y.preventDefault(),k(!1),x.current=`[${I}]`)}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[p]);function L(i,y,v,w){m.move(y,v)&&(x.current=w,T(`Moved to position ${v+1} of ${d.length}.`))}function ce(i,y){const v=d.findIndex(N=>N.id===i.id),w=Math.min(Math.max(v+y,0),d.length-1);if(v===-1||w===v)return;const j=p?`${A(C(i.id,y))}:not(:disabled), ${A(C(i.id,y===-1?1:-1))}`:`[data-todo-grip="${CSS.escape(i.id)}"]`;L(i.id,v,w,j)}function le({active:i,over:y}){if(!y||i.id===y.id)return;const v=d.findIndex(j=>j.id===i.id),w=d.findIndex(j=>j.id===y.id);v!==-1&&w!==-1&&L(String(i.id),v,w,`[data-todo-grip="${CSS.escape(String(i.id))}"]`)}function de(i,y){l.hold(i,y),o.mutateAsync({id:i.id,body:{state:"kept"}}).then(()=>l.saved(i.id)).catch(()=>l.release(i.id))}function ue(i){l.reopen(i.id),o.mutateAsync({id:i.id,body:{state:"open",from:"kept"}}).catch(()=>{}).finally(()=>l.release(i.id))}return n.jsxs("div",{"data-slot":"todo-list",className:"flex flex-col gap-3",children:[n.jsx("p",{role:"status",className:"sr-only",children:f}),n.jsx(On,{filters:s,onChange:a,reorder:{available:c,active:p,onStart:re,onDone:ie}}),r.isPending&&n.jsx(te,{className:"h-24 w-full"}),r.isError&&n.jsx(rn,{title:"Couldn’t load your to-dos",description:"The DorkOS server didn’t answer. Check that it’s running.",onRetry:()=>void r.refetch()}),r.isSuccess&&h.length===0&&n.jsx(Ln,{mine:s.view==="mine",narrowed:s.due!=="any",onNewTodo:e}),r.isSuccess&&h.length>0&&n.jsx(Ue,{sensors:E,collisionDetection:Ge,onDragEnd:le,children:n.jsx(qe,{items:d.map(i=>i.id),strategy:He,children:n.jsx("ul",{className:S("flex flex-col","max-md:-ml-2.5",c&&!_&&"md:-ml-8"),"aria-label":"To-dos","aria-busy":m.moving||void 0,children:h.map((i,y)=>{var P,B;const v=i.assignee.kind==="agent"?u.agentOf(i.assignee.agentId):void 0,w=u.roomTitleOf(i.roomId),j=l.held[i.id],N=j!==void 0;return n.jsx(En,{sortable:c&&i.state==="open"&&!N,onMove:fe=>ce(i,fe),...p&&i.state==="open"&&!N?{reorder:{first:((P=d[0])==null?void 0:P.id)===i.id,last:((B=d[d.length-1])==null?void 0:B.id)===i.id}}:{},todo:i,from:Ve(i.assignedBy,u.agentName),...v?{agent:v}:{},...w?{roomTitle:w}:{},...i.state==="open"&&!N?{onComplete:()=>de(i,y)}:{},...j&&!j.saving&&i.state==="kept"?{onUndo:()=>ue(i)}:{}},i.id)})})})}),!s.showDone&&(((F=r.data)==null?void 0:F.doneCount)??0)>0&&n.jsxs(M,{size:"sm",variant:"ghost",className:r.isSuccess&&h.length===0?"self-center":"self-start",onClick:()=>a("showDone",!0),children:["Show done (",(z=r.data)==null?void 0:z.doneCount,")"]}),s.showDone&&n.jsx(M,{size:"sm",variant:"ghost",className:"self-start",onClick:()=>a("showDone",!1),children:"Hide done"})]})}function A(e){return`[data-todo-move="${CSS.escape(e)}"]`}function _n(e){for(const s of e.split(", ")){const t=document.querySelector(s);if(t){t.focus();return}}}function Ln({mine:e,narrowed:s,onNewTodo:t}){return!e||s?n.jsx("p",{className:"text-muted-foreground px-2 py-4 text-sm",children:"No to-dos here."}):n.jsx(an,{icon:se,headline:"Nothing assigned to you.",description:"Add one, or ask an agent to.",action:{label:"New to-do",onClick:t}})}function Fn(){return n.jsxs(n.Fragment,{children:[n.jsx(tn,{children:"To-dos"}),n.jsx(zn,{})]})}function zn(){const e=sn();return e.isLoading?n.jsx(W,{width:"wide",children:n.jsx(te,{className:"h-24 w-full"})}):e.enabled?n.jsx(W,{width:"wide",children:n.jsx(In,{onNewTodo:on})}):n.jsx(ln,{icon:se,name:"To-do list",description:"One list of what you and your agents need to do.",command:"DORKOS_TODOS_ENABLED=true dorkos"})}const Hn=Fn;export{Hn as component};
@@ -0,0 +1 @@
1
+ import{E as o}from"./ExtensionPageRoute-CP7NM7fw.js";import"./index-BR1m9FON.js";import"./empty-state-BHcmkSzu.js";import"./page-container-0sWZ3xh9.js";import"./use-dev-links-DXcIlMf-.js";import"./UnlinkDialog-B-XCFNSd.js";const e=o;export{e as component};
@@ -0,0 +1 @@
1
+ import{E as o}from"./ExtensionPageRoute-CP7NM7fw.js";import"./index-BR1m9FON.js";import"./empty-state-BHcmkSzu.js";import"./page-container-0sWZ3xh9.js";import"./use-dev-links-DXcIlMf-.js";import"./UnlinkDialog-B-XCFNSd.js";const e=o;export{e as component};