dorkos 0.126.2 → 0.126.4

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 (317) hide show
  1. package/dist/bin/cli.js +254 -114
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-BQ66xWcJ.js → AboutPage-CAt15a-r.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-CPbfgXjw.js → ActivityErrorState-s4xAcJQR.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-CesljfZn.js → ActivityPage-BpSggjZV.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-DzhwE0ht.js → ActivityRow-5PJBHIt2.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-BXJkyF5g.js → AdapterIcon-d8mZODCX.js} +1 -1
  9. package/dist/client/assets/AdapterSetupWizard-R-KxNMiM.js +2 -0
  10. package/dist/client/assets/{AgentOptionRow-0VdNzXCF.js → AgentOptionRow-hemBruhh.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-Ldh64iOA.js → AgentPicker-DOba9a77.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-CmAlDGTr.js → AgentRequestCard-RFQOrk-W.js} +1 -1
  13. package/dist/client/assets/{AppearancePage-DmsZPHst.js → AppearancePage-1m4bJ-Rg.js} +1 -1
  14. package/dist/client/assets/{ApplyToOverridesDialog-Ct1W283T.js → ApplyToOverridesDialog-BxeMLhGv.js} +1 -1
  15. package/dist/client/assets/{AttentionSignalRow-B7gezgzA.js → AttentionSignalRow-BoTonsR5.js} +1 -1
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Nqvr65_g.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-Bz6XyZ6v.js} +3 -3
  17. package/dist/client/assets/BindingDialog-CILm91iU.js +1 -0
  18. package/dist/client/assets/{BlintzCanvas-BCtfZPrs.js → BlintzCanvas-BFJXKo1L.js} +3 -3
  19. package/dist/client/assets/{CanvasCsvContent-DYksqzaf.js → CanvasCsvContent-DzkaHpEo.js} +3 -3
  20. package/dist/client/assets/{CanvasFileContent-CqEqSxuJ.js → CanvasFileContent-DZf9SjJn.js} +2 -2
  21. package/dist/client/assets/{CanvasModel3dContent-vR6ze4IR.js → CanvasModel3dContent-Cd8hf6Ba.js} +2 -2
  22. package/dist/client/assets/{ChannelComposer-BVACOdph.js → ChannelComposer-YXkkFcyY.js} +10 -10
  23. package/dist/client/assets/{ChatAppsOff-VsPP2Hye.js → ChatAppsOff-X5Y8OHAz.js} +2 -2
  24. package/dist/client/assets/{CodeMirrorDiff-CmKjH03N.js → CodeMirrorDiff-BsQKbrls.js} +1 -1
  25. package/dist/client/assets/{CodeMirrorEditor-BtNgazuc.js → CodeMirrorEditor-DnkumDd3.js} +1 -1
  26. package/dist/client/assets/{CommitmentList-D9I-CmNy.js → CommitmentList-BjI2jvMX.js} +1 -1
  27. package/dist/client/assets/{CommitmentsPage-BORMYDZb.js → CommitmentsPage-7g68FcGR.js} +1 -1
  28. package/dist/client/assets/{ComputerResourceView-BZ9BxgOi.js → ComputerResourceView-Dcd0e_Oj.js} +1 -1
  29. package/dist/client/assets/{ComputerViewer-CbuU9tXK.js → ComputerViewer-Dq3aQyZD.js} +1 -1
  30. package/dist/client/assets/{ConnectionAccessLists-uE-Fzp6Y.js → ConnectionAccessLists-CXPn8ICQ.js} +1 -1
  31. package/dist/client/assets/{ConnectionsPage-D7QTHeQQ.js → ConnectionsPage-DEc4JsR5.js} +2 -2
  32. package/dist/client/assets/{ConventionPage-PS2WWCyB.js → ConventionPage-B7cm4O1D.js} +1 -1
  33. package/dist/client/assets/{ExtensionPageRoute-Cn7bYxGB.js → ExtensionPageRoute-ba2uGsYs.js} +2 -2
  34. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-DKGNSXVz.js → FloatingTanStackRouterDevtools-CqogiFob-Dxk_rLHR.js} +1 -1
  35. package/dist/client/assets/{ForwardConsentHost-CLIHtWwq.js → ForwardConsentHost-CNuTTR3q.js} +1 -1
  36. package/dist/client/assets/HandlePage-WIwOCyJg.js +1 -0
  37. package/dist/client/assets/{HeartbeatPage-7MTowke-.js → HeartbeatPage-CEb8SaAx.js} +1 -1
  38. package/dist/client/assets/{KeyEntry-Cf7D0Oo6.js → KeyEntry-CHJpgP6H.js} +1 -1
  39. package/dist/client/assets/{LexicalField-DqvzeMr3.js → LexicalField-B0tWaDy5.js} +1 -1
  40. package/dist/client/assets/{ManagesPage-DxR4zWMf.js → ManagesPage-rcz--gCT.js} +1 -1
  41. package/dist/client/assets/{Marketplace-V_92jKOn.js → Marketplace-wjAUiULQ.js} +4 -4
  42. package/dist/client/assets/{MarketplaceSourcesView-CjCVMP_d.js → MarketplaceSourcesView-BMGnEy8T.js} +1 -1
  43. package/dist/client/assets/{McpAppFrame-4JDJsrmg.js → McpAppFrame-CmwiQHxf.js} +2 -2
  44. package/dist/client/assets/{McpSigninBody-DG1XX7XT.js → McpSigninBody-D99PCc0n.js} +1 -1
  45. package/dist/client/assets/{Model3dViewer-DedBFHsl.js → Model3dViewer-qUwwZnb2.js} +1 -1
  46. package/dist/client/assets/NamePage-B7VSrPmK.js +1 -0
  47. package/dist/client/assets/{NewDirectMessageMenu-C8t7x-sB.js → NewDirectMessageMenu-DyMfEU7i.js} +1 -1
  48. package/dist/client/assets/{NotificationsPage-DwGFE3F6.js → NotificationsPage-BsOaV6Ei.js} +1 -1
  49. package/dist/client/assets/{OpenMeshSwitch-DPmTA9eg.js → OpenMeshSwitch-CjCPWZn0.js} +2 -2
  50. package/dist/client/assets/{OperatorIdentityForm-Cu0h8Xqy.js → OperatorIdentityForm-Cd6B2hxb.js} +1 -1
  51. package/dist/client/assets/{PermissionHistory-zD6ksrl2.js → PermissionHistory-xp6vPQ20.js} +1 -1
  52. package/dist/client/assets/{PermissionsPage-Durcnmie.js → PermissionsPage-DaAJew99.js} +1 -1
  53. package/dist/client/assets/{PersonalityPopover-DuRjJuLj.js → PersonalityPopover-BZaif5Fn.js} +1 -1
  54. package/dist/client/assets/PhotoPage-43WNaavk.js +1 -0
  55. package/dist/client/assets/{PreviewRefusedNotice-hlYrFDQM.js → PreviewRefusedNotice-CCpHgrea.js} +1 -1
  56. package/dist/client/assets/{ProfileFields-x-x8vgNo.js → ProfileFields-DyVqmcPr.js} +1 -1
  57. package/dist/client/assets/{ProfilePanelContainer-8WxopRj2.js → ProfilePanelContainer-CMRG6AmB.js} +1 -1
  58. package/dist/client/assets/{ProfileRolePicker-BfciiNpr.js → ProfileRolePicker-Q_hY6ybO.js} +1 -1
  59. package/dist/client/assets/{PromptSuggestionChips-D34Zeaq_.js → PromptSuggestionChips-B5afjbD0.js} +1 -1
  60. package/dist/client/assets/{ReportsToPopover-BhqA5qXi.js → ReportsToPopover-CVF7Rtzh.js} +1 -1
  61. package/dist/client/assets/{RoomSurface-BlMNuQsT.js → RoomSurface-Bz1DfoQD.js} +1 -1
  62. package/dist/client/assets/{RoomsPage-C52AOHIE.js → RoomsPage-4u74yonc.js} +1 -1
  63. package/dist/client/assets/{RunsOnPopover-DLhEKwXF.js → RunsOnPopover-CnUm4LP2.js} +1 -1
  64. package/dist/client/assets/{RuntimeConnectFlow-D3H5Fpkc.js → RuntimeConnectFlow-B0TIITVq.js} +1 -1
  65. package/dist/client/assets/{RuntimeSetupDialog-DPU4QIY9.js → RuntimeSetupDialog-CEUC7GrY.js} +1 -1
  66. package/dist/client/assets/{SeenDevices-CDSHTsL7.js → SeenDevices-CxhuIRp3.js} +2 -2
  67. package/dist/client/assets/{SessionsPage-Crh3D3Jj.js → SessionsPage-l6_Qc7hz.js} +1 -1
  68. package/dist/client/assets/{SettingsDialog-D0Oh-ku1.js → SettingsDialog-GEK8nhI8.js} +4 -4
  69. package/dist/client/assets/{SkillsPage-BPexZwnJ.js → SkillsPage-PlVj6VdA.js} +1 -1
  70. package/dist/client/assets/{TaskDialogWrapper-D6RB8E59.js → TaskDialogWrapper-TspfYk9J.js} +1 -1
  71. package/dist/client/assets/{TasksEmptyState-Di3SbhJM.js → TasksEmptyState-DsHh0blU.js} +2 -2
  72. package/dist/client/assets/{TasksPage-CDLsY1Ww.js → TasksPage-Va0dvkif.js} +1 -1
  73. package/dist/client/assets/{TeamComputerEntry-B_q-oVSs.js → TeamComputerEntry-C6juiObF.js} +1 -1
  74. package/dist/client/assets/{ToolsPage-gvIVTnwf.js → ToolsPage-C0ESG42C.js} +2 -2
  75. package/dist/client/assets/{TopologyGraph-Bp8aL_qw.js → TopologyGraph-M24Edx-I.js} +3 -3
  76. package/dist/client/assets/TourHost-CcN4uCDR.js +1 -0
  77. package/dist/client/assets/{UnlinkDialog-Ddd1Yxfk.js → UnlinkDialog-DlD1cmRZ.js} +1 -1
  78. package/dist/client/assets/{UnreadDivider-LL4_YtF0.js → UnreadDivider-DPD9MQ8-.js} +1 -1
  79. package/dist/client/assets/{WidgetErrorCard-BA3P7hNv.js → WidgetErrorCard-Bte2obmw.js} +3 -3
  80. package/dist/client/assets/{WithheldExtensionsNotice-quqWNbus.js → WithheldExtensionsNotice-CZibLuKA.js} +1 -1
  81. package/dist/client/assets/{WorkView-C_h8sclU.js → WorkView-PsLjURld.js} +15 -15
  82. package/dist/client/assets/{_shell-D9q8zLfr.js → _shell-Ce_cSF7V.js} +2 -2
  83. package/dist/client/assets/{_shell._home-CrTxBB3h.js → _shell._home-DcZcTXu8.js} +1 -1
  84. package/dist/client/assets/{_shell._home.activity-2M0BJkbQ.js → _shell._home.activity-BXw8iSC4.js} +1 -1
  85. package/dist/client/assets/_shell._home.index-BleaCq_y.js +3 -0
  86. package/dist/client/assets/{_shell._home.tasks-Dfrqv2nl.js → _shell._home.tasks-gdbnkq3-.js} +1 -1
  87. package/dist/client/assets/{_shell._home.workspaces-DPLQXDdH.js → _shell._home.workspaces-BCwJX783.js} +1 -1
  88. package/dist/client/assets/{_shell.channels-CJqfUTZ1.js → _shell.channels-D-lMqbSA.js} +1 -1
  89. package/dist/client/assets/_shell.connections-BFmTpceq.js +1 -0
  90. package/dist/client/assets/{_shell.feedback-requests-BeWCqScf.js → _shell.feedback-requests-NKpm6Uhu.js} +1 -1
  91. package/dist/client/assets/_shell.marketplace-DB7NSxDU.js +1 -0
  92. package/dist/client/assets/_shell.marketplace_.sources-WU9ILkRM.js +1 -0
  93. package/dist/client/assets/_shell.session-CchZWYRA.js +1 -0
  94. package/dist/client/assets/{_shell.team-EPvcS7RS.js → _shell.team-DcCRbdAb.js} +4 -4
  95. package/dist/client/assets/{_shell.threads-NJDzq9dv.js → _shell.threads-BLy6Cgqk.js} +1 -1
  96. package/dist/client/assets/_shell.x._extensionId-CVW0g7Rb.js +1 -0
  97. package/dist/client/assets/_shell.x._extensionId_._-CVW0g7Rb.js +1 -0
  98. package/dist/client/assets/{abnfDiagram-WEYOIA3C-DUHshdrR.js → abnfDiagram-WEYOIA3C-DpkXbw1_.js} +1 -1
  99. package/dist/client/assets/{access-copy-DHfPjN3G.js → access-copy-Y2_F9uAx.js} +1 -1
  100. package/dist/client/assets/{arc-sP6zNsGB.js → arc-B3bZAGvi.js} +1 -1
  101. package/dist/client/assets/{architectureDiagram-ZHVYKT53-C8PTjsPx.js → architectureDiagram-ZHVYKT53-BKR1sFvp.js} +1 -1
  102. package/dist/client/assets/{banner-CVrzHqOT.js → banner-CqhUGJmy.js} +2 -2
  103. package/dist/client/assets/{blockDiagram-RJAE7QA3-Cydde2fz.js → blockDiagram-RJAE7QA3-C2I50BMQ.js} +1 -1
  104. package/dist/client/assets/{c4Diagram-XDPPPE54-DbM6KAK7.js → c4Diagram-XDPPPE54-dhHi_wUH.js} +1 -1
  105. package/dist/client/assets/{card-DA_Z-FYX.js → card-CM7-_8nD.js} +1 -1
  106. package/dist/client/assets/channel-NlrM9BR7.js +1 -0
  107. package/dist/client/assets/{chunk-2E7WHVMD-CEbspaNh.js → chunk-2E7WHVMD-B0B27SHJ.js} +1 -1
  108. package/dist/client/assets/{chunk-2Q5K7J3B-DDP1SiE0.js → chunk-2Q5K7J3B-dsUDjsr2.js} +1 -1
  109. package/dist/client/assets/{chunk-4EMNKR2T-BFjozJqd.js → chunk-4EMNKR2T-C3IdUlS9.js} +1 -1
  110. package/dist/client/assets/{chunk-55XCU76K-0JSp6acZ.js → chunk-55XCU76K-D6qgX8rY.js} +1 -1
  111. package/dist/client/assets/{chunk-5VM5RSS4-DswTXnmp.js → chunk-5VM5RSS4-CWhRZZS1.js} +1 -1
  112. package/dist/client/assets/{chunk-JWPE2WC7-D0PYncYV.js → chunk-JWPE2WC7-Bd3RyNB2.js} +1 -1
  113. package/dist/client/assets/{chunk-VQ5W62QI-r5T-ZVBs.js → chunk-VQ5W62QI-HqUjzAO7.js} +1 -1
  114. package/dist/client/assets/{chunk-XXDRQBXY-D8kkjktE.js → chunk-XXDRQBXY-CfeGRauy.js} +1 -1
  115. package/dist/client/assets/{chunk-ZCHMQSOR-D6XtRzln.js → chunk-ZCHMQSOR-D30UE34C.js} +2 -2
  116. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-DUPDMGfm.js → classDiagram-v2-4MYWR3UA-ClIZEeNx.js} +1 -1
  117. package/dist/client/assets/{command-BvXBgZfv.js → command-DuhX52Bi.js} +1 -1
  118. package/dist/client/assets/{cose-bilkent-JH36ORCC-tiQpE-Q8.js → cose-bilkent-JH36ORCC-C_MZbmxw.js} +1 -1
  119. package/dist/client/assets/{cpu-mx7zDf7k.js → cpu-BMUMZCWW.js} +1 -1
  120. package/dist/client/assets/{cynefin-EF2NZ3EQ-BjAUxFfb.js → cynefin-EF2NZ3EQ-DjzC1gsw.js} +1 -1
  121. package/dist/client/assets/{cynefinDiagram-WF24UDRP-PmlyltXR.js → cynefinDiagram-WF24UDRP-Dnu1pf_9.js} +1 -1
  122. package/dist/client/assets/{dagre-NK4GIZVX-DDePjPkn.js → dagre-NK4GIZVX-Bruwoqfg.js} +1 -1
  123. package/dist/client/assets/{diagram-CBK3MWTC-D7N3T4Fx.js → diagram-CBK3MWTC-Co7nk3xQ.js} +1 -1
  124. package/dist/client/assets/{diagram-I5XIIV2D-BfZHSbR2.js → diagram-I5XIIV2D-CDJY0Snc.js} +1 -1
  125. package/dist/client/assets/{diagram-ODIL2UCW-sXAa9bzN.js → diagram-ODIL2UCW-CF0utpvI.js} +1 -1
  126. package/dist/client/assets/{diagram-PFBEJUXE-Dfd_61WO.js → diagram-PFBEJUXE-BrLRX5Ip.js} +1 -1
  127. package/dist/client/assets/{diagram-RJA3I4VV-BCzdEfnM.js → diagram-RJA3I4VV-BOo6-thr.js} +1 -1
  128. package/dist/client/assets/{diagram-TYUNFSNR-BMqtz6sZ.js → diagram-TYUNFSNR-B-206XZy.js} +1 -1
  129. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-CyWj1615.js → ebnfDiagram-V4P3TTPT-C6SZjvSQ.js} +1 -1
  130. package/dist/client/assets/{elk-QONTBCTQ-BkQMBXse.js → elk-QONTBCTQ-B_QHOQ8G.js} +1 -1
  131. package/dist/client/assets/{empty-state-Dv5iV4jb.js → empty-state-BzWMBBQZ.js} +1 -1
  132. package/dist/client/assets/{erDiagram-KYQIGQAA-DiPsX7uU.js → erDiagram-KYQIGQAA-BTKJgVOK.js} +1 -1
  133. package/dist/client/assets/{execution-config-Bej0Ot8e.js → execution-config-D_PgYyCI.js} +1 -1
  134. package/dist/client/assets/{file-DXbyb23e.js → file-DiYwTQdD.js} +1 -1
  135. package/dist/client/assets/{file-exclamation-point-C8XqHyzY.js → file-exclamation-point-CnQYdJiV.js} +1 -1
  136. package/dist/client/assets/{file-text-CRTgqqkn.js → file-text-DLPhIP0f.js} +1 -1
  137. package/dist/client/assets/{find-latest-widget-fence-D1i7qNny.js → find-latest-widget-fence-BYtG5PzD.js} +3 -3
  138. package/dist/client/assets/{flowDiagram-IUGLLWBU-BSM44aJP.js → flowDiagram-IUGLLWBU-o2In4cGl.js} +1 -1
  139. package/dist/client/assets/{form-DYSiVEri.js → form-DUFlQ-yL.js} +1 -1
  140. package/dist/client/assets/{format-cron-DYYwmo-o.js → format-cron-D5dtMPdH.js} +1 -1
  141. package/dist/client/assets/{ganttDiagram-R7GPNTJY-BWCjYexX.js → ganttDiagram-R7GPNTJY-WwrWLB2J.js} +1 -1
  142. package/dist/client/assets/{git-branch-1zYKSuur.js → git-branch-uZFa3Tmr.js} +1 -1
  143. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-ULC7Zunc.js → gitGraphDiagram-PDYL7XHY-C1yG6xrf.js} +1 -1
  144. package/dist/client/assets/{graph-BsZzo5TN.js → graph-C10tj8MW.js} +1 -1
  145. package/dist/client/assets/{heart-C4CSHUW7.js → heart--8btr31M.js} +1 -1
  146. package/dist/client/assets/{highlighted-body-KPVGNVTW-CFECg7iB.js → highlighted-body-KPVGNVTW-DGp-Vg6c.js} +1 -1
  147. package/dist/client/assets/{image-lightbox-M9t3Wulc.js → image-lightbox-BfwZy_vF.js} +1 -1
  148. package/dist/client/assets/{image-off-c01kxBAm.js → image-off-Bmtj2Xtq.js} +1 -1
  149. package/dist/client/assets/{index-BScgHCO_.js → index-8hXtJ0Xw.js} +1 -1
  150. package/dist/client/assets/{index-DG13Cp5o.js → index-B5i5B8F0.js} +1 -1
  151. package/dist/client/assets/{index-DzHj8lCz.js → index-BBaFVr5z.js} +9 -9
  152. package/dist/client/assets/{index-DIDUjTkq.js → index-BCZa5De0.js} +1 -1
  153. package/dist/client/assets/{index-BTGRc0hC.js → index-BE8yM241.js} +1 -1
  154. package/dist/client/assets/{index-XEE1k4cl.js → index-BHXG7bNX.js} +1 -1
  155. package/dist/client/assets/{index-BqwCOIbF.js → index-BJ_fl1Gy.js} +1 -1
  156. package/dist/client/assets/{index-DhoaVQXu.js → index-BbIFaQ9_.js} +1 -1
  157. package/dist/client/assets/{index-Dt7RONID.js → index-BlHuuCes.js} +1 -1
  158. package/dist/client/assets/{index-C3swXqWW.js → index-BtrV6g02.js} +1 -1
  159. package/dist/client/assets/{index-C1XazYWZ.js → index-C-tNYOVV.js} +1 -1
  160. package/dist/client/assets/{index-BYY8HEOz.js → index-C3LZBxuM.js} +1 -1
  161. package/dist/client/assets/{index-B-7P1Q9s.js → index-CO9QUYdl.js} +1 -1
  162. package/dist/client/assets/{index-BIVIHPoe.js → index-CP47qL8N.js} +1 -1
  163. package/dist/client/assets/{index-BRH6C3LJ.js → index-CYM65t4i.js} +1 -1
  164. package/dist/client/assets/{index-DhkfALZp.js → index-CaZ9yNIm.js} +1 -1
  165. package/dist/client/assets/index-CaxFHvSK.js +1 -0
  166. package/dist/client/assets/index-CdHuEKYh.js +1 -0
  167. package/dist/client/assets/{index-YXyEu3Ia.js → index-CoL3MmPh.js} +1 -1
  168. package/dist/client/assets/{index-Du4HX97h.js → index-CtN6_QCQ.js} +2 -2
  169. package/dist/client/assets/{index-JG_0k1NX.js → index-CvIKejlx.js} +1 -1
  170. package/dist/client/assets/{index-FwAvbbet.js → index-CypEgDik.js} +1 -1
  171. package/dist/client/assets/index-Cz9N1NHd.js +1 -0
  172. package/dist/client/assets/{index-CnltS8ym.js → index-D-ZRSiaH.js} +1 -1
  173. package/dist/client/assets/{index-DQTTC52E.js → index-D8ZcqMea.js} +1 -1
  174. package/dist/client/assets/{index-CAjKQnAd.js → index-D97clHqL.js} +1 -1
  175. package/dist/client/assets/index-DAaYbj1s.js +1 -0
  176. package/dist/client/assets/{index-B3xeyV6n.js → index-DI9IsN-O.js} +1 -1
  177. package/dist/client/assets/{index-DhYnXLRT.js → index-DLPkp7I9.js} +1 -1
  178. package/dist/client/assets/{index-CAAsqmfP.js → index-DMTfnznD.js} +1 -1
  179. package/dist/client/assets/{index-BSxkprTm.js → index-DZQUx5pX.js} +3 -3
  180. package/dist/client/assets/{index-B_he44rF.js → index-DamNtsio.js} +1 -1
  181. package/dist/client/assets/{index-Ce3HZQem.js → index-DenTxAiI.js} +1 -1
  182. package/dist/client/assets/{index-jLIoULQt.js → index-DmG7yphM.js} +1 -1
  183. package/dist/client/assets/{index-BnXWm8Db.js → index-Dqouol3i.js} +1 -1
  184. package/dist/client/assets/{index-DsasLE1l.js → index-Dsj1fDYU.js} +1 -1
  185. package/dist/client/assets/{index-Br35Gqfz.js → index-E5KPj_ZX.js} +1 -1
  186. package/dist/client/assets/{index-DrENuQdJ.js → index-LGTvsZzp.js} +1 -1
  187. package/dist/client/assets/{index-uLbyd6YP.js → index-Nr39AP-T.js} +1 -1
  188. package/dist/client/assets/{index-DrQqkQq_.js → index-YrSNUw95.js} +1 -1
  189. package/dist/client/assets/index-fge85Gub.js +1053 -0
  190. package/dist/client/assets/{index-D847rJXW.js → index-mweR5xOP.js} +1 -1
  191. package/dist/client/assets/{index-LpaxG4VS.js → index-ocZzSFoR.js} +1 -1
  192. package/dist/client/assets/{index.esm-CZ68Qd2t.js → index.esm-BEGwgVfU.js} +1 -1
  193. package/dist/client/assets/{infoDiagram-MVDRKAX5-BCjhXqIT.js → infoDiagram-MVDRKAX5-oeBcoEBA.js} +1 -1
  194. package/dist/client/assets/{inline-code-BKPMIXZR.js → inline-code-7dwi7wWG.js} +1 -1
  195. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-C9rsv2nh.js → ishikawaDiagram-HPEHV2GE-CLIGz304.js} +1 -1
  196. package/dist/client/assets/{journeyDiagram-BOSHW7O7-BRYr1XL1.js → journeyDiagram-BOSHW7O7-Cg0HlPT5.js} +1 -1
  197. package/dist/client/assets/{kanban-definition-FNSA4HC5-2ey8FXEn.js → kanban-definition-FNSA4HC5-DXaqYXhm.js} +1 -1
  198. package/dist/client/assets/{layers-DE3wjQuk.js → layers-BhECZJWp.js} +1 -1
  199. package/dist/client/assets/{lightbulb-BXJIRUdm.js → lightbulb-DjMxuZnu.js} +1 -1
  200. package/dist/client/assets/{link-2-DzWm9OxA.js → link-2-BY2WyWzK.js} +1 -1
  201. package/dist/client/assets/{list-runtime-types-BhkZkTrB.js → list-runtime-types-hMouIGtG.js} +1 -1
  202. package/dist/client/assets/{markdown-content-Bk9lCksw.js → markdown-content-DV3AiG76.js} +1 -1
  203. package/dist/client/assets/{mention-pill-os_7QQu2.js → mention-pill-Db0XBC6Z.js} +1 -1
  204. package/dist/client/assets/{mermaid.core-BcRUBvZd.js → mermaid.core-_ZqWvaFB.js} +4 -4
  205. package/dist/client/assets/{message-square-off-DuOiETNI.js → message-square-off-w0__0O5g.js} +1 -1
  206. package/dist/client/assets/{mindmap-definition-6OY57UG3-DBhXkS2i.js → mindmap-definition-6OY57UG3-BRVkHL68.js} +1 -1
  207. package/dist/client/assets/{more-details-Bt9nlPmS.js → more-details-BUolHzrY.js} +1 -1
  208. package/dist/client/assets/{owner-notice-4ZSBxa2K.js → owner-notice-Cn5EUxgh.js} +1 -1
  209. package/dist/client/assets/{package-BmOMrNwc.js → package-BafFSryH.js} +1 -1
  210. package/dist/client/assets/{page-container-LomhzyuS.js → page-container-BCdJ_DsH.js} +1 -1
  211. package/dist/client/assets/{pane-resize-handle-BOtzx5Q4.js → pane-resize-handle-Bar-FdkY.js} +1 -1
  212. package/dist/client/assets/{paperclip-C1tkiT74.js → paperclip-DY4e-IlK.js} +1 -1
  213. package/dist/client/assets/{path-input-JHTlL97W.js → path-input-SZl4NGTs.js} +1 -1
  214. package/dist/client/assets/{pegDiagram-ECIUJNBX-B01fb3t0.js → pegDiagram-ECIUJNBX-D9J7XmXK.js} +1 -1
  215. package/dist/client/assets/{pieDiagram-GNMPY74T-BJ7JYrTk.js → pieDiagram-GNMPY74T-myMGqtsR.js} +1 -1
  216. package/dist/client/assets/{plug-CsqfQsYq.js → plug-BdWCGVJg.js} +1 -1
  217. package/dist/client/assets/primer-trigger-r8N0YY5e.js +3 -0
  218. package/dist/client/assets/{profile-errors-CpvSy5wY.js → profile-errors-DymWFWiP.js} +1 -1
  219. package/dist/client/assets/{progress-qB87L0zJ.js → progress-es667_cM.js} +1 -1
  220. package/dist/client/assets/{quadrantDiagram-D57K4MC3-mJYGGmOV.js → quadrantDiagram-D57K4MC3-D5_2lcqK.js} +1 -1
  221. package/dist/client/assets/{query-error-state-MyJ1ivia.js → query-error-state-BNPduDBN.js} +1 -1
  222. package/dist/client/assets/{radio-DJV7l0fv.js → radio-DpWUX1KL.js} +1 -1
  223. package/dist/client/assets/{railroadDiagram-Y72NRBL7-BlXWwQe2.js → railroadDiagram-Y72NRBL7-D15ELhSC.js} +1 -1
  224. package/dist/client/assets/{registry-tJrGs7kB.js → registry-5Qudcjd5.js} +4 -4
  225. package/dist/client/assets/registry-DvKu39S1.js +1 -0
  226. package/dist/client/assets/relay-trace-schemas-DURazPP9.js +6 -0
  227. package/dist/client/assets/{repeat-CBnopqBr.js → repeat-HOHWZc6L.js} +1 -1
  228. package/dist/client/assets/{requirementDiagram-EQYSW5RA-Dqr1Y74x.js → requirementDiagram-EQYSW5RA-CHcEVlsR.js} +1 -1
  229. package/dist/client/assets/{room-files-source-BFo0FEUP.js → room-files-source-BO3E2ed0.js} +1 -1
  230. package/dist/client/assets/{rotate-ccw-clock-D9XRHj5E.js → rotate-ccw-clock-Dniulnw5.js} +1 -1
  231. package/dist/client/assets/{rotate-cw-DNa7ENG3.js → rotate-cw-um9OzAM7.js} +1 -1
  232. package/dist/client/assets/{sankeyDiagram-SY24JHO5-DGYZs_kW.js → sankeyDiagram-SY24JHO5-_R5087R3.js} +1 -1
  233. package/dist/client/assets/{scroll-area-Bf6IGziJ.js → scroll-area-MdXbnM77.js} +1 -1
  234. package/dist/client/assets/search-x-CHNgYj0F.js +6 -0
  235. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-BW3u4L9y.js → sequenceDiagram-BLEHNHQU-BzHmSHMF.js} +1 -1
  236. package/dist/client/assets/{shield-x-WGxwrtNV.js → shield-x-CDXAW9YF.js} +1 -1
  237. package/dist/client/assets/{signed-in-eV4_EXuv.js → signed-in-JAMHtSjx.js} +1 -1
  238. package/dist/client/assets/{sizeCapture-INFHLROL-C1TpueOu.js → sizeCapture-INFHLROL-CqA3cZcy.js} +1 -1
  239. package/dist/client/assets/{soul-file-e1iYX9IV.js → soul-file-BcaDvIdL.js} +1 -1
  240. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DvrHUauN.js → stateDiagram-v2-A6IESKWZ-RAA8YyBW.js} +1 -1
  241. package/dist/client/assets/{swimlanes-B3ENRKFQ-BUbTcoId.js → swimlanes-B3ENRKFQ-BQvgJIcj.js} +1 -1
  242. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-iDgTYazX.js +8 -0
  243. package/dist/client/assets/{table-DsxLk3Gx.js → table-BcJvj9rx.js} +1 -1
  244. package/dist/client/assets/{timeline-definition-JXYKGLGB-CzbVpGxn.js → timeline-definition-JXYKGLGB-DXi0saeN.js} +1 -1
  245. package/dist/client/assets/{trust-posture-Blofy7eE.js → trust-posture-vH4plBRD.js} +1 -1
  246. package/dist/client/assets/{unplug-B6dUhqA7.js → unplug-CK2bPGpg.js} +1 -1
  247. package/dist/client/assets/untrusted-text-BDygHCRk.js +1 -0
  248. package/dist/client/assets/{unverified-catalog-notice-6pwZtIjx.js → unverified-catalog-notice-WMkPDdUp.js} +1 -1
  249. package/dist/client/assets/{use-bindings-BgXZ0D7k.js → use-bindings-h_mG9d64.js} +1 -1
  250. package/dist/client/assets/{use-composer-prefs--zO2mm_M.js → use-composer-prefs-DhCnTsrF.js} +1 -1
  251. package/dist/client/assets/{use-connector-management-9Q7wHb06.js → use-connector-management-CXVz2xe3.js} +1 -1
  252. package/dist/client/assets/{use-deep-link-scroll-CXqwdwGr.js → use-deep-link-scroll-DYOZ5k0G.js} +1 -1
  253. package/dist/client/assets/{use-delete-binding-BBQNMtUY.js → use-delete-binding-CHAeTC_Q.js} +1 -1
  254. package/dist/client/assets/{use-dev-links-C643CCcq.js → use-dev-links-CM2NIeqy.js} +1 -1
  255. package/dist/client/assets/{use-direct-message-panel-BD_daG2E.js → use-direct-message-panel-DXTH05Ym.js} +1 -1
  256. package/dist/client/assets/use-external-adapter-catalog-DKlBkkvF.js +1 -0
  257. package/dist/client/assets/use-full-activity-feed-QZAZ5vBJ.js +1 -0
  258. package/dist/client/assets/use-is-below-desktop-DS51QTwj.js +1 -0
  259. package/dist/client/assets/{use-local-browser-P93oA-F5.js → use-local-browser-43FpcgCM.js} +1 -1
  260. package/dist/client/assets/{use-mesh-topology-B0k0gLoW.js → use-mesh-topology-Bw7MmKA9.js} +1 -1
  261. package/dist/client/assets/{use-mounted-ref-DE7EQsBF.js → use-mounted-ref-Cuui7-gf.js} +1 -1
  262. package/dist/client/assets/{use-notification-prefs-B8JtshQ0.js → use-notification-prefs-CJnF55Rv.js} +1 -1
  263. package/dist/client/assets/use-pending-read-DB25CO5E.js +1 -0
  264. package/dist/client/assets/{use-personality-commit-Dh5Sejj_.js → use-personality-commit-p6Of1UxX.js} +1 -1
  265. package/dist/client/assets/{use-promo-activation-C9FWA7ru.js → use-promo-activation-CxG-kZJQ.js} +3 -3
  266. package/dist/client/assets/{use-promo-dismissals-BIfafj9f.js → use-promo-dismissals-DeNbRWOh.js} +1 -1
  267. package/dist/client/assets/{use-pulse-freshness-CxzVMmVK.js → use-pulse-freshness-CdRkKThf.js} +1 -1
  268. package/dist/client/assets/{use-room-follow-claim-B1QPFaUb.js → use-room-follow-claim-_B7HonZx.js} +1 -1
  269. package/dist/client/assets/{use-room-sessions-CdjzO67_.js → use-room-sessions-CrFskgCJ.js} +1 -1
  270. package/dist/client/assets/{use-roving-tab-list-Nu-MIapD.js → use-roving-tab-list-DSjW4_wm.js} +1 -1
  271. package/dist/client/assets/use-session-canvas-KguPfnsc.js +27 -0
  272. package/dist/client/assets/{use-status-budget-DgeTxC3h.js → use-status-budget-CTereFSr.js} +3 -3
  273. package/dist/client/assets/{use-transform-CiJqtMBf.js → use-transform-YUDqOhoc.js} +1 -1
  274. package/dist/client/assets/{use-unclaimed-chats-Blkq6U4D.js → use-unclaimed-chats-B9ChucvA.js} +1 -1
  275. package/dist/client/assets/use-update-config-BH0agtZh.js +1 -0
  276. package/dist/client/assets/{useMutationState-lbcdmnfE.js → useMutationState-TJGtJT5R.js} +1 -1
  277. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-BM36oESm.js → usecaseDiagram-WPOLBNNX-Cjs1EpVL.js} +1 -1
  278. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-Zrybcs91.js → vennDiagram-Q3Y3IDCW-BtgH-ZyN.js} +1 -1
  279. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-CO4pzGG0.js → wardleyDiagram-IVAIDKWA-BCWHQ18G.js} +1 -1
  280. package/dist/client/assets/{xychartDiagram-4URNHDU4-pi_wF1CM.js → xychartDiagram-4URNHDU4-CUBPWq_V.js} +1 -1
  281. package/dist/client/index.html +1 -1
  282. package/dist/server/index.js +7695 -5486
  283. package/dist/server/index.js.map +2 -2
  284. package/package.json +5 -5
  285. package/dist/client/assets/AdapterSetupWizard-CwKYl1vG.js +0 -2
  286. package/dist/client/assets/BindingDialog-CpBZoSZU.js +0 -1
  287. package/dist/client/assets/HandlePage-BjlcYr_l.js +0 -1
  288. package/dist/client/assets/NamePage-A8X09lY7.js +0 -1
  289. package/dist/client/assets/PhotoPage-DP5WoeFd.js +0 -1
  290. package/dist/client/assets/TourHost-Cg8EHvod.js +0 -1
  291. package/dist/client/assets/_shell._home.index-BTJhhEWN.js +0 -3
  292. package/dist/client/assets/_shell.connections-Cpe1hru3.js +0 -1
  293. package/dist/client/assets/_shell.marketplace-CzLqm8iR.js +0 -1
  294. package/dist/client/assets/_shell.marketplace_.sources-DtraxnMx.js +0 -1
  295. package/dist/client/assets/_shell.session-72JEfodU.js +0 -1
  296. package/dist/client/assets/_shell.x._extensionId-CcJi8pKR.js +0 -1
  297. package/dist/client/assets/_shell.x._extensionId_._-CcJi8pKR.js +0 -1
  298. package/dist/client/assets/channel-DMgpNBDz.js +0 -1
  299. package/dist/client/assets/index-B6Scr7KJ.js +0 -1053
  300. package/dist/client/assets/index-DyN65ufd.js +0 -1
  301. package/dist/client/assets/index-UJq1qaku.js +0 -1
  302. package/dist/client/assets/index-e6oawwKv.js +0 -1
  303. package/dist/client/assets/index-j30EyYIU.js +0 -1
  304. package/dist/client/assets/primer-trigger-DLdK7lVr.js +0 -3
  305. package/dist/client/assets/registry-BrjQCdmG.js +0 -1
  306. package/dist/client/assets/relay-trace-schemas-TH0-GYCB.js +0 -6
  307. package/dist/client/assets/search-x-DFBBEouE.js +0 -6
  308. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-wkooBe_N.js +0 -8
  309. package/dist/client/assets/untrusted-text-pHjcUwfI.js +0 -1
  310. package/dist/client/assets/use-adapter-catalog-J43bUHJu.js +0 -1
  311. package/dist/client/assets/use-external-adapter-catalog-BjbC1V6t.js +0 -1
  312. package/dist/client/assets/use-full-activity-feed-DUH8r8jx.js +0 -1
  313. package/dist/client/assets/use-is-below-desktop-DAZnwJGB.js +0 -1
  314. package/dist/client/assets/use-pending-read-DeGO1wGC.js +0 -1
  315. package/dist/client/assets/use-relay-config-DQE3dmJ2.js +0 -1
  316. package/dist/client/assets/use-session-canvas-BfKGOpNy.js +0 -27
  317. package/dist/client/assets/use-update-config-BFFW_6Mc.js +0 -1
@@ -1,9 +1,9 @@
1
- import{O as re,aN as De,a1 as os,a3 as Me,a4 as ls,aH as cs,aI as O,r as h,m0 as us,j as s,G as N,by as ae,ar as oe,em as ds,m1 as ee,m2 as ms,cP as ps,m3 as hs,jx as Oe,m4 as fs,m5 as xs,bX as le,gO as gs,y as Pe,aY as js,it as Le,cV as U,gW as Ns,m6 as bs,m7 as ys,gU as vs,m8 as $,dl as _,dm as R,dn as D,bz as ce,bA as ue,bB as de,bD as me,gY as ks,aQ as Ue,gV as Ts,m9 as he,ma as Ss,mb as Cs,ga as ze,gb as ws,gc as $e,ea as Be,mc as Es,md as se,me as Is,ba as As,B as P,mf as _s,mg as Rs,a9 as Ds,mh as Fe,eQ as Ms,ed as Os,mi as fe,mj as Ps,k6 as Ls,k7 as Us,k8 as zs,k9 as $s,mk as Bs,ml as Fs,ka as xe,mm as Gs,f as Ws,ef as Y,jW as Hs,hh as Ge,mn as Vs,mo as Qs,mp as We,mq as He,mr as Xs,bJ as qs,bK as Ks,bL as Ys,bM as Js,_ as V,bN as Zs,bO as et,bP as st,bR as tt,e as G,eS as Ve,ll as ge,dV as nt,I as it,lm as rt,jV as at,ec as ot,aV as Qe,aS as pe,cx as lt,ms as ct,e9 as Q,mt as ut,cz as J,mu as te,mv as Xe,mw as qe,cA as Ke,mx as dt,my as mt,mz as pt,mA as ht,cB as ft,lY as xt,bE as W,cD as Ye,mB as gt,kg as jt,aq as Nt,g0 as bt,mC as yt,gZ as vt,mD as kt,mE as Tt,ip as St,jr as Ct,J as wt,X as Et,ad as It,h8 as At,g3 as _t,ib as Rt,ez as Dt,hU as Mt,k3 as Ot,$ as Pt,hl as Lt}from"./index-B6Scr7KJ.js";import{G as H}from"./git-branch-1zYKSuur.js";import{u as Ut}from"./use-update-config-BFFW_6Mc.js";import{s as zt}from"./settings-for-runtime-BoOa-ZFG.js";import{C as $t}from"./card-DA_Z-FYX.js";import{R as Bt,H as Ft,a as Gt,b as Wt}from"./RuntimeSetupDialog-DPU4QIY9.js";import{r as Ht}from"./RuntimeConnectFlow-D3H5Fpkc.js";import{U as je}from"./unverified-catalog-notice-6pwZtIjx.js";import{L as Vt}from"./layers-DE3wjQuk.js";import{C as Qt,a as Xt}from"./cpu-mx7zDf7k.js";/**
1
+ import{O as re,aL as De,a1 as os,a3 as Me,a4 as ls,aF as cs,aG as O,r as h,m3 as us,j as s,G as N,bw as ae,ap as oe,el as ds,m4 as ee,m5 as ms,cN as ps,m6 as hs,jA as Oe,m7 as fs,m8 as xs,bV as le,gO as gs,y as Pe,aW as js,iw as Le,cT as U,gW as Ns,m9 as bs,ma as ys,gU as vs,mb as $,dj as _,dk as R,dl as D,bx as ce,by as ue,bz as de,bB as me,gY as ks,aO as Ue,gV as Ts,mc as he,md as Ss,me as Cs,g9 as ze,ga as ws,gb as $e,e9 as Be,mf as Es,mg as se,mh as Is,b8 as As,B as P,mi as _s,mj as Rs,a7 as Ds,mk as Fe,eP as Ms,ec as Os,ml as fe,mm as Ps,k9 as Ls,ka as Us,kb as zs,kc as $s,mn as Bs,mo as Fs,kd as xe,mp as Gs,f as Ws,ee as Y,jZ as Hs,hh as Ge,mq as Qs,mr as Xs,ms as We,mt as He,mu as qs,bH as Vs,bI as Ks,bJ as Ys,bK as Js,_ as Q,bL as Zs,bM as et,bN as st,bP as tt,e as G,eR as Qe,lo as ge,dU as nt,I as it,lp as rt,jY as at,eb as ot,aT as Xe,aQ as pe,cv as lt,mv as ct,e8 as X,mw as ut,cx as J,mx as te,my as qe,mz as Ve,cy as Ke,mA as dt,mB as mt,mC as pt,mD as ht,cz as ft,l$ as xt,bC as W,cB as Ye,mE as gt,kj as jt,ao as Nt,f$ as bt,mF as yt,gZ as vt,mG as kt,mH as Tt,is as St,ju as Ct,J as wt,X as Et,ab as It,h8 as At,g2 as _t,ie as Rt,ey as Dt,hU as Mt,k6 as Ot,$ as Pt,hl as Lt}from"./index-fge85Gub.js";import{G as H}from"./git-branch-uZFa3Tmr.js";import{u as Ut}from"./use-update-config-BH0agtZh.js";import{s as zt}from"./settings-for-runtime-BoOa-ZFG.js";import{C as $t}from"./card-CM7-_8nD.js";import{R as Bt,H as Ft,a as Gt,b as Wt}from"./RuntimeSetupDialog-CEUC7GrY.js";import{r as Ht}from"./RuntimeConnectFlow-B0TIITVq.js";import{U as je}from"./unverified-catalog-notice-WMkPDdUp.js";import{L as Qt}from"./layers-BhECZJWp.js";import{C as Xt,a as qt}from"./cpu-BMUMZCWW.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const Je={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};Je.node;const qt=re(Je);/**
6
+ */const Je={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};Je.node;const Vt=re(Je);/**
7
7
  * @license lucide-react v1.48.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
@@ -13,4 +13,4 @@ import{O as re,aN as De,a1 as os,a3 as Me,a4 as ls,aH as cs,aI as O,r as h,m0 as
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const es={name:"wifi",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]};es.node;const z=re(es);function Yt(e){var t;return((t=e==null?void 0:e.ui)==null?void 0:t.statusBar)??us}function Jt(){const{data:e}=De();return Yt(e)}function Zt(){const e=os(),t=Me(),n=ls({mutationKey:cs,mutationFn:r=>e.updateConfig({ui:{statusBar:{pins:[...r]}}}),onMutate:async r=>{await t.cancelQueries({queryKey:O.current()});const a=t.getQueryData(O.current());return t.setQueryData(O.current(),o=>o!=null&&o.ui?{...o,ui:{...o.ui,statusBar:{pins:[...r]}}}:o),{previous:a}},onError:(r,a,o)=>{o&&o.previous!==void 0&&t.setQueryData(O.current(),o.previous)},onSettled:()=>{t.invalidateQueries({queryKey:O.current()})}});return{setPins:h.useCallback(r=>n.mutate(r),[n]),isPending:n.isPending}}const en={duration:.2,ease:[.4,0,.2,1]},sn="pointer-coarse:[&_button]:py-3",tn=1e3;function _i({items:e,trailing:t,nameFirst:n}){const i=e.filter(a=>a.cluster==="left"),r=e.filter(a=>a.cluster==="right");return s.jsxs("div",{role:"toolbar","aria-label":"Chat status","aria-live":"polite","data-testid":"status-line",className:"text-muted-foreground flex items-center gap-2 overflow-hidden px-1 text-xs whitespace-nowrap pointer-coarse:min-h-11",children:[s.jsx(Ne,{items:i,className:N("flex-auto",n&&i.length>0?"min-w-10":"min-w-0"),style:n?{flexShrink:tn}:void 0}),s.jsx(Ne,{items:r,className:"min-w-0 shrink"}),t!==void 0&&s.jsx("span",{className:"flex shrink-0 items-center",children:t})]})}const nn=8;function rn(e,t){return nn**Math.max(0,t.indexOf(e.key))}function Ne({items:e,className:t,style:n}){const i=[...e].sort((r,a)=>a.severity-r.severity).map(r=>r.key);return s.jsx("div",{className:N("flex items-center gap-2",t),style:n,children:s.jsx(ae,{initial:!1,mode:"popLayout",children:e.map((r,a)=>s.jsxs(oe.div,{"data-testid":`status-item-${r.key}`,"data-rigid":r.rigid?"true":void 0,"data-held":r.held?"true":void 0,"data-snug":r.snug?"true":void 0,layout:"position",initial:{opacity:0,scale:.8,filter:"blur(4px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},exit:{opacity:0,scale:.8,filter:"blur(4px)"},transition:en,style:r.rigid||r.held||r.snug?void 0:{flexShrink:rn(r,i)},className:N("inline-flex items-center gap-2",r.rigid||r.held||r.snug?"shrink-0":"min-w-10",sn),children:[a>0&&s.jsx(an,{}),r.node]},r.key))})})}function an(){return s.jsx("span",{className:"text-muted-foreground/30 shrink-0","aria-hidden":"true",children:"·"})}function Ri({cwd:e}){const t=e.split("/").filter(Boolean).pop()??e;return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:e,children:[s.jsx(ds,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:t})]})}function X(e){const t=e.trim(),n=Array.from(t);return n.length<=ee?t:`${n.slice(0,ee-1).join("").trimEnd()}…`}function on(e){return e.replace(/\s*\([^()]*\)\s*$/,"").split("·")[0].trim()}function ln(e,t){return X(cn(e,t))}function cn(e,t){const n=t.find(r=>r.value===e);if(n)return on(n.displayName);const i=/claude-(\w+)-/.exec(e);return i?`${i[1].charAt(0).toUpperCase()}${i[1].slice(1)}`:e==="default"?"Default":ms(e)??e}function Di({data:e,workspace:t,compact:n}){if(!e)return null;if(!ps(e))return s.jsxs("span",{className:"text-muted-foreground/50 inline-flex min-w-0 items-center gap-1",title:"Not a git repository",children:[s.jsx(H,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:"No repo"})]});const i=e.modified+e.staged+e.untracked,r=i===1?"1 change":`${i} changes`,a=[];if(e.modified>0&&a.push(`${e.modified} modified`),e.staged>0&&a.push(`${e.staged} staged`),e.untracked>0&&a.push(`${e.untracked} untracked`),e.conflicted>0&&a.push(`${e.conflicted} conflicted`),t){const d=hs(t.portBase),c=[`${t.key} · ${t.projectKey}`,`${t.branch??e.branch} · ${t.provider}`,e.ahead>0?`↑${e.ahead}`:"",e.behind>0?`↓${e.behind}`:"",a.length>0?a.join(", "):"clean",`ports ${d.DORKOS_PORT} / ${d.VITE_PORT} / ${d.SITE_PORT}`,t.pinned?"pinned":""].filter(Boolean);return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:c.join(" · "),children:[s.jsx(H,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"max-w-[20ch] truncate font-medium",children:n?X(t.key):t.key}),!n&&s.jsxs("span",{className:"text-muted-foreground truncate",children:["· ",t.projectKey]}),t.pinned&&s.jsx(Oe,{className:"text-muted-foreground size-(--size-icon-xs) shrink-0"}),i>0&&(n?s.jsx(be,{label:r}):s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["· ",r]}))]})}const o=a.length>0?`${e.branch} · ${a.join(", ")}`:`${e.branch} · clean`;return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:o,children:[s.jsx(H,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"max-w-[25ch] truncate",children:n?X(e.branch):e.branch}),e.ahead>0&&s.jsxs("span",{className:"text-muted-foreground inline-flex shrink-0 items-center gap-0.5",children:[s.jsx(fs,{className:"size-(--size-icon-xs)"}),e.ahead]}),e.behind>0&&s.jsxs("span",{className:"text-muted-foreground inline-flex shrink-0 items-center gap-0.5",children:[s.jsx(xs,{className:"size-(--size-icon-xs)"}),e.behind]}),i>0&&(n?s.jsx(be,{label:r}):s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["· ",r]}))]})}function be({label:e}){return s.jsx("span",{role:"img","aria-label":e,title:e,className:"bg-muted-foreground/70 size-1 shrink-0 rounded-full"})}function un({stop:e,onMakeDefault:t,onDismiss:n,pending:i,error:r,placement:a="inline"}){const o=a==="overlay";return o&&!e?null:s.jsx("div",{className:N("flex items-center px-1",o?"bg-background/95 pointer-events-auto absolute right-0 bottom-full left-0 z-20 mb-1 rounded-md py-0.5 backdrop-blur-sm":"min-h-5"),"data-testid":o?"make-default-slot-overlay":"make-default-slot",children:e&&s.jsxs("p",{role:"status","data-testid":"make-default-offer",className:N("animate-in fade-in-0 flex min-w-0 items-center gap-1.5 text-xs duration-200 motion-reduce:animate-none",r?"text-destructive":"text-muted-foreground"),children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:r?s.jsxs(s.Fragment,{children:[s.jsx(le,{className:"mr-1 inline size-3 shrink-0 align-[-2px]","aria-hidden":!0}),r]}):s.jsxs(s.Fragment,{children:["Start every new chat in ",gs(e),"?"]})})," ",s.jsxs("span",{className:"flex shrink-0 items-center gap-1 whitespace-nowrap",children:[r?s.jsx("button",{type:"button",disabled:i,onClick:t,"data-testid":"make-default-retry",className:"focus-ring text-foreground rounded-sm underline underline-offset-2 disabled:opacity-50",children:"Try again"}):s.jsx("button",{type:"button",disabled:i,onClick:t,"data-testid":"make-default-confirm",className:"focus-ring text-foreground rounded-sm underline underline-offset-2 disabled:opacity-50",children:"Make default"}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("button",{type:"button",onClick:n,"data-testid":"make-default-dismiss",className:"focus-ring hover:text-foreground rounded-sm underline underline-offset-2",children:"Dismiss"})]})]})})}function dn(e,t,n){const i=he(e,t),r=he(e,n);return!i||!r?!1:Ss(r,i)?i.auto===!0&&r.auto!==!0&&r.asks!=="never":!0}const mn="Auto mode needs Opus 4.6+ or Sonnet 4.6";function Mi({mode:e,onChangeMode:t,disabled:n,pending:i,runtime:r,modelSupportsAutoMode:a,planActive:o,compact:d,makeDefault:c,onOpenChange:m}){var w;const l=Pe(r),p=js(x=>x.setControlCenterOpen),u=Le(),S=U(x=>x.open),y=U(x=>x.setOpen),v=U(x=>x.setAvailable),j=!(l&&!l.permissionModes.supported)&&n!==!0&&i!==!0;h.useEffect(()=>(v(j),()=>v(!1)),[j,v]);const b=h.useRef(m);if(h.useEffect(()=>{b.current=m},[m]),h.useEffect(()=>()=>{var x;y(!1),(x=b.current)==null||x.call(b,!1)},[y]),l&&!l.permissionModes.supported)return null;const T=(l==null?void 0:l.permissionModes.values)??[],M=!a&&T.some(x=>x.id==="auto"),A=M?T.filter(x=>x.id!=="auto"):T,E=A.find(x=>x.id===e),C=u?T.find(x=>x.id===(l==null?void 0:l.permissionModes.default)):void 0,k=C!==void 0&&E!==void 0&&l!==void 0&&dn(l.permissionModes,E.id,C.id),f=k?C:E,I=k?`${C.label} (Wi-Fi)`:(f==null?void 0:f.label)??Ns(e),q=d?X(k?C.label:I):I,K=bs(f),B=(w=ys(A).find(x=>x.mode.id===e))==null?void 0:w.stop,F=M&&(B==="act"||e==="auto"),L=s.jsxs("button",{disabled:n,"data-testid":"permission-mode-trigger","aria-label":`Permissions: ${I}`,className:N($,"items-center gap-1 disabled:cursor-not-allowed disabled:opacity-40",K),children:[s.jsx(vs,{descriptor:f,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:q})]});return n?s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsx("span",{className:"inline-flex",children:L})}),s.jsx(D,{side:"top",children:"Send a message first"})]}):i?s.jsxs("span",{"data-testid":"permission-mode-pending","aria-busy":"true","aria-label":"Permissions: still loading",className:N($,"items-center gap-1 opacity-40"),children:[s.jsx("span",{className:"bg-muted-foreground/30 size-(--size-icon-xs) shrink-0 animate-pulse rounded-full"}),s.jsx("span",{className:"bg-muted-foreground/30 h-2 w-10 animate-pulse rounded"})]}):s.jsxs(ce,{open:S,onOpenChange:x=>{y(x),m==null||m(x)},children:[s.jsx(ue,{asChild:!0,children:L}),s.jsxs(de,{side:"top",align:"start",className:"w-80 p-3","aria-label":"Permissions",children:[s.jsx(me,{children:"Permissions"}),s.jsx(ks,{mode:e,descriptors:A,onChangeMode:t,planActive:o,onUnlock:()=>p(!0)}),c&&s.jsx(un,{...c}),F&&s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("p",{"data-testid":"auto-unsupported-hint",className:"text-muted-foreground text-3xs mt-2 flex items-center gap-1.5 px-1",children:[s.jsx(Ue,{className:"size-(--size-icon-xs) shrink-0"}),"Auto unavailable on this model"]})}),s.jsx(D,{side:"top",children:mn})]}),s.jsx(Ts,{mode:e,descriptor:E,className:"mt-2 px-1"})]})]})}const ye="On Wi-Fi · agents ask or only read",Z="Over Wi-Fi, every file or shell step needs your OK, or agents only read.",pn="relative after:absolute after:top-1/2 after:left-1/2 after:size-11 after:-translate-x-1/2 after:-translate-y-1/2 after:content-['']";function Oi({compact:e}){const t=Le(),n=Cs();if(!t)return null;const i=s.jsxs("button",{type:"button","data-testid":"wifi-turn-cap","aria-label":`${ye}. ${Z}`,className:N("border-border text-muted-foreground inline-flex items-center gap-1 rounded-full border py-0.5",pn,n?"cursor-pointer":"cursor-default",e?"mx-1.5 px-1":"px-2","focus-visible:ring-ring outline-none focus-visible:ring-[3px]"),children:[s.jsx(z,{"aria-hidden":!0,className:"size-(--size-icon-xs) shrink-0"}),!e&&s.jsx("span",{children:ye})]});return n?s.jsxs(ze,{children:[s.jsx(ws,{asChild:!0,children:i}),s.jsx($e,{side:"top",collisionPadding:8,"data-testid":"wifi-turn-cap-detail",className:"w-auto max-w-70 p-3 text-xs",children:Z})]}):s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:i}),s.jsx(D,{side:"top",children:Z})]})}const hn=6e3;function fn(e){return e instanceof Error&&e.message||"Couldn’t save that. Try again."}function Pi(e){var B,F,L;const{sessionId:t,runtime:n,declaredModes:i,runtimeDefaultMode:r}=e,{data:a}=De(),{data:o}=Be(),d=Ut(),c=Me(),m=Es(t),l=se(w=>w.dismissDefaultStopOffer),[p,u]=h.useState(null),[S,y]=h.useState(null),[v,j]=h.useState(t);v!==t&&(j(t),u(null),y(null));const b=a==null?void 0:a.executionDefaults,T=n??(b==null?void 0:b.runtime),M=(B=b==null?void 0:b.perRuntime.find(w=>w.runtime===T))==null?void 0:B.trustStop,A=M??(b==null?void 0:b.trustStop)??null,E=(F=i.find(w=>w.id===r))==null?void 0:F.stop,C=A??E,k=M!=null?(L=zt(o,T))==null?void 0:L.configSection:void 0,f=a!==void 0;h.useEffect(()=>{if(!p)return;const w=setTimeout(()=>u(null),hn);return()=>clearTimeout(w)},[p]);const I=h.useCallback(w=>{const x=i.find(as=>as.id===w);!x||Is(x)||!f||m||x.stop!==C&&(y(null),u(x.stop))},[i,f,m,C,u,y]),q=h.useCallback(()=>{if(!p)return;const w=p;y(null),d.mutate({runtimes:k?{[k]:{defaultTrustStop:w}}:{defaultTrustStop:w}},{onSuccess:()=>{c.invalidateQueries({queryKey:O.all}),u(null)},onError:x=>y(fn(x))})},[p,d,c,k,u,y]),K=h.useCallback(()=>{l(t),u(null)},[l,t,u]);return{line:f?{stop:p,onMakeDefault:q,onDismiss:K,pending:d.isPending,error:S}:null,offerFor:I}}function Li({runtimeLabel:e,onShown:t,onDismiss:n}){const i=U(a=>a.available),r=U(a=>a.setOpen);return h.useEffect(()=>{t==null||t()},[t]),s.jsxs($t,{"data-slot":"read-only-mode-notice","data-testid":"read-only-mode-notice",gap:"none",className:"flex-row flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2",children:[s.jsx(As,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":!0}),s.jsxs("p",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:["In this mode, ",e," reads files but won’t change them. Asking won’t help."]}),s.jsxs("div",{className:"flex w-full shrink-0 flex-wrap items-center justify-end gap-1.5 sm:w-auto",children:[s.jsx(P,{variant:"ghost",size:"sm",responsive:!1,className:"h-7 px-2 text-xs",onClick:n,children:"Dismiss"}),i&&s.jsx(P,{variant:"outline",size:"sm",responsive:!1,className:"h-7 px-2 text-xs",onClick:()=>r(!0),children:"Change permissions"})]})]})}function Ui(e,t,n){const i=Pe(t??void 0),r=se(p=>p.recordReadOnlyHintShown),a=se(p=>p.spendReadOnlyHint),o=_s(e??""),d=i==null?void 0:i.permissionModes.values.find(p=>p.id===n),c=d!==void 0&&Rs(d);h.useEffect(()=>{c||!e||o!=="shown"||a(e)},[c,e,o,a]);const m=h.useCallback(()=>{e&&r(e)},[e,r]),l=h.useCallback(()=>{e&&a(e)},[e,a]);return h.useMemo(()=>({eligible:!!e&&c&&o!=="spent",runtimeLabel:t?Ds(t):"This agent",markShown:m,dismiss:l}),[e,c,o,t,m,l])}function zi({descriptor:e,active:t,onToggle:n,disabled:i}){return s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("button",{type:"button","aria-pressed":t,disabled:i,onClick:()=>n(!t),className:N($,"items-center gap-1","disabled:cursor-not-allowed disabled:opacity-40",t&&"text-foreground"),children:[s.jsx(Fe,{className:"size-(--size-icon-xs) shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e.label})]})}),s.jsx(D,{side:"top",children:i?"Send a message first":e.promise})]})}function $i({runtime:e,model:t,onChangeRuntime:n,canSelect:i,compact:r,iconOnly:a,account:o}){const{data:d}=Be(),{data:c}=Ms(),{nameFor:m}=Os(),[l,p]=h.useState({open:!1}),u=Object.keys((d==null?void 0:d.capabilities)??{}),S=u.filter(f=>fe(c,f)),y=u.filter(f=>!fe(c,f)),v=d!==void 0&&Object.values(Ps).some(f=>f.setup&&!u.includes(f.type)),j=!!n&&(u.length>1||y.length>0||v),b=r?null:t,T=Y(e),M=T.icon,A=a?s.jsx(M,{"aria-hidden":!0,className:"size-(--size-icon-xs) shrink-0"}):s.jsx(Hs,{runtime:e,model:b,iconClassName:"size-(--size-icon-xs)"}),E=a?s.jsx("span",{className:"block",children:T.label}):null,C=a?s.jsx("span",{role:"img","aria-label":T.label,"data-testid":"runtime-item-icon",className:"inline-flex items-center",children:A}):A,k=o?`Account: ${m(o)}`:null;return i?j?s.jsxs(s.Fragment,{children:[s.jsxs(Ls,{children:[s.jsx(Us,{asChild:!0,children:s.jsx("button",{className:$,"aria-label":a?`Runs on: ${T.label}`:void 0,title:a?T.label:void 0,children:A})}),s.jsxs(zs,{side:"top",align:"start",className:"w-56",children:[s.jsx($s,{children:"Runs on"}),s.jsx(Bs,{value:e,onValueChange:f=>n==null?void 0:n(f),children:S.map(f=>{const I=Y(f);return s.jsx(Fs,{value:f,icon:I.icon,children:I.label},f)})}),y.map(f=>{const I=Y(f);return s.jsx(xe,{icon:I.icon,description:"Connect",onSelect:()=>p({open:!0,runtime:f}),children:I.label},f)}),v&&s.jsxs(s.Fragment,{children:[s.jsx(Gs,{}),s.jsx(xe,{icon:Ws,onSelect:()=>p({open:!0}),children:"Add a runtime"})]})]})]}),s.jsx(Bt,{runtime:l.runtime,open:l.open,onOpenChange:f=>p(I=>({...I,open:f})),renderConnect:Ht,showConnectSuccess:!0,onRuntimeReady:f=>{n==null||n(f)}})]}):!k&&!E?C:s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:C}),s.jsxs(D,{side:"top",children:[E,k&&s.jsx("span",{className:"block",children:k})]})]}):s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:C}),s.jsxs(D,{side:"top",children:[E,s.jsx("span",{className:"block",children:"Set when the chat starts. It can’t change after."}),k&&s.jsx("span",{className:"block",children:k})]})]})}function Bi(e,t,n){const i=Ge(),r=Vs(e),a=new Date(i),o=t.pending?null:t.usage;return{...Qs({liveTurnUsage:n,liveTurnAt:r,accountStatus:Xs(o,a),accountObservedAt:We(He(o))}),accountUsage:o}}function Fi({open:e,onOpenChange:t,onConfirm:n}){return s.jsx(qs,{open:e,onOpenChange:t,children:s.jsxs(Ks,{children:[s.jsxs(Ys,{children:[s.jsxs(Js,{className:"flex items-center gap-2",children:[s.jsx(Ue,{className:"text-muted-foreground size-4"}),"Turn on Auto mode?",s.jsx(V,{size:"xs",variant:"secondary",className:"tracking-wide uppercase",children:"Preview"})]}),s.jsx(Zs,{children:"Asks only before risky steps, like deleting files. Switch back anytime."})]}),s.jsxs(et,{children:[s.jsx(st,{children:"Cancel"}),s.jsx(tt,{onClick:n,children:"Turn on Auto mode"})]})]})})}const ve=[{slug:"frontier",label:"Frontier"},{slug:"solid-coders",label:"Solid coders"},{slug:"quick-helpers",label:"Quick helpers"},{slug:"more-models",label:"More models"},{slug:"no-tools",label:"Can’t do agent work"}],xn=10,gn="Can’t use tools, so it can’t read files or run commands.",jn="Makes images DorkOS can’t show yet.",Nn=["openrouter/openrouter/auto","openrouter/auto"];function bn(e){return Nn.some(t=>e.value===t||e.value.startsWith(`${t}-`))}function ss(e){return e.supportsToolUse!==!1}function yn(e){return e.supportsImageOutput===!0&&!bn(e)?jn:ss(e)?null:gn}function vn(e){if(!ss(e))return"no-tools";switch(e.tier){case"frontier":return"frontier";case"solid-coder":return"solid-coders";case"quick-helper":return"quick-helpers";default:return"more-models"}}function kn(e){return e.some(t=>t.tier!=null)||e.length>xn}function Tn(e,t){const n=t.trim().toLowerCase();return n?e.value.toLowerCase().includes(n)||e.displayName.toLowerCase().includes(n):!0}function Sn(e){const t=new Map(ve.map(n=>[n.slug,[]]));for(const n of e)t.get(vn(n)).push(n);return ve.map(n=>({...n,models:t.get(n.slug)})).filter(n=>n.models.length>0)}function Cn(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function wn(){return s.jsx("div",{className:"space-y-2","data-testid":"model-cards-skeleton",children:Array.from({length:3}).map((e,t)=>s.jsxs("div",{className:"flex items-center gap-3 rounded-xl p-3",children:[s.jsx(G,{className:"size-4 rounded-full"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(G,{className:"h-3.5 w-24"}),s.jsx(G,{className:"h-2.5 w-32"})]}),s.jsx(G,{className:"h-5 w-10 rounded-md"})]},t))})}function En({onRetry:e,message:t}){return s.jsxs("div",{className:"flex flex-col items-center gap-3 py-6 text-center","data-testid":"model-load-error",children:[s.jsx(le,{className:"text-muted-foreground size-5"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:t??"Couldn’t load the model list."}),s.jsxs("button",{onClick:e,className:"text-foreground hover:bg-accent inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors",children:[s.jsx(Ve,{className:"size-3"}),"Retry"]})]})}function In(e){const t=e.slice(e.lastIndexOf(" ")+1);return t.includes("/")||t.includes(":")}function ts({text:e,className:t}){return In(e)?s.jsx("div",{dir:"rtl",className:N("truncate text-left",t),title:e,children:s.jsx("bdi",{dir:"ltr",children:e})}):s.jsx("div",{className:N("truncate",t),title:e,children:e})}function ke({model:e,isSelected:t}){const n=yn(e);return s.jsxs("label",{className:N("flex w-full cursor-pointer items-center gap-3 rounded-xl border p-3 transition-colors duration-150",t?"bg-secondary border-foreground/15":"border-border hover:border-muted-foreground/30 hover:bg-muted/50 opacity-70"),children:[s.jsx(rt,{value:e.value,className:"shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"text-foreground line-clamp-2 text-sm font-medium break-words",children:[e.displayName,e.local&&s.jsxs("span",{className:"text-muted-foreground text-3xs ml-1.5 font-normal",children:[at()," · private"]})]}),s.jsx(ts,{text:e.description,className:"text-muted-foreground text-2xs leading-tight"}),n&&s.jsx("div",{className:"text-2xs text-status-warning-fg mt-0.5 leading-tight","data-testid":`model-limitation-${e.value}`,children:n})]}),e.contextWindow&&s.jsx(V,{size:"xs",variant:"secondary",className:"shrink-0",children:Cn(e.contextWindow)})]})}function An({value:e}){return s.jsxs("div",{className:"space-y-1.5","data-testid":"model-unavailable-saved",children:[s.jsxs("div",{className:"border-border flex w-full items-center gap-3 rounded-xl border border-dashed p-3 opacity-80",children:[s.jsx(le,{className:"text-status-warning-fg size-4 shrink-0"}),s.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-1.5",children:[s.jsx(ts,{text:e,className:"text-foreground min-w-0 text-sm font-medium"}),s.jsx("span",{className:"text-muted-foreground text-2xs shrink-0 font-normal",children:"(not available)"})]})]}),s.jsx("p",{className:"text-muted-foreground text-2xs leading-snug",children:"This model isn’t available anymore. Pick another."})]})}function _n({slug:e,label:t}){return s.jsx("div",{className:"text-muted-foreground text-2xs mt-2 mb-1 font-medium tracking-wide uppercase first:mt-0","data-testid":`model-group-${e}`,children:t})}function Rn({models:e,selectedModel:t,onChangeModel:n,emptyMessage:i}){const[r,a]=h.useState(""),o=kn(e),c=e.length>0&&t.length>0&&!e.some(u=>u.value===t)?s.jsx(An,{value:t}):null,m=e.some(u=>u.unverified),l=h.useMemo(()=>o?e.filter(u=>Tn(u,r)):e,[e,r,o]),p=h.useMemo(()=>o?Sn(l):[],[l,o]);return e.length===0?s.jsx("div",{className:"border-border text-muted-foreground text-2xs rounded-xl border border-dashed p-3 leading-snug","data-testid":"model-catalog-unavailable",children:i??"Couldn’t load models. Check Settings, then try again."}):o?s.jsxs("div",{className:"space-y-2",children:[c,m&&s.jsx(je,{}),s.jsxs("div",{className:"relative",children:[s.jsx(nt,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2"}),s.jsx(it,{type:"text",value:r,onChange:u=>a(u.target.value),placeholder:"Search models…","aria-label":"Search models","data-testid":"model-search",className:"h-8 pl-8 text-xs"})]}),p.length===0?s.jsx("p",{className:"text-muted-foreground py-4 text-center text-xs","data-testid":"model-search-empty",children:m?"No match in this short list. Connect a provider to see more.":"No models match"}):s.jsx(ge,{value:t,onValueChange:n,className:"grid-cols-1 gap-1.5","aria-label":"Model selection","data-testid":"model-card-list",children:p.map(u=>s.jsxs(h.Fragment,{children:[s.jsx(_n,{slug:u.slug,label:u.label}),u.models.map(S=>s.jsx(ke,{model:S,isSelected:S.value===t},S.value))]},u.slug))})]}):s.jsxs("div",{className:"space-y-2",children:[c,m&&s.jsx(je,{}),s.jsx(ge,{value:t,onValueChange:n,className:"grid-cols-1 gap-1.5","aria-label":"Model selection","data-testid":"model-card-list",children:e.map(u=>s.jsx(ke,{model:u,isSelected:u.value===t},u.value))})]})}const ne={none:{label:"None",description:"No reasoning"},minimal:{label:"Minimal",description:"Near-zero thinking"},low:{label:"Low",description:"Fastest responses"},medium:{label:"Medium",description:"Moderate thinking"},high:{label:"High",description:"Deep reasoning"},max:{label:"Max",description:"Maximum thinking"},xhigh:{label:"XHigh",description:"Beyond maximum"}},Dn={duration:.15,ease:"easeOut"};function Mn({effortLevels:e,effort:t,onChangeEffort:n}){return s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-2xs mb-2 font-medium tracking-wide uppercase",children:"Effort"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Effort level",children:[s.jsx(ie,{role:"radio",label:"Default",isSelected:t===null,onClick:()=>n(null)}),e.map(i=>s.jsx(ie,{role:"radio",label:ne[i].label,description:ne[i].description,isSelected:t===i,onClick:()=>n(i)},i))]})]})}function On({supportsFastMode:e,fastMode:t,onChangeFastMode:n}){return e?s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-2xs mb-2 font-medium tracking-wide uppercase",children:"Mode"}),s.jsx("div",{className:"flex gap-1.5",children:s.jsx(ie,{role:"switch",label:"Fast",icon:s.jsx(pe,{className:"size-3"}),isSelected:t,onClick:()=>n(!t)})})]}):null}function ie({role:e,label:t,description:n,icon:i,isSelected:r,onClick:a}){const o=s.jsxs("button",{role:e,"aria-checked":r,onClick:a,className:N("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"),children:[i,t]});return n?s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:o}),s.jsx(D,{side:"top",className:"text-xs",children:n})]}):o}function Gi({model:e,onChangeModel:t,effort:n,onChangeEffort:i,fastMode:r,onChangeFastMode:a,disabled:o,sessionId:d,runtime:c,onCredits:m,compact:l}){var C;const{data:p,isLoading:u,isError:S,refetch:y}=ot({sessionId:d,runtime:c??void 0}),v=p??[],j=v.find(k=>k.value===e),b=!!(j!=null&&j.supportsEffort&&(((C=j.supportedEffortLevels)==null?void 0:C.length)??0)>0),T=(j==null?void 0:j.supportsFastMode)??!1,M=!l&&b&&n?ne[n].label:null,A=!l&&r,E=s.jsxs("button",{disabled:o,className:N($,"items-center gap-1 disabled:cursor-not-allowed disabled:opacity-40"),"data-testid":"model-config-trigger",children:[s.jsx(Qe,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:ln(e,v)}),M&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground text-2xs",children:"·"}),s.jsx(V,{size:"xs",variant:"secondary",children:M})]}),A&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground text-2xs",children:"·"}),s.jsxs(V,{size:"xs",variant:"secondary",children:[s.jsx(pe,{className:"mr-0.5 inline size-2.5"}),"Fast"]})]})]});return o?s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsx("span",{className:"inline-flex",children:E})}),s.jsx(D,{side:"top",children:"Send a message first"})]}):s.jsxs(ce,{children:[s.jsx(ue,{asChild:!0,children:E}),s.jsxs(de,{side:"top",align:"start",className:"w-120 max-w-[calc(100vw-1.5rem)] p-3","data-testid":"model-config-popover",children:[s.jsx(me,{children:"Model"}),v.some(k=>k.paidFromCredits)&&s.jsx("p",{className:"text-muted-foreground text-2xs mb-2","data-testid":"model-credits-note",children:v.some(k=>k.creditsListOutOfDate)?"Models your DorkOS credits cover. This list may be out of date.":"Models your DorkOS credits cover"}),u&&s.jsx(wn,{}),S&&s.jsx(En,{onRetry:()=>y(),message:m?"Couldn’t load the models DorkOS credits cover. Your model stays as it is.":void 0}),!u&&!S&&s.jsx(Rn,{models:v,selectedModel:e,onChangeModel:t,emptyMessage:m?"DorkOS credits don’t cover a model for this runtime yet.":void 0}),s.jsx(ae,{children:!u&&!S&&(b||T)&&s.jsxs(oe.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:Dn,children:[s.jsx(lt,{className:"my-3"}),s.jsx("div",{className:"text-muted-foreground text-2xs mb-3 font-medium tracking-wide uppercase",children:"Configuration"}),s.jsxs("div",{className:"space-y-3",children:[b&&s.jsx(Mn,{effortLevels:j.supportedEffortLevels,effort:n,onChangeEffort:i}),T&&s.jsx(On,{supportsFastMode:(j==null?void 0:j.supportsFastMode)??!1,fastMode:r,onChangeFastMode:a})]})]},"config")})]})]})}function Wi({percent:e,contextUsage:t,compact:n,reading:i,now:r}){const a=ct(e,t)??e,o=ut(a),d=o==="critical"?Q.error:o==="warning"?Q.warning:"",c=n!=null&&a>=qe,m=t?{total:t.totalTokens,max:t.maxTokens}:i&&i.maxTokens>0?{total:i.totalTokens,max:i.maxTokens}:null,l=(i==null?void 0:i.observedAt)??null,p=m!==null,u=s.jsxs("span",{"aria-label":p?"Context window usage":void 0,className:N("inline-flex shrink-0 items-center gap-1",p&&"cursor-default",d),children:[s.jsx(Vt,{className:"size-(--size-icon-xs) shrink-0"}),s.jsxs("span",{children:[a,"%"]})]});return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[m?s.jsx(Pn,{totals:m,categories:(t==null?void 0:t.categories)??[],observedAt:l,now:r,children:u}):u,s.jsx(ae,{initial:!1,children:c&&s.jsxs(oe.button,{type:"button",onClick:n.onCompact,disabled:n.pending,"aria-label":n.pending?"Compacting chat…":`Context ${a}% full. Compact now`,"aria-busy":n.pending,"data-testid":"compaction-chip",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted inline-flex min-w-0 shrink items-center gap-1 rounded-md px-1.5 py-0.5 transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-60",children:[s.jsx(Ve,{"aria-hidden":"true",className:N("size-(--size-icon-xs) shrink-0",n.pending&&"animate-spin")}),s.jsx("span",{className:"truncate",children:"Compact"})]},"compact")})]})}function Pn({totals:e,categories:t,observedAt:n,now:i,children:r}){const a=t.filter(o=>o.tokens>0).sort((o,d)=>d.tokens-o.tokens);return s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:r}),s.jsx(D,{side:"top",className:"max-w-64",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"text-xs font-medium",children:[J(e.total)," / ",J(e.max)," tokens"]}),a.length>0&&s.jsx("div",{className:"space-y-0.5",children:a.map(o=>s.jsxs("div",{className:"text-3xs flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"flex items-center gap-1 truncate",children:[s.jsx("span",{className:"inline-block size-1.5 shrink-0 rounded-full",style:{backgroundColor:o.color}}),o.name]}),s.jsx("span",{className:N(te,"shrink-0"),children:J(o.tokens)})]},o.name))}),n!==null&&s.jsx(Xe,{observedAt:n,now:i,surface:"tooltip"})]})})]})}function Hi({usage:e,accountUsage:t=null,observedAt:n=null,open:i,onOpenChange:r,now:a}){const o=Ge(),d=a??new Date(o),c=He(t),m=c.length>0?We(c):n,l=e!=null&&Ke(e);let p;return c.length>0?p=s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-medium",children:"Subscription usage"}),s.jsx("div",{className:"flex flex-col gap-2.5",children:c.map(u=>s.jsx(dt,{window:u,label:mt(u.key,u.label),now:d},u.key))}),e&&s.jsx("div",{className:"text-3xs space-y-0.5",children:s.jsx(pt,{usage:e})})]}):l?p=s.jsx(ft,{usage:e}):p=s.jsx("p",{className:"text-muted-foreground text-xs",children:"No usage yet."}),s.jsxs(ze,{open:i,onOpenChange:r,children:[s.jsx(ht,{asChild:!0,children:s.jsx("span",{"aria-hidden":!0,className:"inline-block h-0 w-0"})}),s.jsx($e,{side:"top",align:"end",className:"w-72 max-w-[calc(100vw-1.5rem)]","aria-label":"Usage and cost",children:s.jsxs("div",{className:"space-y-2",children:[p,m!==null&&(c.length>0||l)&&s.jsx(Xe,{observedAt:m,now:d})]})})]})}const Ln={connecting:{color:W.warning,label:"Connecting",shortLabel:"Connecting",icon:z,tasks:!0},connected:{color:W.success,label:"Connected",shortLabel:"Connected",icon:z,tasks:!1},reconnecting:{color:W.warning,label:"Reconnecting",shortLabel:"Reconnecting",icon:z,tasks:!0},disconnected:{color:W.error,label:"Live updates lost",shortLabel:"Offline",icon:xt,tasks:!1}};function Vi({connectionState:e,compact:t}){const n=Ln[e],i=n.icon;return s.jsxs(Ft,{openDelay:200,children:[s.jsx(Gt,{asChild:!0,children:s.jsxs("span",{className:"flex min-w-0 cursor-default items-center gap-1.5 text-xs",children:[s.jsx("span",{className:N("size-1.5 shrink-0 rounded-full",n.color,n.tasks&&"animate-breath")}),s.jsx("span",{className:"text-muted-foreground truncate",children:t?n.shortLabel:n.label})]})}),s.jsx(Wt,{side:"top",align:"center",className:"w-72 p-3",children:s.jsxs("div",{className:"flex items-start gap-2.5",children:[s.jsx(i,{className:N("mt-0.5 size-4 shrink-0",e==="disconnected"?Q.error:Q.warning)}),s.jsxs("div",{className:"min-w-0 space-y-1.5",children:[s.jsx("p",{className:"text-sm font-medium",children:n.label}),s.jsx(Un,{connectionState:e})]})]})})]})}function Un({connectionState:e}){const t="text-muted-foreground text-xs leading-relaxed";return e==="connecting"?s.jsx("p",{className:t,children:"Connecting to live updates. New messages appear once connected."}):e==="reconnecting"?s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:t,children:"Live updates dropped and are reconnecting. Nothing is lost."}),s.jsx("p",{className:N(t,"text-muted-foreground/70"),children:"No action needed."})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:t,children:"Couldn’t reconnect live updates. New messages won’t appear until they’re back."}),s.jsx("p",{className:N(t,"text-muted-foreground/70"),children:"Refresh the page. If that doesn’t help, check that DorkOS is running."})]})}function Qi({count:e,running:t,waiting:n}){const i=e===1?"":"s",r=e-t.length,a=`${e} subagent${i} running`;return s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1","aria-label":a,children:[s.jsx(Ye,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"shrink-0 tabular-nums",children:e})]})}),s.jsxs(D,{side:"top",className:"max-w-64",children:[n&&s.jsx("p",{className:"mb-1 font-medium",children:"Still working. The agent continues when they finish."}),s.jsx("ul",{className:"space-y-1",children:t.map(o=>s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:o.description??"Working…"}),s.jsxs("p",{className:N(te,"text-3xs leading-tight"),children:[o.toolUses??0," tool",o.toolUses===1?"":"s",o.lastToolName?` · last ${o.lastToolName}`:""]})]},o.taskId))}),r>0&&s.jsx("p",{className:N(te,"text-3xs leading-tight"),children:t.length>0?`and ${r} more`:`${r} task${i} from earlier`})]})]})}const Te=648,zn=440,$n=340,Bn=3,Fn=3,Gn=2,Wn=4,Hn=8,Vn=20,Qn=ee*Hn+Vn,Xn=Number.POSITIVE_INFINITY,Se=[],qn=["cwd"],Ce=["cwd","git"];function Kn(e){if(e===null||e<=0)return{density:"full",rightBudget:Xn,dropped:Se};if(e>=Te){const t=Math.floor((e-Te)/Qn);return{density:"full",rightBudget:Wn+t,dropped:Se}}return e>=zn?{density:"compact",rightBudget:Bn,dropped:qn}:e>=$n?{density:"identity",rightBudget:Fn,dropped:Ce}:{density:"avatar",rightBudget:Gn,dropped:Ce}}function Yn(e){return e==="identity"||e==="avatar"}function Jn(e,t){return t.severity!==e.severity?t.severity-e.severity:Number(t.pinned)-Number(e.pinned)}const Zn=2,ei=2;function Xi(e,t){const n=new Set(t.dropped),i=t.density!=="full",r=l=>i&&l.held,a=e.filter(l=>l.cluster==="right"),o=new Set;let d=0,c=0;const m=[...a].sort((l,p)=>Number(r(p))-Number(r(l))||Jn(l,p));for(const l of m){if(c>=t.rightBudget)break;const p=l.rigid||r(l);p&&d>=Zn||(p&&(d+=1),o.add(l.key),c+=l.wide?Math.min(ei,t.rightBudget-c):1)}return{items:e.filter(l=>l.cluster==="right"?o.has(l.key):!n.has(l.key)).map(l=>l.held===r(l)?l:{...l,held:r(l)}),overflow:a.length-o.size}}const si=new Set(["main","master"]);function qi(e,t,n){return{dirty:!t,onDefaultBranch:!n&&si.has(e)}}const g={AGENT_ANCHOR:1e3,CONNECTION_LOST:100,CONTEXT_CRITICAL:90,ACCOUNT_ATTENTION:85,USAGE_EXHAUSTED:80,PERMISSION_BYPASS:70,CONTEXT_WARNING:50,USAGE_WARNING:50,PERMISSION_ELEVATED:40,PLAN_ACTIVE:40,SUBAGENTS_RUNNING:35,EXTENSION_ITEM:35,RUNTIME_NON_DEFAULT:30,GIT_DIRTY:20,MODEL:10,CWD:5,QUIET:0},ti={session:"Session",diagnostics:"Diagnostics"};function we(e){return e.runtime&&!e.runtime.isDefault?g.RUNTIME_NON_DEFAULT:g.QUIET}function ni(e){return e.account!==null}const ii=new Set(["near","model-out","out"]);function Ee(e){return e.permissionDescriptor?e.permissionDescriptor.stop!=="ask":e.permissionMode!=="default"}const ns=[{key:"agent",label:"Agent",description:"Who you are talking to",cluster:"left",group:null,icon:jt,promote:()=>!0,severity:()=>g.AGENT_ANCHOR},{key:"cwd",label:"Directory",description:"The folder this chat can touch",cluster:"left",group:"session",icon:Nt,promote:e=>e.cwd!==null,severity:()=>g.CWD},{key:"git",label:"Git",description:"Branch and uncommitted changes",cluster:"left",group:"session",icon:H,promote:e=>e.git!==null&&(e.git.dirty||!e.git.onDefaultBranch),severity:e=>{var t;return(t=e.git)!=null&&t.dirty?g.GIT_DIRTY:g.QUIET}},{key:"runtime",label:"Runs on",description:"What runs this chat",cluster:"right",group:"session",icon:Qt,promote:e=>e.runtime!==null&&e.runtime.type!=="doe"&&(!e.runtime.isDefault||e.runtime.canSelect),severity:we,snug:Yn},{key:"account",label:"Account",description:"Which Claude account this uses, and what’s left",cluster:"right",group:null,icon:Xt,promote:e=>e.account!==null,severity:e=>e.account&&ii.has(e.account.chipState)?g.ACCOUNT_ATTENTION:we(e)},{key:"extensions",label:"Add-ons",description:"What your extensions show here",cluster:"right",group:null,icon:bt,promote:e=>e.extensionItems.some(t=>t.visible),severity:e=>e.extensionItems.some(t=>t.visible&&t.urgent)?g.ACCOUNT_ATTENTION:g.EXTENSION_ITEM},{key:"model",label:"Model",description:"The model answering you",cluster:"right",group:"session",icon:Qe,promote:()=>!1,severity:()=>g.MODEL},{key:"cache",label:"Cache",description:"How much came from cache",cluster:"right",group:"session",icon:pe,promote:()=>!1,severity:()=>g.QUIET,neverInLine:!0},{key:"context",label:"Context",description:"How full the context window is",cluster:"right",group:"session",icon:qt,rigid:!0,promote:e=>e.contextPercent!==null,severity:e=>e.contextPercent===null?g.QUIET:e.contextPercent>=qe?g.CONTEXT_CRITICAL:e.contextPercent>=kt?g.CONTEXT_WARNING:g.QUIET},{key:"usage",label:"Usage & cost",description:"Plan limits or chat cost",cluster:"right",group:"session",icon:yt,rigid:!0,promote:e=>e.usage!==null&&Ke(e.usage)&&!ni(e),wide:e=>e.usageStale,severity:e=>{var t,n;return((t=e.usage)==null?void 0:t.state)==="exhausted"?g.USAGE_EXHAUSTED:((n=e.usage)==null?void 0:n.state)==="warning"?g.USAGE_WARNING:g.QUIET}},{key:"permission",label:"Permissions",description:"How freely the agent acts",cluster:"right",group:"session",icon:vt,held:!0,promote:e=>Ee(e)||e.permissionPickerOpen===!0||e.onWifi===!0,severity:e=>(e.permissionDescriptor?Tt(e.permissionDescriptor):St(e.permissionMode))?g.PERMISSION_BYPASS:Ee(e)||e.permissionPickerOpen===!0||e.onWifi===!0?g.PERMISSION_ELEVATED:g.QUIET},{key:"plan",label:"Plan",description:"Plan first, change nothing until approved",cluster:"right",group:"session",icon:Fe,promote:e=>e.plan!==null,severity:e=>{var t;return(t=e.plan)!=null&&t.active?g.PLAN_ACTIVE:g.QUIET},snug:()=>!0},{key:"subagents",label:"Subagents",description:"Subagents working on this turn",cluster:"right",group:"diagnostics",icon:Ye,rigid:!0,promote:e=>e.subagentsInFlight>0,severity:e=>e.subagentsInFlight>0?g.SUBAGENTS_RUNNING:g.QUIET},{key:"connection",label:"Live updates",description:"The live link that delivers messages",cluster:"right",group:"diagnostics",icon:z,promote:e=>e.connectionState!=="connected",severity:e=>e.connectionState==="connected"?g.QUIET:g.CONNECTION_LOST}];function is(e){return e.group==="session"&&e.neverInLine!==!0}function ri(){const{pins:e}=Jt(),{setPins:t}=Zt(),n=h.useCallback(r=>{const a=gt.find(o=>o===r);a&&t(e.includes(a)?e.filter(o=>o!==a):[...e,a])},[e,t]),i=h.useCallback(()=>t([]),[t]);return{pins:e,toggle:n,reset:i}}function ai(){return["session","diagnostics"].map(t=>({group:t,label:ti[t],items:ns.filter(n=>n.group===t)})).filter(t=>t.items.length>0)}function rs(e){const t=e.contextTokens??e.readTokens+e.creationTokens;return t<=0?0:Math.round(e.readTokens/t*100)}function oi(e){return e?e.kind==="subscription"&&e.utilization!=null?`${Math.round(e.utilization*100)}% of ${e.windowLabel??"your plan"}`:e.costUsd!=null?`$${e.costUsd.toFixed(2)}`:null:null}function li(e){return e.split("/").filter(Boolean).pop()??e}function ci(e,t){switch(e){case"cwd":return t.cwd?li(t.cwd):null;case"git":return t.git.state==="unknown"?null:t.git.state==="no-repo"?"No repo":t.git.dirty?`${t.git.branch} · changed`:t.git.branch;case"runtime":return t.runtime;case"model":return t.model;case"context":return t.contextPercent===null?null:`${t.contextPercent}% full`;case"cache":return t.cache===null?null:`${rs(t.cache)}% from cache`;case"usage":return oi(t.usage);case"permission":return t.permissionMode;case"connection":return`${t.connectionState} · event ${t.lastEventSeq}`;default:return null}}function ui(e){return JSON.stringify({sessionId:e.sessionId,cwd:e.cwd,git:e.git,runtime:e.runtime,model:e.model,selectedModel:e.selectedModel,effort:e.effort,fastMode:e.fastMode,permissionMode:e.permissionMode,contextPercent:e.contextPercent,contextUsage:e.contextUsage,cache:e.cache===null?null:{readTokens:e.cache.readTokens,creationTokens:e.cache.creationTokens,contextTokens:e.cache.contextTokens??null,hitPercent:rs(e.cache)},usage:e.usage,connectionState:e.connectionState,streaming:e.streaming,lifecycle:e.lifecycle,triggerPending:e.triggerPending,lastEventSeq:e.lastEventSeq,snapshotCursor:e.snapshotCursor,lastEventAt:e.lastEventAt===null?null:new Date(e.lastEventAt).toISOString(),queueDepth:e.queueDepth,subagents:e.subagents.map(t=>t.name),activeSubagents:e.activeSubagents,runningSubagentCount:e.runningSubagentCount,clientVersion:e.clientVersion,capturedAt:new Date().toISOString()},null,2)}function di({copied:e,failed:t}){return e?s.jsx(wt,{className:"text-status-success size-3.5","aria-hidden":!0}):t?s.jsx(Et,{className:"text-destructive size-3.5","aria-hidden":!0}):s.jsx(Kt,{className:"size-3.5","aria-hidden":!0})}function mi(e,t){return e?"Copied":t?"Couldn’t copy":"Copy diagnostics"}function pi({diagnostics:e,className:t}){const{copied:n,failed:i,copy:r}=Ct(),a=()=>void r(ui(e));return s.jsxs(P,{variant:"ghost",size:"sm",className:N("gap-1.5 text-xs",t),onClick:a,children:[s.jsx(di,{copied:n,failed:i}),mi(n,i)]})}function Ki({open:e,onOpenChange:t,diagnostics:n,controls:i,promotionContext:r,urgentAction:a,overflowCount:o=0,addOns:d}){const c=It(),{pins:m,toggle:l,reset:p}=ri(),u=ai(),S=new Set(m),y=o>0;return s.jsxs(ce,{open:e,onOpenChange:t,children:[s.jsx(At,{children:s.jsxs(_,{children:[s.jsx(ue,{asChild:!0,children:s.jsx(R,{asChild:!0,children:s.jsxs("button",{type:"button","data-testid":"status-reveal","aria-label":y?`Chat details, ${o} more`:"Chat details",className:"text-muted-foreground/50 hover:text-muted-foreground inline-flex shrink-0 items-center justify-center gap-0.5 transition-colors duration-150 pointer-coarse:min-h-11 pointer-coarse:min-w-11",children:[s.jsx(_t,{className:"size-4"}),y&&s.jsxs("span",{className:"tabular-nums",children:["+",o]})]})})}),s.jsx(D,{side:"top",children:y?`Chat details, ${o} more`:"Chat details"})]})}),s.jsxs(de,{side:"top",align:"end",className:"w-80 p-3","aria-label":"Chat",children:[s.jsx(me,{children:"Chat"}),a&&s.jsx(P,{variant:"secondary",className:"mb-3 w-full",disabled:a.pending,onClick:()=>{a.onAction(),t(!1)},children:a.label}),s.jsxs("div",{className:"flex flex-col gap-4",children:[d&&s.jsxs("section",{className:"space-y-1","data-testid":"session-add-ons",children:[s.jsx("h3",{className:"text-muted-foreground px-1 text-xs font-medium tracking-wide uppercase",children:"Add-ons"}),d]}),u.map(v=>s.jsxs("section",{className:"space-y-1",children:[s.jsx("h3",{className:"text-muted-foreground px-1 text-xs font-medium tracking-wide uppercase",children:v.label}),hi(fi(v.items,i),c?r:null).map(j=>s.jsx(gi,{item:j,value:ci(j.key,n),pinned:S.has(j.key),onTogglePin:is(j)?()=>l(j.key):null,control:xi(j.key,i)},j.key)),v.group==="diagnostics"&&s.jsxs(s.Fragment,{children:[s.jsx(Ie,{label:"Queued messages",value:String(n.queueDepth)}),s.jsx(Ie,{label:"Chat ID",value:n.sessionId||"—"})]})]},v.group))]}),n.sessionId!==""&&s.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground mt-3 h-7 w-full justify-start gap-1.5 text-xs",onClick:()=>{t(!1),Dt({sessionId:n.sessionId})},children:[s.jsx(Rt,{className:"size-3.5","aria-hidden":!0}),"View notifications"]}),s.jsxs("div",{className:"mt-4 flex items-center justify-between gap-2",children:[s.jsx(pi,{diagnostics:n}),s.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 text-xs",disabled:m.length===0,onClick:p,children:[s.jsx(Mt,{className:"size-3.5","aria-hidden":!0}),"Reset pins"]})]})]})]})}function hi(e,t){return t?[...e].sort((n,i)=>i.severity(t)-n.severity(t)):e}function fi(e,t){return e.filter(n=>n.key!=="plan"||t.plan!==null)}function xi(e,t){return e==="plan"&&t.plan?s.jsx(Pt,{checked:t.plan.active,onCheckedChange:t.plan.onToggle,"aria-label":"Plan first, change nothing until approved"}):null}function gi({item:e,value:t,pinned:n,onTogglePin:i,control:r}){const a=e.icon;return s.jsxs("div",{"data-testid":`session-row-${e.key}`,className:"flex items-center gap-2 px-1 py-1 text-sm",children:[s.jsx(a,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e.label}),s.jsx("span",{className:"min-w-0 flex-1"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",title:t??void 0,children:t??"—"}),r,i&&s.jsx("button",{type:"button",onClick:i,"aria-pressed":n,"aria-label":n?`Stop keeping ${e.label} in the status bar`:`Keep ${e.label} in the status bar`,className:N("hover:text-foreground inline-flex size-6 shrink-0 items-center justify-center rounded-md transition-colors duration-150",n?"text-foreground":"text-muted-foreground/50"),children:n?s.jsx(Oe,{className:"size-3.5"}):s.jsx(Ot,{className:"size-3.5"})})]})}function Ie({label:e,value:t}){return s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-sm",children:[s.jsx("span",{className:"w-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e}),s.jsx("span",{className:"min-w-0 flex-1"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",title:t,children:t})]})}function Yi(e){const t=h.useRef(e);h.useEffect(()=>{t.current=e},[e]),h.useEffect(()=>{const n=i=>{const r=i.key==="."||i.key===">";(i.metaKey||i.ctrlKey)&&i.shiftKey&&r&&(i.preventDefault(),t.current())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[])}const Ae=new WeakMap;function _e(e,t,n){let i=Ae.get(e);i||(i=new Set,Ae.set(e,i)),!i.has(t)&&(i.add(t),n())}function Re(e,t,n){let i;try{i=n()}catch(r){return _e(e,`${t}:throw`,()=>console.warn(`[extensions] ${e.extensionId}'s status-bar item "${e.id}" threw in ${t}(); it is hidden until it stops throwing.`,r)),!1}return typeof i!="boolean"?(_e(e,`${t}:type`,()=>console.warn(`[extensions] ${e.extensionId}'s status-bar item "${e.id}": ${t}() must return true or false, synchronously, reading only its ctx; it returned ${ji(i)}, read as false.`)),!1):i}function ji(e){return e instanceof Promise?"a Promise":e===null?"null":typeof e=="object"?"an object":`a ${typeof e}`}function Ni(e,t){const n=[],i=[];for(const r of e){const a=r.when?Re(r,"when",()=>r.when(t)):!0,o=a&&r.urgent?Re(r,"urgent",()=>r.urgent(t)):!1;n.push({id:r.id,visible:a,urgent:o}),a&&i.push(r)}return i.sort((r,a)=>(r.priority??0)-(a.priority??0)),{promotion:n,visible:i}}function Ji(e){const t=Lt("status-bar");return h.useMemo(()=>Ni(t,e),[t,e])}function bi(e){return e!=null&&e!==!1}function Zi({ctx:e,pins:t,nodes:n,density:i="full"}){var o,d;const r=new Set(t),a=[];for(const c of ns){if(c.neverInLine)continue;const m=n[c.key];if(!bi(m))continue;const l=r.has(c.key)&&is(c);!l&&!c.promote(e)||a.push({key:c.key,cluster:c.cluster,severity:c.severity(e),pinned:l,rigid:c.rigid===!0,wide:((o=c.wide)==null?void 0:o.call(c,e))===!0,held:c.held===!0,snug:((d=c.snug)==null?void 0:d.call(c,i))===!0,node:m})}return a}function er(){const e=h.useRef(null),[t,n]=h.useState(null);h.useLayoutEffect(()=>{const r=e.current;if(!r)return;n(r.getBoundingClientRect().width);const a=new ResizeObserver(o=>{var m,l;const d=o.at(0);if(!d)return;const c=((l=(m=d.contentBoxSize)==null?void 0:m.at(0))==null?void 0:l.inlineSize)??d.contentRect.width;n(c)});return a.observe(r),()=>a.disconnect()},[]);const i=h.useMemo(()=>Kn(t),[t]);return{ref:e,budget:i}}export{Fi as A,pi as C,Di as G,un as M,Mi as P,Li as R,Ki as S,Hi as U,Oi as W,Ln as a,Vi as b,rs as c,Wi as d,Ri as e,Gi as f,zi as g,$i as h,_i as i,Qi as j,Xi as k,Ni as l,ui as m,qi as n,Yn as o,ni as p,ln as q,Kn as r,Zi as s,Pi as t,Ji as u,Ui as v,Yi as w,ri as x,er as y,Bi as z};
16
+ */const es={name:"wifi",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]};es.node;const z=re(es);function Yt(e){var t;return((t=e==null?void 0:e.ui)==null?void 0:t.statusBar)??us}function Jt(){const{data:e}=De();return Yt(e)}function Zt(){const e=os(),t=Me(),n=ls({mutationKey:cs,mutationFn:r=>e.updateConfig({ui:{statusBar:{pins:[...r]}}}),onMutate:async r=>{await t.cancelQueries({queryKey:O.current()});const a=t.getQueryData(O.current());return t.setQueryData(O.current(),o=>o!=null&&o.ui?{...o,ui:{...o.ui,statusBar:{pins:[...r]}}}:o),{previous:a}},onError:(r,a,o)=>{o&&o.previous!==void 0&&t.setQueryData(O.current(),o.previous)},onSettled:()=>{t.invalidateQueries({queryKey:O.current()})}});return{setPins:h.useCallback(r=>n.mutate(r),[n]),isPending:n.isPending}}const en={duration:.2,ease:[.4,0,.2,1]},sn="pointer-coarse:[&_button]:py-3",tn=1e3;function _i({items:e,trailing:t,nameFirst:n}){const i=e.filter(a=>a.cluster==="left"),r=e.filter(a=>a.cluster==="right");return s.jsxs("div",{role:"toolbar","aria-label":"Chat status","aria-live":"polite","data-testid":"status-line",className:"text-muted-foreground flex items-center gap-2 overflow-hidden px-1 text-xs whitespace-nowrap pointer-coarse:min-h-11",children:[s.jsx(Ne,{items:i,className:N("flex-auto",n&&i.length>0?"min-w-10":"min-w-0"),style:n?{flexShrink:tn}:void 0}),s.jsx(Ne,{items:r,className:"min-w-0 shrink"}),t!==void 0&&s.jsx("span",{className:"flex shrink-0 items-center",children:t})]})}const nn=8;function rn(e,t){return nn**Math.max(0,t.indexOf(e.key))}function Ne({items:e,className:t,style:n}){const i=[...e].sort((r,a)=>a.severity-r.severity).map(r=>r.key);return s.jsx("div",{className:N("flex items-center gap-2",t),style:n,children:s.jsx(ae,{initial:!1,mode:"popLayout",children:e.map((r,a)=>s.jsxs(oe.div,{"data-testid":`status-item-${r.key}`,"data-rigid":r.rigid?"true":void 0,"data-held":r.held?"true":void 0,"data-snug":r.snug?"true":void 0,layout:"position",initial:{opacity:0,scale:.8,filter:"blur(4px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},exit:{opacity:0,scale:.8,filter:"blur(4px)"},transition:en,style:r.rigid||r.held||r.snug?void 0:{flexShrink:rn(r,i)},className:N("inline-flex items-center gap-2",r.rigid||r.held||r.snug?"shrink-0":"min-w-10",sn),children:[a>0&&s.jsx(an,{}),r.node]},r.key))})})}function an(){return s.jsx("span",{className:"text-muted-foreground/30 shrink-0","aria-hidden":"true",children:"·"})}function Ri({cwd:e}){const t=e.split("/").filter(Boolean).pop()??e;return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:e,children:[s.jsx(ds,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:t})]})}function q(e){const t=e.trim(),n=Array.from(t);return n.length<=ee?t:`${n.slice(0,ee-1).join("").trimEnd()}…`}function on(e){return e.replace(/\s*\([^()]*\)\s*$/,"").split("·")[0].trim()}function ln(e,t){return q(cn(e,t))}function cn(e,t){const n=t.find(r=>r.value===e);if(n)return on(n.displayName);const i=/claude-(\w+)-/.exec(e);return i?`${i[1].charAt(0).toUpperCase()}${i[1].slice(1)}`:e==="default"?"Default":ms(e)??e}function Di({data:e,workspace:t,compact:n}){if(!e)return null;if(!ps(e))return s.jsxs("span",{className:"text-muted-foreground/50 inline-flex min-w-0 items-center gap-1",title:"Not a git repository",children:[s.jsx(H,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:"No repo"})]});const i=e.modified+e.staged+e.untracked,r=i===1?"1 change":`${i} changes`,a=[];if(e.modified>0&&a.push(`${e.modified} modified`),e.staged>0&&a.push(`${e.staged} staged`),e.untracked>0&&a.push(`${e.untracked} untracked`),e.conflicted>0&&a.push(`${e.conflicted} conflicted`),t){const d=hs(t.portBase),c=[`${t.key} · ${t.projectKey}`,`${t.branch??e.branch} · ${t.provider}`,e.ahead>0?`↑${e.ahead}`:"",e.behind>0?`↓${e.behind}`:"",a.length>0?a.join(", "):"clean",`ports ${d.DORKOS_PORT} / ${d.VITE_PORT} / ${d.SITE_PORT}`,t.pinned?"pinned":""].filter(Boolean);return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:c.join(" · "),children:[s.jsx(H,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"max-w-[20ch] truncate font-medium",children:n?q(t.key):t.key}),!n&&s.jsxs("span",{className:"text-muted-foreground truncate",children:["· ",t.projectKey]}),t.pinned&&s.jsx(Oe,{className:"text-muted-foreground size-(--size-icon-xs) shrink-0"}),i>0&&(n?s.jsx(be,{label:r}):s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["· ",r]}))]})}const o=a.length>0?`${e.branch} · ${a.join(", ")}`:`${e.branch} · clean`;return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:o,children:[s.jsx(H,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"max-w-[25ch] truncate",children:n?q(e.branch):e.branch}),e.ahead>0&&s.jsxs("span",{className:"text-muted-foreground inline-flex shrink-0 items-center gap-0.5",children:[s.jsx(fs,{className:"size-(--size-icon-xs)"}),e.ahead]}),e.behind>0&&s.jsxs("span",{className:"text-muted-foreground inline-flex shrink-0 items-center gap-0.5",children:[s.jsx(xs,{className:"size-(--size-icon-xs)"}),e.behind]}),i>0&&(n?s.jsx(be,{label:r}):s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["· ",r]}))]})}function be({label:e}){return s.jsx("span",{role:"img","aria-label":e,title:e,className:"bg-muted-foreground/70 size-1 shrink-0 rounded-full"})}function un({stop:e,onMakeDefault:t,onDismiss:n,pending:i,error:r,placement:a="inline"}){const o=a==="overlay";return o&&!e?null:s.jsx("div",{className:N("flex items-center px-1",o?"bg-background/95 pointer-events-auto absolute right-0 bottom-full left-0 z-20 mb-1 rounded-md py-0.5 backdrop-blur-sm":"min-h-5"),"data-testid":o?"make-default-slot-overlay":"make-default-slot",children:e&&s.jsxs("p",{role:"status","data-testid":"make-default-offer",className:N("animate-in fade-in-0 flex min-w-0 items-center gap-1.5 text-xs duration-200 motion-reduce:animate-none",r?"text-destructive":"text-muted-foreground"),children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:r?s.jsxs(s.Fragment,{children:[s.jsx(le,{className:"mr-1 inline size-3 shrink-0 align-[-2px]","aria-hidden":!0}),r]}):s.jsxs(s.Fragment,{children:["Start every new chat in ",gs(e),"?"]})})," ",s.jsxs("span",{className:"flex shrink-0 items-center gap-1 whitespace-nowrap",children:[r?s.jsx("button",{type:"button",disabled:i,onClick:t,"data-testid":"make-default-retry",className:"focus-ring text-foreground rounded-sm underline underline-offset-2 disabled:opacity-50",children:"Try again"}):s.jsx("button",{type:"button",disabled:i,onClick:t,"data-testid":"make-default-confirm",className:"focus-ring text-foreground rounded-sm underline underline-offset-2 disabled:opacity-50",children:"Make default"}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("button",{type:"button",onClick:n,"data-testid":"make-default-dismiss",className:"focus-ring hover:text-foreground rounded-sm underline underline-offset-2",children:"Dismiss"})]})]})})}function dn(e,t,n){const i=he(e,t),r=he(e,n);return!i||!r?!1:Ss(r,i)?i.auto===!0&&r.auto!==!0&&r.asks!=="never":!0}const mn="Auto mode needs Opus 4.6+ or Sonnet 4.6";function Mi({mode:e,onChangeMode:t,disabled:n,pending:i,runtime:r,modelSupportsAutoMode:a,planActive:o,compact:d,makeDefault:c,onOpenChange:m}){var w;const l=Pe(r),p=js(x=>x.setControlCenterOpen),u=Le(),S=U(x=>x.open),y=U(x=>x.setOpen),v=U(x=>x.setAvailable),j=!(l&&!l.permissionModes.supported)&&n!==!0&&i!==!0;h.useEffect(()=>(v(j),()=>v(!1)),[j,v]);const b=h.useRef(m);if(h.useEffect(()=>{b.current=m},[m]),h.useEffect(()=>()=>{var x;y(!1),(x=b.current)==null||x.call(b,!1)},[y]),l&&!l.permissionModes.supported)return null;const T=(l==null?void 0:l.permissionModes.values)??[],M=!a&&T.some(x=>x.id==="auto"),A=M?T.filter(x=>x.id!=="auto"):T,E=A.find(x=>x.id===e),C=u?T.find(x=>x.id===(l==null?void 0:l.permissionModes.default)):void 0,k=C!==void 0&&E!==void 0&&l!==void 0&&dn(l.permissionModes,E.id,C.id),f=k?C:E,I=k?`${C.label} (Wi-Fi)`:(f==null?void 0:f.label)??Ns(e),V=d?q(k?C.label:I):I,K=bs(f),B=(w=ys(A).find(x=>x.mode.id===e))==null?void 0:w.stop,F=M&&(B==="act"||e==="auto"),L=s.jsxs("button",{disabled:n,"data-testid":"permission-mode-trigger","aria-label":`Permissions: ${I}`,className:N($,"items-center gap-1 disabled:cursor-not-allowed disabled:opacity-40",K),children:[s.jsx(vs,{descriptor:f,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:V})]});return n?s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsx("span",{className:"inline-flex",children:L})}),s.jsx(D,{side:"top",children:"Send a message first"})]}):i?s.jsxs("span",{"data-testid":"permission-mode-pending","aria-busy":"true","aria-label":"Permissions: still loading",className:N($,"items-center gap-1 opacity-40"),children:[s.jsx("span",{className:"bg-muted-foreground/30 size-(--size-icon-xs) shrink-0 animate-pulse rounded-full"}),s.jsx("span",{className:"bg-muted-foreground/30 h-2 w-10 animate-pulse rounded"})]}):s.jsxs(ce,{open:S,onOpenChange:x=>{y(x),m==null||m(x)},children:[s.jsx(ue,{asChild:!0,children:L}),s.jsxs(de,{side:"top",align:"start",className:"w-80 p-3","aria-label":"Permissions",children:[s.jsx(me,{children:"Permissions"}),s.jsx(ks,{mode:e,descriptors:A,onChangeMode:t,planActive:o,onUnlock:()=>p(!0)}),c&&s.jsx(un,{...c}),F&&s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("p",{"data-testid":"auto-unsupported-hint",className:"text-muted-foreground text-3xs mt-2 flex items-center gap-1.5 px-1",children:[s.jsx(Ue,{className:"size-(--size-icon-xs) shrink-0"}),"Auto unavailable on this model"]})}),s.jsx(D,{side:"top",children:mn})]}),s.jsx(Ts,{mode:e,descriptor:E,className:"mt-2 px-1"})]})]})}const ye="On Wi-Fi · agents ask or only read",Z="Over Wi-Fi, every file or shell step needs your OK, or agents only read.",pn="relative after:absolute after:top-1/2 after:left-1/2 after:size-11 after:-translate-x-1/2 after:-translate-y-1/2 after:content-['']";function Oi({compact:e}){const t=Le(),n=Cs();if(!t)return null;const i=s.jsxs("button",{type:"button","data-testid":"wifi-turn-cap","aria-label":`${ye}. ${Z}`,className:N("border-border text-muted-foreground inline-flex items-center gap-1 rounded-full border py-0.5",pn,n?"cursor-pointer":"cursor-default",e?"mx-1.5 px-1":"px-2","focus-visible:ring-ring outline-none focus-visible:ring-[3px]"),children:[s.jsx(z,{"aria-hidden":!0,className:"size-(--size-icon-xs) shrink-0"}),!e&&s.jsx("span",{children:ye})]});return n?s.jsxs(ze,{children:[s.jsx(ws,{asChild:!0,children:i}),s.jsx($e,{side:"top",collisionPadding:8,"data-testid":"wifi-turn-cap-detail",className:"w-auto max-w-70 p-3 text-xs",children:Z})]}):s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:i}),s.jsx(D,{side:"top",children:Z})]})}const hn=6e3;function fn(e){return e instanceof Error&&e.message||"Couldn’t save that. Try again."}function Pi(e){var B,F,L;const{sessionId:t,runtime:n,declaredModes:i,runtimeDefaultMode:r}=e,{data:a}=De(),{data:o}=Be(),d=Ut(),c=Me(),m=Es(t),l=se(w=>w.dismissDefaultStopOffer),[p,u]=h.useState(null),[S,y]=h.useState(null),[v,j]=h.useState(t);v!==t&&(j(t),u(null),y(null));const b=a==null?void 0:a.executionDefaults,T=n??(b==null?void 0:b.runtime),M=(B=b==null?void 0:b.perRuntime.find(w=>w.runtime===T))==null?void 0:B.trustStop,A=M??(b==null?void 0:b.trustStop)??null,E=(F=i.find(w=>w.id===r))==null?void 0:F.stop,C=A??E,k=M!=null?(L=zt(o,T))==null?void 0:L.configSection:void 0,f=a!==void 0;h.useEffect(()=>{if(!p)return;const w=setTimeout(()=>u(null),hn);return()=>clearTimeout(w)},[p]);const I=h.useCallback(w=>{const x=i.find(as=>as.id===w);!x||Is(x)||!f||m||x.stop!==C&&(y(null),u(x.stop))},[i,f,m,C,u,y]),V=h.useCallback(()=>{if(!p)return;const w=p;y(null),d.mutate({runtimes:k?{[k]:{defaultTrustStop:w}}:{defaultTrustStop:w}},{onSuccess:()=>{c.invalidateQueries({queryKey:O.all}),u(null)},onError:x=>y(fn(x))})},[p,d,c,k,u,y]),K=h.useCallback(()=>{l(t),u(null)},[l,t,u]);return{line:f?{stop:p,onMakeDefault:V,onDismiss:K,pending:d.isPending,error:S}:null,offerFor:I}}function Li({runtimeLabel:e,onShown:t,onDismiss:n}){const i=U(a=>a.available),r=U(a=>a.setOpen);return h.useEffect(()=>{t==null||t()},[t]),s.jsxs($t,{"data-slot":"read-only-mode-notice","data-testid":"read-only-mode-notice",gap:"none",className:"flex-row flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2",children:[s.jsx(As,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":!0}),s.jsxs("p",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:["In this mode, ",e," reads files but won’t change them. Asking won’t help."]}),s.jsxs("div",{className:"flex w-full shrink-0 flex-wrap items-center justify-end gap-1.5 sm:w-auto",children:[s.jsx(P,{variant:"ghost",size:"sm",responsive:!1,className:"h-7 px-2 text-xs",onClick:n,children:"Dismiss"}),i&&s.jsx(P,{variant:"outline",size:"sm",responsive:!1,className:"h-7 px-2 text-xs",onClick:()=>r(!0),children:"Change permissions"})]})]})}function Ui(e,t,n){const i=Pe(t??void 0),r=se(p=>p.recordReadOnlyHintShown),a=se(p=>p.spendReadOnlyHint),o=_s(e??""),d=i==null?void 0:i.permissionModes.values.find(p=>p.id===n),c=d!==void 0&&Rs(d);h.useEffect(()=>{c||!e||o!=="shown"||a(e)},[c,e,o,a]);const m=h.useCallback(()=>{e&&r(e)},[e,r]),l=h.useCallback(()=>{e&&a(e)},[e,a]);return h.useMemo(()=>({eligible:!!e&&c&&o!=="spent",runtimeLabel:t?Ds(t):"This agent",markShown:m,dismiss:l}),[e,c,o,t,m,l])}function zi({descriptor:e,active:t,onToggle:n,disabled:i}){return s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("button",{type:"button","aria-pressed":t,disabled:i,onClick:()=>n(!t),className:N($,"items-center gap-1","disabled:cursor-not-allowed disabled:opacity-40",t&&"text-foreground"),children:[s.jsx(Fe,{className:"size-(--size-icon-xs) shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e.label})]})}),s.jsx(D,{side:"top",children:i?"Send a message first":e.promise})]})}function $i({runtime:e,model:t,onChangeRuntime:n,canSelect:i,compact:r,iconOnly:a,account:o}){const{data:d}=Be(),{data:c}=Ms(),{nameFor:m}=Os(),[l,p]=h.useState({open:!1}),u=Object.keys((d==null?void 0:d.capabilities)??{}),S=u.filter(f=>fe(c,f)),y=u.filter(f=>!fe(c,f)),v=d!==void 0&&Object.values(Ps).some(f=>f.setup&&!u.includes(f.type)),j=!!n&&(u.length>1||y.length>0||v),b=r?null:t,T=Y(e),M=T.icon,A=a?s.jsx(M,{"aria-hidden":!0,className:"size-(--size-icon-xs) shrink-0"}):s.jsx(Hs,{runtime:e,model:b,iconClassName:"size-(--size-icon-xs)"}),E=a?s.jsx("span",{className:"block",children:T.label}):null,C=a?s.jsx("span",{role:"img","aria-label":T.label,"data-testid":"runtime-item-icon",className:"inline-flex items-center",children:A}):A,k=o?`Account: ${m(o)}`:null;return i?j?s.jsxs(s.Fragment,{children:[s.jsxs(Ls,{children:[s.jsx(Us,{asChild:!0,children:s.jsx("button",{className:$,"aria-label":a?`Runs on: ${T.label}`:void 0,title:a?T.label:void 0,children:A})}),s.jsxs(zs,{side:"top",align:"start",className:"w-56",children:[s.jsx($s,{children:"Runs on"}),s.jsx(Bs,{value:e,onValueChange:f=>n==null?void 0:n(f),children:S.map(f=>{const I=Y(f);return s.jsx(Fs,{value:f,icon:I.icon,children:I.label},f)})}),y.map(f=>{const I=Y(f);return s.jsx(xe,{icon:I.icon,description:"Connect",onSelect:()=>p({open:!0,runtime:f}),children:I.label},f)}),v&&s.jsxs(s.Fragment,{children:[s.jsx(Gs,{}),s.jsx(xe,{icon:Ws,onSelect:()=>p({open:!0}),children:"Add a runtime"})]})]})]}),s.jsx(Bt,{runtime:l.runtime,open:l.open,onOpenChange:f=>p(I=>({...I,open:f})),renderConnect:Ht,showConnectSuccess:!0,onRuntimeReady:f=>{n==null||n(f)}})]}):!k&&!E?C:s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:C}),s.jsxs(D,{side:"top",children:[E,k&&s.jsx("span",{className:"block",children:k})]})]}):s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:C}),s.jsxs(D,{side:"top",children:[E,s.jsx("span",{className:"block",children:"Set when the chat starts. It can’t change after."}),k&&s.jsx("span",{className:"block",children:k})]})]})}function Bi(e,t,n){const i=Ge(),r=Qs(e),a=new Date(i),o=t.pending?null:t.usage;return{...Xs({liveTurnUsage:n,liveTurnAt:r,accountStatus:qs(o,a),accountObservedAt:We(He(o))}),accountUsage:o}}function Fi({open:e,onOpenChange:t,onConfirm:n}){return s.jsx(Vs,{open:e,onOpenChange:t,children:s.jsxs(Ks,{children:[s.jsxs(Ys,{children:[s.jsxs(Js,{className:"flex items-center gap-2",children:[s.jsx(Ue,{className:"text-muted-foreground size-4"}),"Turn on Auto mode?",s.jsx(Q,{size:"xs",variant:"secondary",className:"tracking-wide uppercase",children:"Preview"})]}),s.jsx(Zs,{children:"Asks only before risky steps, like deleting files. Switch back anytime."})]}),s.jsxs(et,{children:[s.jsx(st,{children:"Cancel"}),s.jsx(tt,{onClick:n,children:"Turn on Auto mode"})]})]})})}const ve=[{slug:"frontier",label:"Frontier"},{slug:"solid-coders",label:"Solid coders"},{slug:"quick-helpers",label:"Quick helpers"},{slug:"more-models",label:"More models"},{slug:"no-tools",label:"Can’t do agent work"}],xn=10,gn="Can’t use tools, so it can’t read files or run commands.",jn="Makes images DorkOS can’t show yet.",Nn=["openrouter/openrouter/auto","openrouter/auto"];function bn(e){return Nn.some(t=>e.value===t||e.value.startsWith(`${t}-`))}function ss(e){return e.supportsToolUse!==!1}function yn(e){return e.supportsImageOutput===!0&&!bn(e)?jn:ss(e)?null:gn}function vn(e){if(!ss(e))return"no-tools";switch(e.tier){case"frontier":return"frontier";case"solid-coder":return"solid-coders";case"quick-helper":return"quick-helpers";default:return"more-models"}}function kn(e){return e.some(t=>t.tier!=null)||e.length>xn}function Tn(e,t){const n=t.trim().toLowerCase();return n?e.value.toLowerCase().includes(n)||e.displayName.toLowerCase().includes(n):!0}function Sn(e){const t=new Map(ve.map(n=>[n.slug,[]]));for(const n of e)t.get(vn(n)).push(n);return ve.map(n=>({...n,models:t.get(n.slug)})).filter(n=>n.models.length>0)}function Cn(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function wn(){return s.jsx("div",{className:"space-y-2","data-testid":"model-cards-skeleton",children:Array.from({length:3}).map((e,t)=>s.jsxs("div",{className:"flex items-center gap-3 rounded-xl p-3",children:[s.jsx(G,{className:"size-4 rounded-full"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(G,{className:"h-3.5 w-24"}),s.jsx(G,{className:"h-2.5 w-32"})]}),s.jsx(G,{className:"h-5 w-10 rounded-md"})]},t))})}function En({onRetry:e,message:t}){return s.jsxs("div",{className:"flex flex-col items-center gap-3 py-6 text-center","data-testid":"model-load-error",children:[s.jsx(le,{className:"text-muted-foreground size-5"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:t??"Couldn’t load the model list."}),s.jsxs("button",{onClick:e,className:"text-foreground hover:bg-accent inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors",children:[s.jsx(Qe,{className:"size-3"}),"Retry"]})]})}function In(e){const t=e.slice(e.lastIndexOf(" ")+1);return t.includes("/")||t.includes(":")}function ts({text:e,className:t}){return In(e)?s.jsx("div",{dir:"rtl",className:N("truncate text-left",t),title:e,children:s.jsx("bdi",{dir:"ltr",children:e})}):s.jsx("div",{className:N("truncate",t),title:e,children:e})}function ke({model:e,isSelected:t}){const n=yn(e);return s.jsxs("label",{className:N("flex w-full cursor-pointer items-center gap-3 rounded-xl border p-3 transition-colors duration-150",t?"bg-secondary border-foreground/15":"border-border hover:border-muted-foreground/30 hover:bg-muted/50 opacity-70"),children:[s.jsx(rt,{value:e.value,className:"shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"text-foreground line-clamp-2 text-sm font-medium break-words",children:[e.displayName,e.local&&s.jsxs("span",{className:"text-muted-foreground text-3xs ml-1.5 font-normal",children:[at()," · private"]})]}),s.jsx(ts,{text:e.description,className:"text-muted-foreground text-2xs leading-tight"}),n&&s.jsx("div",{className:"text-2xs text-status-warning-fg mt-0.5 leading-tight","data-testid":`model-limitation-${e.value}`,children:n})]}),e.contextWindow&&s.jsx(Q,{size:"xs",variant:"secondary",className:"shrink-0",children:Cn(e.contextWindow)})]})}function An({value:e}){return s.jsxs("div",{className:"space-y-1.5","data-testid":"model-unavailable-saved",children:[s.jsxs("div",{className:"border-border flex w-full items-center gap-3 rounded-xl border border-dashed p-3 opacity-80",children:[s.jsx(le,{className:"text-status-warning-fg size-4 shrink-0"}),s.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-1.5",children:[s.jsx(ts,{text:e,className:"text-foreground min-w-0 text-sm font-medium"}),s.jsx("span",{className:"text-muted-foreground text-2xs shrink-0 font-normal",children:"(not available)"})]})]}),s.jsx("p",{className:"text-muted-foreground text-2xs leading-snug",children:"This model isn’t available anymore. Pick another."})]})}function _n({slug:e,label:t}){return s.jsx("div",{className:"text-muted-foreground text-2xs mt-2 mb-1 font-medium tracking-wide uppercase first:mt-0","data-testid":`model-group-${e}`,children:t})}function Rn({models:e,selectedModel:t,onChangeModel:n,emptyMessage:i}){const[r,a]=h.useState(""),o=kn(e),c=e.length>0&&t.length>0&&!e.some(u=>u.value===t)?s.jsx(An,{value:t}):null,m=e.some(u=>u.unverified),l=h.useMemo(()=>o?e.filter(u=>Tn(u,r)):e,[e,r,o]),p=h.useMemo(()=>o?Sn(l):[],[l,o]);return e.length===0?s.jsx("div",{className:"border-border text-muted-foreground text-2xs rounded-xl border border-dashed p-3 leading-snug","data-testid":"model-catalog-unavailable",children:i??"Couldn’t load models. Check Settings, then try again."}):o?s.jsxs("div",{className:"space-y-2",children:[c,m&&s.jsx(je,{}),s.jsxs("div",{className:"relative",children:[s.jsx(nt,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2"}),s.jsx(it,{type:"text",value:r,onChange:u=>a(u.target.value),placeholder:"Search models…","aria-label":"Search models","data-testid":"model-search",className:"h-8 pl-8 text-xs"})]}),p.length===0?s.jsx("p",{className:"text-muted-foreground py-4 text-center text-xs","data-testid":"model-search-empty",children:m?"No match in this short list. Connect a provider to see more.":"No models match"}):s.jsx(ge,{value:t,onValueChange:n,className:"grid-cols-1 gap-1.5","aria-label":"Model selection","data-testid":"model-card-list",children:p.map(u=>s.jsxs(h.Fragment,{children:[s.jsx(_n,{slug:u.slug,label:u.label}),u.models.map(S=>s.jsx(ke,{model:S,isSelected:S.value===t},S.value))]},u.slug))})]}):s.jsxs("div",{className:"space-y-2",children:[c,m&&s.jsx(je,{}),s.jsx(ge,{value:t,onValueChange:n,className:"grid-cols-1 gap-1.5","aria-label":"Model selection","data-testid":"model-card-list",children:e.map(u=>s.jsx(ke,{model:u,isSelected:u.value===t},u.value))})]})}const ne={none:{label:"None",description:"No reasoning"},minimal:{label:"Minimal",description:"Near-zero thinking"},low:{label:"Low",description:"Fastest responses"},medium:{label:"Medium",description:"Moderate thinking"},high:{label:"High",description:"Deep reasoning"},max:{label:"Max",description:"Maximum thinking"},xhigh:{label:"XHigh",description:"Beyond maximum"}},Dn={duration:.15,ease:"easeOut"};function Mn({effortLevels:e,effort:t,onChangeEffort:n}){return s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-2xs mb-2 font-medium tracking-wide uppercase",children:"Effort"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Effort level",children:[s.jsx(ie,{role:"radio",label:"Default",isSelected:t===null,onClick:()=>n(null)}),e.map(i=>s.jsx(ie,{role:"radio",label:ne[i].label,description:ne[i].description,isSelected:t===i,onClick:()=>n(i)},i))]})]})}function On({supportsFastMode:e,fastMode:t,onChangeFastMode:n}){return e?s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-2xs mb-2 font-medium tracking-wide uppercase",children:"Mode"}),s.jsx("div",{className:"flex gap-1.5",children:s.jsx(ie,{role:"switch",label:"Fast",icon:s.jsx(pe,{className:"size-3"}),isSelected:t,onClick:()=>n(!t)})})]}):null}function ie({role:e,label:t,description:n,icon:i,isSelected:r,onClick:a}){const o=s.jsxs("button",{role:e,"aria-checked":r,onClick:a,className:N("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"),children:[i,t]});return n?s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:o}),s.jsx(D,{side:"top",className:"text-xs",children:n})]}):o}function Gi({model:e,onChangeModel:t,effort:n,onChangeEffort:i,fastMode:r,onChangeFastMode:a,disabled:o,sessionId:d,runtime:c,onCredits:m,compact:l}){var C;const{data:p,isLoading:u,isError:S,refetch:y}=ot({sessionId:d,runtime:c??void 0}),v=p??[],j=v.find(k=>k.value===e),b=!!(j!=null&&j.supportsEffort&&(((C=j.supportedEffortLevels)==null?void 0:C.length)??0)>0),T=(j==null?void 0:j.supportsFastMode)??!1,M=!l&&b&&n?ne[n].label:null,A=!l&&r,E=s.jsxs("button",{disabled:o,className:N($,"items-center gap-1 disabled:cursor-not-allowed disabled:opacity-40"),"data-testid":"model-config-trigger",children:[s.jsx(Xe,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:ln(e,v)}),M&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground text-2xs",children:"·"}),s.jsx(Q,{size:"xs",variant:"secondary",children:M})]}),A&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground text-2xs",children:"·"}),s.jsxs(Q,{size:"xs",variant:"secondary",children:[s.jsx(pe,{className:"mr-0.5 inline size-2.5"}),"Fast"]})]})]});return o?s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsx("span",{className:"inline-flex",children:E})}),s.jsx(D,{side:"top",children:"Send a message first"})]}):s.jsxs(ce,{children:[s.jsx(ue,{asChild:!0,children:E}),s.jsxs(de,{side:"top",align:"start",className:"w-120 max-w-[calc(100vw-1.5rem)] p-3","data-testid":"model-config-popover",children:[s.jsx(me,{children:"Model"}),v.some(k=>k.paidFromCredits)&&s.jsx("p",{className:"text-muted-foreground text-2xs mb-2","data-testid":"model-credits-note",children:v.some(k=>k.creditsListOutOfDate)?"Models your DorkOS credits cover. This list may be out of date.":"Models your DorkOS credits cover"}),u&&s.jsx(wn,{}),S&&s.jsx(En,{onRetry:()=>y(),message:m?"Couldn’t load the models DorkOS credits cover. Your model stays as it is.":void 0}),!u&&!S&&s.jsx(Rn,{models:v,selectedModel:e,onChangeModel:t,emptyMessage:m?"DorkOS credits don’t cover a model for this runtime yet.":void 0}),s.jsx(ae,{children:!u&&!S&&(b||T)&&s.jsxs(oe.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:Dn,children:[s.jsx(lt,{className:"my-3"}),s.jsx("div",{className:"text-muted-foreground text-2xs mb-3 font-medium tracking-wide uppercase",children:"Configuration"}),s.jsxs("div",{className:"space-y-3",children:[b&&s.jsx(Mn,{effortLevels:j.supportedEffortLevels,effort:n,onChangeEffort:i}),T&&s.jsx(On,{supportsFastMode:(j==null?void 0:j.supportsFastMode)??!1,fastMode:r,onChangeFastMode:a})]})]},"config")})]})]})}function Wi({percent:e,contextUsage:t,compact:n,reading:i,now:r}){const a=ct(e,t)??e,o=ut(a),d=o==="critical"?X.error:o==="warning"?X.warning:"",c=n!=null&&a>=Ve,m=t?{total:t.totalTokens,max:t.maxTokens}:i&&i.maxTokens>0?{total:i.totalTokens,max:i.maxTokens}:null,l=(i==null?void 0:i.observedAt)??null,p=m!==null,u=s.jsxs("span",{"aria-label":p?"Context window usage":void 0,className:N("inline-flex shrink-0 items-center gap-1",p&&"cursor-default",d),children:[s.jsx(Qt,{className:"size-(--size-icon-xs) shrink-0"}),s.jsxs("span",{children:[a,"%"]})]});return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[m?s.jsx(Pn,{totals:m,categories:(t==null?void 0:t.categories)??[],observedAt:l,now:r,children:u}):u,s.jsx(ae,{initial:!1,children:c&&s.jsxs(oe.button,{type:"button",onClick:n.onCompact,disabled:n.pending,"aria-label":n.pending?"Compacting chat…":`Context ${a}% full. Compact now`,"aria-busy":n.pending,"data-testid":"compaction-chip",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted inline-flex min-w-0 shrink items-center gap-1 rounded-md px-1.5 py-0.5 transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-60",children:[s.jsx(Qe,{"aria-hidden":"true",className:N("size-(--size-icon-xs) shrink-0",n.pending&&"animate-spin")}),s.jsx("span",{className:"truncate",children:"Compact"})]},"compact")})]})}function Pn({totals:e,categories:t,observedAt:n,now:i,children:r}){const a=t.filter(o=>o.tokens>0).sort((o,d)=>d.tokens-o.tokens);return s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:r}),s.jsx(D,{side:"top",className:"max-w-64",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"text-xs font-medium",children:[J(e.total)," / ",J(e.max)," tokens"]}),a.length>0&&s.jsx("div",{className:"space-y-0.5",children:a.map(o=>s.jsxs("div",{className:"text-3xs flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"flex items-center gap-1 truncate",children:[s.jsx("span",{className:"inline-block size-1.5 shrink-0 rounded-full",style:{backgroundColor:o.color}}),o.name]}),s.jsx("span",{className:N(te,"shrink-0"),children:J(o.tokens)})]},o.name))}),n!==null&&s.jsx(qe,{observedAt:n,now:i,surface:"tooltip"})]})})]})}function Hi({usage:e,accountUsage:t=null,observedAt:n=null,open:i,onOpenChange:r,now:a}){const o=Ge(),d=a??new Date(o),c=He(t),m=c.length>0?We(c):n,l=e!=null&&Ke(e);let p;return c.length>0?p=s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-medium",children:"Subscription usage"}),s.jsx("div",{className:"flex flex-col gap-2.5",children:c.map(u=>s.jsx(dt,{window:u,label:mt(u.key,u.label),now:d},u.key))}),e&&s.jsx("div",{className:"text-3xs space-y-0.5",children:s.jsx(pt,{usage:e})})]}):l?p=s.jsx(ft,{usage:e}):p=s.jsx("p",{className:"text-muted-foreground text-xs",children:"No usage yet."}),s.jsxs(ze,{open:i,onOpenChange:r,children:[s.jsx(ht,{asChild:!0,children:s.jsx("span",{"aria-hidden":!0,className:"inline-block h-0 w-0"})}),s.jsx($e,{side:"top",align:"end",className:"w-72 max-w-[calc(100vw-1.5rem)]","aria-label":"Usage and cost",children:s.jsxs("div",{className:"space-y-2",children:[p,m!==null&&(c.length>0||l)&&s.jsx(qe,{observedAt:m,now:d})]})})]})}const Ln={connecting:{color:W.warning,label:"Connecting",shortLabel:"Connecting",icon:z,tasks:!0},connected:{color:W.success,label:"Connected",shortLabel:"Connected",icon:z,tasks:!1},reconnecting:{color:W.warning,label:"Reconnecting",shortLabel:"Reconnecting",icon:z,tasks:!0},disconnected:{color:W.error,label:"Live updates lost",shortLabel:"Offline",icon:xt,tasks:!1}};function Qi({connectionState:e,compact:t}){const n=Ln[e],i=n.icon;return s.jsxs(Ft,{openDelay:200,children:[s.jsx(Gt,{asChild:!0,children:s.jsxs("span",{className:"flex min-w-0 cursor-default items-center gap-1.5 text-xs",children:[s.jsx("span",{className:N("size-1.5 shrink-0 rounded-full",n.color,n.tasks&&"animate-breath")}),s.jsx("span",{className:"text-muted-foreground truncate",children:t?n.shortLabel:n.label})]})}),s.jsx(Wt,{side:"top",align:"center",className:"w-72 p-3",children:s.jsxs("div",{className:"flex items-start gap-2.5",children:[s.jsx(i,{className:N("mt-0.5 size-4 shrink-0",e==="disconnected"?X.error:X.warning)}),s.jsxs("div",{className:"min-w-0 space-y-1.5",children:[s.jsx("p",{className:"text-sm font-medium",children:n.label}),s.jsx(Un,{connectionState:e})]})]})})]})}function Un({connectionState:e}){const t="text-muted-foreground text-xs leading-relaxed";return e==="connecting"?s.jsx("p",{className:t,children:"Connecting to live updates. New messages appear once connected."}):e==="reconnecting"?s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:t,children:"Live updates dropped and are reconnecting. Nothing is lost."}),s.jsx("p",{className:N(t,"text-muted-foreground/70"),children:"No action needed."})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:t,children:"Couldn’t reconnect live updates. New messages won’t appear until they’re back."}),s.jsx("p",{className:N(t,"text-muted-foreground/70"),children:"Refresh the page. If that doesn’t help, check that DorkOS is running."})]})}function Xi({count:e,running:t,waiting:n}){const i=e===1?"":"s",r=e-t.length,a=`${e} subagent${i} running`;return s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1","aria-label":a,children:[s.jsx(Ye,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"shrink-0 tabular-nums",children:e})]})}),s.jsxs(D,{side:"top",className:"max-w-64",children:[n&&s.jsx("p",{className:"mb-1 font-medium",children:"Still working. The agent continues when they finish."}),s.jsx("ul",{className:"space-y-1",children:t.map(o=>s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:o.description??"Working…"}),s.jsxs("p",{className:N(te,"text-3xs leading-tight"),children:[o.toolUses??0," tool",o.toolUses===1?"":"s",o.lastToolName?` · last ${o.lastToolName}`:""]})]},o.taskId))}),r>0&&s.jsx("p",{className:N(te,"text-3xs leading-tight"),children:t.length>0?`and ${r} more`:`${r} task${i} from earlier`})]})]})}const Te=648,zn=440,$n=340,Bn=3,Fn=3,Gn=2,Wn=4,Hn=8,Qn=20,Xn=ee*Hn+Qn,qn=Number.POSITIVE_INFINITY,Se=[],Vn=["cwd"],Ce=["cwd","git"];function Kn(e){if(e===null||e<=0)return{density:"full",rightBudget:qn,dropped:Se};if(e>=Te){const t=Math.floor((e-Te)/Xn);return{density:"full",rightBudget:Wn+t,dropped:Se}}return e>=zn?{density:"compact",rightBudget:Bn,dropped:Vn}:e>=$n?{density:"identity",rightBudget:Fn,dropped:Ce}:{density:"avatar",rightBudget:Gn,dropped:Ce}}function Yn(e){return e==="identity"||e==="avatar"}function Jn(e,t){return t.severity!==e.severity?t.severity-e.severity:Number(t.pinned)-Number(e.pinned)}const Zn=2,ei=2;function qi(e,t){const n=new Set(t.dropped),i=t.density!=="full",r=l=>i&&l.held,a=e.filter(l=>l.cluster==="right"),o=new Set;let d=0,c=0;const m=[...a].sort((l,p)=>Number(r(p))-Number(r(l))||Jn(l,p));for(const l of m){if(c>=t.rightBudget)break;const p=l.rigid||r(l);p&&d>=Zn||(p&&(d+=1),o.add(l.key),c+=l.wide?Math.min(ei,t.rightBudget-c):1)}return{items:e.filter(l=>l.cluster==="right"?o.has(l.key):!n.has(l.key)).map(l=>l.held===r(l)?l:{...l,held:r(l)}),overflow:a.length-o.size}}const si=new Set(["main","master"]);function Vi(e,t,n){return{dirty:!t,onDefaultBranch:!n&&si.has(e)}}const g={AGENT_ANCHOR:1e3,CONNECTION_LOST:100,CONTEXT_CRITICAL:90,ACCOUNT_ATTENTION:85,USAGE_EXHAUSTED:80,PERMISSION_BYPASS:70,CONTEXT_WARNING:50,USAGE_WARNING:50,PERMISSION_ELEVATED:40,PLAN_ACTIVE:40,SUBAGENTS_RUNNING:35,EXTENSION_ITEM:35,RUNTIME_NON_DEFAULT:30,GIT_DIRTY:20,MODEL:10,CWD:5,QUIET:0},ti={session:"Session",diagnostics:"Diagnostics"};function we(e){return e.runtime&&!e.runtime.isDefault?g.RUNTIME_NON_DEFAULT:g.QUIET}function ni(e){return e.account!==null}const ii=new Set(["near","model-out","out"]);function Ee(e){return e.permissionDescriptor?e.permissionDescriptor.stop!=="ask":e.permissionMode!=="default"}const ns=[{key:"agent",label:"Agent",description:"Who you are talking to",cluster:"left",group:null,icon:jt,promote:()=>!0,severity:()=>g.AGENT_ANCHOR},{key:"cwd",label:"Directory",description:"The folder this chat can touch",cluster:"left",group:"session",icon:Nt,promote:e=>e.cwd!==null,severity:()=>g.CWD},{key:"git",label:"Git",description:"Branch and uncommitted changes",cluster:"left",group:"session",icon:H,promote:e=>e.git!==null&&(e.git.dirty||!e.git.onDefaultBranch),severity:e=>{var t;return(t=e.git)!=null&&t.dirty?g.GIT_DIRTY:g.QUIET}},{key:"runtime",label:"Runs on",description:"What runs this chat",cluster:"right",group:"session",icon:Xt,promote:e=>e.runtime!==null&&e.runtime.type!=="doe"&&(!e.runtime.isDefault||e.runtime.canSelect),severity:we,snug:Yn},{key:"account",label:"Account",description:"Which Claude account this uses, and what’s left",cluster:"right",group:null,icon:qt,promote:e=>e.account!==null,severity:e=>e.account&&ii.has(e.account.chipState)?g.ACCOUNT_ATTENTION:we(e)},{key:"extensions",label:"Add-ons",description:"What your extensions show here",cluster:"right",group:null,icon:bt,promote:e=>e.extensionItems.some(t=>t.visible),severity:e=>e.extensionItems.some(t=>t.visible&&t.urgent)?g.ACCOUNT_ATTENTION:g.EXTENSION_ITEM},{key:"model",label:"Model",description:"The model answering you",cluster:"right",group:"session",icon:Xe,promote:()=>!1,severity:()=>g.MODEL},{key:"cache",label:"Cache",description:"How much came from cache",cluster:"right",group:"session",icon:pe,promote:()=>!1,severity:()=>g.QUIET,neverInLine:!0},{key:"context",label:"Context",description:"How full the context window is",cluster:"right",group:"session",icon:Vt,rigid:!0,promote:e=>e.contextPercent!==null,severity:e=>e.contextPercent===null?g.QUIET:e.contextPercent>=Ve?g.CONTEXT_CRITICAL:e.contextPercent>=kt?g.CONTEXT_WARNING:g.QUIET},{key:"usage",label:"Usage & cost",description:"Plan limits or chat cost",cluster:"right",group:"session",icon:yt,rigid:!0,promote:e=>e.usage!==null&&Ke(e.usage)&&!ni(e),wide:e=>e.usageStale,severity:e=>{var t,n;return((t=e.usage)==null?void 0:t.state)==="exhausted"?g.USAGE_EXHAUSTED:((n=e.usage)==null?void 0:n.state)==="warning"?g.USAGE_WARNING:g.QUIET}},{key:"permission",label:"Permissions",description:"How freely the agent acts",cluster:"right",group:"session",icon:vt,held:!0,promote:e=>Ee(e)||e.permissionPickerOpen===!0||e.onWifi===!0,severity:e=>(e.permissionDescriptor?Tt(e.permissionDescriptor):St(e.permissionMode))?g.PERMISSION_BYPASS:Ee(e)||e.permissionPickerOpen===!0||e.onWifi===!0?g.PERMISSION_ELEVATED:g.QUIET},{key:"plan",label:"Plan",description:"Plan first, change nothing until approved",cluster:"right",group:"session",icon:Fe,promote:e=>e.plan!==null,severity:e=>{var t;return(t=e.plan)!=null&&t.active?g.PLAN_ACTIVE:g.QUIET},snug:()=>!0},{key:"subagents",label:"Subagents",description:"Subagents working on this turn",cluster:"right",group:"diagnostics",icon:Ye,rigid:!0,promote:e=>e.subagentsInFlight>0,severity:e=>e.subagentsInFlight>0?g.SUBAGENTS_RUNNING:g.QUIET},{key:"connection",label:"Live updates",description:"The live link that delivers messages",cluster:"right",group:"diagnostics",icon:z,promote:e=>e.connectionState!=="connected",severity:e=>e.connectionState==="connected"?g.QUIET:g.CONNECTION_LOST}];function is(e){return e.group==="session"&&e.neverInLine!==!0}function ri(){const{pins:e}=Jt(),{setPins:t}=Zt(),n=h.useCallback(r=>{const a=gt.find(o=>o===r);a&&t(e.includes(a)?e.filter(o=>o!==a):[...e,a])},[e,t]),i=h.useCallback(()=>t([]),[t]);return{pins:e,toggle:n,reset:i}}function ai(){return["session","diagnostics"].map(t=>({group:t,label:ti[t],items:ns.filter(n=>n.group===t)})).filter(t=>t.items.length>0)}function rs(e){const t=e.contextTokens??e.readTokens+e.creationTokens;return t<=0?0:Math.round(e.readTokens/t*100)}function oi(e){return e?e.kind==="subscription"&&e.utilization!=null?`${Math.round(e.utilization*100)}% of ${e.windowLabel??"your plan"}`:e.costUsd!=null?`$${e.costUsd.toFixed(2)}`:null:null}function li(e){return e.split("/").filter(Boolean).pop()??e}function ci(e,t){switch(e){case"cwd":return t.cwd?li(t.cwd):null;case"git":return t.git.state==="unknown"?null:t.git.state==="no-repo"?"No repo":t.git.dirty?`${t.git.branch} · changed`:t.git.branch;case"runtime":return t.runtime;case"model":return t.model;case"context":return t.contextPercent===null?null:`${t.contextPercent}% full`;case"cache":return t.cache===null?null:`${rs(t.cache)}% from cache`;case"usage":return oi(t.usage);case"permission":return t.permissionMode;case"connection":return`${t.connectionState} · event ${t.lastEventSeq}`;default:return null}}function ui(e){return JSON.stringify({sessionId:e.sessionId,cwd:e.cwd,git:e.git,runtime:e.runtime,model:e.model,selectedModel:e.selectedModel,effort:e.effort,fastMode:e.fastMode,permissionMode:e.permissionMode,contextPercent:e.contextPercent,contextUsage:e.contextUsage,cache:e.cache===null?null:{readTokens:e.cache.readTokens,creationTokens:e.cache.creationTokens,contextTokens:e.cache.contextTokens??null,hitPercent:rs(e.cache)},usage:e.usage,connectionState:e.connectionState,streaming:e.streaming,lifecycle:e.lifecycle,triggerPending:e.triggerPending,lastEventSeq:e.lastEventSeq,snapshotCursor:e.snapshotCursor,lastEventAt:e.lastEventAt===null?null:new Date(e.lastEventAt).toISOString(),queueDepth:e.queueDepth,subagents:e.subagents.map(t=>t.name),activeSubagents:e.activeSubagents,runningSubagentCount:e.runningSubagentCount,clientVersion:e.clientVersion,capturedAt:new Date().toISOString()},null,2)}function di({copied:e,failed:t}){return e?s.jsx(wt,{className:"text-status-success size-3.5","aria-hidden":!0}):t?s.jsx(Et,{className:"text-destructive size-3.5","aria-hidden":!0}):s.jsx(Kt,{className:"size-3.5","aria-hidden":!0})}function mi(e,t){return e?"Copied":t?"Couldn’t copy":"Copy diagnostics"}function pi({diagnostics:e,className:t}){const{copied:n,failed:i,copy:r}=Ct(),a=()=>void r(ui(e));return s.jsxs(P,{variant:"ghost",size:"sm",className:N("gap-1.5 text-xs",t),onClick:a,children:[s.jsx(di,{copied:n,failed:i}),mi(n,i)]})}function Ki({open:e,onOpenChange:t,diagnostics:n,controls:i,promotionContext:r,urgentAction:a,overflowCount:o=0,addOns:d}){const c=It(),{pins:m,toggle:l,reset:p}=ri(),u=ai(),S=new Set(m),y=o>0;return s.jsxs(ce,{open:e,onOpenChange:t,children:[s.jsx(At,{children:s.jsxs(_,{children:[s.jsx(ue,{asChild:!0,children:s.jsx(R,{asChild:!0,children:s.jsxs("button",{type:"button","data-testid":"status-reveal","aria-label":y?`Chat details, ${o} more`:"Chat details",className:"text-muted-foreground/50 hover:text-muted-foreground inline-flex shrink-0 items-center justify-center gap-0.5 transition-colors duration-150 pointer-coarse:min-h-11 pointer-coarse:min-w-11",children:[s.jsx(_t,{className:"size-4"}),y&&s.jsxs("span",{className:"tabular-nums",children:["+",o]})]})})}),s.jsx(D,{side:"top",children:y?`Chat details, ${o} more`:"Chat details"})]})}),s.jsxs(de,{side:"top",align:"end",className:"w-80 p-3","aria-label":"Chat",children:[s.jsx(me,{children:"Chat"}),a&&s.jsx(P,{variant:"secondary",className:"mb-3 w-full",disabled:a.pending,onClick:()=>{a.onAction(),t(!1)},children:a.label}),s.jsxs("div",{className:"flex flex-col gap-4",children:[d&&s.jsxs("section",{className:"space-y-1","data-testid":"session-add-ons",children:[s.jsx("h3",{className:"text-muted-foreground px-1 text-xs font-medium tracking-wide uppercase",children:"Add-ons"}),d]}),u.map(v=>s.jsxs("section",{className:"space-y-1",children:[s.jsx("h3",{className:"text-muted-foreground px-1 text-xs font-medium tracking-wide uppercase",children:v.label}),hi(fi(v.items,i),c?r:null).map(j=>s.jsx(gi,{item:j,value:ci(j.key,n),pinned:S.has(j.key),onTogglePin:is(j)?()=>l(j.key):null,control:xi(j.key,i)},j.key)),v.group==="diagnostics"&&s.jsxs(s.Fragment,{children:[s.jsx(Ie,{label:"Queued messages",value:String(n.queueDepth)}),s.jsx(Ie,{label:"Chat ID",value:n.sessionId||"—"})]})]},v.group))]}),n.sessionId!==""&&s.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground mt-3 h-7 w-full justify-start gap-1.5 text-xs",onClick:()=>{t(!1),Dt({sessionId:n.sessionId})},children:[s.jsx(Rt,{className:"size-3.5","aria-hidden":!0}),"View notifications"]}),s.jsxs("div",{className:"mt-4 flex items-center justify-between gap-2",children:[s.jsx(pi,{diagnostics:n}),s.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 text-xs",disabled:m.length===0,onClick:p,children:[s.jsx(Mt,{className:"size-3.5","aria-hidden":!0}),"Reset pins"]})]})]})]})}function hi(e,t){return t?[...e].sort((n,i)=>i.severity(t)-n.severity(t)):e}function fi(e,t){return e.filter(n=>n.key!=="plan"||t.plan!==null)}function xi(e,t){return e==="plan"&&t.plan?s.jsx(Pt,{checked:t.plan.active,onCheckedChange:t.plan.onToggle,"aria-label":"Plan first, change nothing until approved"}):null}function gi({item:e,value:t,pinned:n,onTogglePin:i,control:r}){const a=e.icon;return s.jsxs("div",{"data-testid":`session-row-${e.key}`,className:"flex items-center gap-2 px-1 py-1 text-sm",children:[s.jsx(a,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e.label}),s.jsx("span",{className:"min-w-0 flex-1"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",title:t??void 0,children:t??"—"}),r,i&&s.jsx("button",{type:"button",onClick:i,"aria-pressed":n,"aria-label":n?`Stop keeping ${e.label} in the status bar`:`Keep ${e.label} in the status bar`,className:N("hover:text-foreground inline-flex size-6 shrink-0 items-center justify-center rounded-md transition-colors duration-150",n?"text-foreground":"text-muted-foreground/50"),children:n?s.jsx(Oe,{className:"size-3.5"}):s.jsx(Ot,{className:"size-3.5"})})]})}function Ie({label:e,value:t}){return s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-sm",children:[s.jsx("span",{className:"w-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e}),s.jsx("span",{className:"min-w-0 flex-1"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",title:t,children:t})]})}function Yi(e){const t=h.useRef(e);h.useEffect(()=>{t.current=e},[e]),h.useEffect(()=>{const n=i=>{const r=i.key==="."||i.key===">";(i.metaKey||i.ctrlKey)&&i.shiftKey&&r&&(i.preventDefault(),t.current())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[])}const Ae=new WeakMap;function _e(e,t,n){let i=Ae.get(e);i||(i=new Set,Ae.set(e,i)),!i.has(t)&&(i.add(t),n())}function Re(e,t,n){let i;try{i=n()}catch(r){return _e(e,`${t}:throw`,()=>console.warn(`[extensions] ${e.extensionId}'s status-bar item "${e.id}" threw in ${t}(); it is hidden until it stops throwing.`,r)),!1}return typeof i!="boolean"?(_e(e,`${t}:type`,()=>console.warn(`[extensions] ${e.extensionId}'s status-bar item "${e.id}": ${t}() must return true or false, synchronously, reading only its ctx; it returned ${ji(i)}, read as false.`)),!1):i}function ji(e){return e instanceof Promise?"a Promise":e===null?"null":typeof e=="object"?"an object":`a ${typeof e}`}function Ni(e,t){const n=[],i=[];for(const r of e){const a=r.when?Re(r,"when",()=>r.when(t)):!0,o=a&&r.urgent?Re(r,"urgent",()=>r.urgent(t)):!1;n.push({id:r.id,visible:a,urgent:o}),a&&i.push(r)}return i.sort((r,a)=>(r.priority??0)-(a.priority??0)),{promotion:n,visible:i}}function Ji(e){const t=Lt("status-bar");return h.useMemo(()=>Ni(t,e),[t,e])}function bi(e){return e!=null&&e!==!1}function Zi({ctx:e,pins:t,nodes:n,density:i="full"}){var o,d;const r=new Set(t),a=[];for(const c of ns){if(c.neverInLine)continue;const m=n[c.key];if(!bi(m))continue;const l=r.has(c.key)&&is(c);!l&&!c.promote(e)||a.push({key:c.key,cluster:c.cluster,severity:c.severity(e),pinned:l,rigid:c.rigid===!0,wide:((o=c.wide)==null?void 0:o.call(c,e))===!0,held:c.held===!0,snug:((d=c.snug)==null?void 0:d.call(c,i))===!0,node:m})}return a}function er(){const e=h.useRef(null),[t,n]=h.useState(null);h.useLayoutEffect(()=>{const r=e.current;if(!r)return;n(r.getBoundingClientRect().width);const a=new ResizeObserver(o=>{var m,l;const d=o.at(0);if(!d)return;const c=((l=(m=d.contentBoxSize)==null?void 0:m.at(0))==null?void 0:l.inlineSize)??d.contentRect.width;n(c)});return a.observe(r),()=>a.disconnect()},[]);const i=h.useMemo(()=>Kn(t),[t]);return{ref:e,budget:i}}export{Fi as A,pi as C,Di as G,un as M,Mi as P,Li as R,Ki as S,Hi as U,Oi as W,Ln as a,Qi as b,rs as c,Wi as d,Ri as e,Gi as f,zi as g,$i as h,_i as i,Xi as j,qi as k,Ni as l,ui as m,Vi as n,Yn as o,ni as p,ln as q,Kn as r,Zi as s,Pi as t,Ji as u,Ui as v,Yi as w,ri as x,er as y,Bi as z};
@@ -1 +1 @@
1
- import{f7 as A,f8 as u,f9 as h,r as i,fa as C,fb as V,fc as k,fd as x,fe as l}from"./index-B6Scr7KJ.js";function E(...t){const s=!Array.isArray(t[0]),e=s?0:-1,n=t[0+e],o=t[1+e],r=t[2+e],c=t[3+e],f=A(o,r,c);return s?f(n):f}function b(t){const s=u(()=>h(t)),{isStatic:e}=i.useContext(C);if(e){const[,n]=i.useState(t);i.useEffect(()=>s.on("change",n),[])}return s}function d(t,s){const e=b(s()),n=()=>e.set(s());return n(),V(()=>{const o=()=>x.preRender(n,!1,!0),r=t.map(c=>c.on("change",o));return()=>{r.forEach(c=>c()),k(n)}}),e}function L(t){l.current=[],t();const s=d(l.current,t);return l.current=void 0,s}function I(t,s,e,n){if(typeof t=="function")return L(t);if(e!==void 0&&!Array.isArray(e)&&typeof s!="function")return S(t,s,e,n);const c=typeof s=="function"?s:E(s,e,n),f=Array.isArray(t)?y(t,c):y([t],([m])=>c(m)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof s!="function"&&Array.isArray(e)&&(n==null?void 0:n.clamp)!==!1&&(f.accelerate={...a,times:s,keyframes:e,isTransformed:!0}),f}function y(t,s){const e=u(()=>[]);return d(t,()=>{e.length=0;const n=t.length;for(let o=0;o<n;o++)e[o]=t[o].get();return s(e)})}function S(t,s,e,n){const o=u(()=>Object.keys(e)),r=u(()=>({}));for(const c of o)r[c]=I(t,s,e[c],n);return r}export{I as a,b as u};
1
+ import{f6 as A,f7 as u,f8 as h,r as i,f9 as C,fa as V,fb as k,fc as x,fd as l}from"./index-fge85Gub.js";function E(...t){const s=!Array.isArray(t[0]),e=s?0:-1,n=t[0+e],o=t[1+e],r=t[2+e],c=t[3+e],f=A(o,r,c);return s?f(n):f}function b(t){const s=u(()=>h(t)),{isStatic:e}=i.useContext(C);if(e){const[,n]=i.useState(t);i.useEffect(()=>s.on("change",n),[])}return s}function d(t,s){const e=b(s()),n=()=>e.set(s());return n(),V(()=>{const o=()=>x.preRender(n,!1,!0),r=t.map(c=>c.on("change",o));return()=>{r.forEach(c=>c()),k(n)}}),e}function L(t){l.current=[],t();const s=d(l.current,t);return l.current=void 0,s}function I(t,s,e,n){if(typeof t=="function")return L(t);if(e!==void 0&&!Array.isArray(e)&&typeof s!="function")return S(t,s,e,n);const c=typeof s=="function"?s:E(s,e,n),f=Array.isArray(t)?y(t,c):y([t],([m])=>c(m)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof s!="function"&&Array.isArray(e)&&(n==null?void 0:n.clamp)!==!1&&(f.accelerate={...a,times:s,keyframes:e,isTransformed:!0}),f}function y(t,s){const e=u(()=>[]);return d(t,()=>{e.length=0;const n=t.length;for(let o=0;o<n;o++)e[o]=t[o].get();return s(e)})}function S(t,s,e,n){const o=u(()=>Object.keys(e)),r=u(()=>({}));for(const c of o)r[c]=I(t,s,e[c],n);return r}export{I as a,b as u};
@@ -1 +1 @@
1
- import{a1 as a,a2 as l,a3 as r,ap as o,a4 as s}from"./index-B6Scr7KJ.js";import{B as d}from"./use-bindings-BgXZ0D7k.js";const u=["relay","unclaimed-chats"];function m(e){return[...u,e]}function y(e="pending",t=!0){const n=a();return l({queryKey:m(e),queryFn:()=>n.listUnclaimedChats(e),enabled:t})}function U(){const e=r(),t=()=>{e.invalidateQueries({queryKey:[...u]})};o("relay_chat_unclaimed",t),o("relay_chat_unclaimed_burst",t)}function i(e){e.invalidateQueries({queryKey:[...u]})}function p(){const e=a(),t=r();return s({mutationFn:({id:n,input:c})=>e.claimUnclaimedChat(n,c),meta:{suppressErrorToast:!0},onSuccess:()=>{i(t),t.invalidateQueries({queryKey:[...d]})}})}function v(){const e=a(),t=r();return s({mutationFn:n=>e.ignoreUnclaimedChat(n),meta:{errorLabel:"Couldn’t ignore this chat"},onSuccess:()=>i(t)})}function f(){const e=a(),t=r();return s({mutationFn:n=>e.blockUnclaimedChat(n),meta:{errorLabel:"Couldn’t block this chat"},onSuccess:()=>i(t)})}function q(){const e=a(),t=r();return s({mutationFn:n=>e.leaveUnclaimedChat(n),meta:{errorLabel:"Couldn’t leave this chat"},onSuccess:()=>i(t)})}export{u as U,U as a,p as b,v as c,f as d,q as e,y as u};
1
+ import{a1 as a,a2 as l,a3 as r,an as o,a4 as s}from"./index-fge85Gub.js";import{B as d}from"./use-bindings-h_mG9d64.js";const u=["relay","unclaimed-chats"];function m(e){return[...u,e]}function y(e="pending",t=!0){const n=a();return l({queryKey:m(e),queryFn:()=>n.listUnclaimedChats(e),enabled:t})}function U(){const e=r(),t=()=>{e.invalidateQueries({queryKey:[...u]})};o("relay_chat_unclaimed",t),o("relay_chat_unclaimed_burst",t)}function i(e){e.invalidateQueries({queryKey:[...u]})}function p(){const e=a(),t=r();return s({mutationFn:({id:n,input:c})=>e.claimUnclaimedChat(n,c),meta:{suppressErrorToast:!0},onSuccess:()=>{i(t),t.invalidateQueries({queryKey:[...d]})}})}function v(){const e=a(),t=r();return s({mutationFn:n=>e.ignoreUnclaimedChat(n),meta:{errorLabel:"Couldn’t ignore this chat"},onSuccess:()=>i(t)})}function f(){const e=a(),t=r();return s({mutationFn:n=>e.blockUnclaimedChat(n),meta:{errorLabel:"Couldn’t block this chat"},onSuccess:()=>i(t)})}function q(){const e=a(),t=r();return s({mutationFn:n=>e.leaveUnclaimedChat(n),meta:{errorLabel:"Couldn’t leave this chat"},onSuccess:()=>i(t)})}export{u as U,U as a,p as b,v as c,f as d,q as e,y as u};
@@ -0,0 +1 @@
1
+ import{a1 as n,a3 as s,a4 as u,aF as o,aG as r}from"./index-fge85Gub.js";function c(){const e=n(),t=s();return u({mutationKey:o,mutationFn:a=>e.updateConfig(a),onSuccess:()=>{t.invalidateQueries({queryKey:r.current()})}})}export{c as u};
@@ -1 +1 @@
1
- import{a3 as f,r as n,an as i,ao as o}from"./index-B6Scr7KJ.js";function a(r,u){return r.findAll(u.filters).map(e=>u.select?u.select(e):e.state)}function x(r={},u){const e=f(u).getMutationCache(),c=n.useRef(r),t=n.useRef(null);return t.current===null&&(t.current=a(e,r)),n.useEffect(()=>{c.current=r}),n.useSyncExternalStore(n.useCallback(l=>e.subscribe(()=>{const s=i(t.current,a(e,c.current));t.current!==s&&(t.current=s,o.schedule(l))}),[e]),()=>t.current,()=>t.current)}export{x as u};
1
+ import{a3 as f,r as n,al as i,am as o}from"./index-fge85Gub.js";function a(r,u){return r.findAll(u.filters).map(e=>u.select?u.select(e):e.state)}function m(r={},u){const e=f(u).getMutationCache(),c=n.useRef(r),t=n.useRef(null);return t.current===null&&(t.current=a(e,r)),n.useEffect(()=>{c.current=r}),n.useSyncExternalStore(n.useCallback(l=>e.subscribe(()=>{const s=i(t.current,a(e,c.current));t.current!==s&&(t.current=s,o.schedule(l))}),[e]),()=>t.current,()=>t.current)}export{m as u};
@@ -1,4 +1,4 @@
1
- import{g as Ni}from"./chunk-XXDRQBXY-D8kkjktE.js";import{s as Ci}from"./chunk-VQ5W62QI-r5T-ZVBs.js";import{g as Zs,s as jt,a as Qs,b as Gt,v as bi,t as vi,_ as u,E as je,l as _i,c as en,q as Mi,r as xi,u as wi,j as Ui,A as Pi,P as Di,D as Fi,M as Bi,F as $i,K as ji,bj as Gi}from"./mermaid.core-BcRUBvZd.js";import{s as Wi}from"./transform-BqqRT-Iy.js";import"./index-B6Scr7KJ.js";import"./BlintzCanvas-BCtfZPrs.js";import"./index-DsasLE1l.js";import"./index-BSxkprTm.js";function Wt(s){console&&console.error&&console.error(`Error: ${s}`)}function tn(s){console&&console.warn&&console.warn(`Warning: ${s}`)}function sn(s){const e=new Date().getTime(),t=s();return{time:new Date().getTime()-e,value:t}}function nn(s){function e(){}e.prototype=s;const t=new e;function n(){return typeof t.bar}return n(),n(),s}function Ki(s){return Vi(s)?s.LABEL:s.name}function Vi(s){return typeof s.LABEL=="string"&&s.LABEL!==""}class te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class K extends te{constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class _e extends te{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}}class W extends te{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}}class G extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class se extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class ne extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class x extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class J extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class Z extends te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ie(e))}}class k{constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}}function zi(s){return s.map(at)}function at(s){function e(t){return t.map(at)}if(s instanceof K){const t={type:"NonTerminal",name:s.nonTerminalName,idx:s.idx};return typeof s.label=="string"&&(t.label=s.label),t}else{if(s instanceof W)return{type:"Alternative",definition:e(s.definition)};if(s instanceof G)return{type:"Option",idx:s.idx,definition:e(s.definition)};if(s instanceof se)return{type:"RepetitionMandatory",idx:s.idx,definition:e(s.definition)};if(s instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof J)return{type:"RepetitionWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof x)return{type:"Repetition",idx:s.idx,definition:e(s.definition)};if(s instanceof Z)return{type:"Alternation",idx:s.idx,definition:e(s.definition)};if(s instanceof k){const t={type:"Terminal",name:s.terminalType.name,label:Ki(s.terminalType),idx:s.idx};typeof s.label=="string"&&(t.terminalLabel=s.label);const n=s.terminalType.PATTERN;return s.terminalType.PATTERN&&(t.pattern=n instanceof RegExp?n.source:n),t}else{if(s instanceof _e)return{type:"Rule",name:s.name,orgText:s.orgText,definition:e(s.definition)};throw Error("non exhaustive match")}}}function ie(s){return Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0))}class Me{visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case J:return this.visitRepetitionWithSeparator(t);case x:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case _e:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Hi(s){return s instanceof W||s instanceof G||s instanceof x||s instanceof se||s instanceof ne||s instanceof J||s instanceof k||s instanceof _e}function Tt(s,e=[]){return s instanceof G||s instanceof x||s instanceof J?!0:s instanceof Z?s.definition.some(n=>Tt(n,e)):s instanceof K&&e.includes(s)?!1:s instanceof te?(s instanceof K&&e.push(s),s.definition.every(n=>Tt(n,e))):!1}function Xi(s){return s instanceof Z}function ee(s){if(s instanceof K)return"SUBRULE";if(s instanceof G)return"OPTION";if(s instanceof Z)return"OR";if(s instanceof se)return"AT_LEAST_ONE";if(s instanceof ne)return"AT_LEAST_ONE_SEP";if(s instanceof J)return"MANY_SEP";if(s instanceof x)return"MANY";if(s instanceof k)return"CONSUME";throw Error("non exhaustive match")}class kt{walk(e,t=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof K)this.walkProdRef(n,a,t);else if(n instanceof k)this.walkTerminal(n,a,t);else if(n instanceof W)this.walkFlat(n,a,t);else if(n instanceof G)this.walkOption(n,a,t);else if(n instanceof se)this.walkAtLeastOne(n,a,t);else if(n instanceof ne)this.walkAtLeastOneSep(n,a,t);else if(n instanceof J)this.walkManySep(n,a,t);else if(n instanceof x)this.walkMany(n,a,t);else if(n instanceof Z)this.walkOr(n,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){const i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkMany(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkOr(e,t,n){const i=t.concat(n);e.definition.forEach(a=>{const r=new W({definition:[a]});this.walk(r,i)})}}function ys(s,e,t){return[new G({definition:[new k({terminalType:s.separator})].concat(s.definition)})].concat(e,t)}function qe(s){if(s instanceof K)return qe(s.referencedRule);if(s instanceof k)return Ji(s);if(Hi(s))return Yi(s);if(Xi(s))return qi(s);throw Error("non exhaustive match")}function Yi(s){let e=[];const t=s.definition;let n=0,i=t.length>n,a,r=!0;for(;i&&r;)a=t[n],r=Tt(a),e=e.concat(qe(a)),n=n+1,i=t.length>n;return[...new Set(e)]}function qi(s){const e=s.definition.map(t=>qe(t));return[...new Set(e.flat())]}function Ji(s){return[s.terminalType]}const an="_~IN~_";class Zi extends kt{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const i=ea(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),r=new W({definition:a}),o=qe(r);this.follows[i]=o}}function Qi(s){const e={};return s.forEach(t=>{const n=new Zi(t).startWalking();Object.assign(e,n)}),e}function ea(s,e){return s.name+e+an}function y(s){return s.charCodeAt(0)}function Pt(s,e){Array.isArray(s)?s.forEach(function(t){e.push(t)}):e.push(s)}function Fe(s,e){if(s[e]===!0)throw"duplicate flag "+e;s[e],s[e]=!0}function Se(s){if(s===void 0)throw Error("Internal Error - Should never get here!");return!0}function ta(){throw Error("Internal Error - Should never get here!")}function Rs(s){return s.type==="Character"}const gt=[];for(let s=y("0");s<=y("9");s++)gt.push(s);const At=[y("_")].concat(gt);for(let s=y("a");s<=y("z");s++)At.push(s);for(let s=y("A");s<=y("Z");s++)At.push(s);const Os=[y(" "),y("\f"),y(`
1
+ import{g as Ni}from"./chunk-XXDRQBXY-CfeGRauy.js";import{s as Ci}from"./chunk-VQ5W62QI-HqUjzAO7.js";import{g as Zs,s as jt,a as Qs,b as Gt,v as bi,t as vi,_ as u,E as je,l as _i,c as en,q as Mi,r as xi,u as wi,j as Ui,A as Pi,P as Di,D as Fi,M as Bi,F as $i,K as ji,bj as Gi}from"./mermaid.core-_ZqWvaFB.js";import{s as Wi}from"./transform-BqqRT-Iy.js";import"./index-fge85Gub.js";import"./BlintzCanvas-BFJXKo1L.js";import"./index-Dsj1fDYU.js";import"./index-DZQUx5pX.js";function Wt(s){console&&console.error&&console.error(`Error: ${s}`)}function tn(s){console&&console.warn&&console.warn(`Warning: ${s}`)}function sn(s){const e=new Date().getTime(),t=s();return{time:new Date().getTime()-e,value:t}}function nn(s){function e(){}e.prototype=s;const t=new e;function n(){return typeof t.bar}return n(),n(),s}function Ki(s){return Vi(s)?s.LABEL:s.name}function Vi(s){return typeof s.LABEL=="string"&&s.LABEL!==""}class te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class K extends te{constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class _e extends te{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}}class W extends te{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}}class G extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class se extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class ne extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class x extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class J extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class Z extends te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ie(e))}}class k{constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}}function zi(s){return s.map(at)}function at(s){function e(t){return t.map(at)}if(s instanceof K){const t={type:"NonTerminal",name:s.nonTerminalName,idx:s.idx};return typeof s.label=="string"&&(t.label=s.label),t}else{if(s instanceof W)return{type:"Alternative",definition:e(s.definition)};if(s instanceof G)return{type:"Option",idx:s.idx,definition:e(s.definition)};if(s instanceof se)return{type:"RepetitionMandatory",idx:s.idx,definition:e(s.definition)};if(s instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof J)return{type:"RepetitionWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof x)return{type:"Repetition",idx:s.idx,definition:e(s.definition)};if(s instanceof Z)return{type:"Alternation",idx:s.idx,definition:e(s.definition)};if(s instanceof k){const t={type:"Terminal",name:s.terminalType.name,label:Ki(s.terminalType),idx:s.idx};typeof s.label=="string"&&(t.terminalLabel=s.label);const n=s.terminalType.PATTERN;return s.terminalType.PATTERN&&(t.pattern=n instanceof RegExp?n.source:n),t}else{if(s instanceof _e)return{type:"Rule",name:s.name,orgText:s.orgText,definition:e(s.definition)};throw Error("non exhaustive match")}}}function ie(s){return Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0))}class Me{visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case J:return this.visitRepetitionWithSeparator(t);case x:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case _e:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Hi(s){return s instanceof W||s instanceof G||s instanceof x||s instanceof se||s instanceof ne||s instanceof J||s instanceof k||s instanceof _e}function Tt(s,e=[]){return s instanceof G||s instanceof x||s instanceof J?!0:s instanceof Z?s.definition.some(n=>Tt(n,e)):s instanceof K&&e.includes(s)?!1:s instanceof te?(s instanceof K&&e.push(s),s.definition.every(n=>Tt(n,e))):!1}function Xi(s){return s instanceof Z}function ee(s){if(s instanceof K)return"SUBRULE";if(s instanceof G)return"OPTION";if(s instanceof Z)return"OR";if(s instanceof se)return"AT_LEAST_ONE";if(s instanceof ne)return"AT_LEAST_ONE_SEP";if(s instanceof J)return"MANY_SEP";if(s instanceof x)return"MANY";if(s instanceof k)return"CONSUME";throw Error("non exhaustive match")}class kt{walk(e,t=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof K)this.walkProdRef(n,a,t);else if(n instanceof k)this.walkTerminal(n,a,t);else if(n instanceof W)this.walkFlat(n,a,t);else if(n instanceof G)this.walkOption(n,a,t);else if(n instanceof se)this.walkAtLeastOne(n,a,t);else if(n instanceof ne)this.walkAtLeastOneSep(n,a,t);else if(n instanceof J)this.walkManySep(n,a,t);else if(n instanceof x)this.walkMany(n,a,t);else if(n instanceof Z)this.walkOr(n,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){const i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkMany(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkOr(e,t,n){const i=t.concat(n);e.definition.forEach(a=>{const r=new W({definition:[a]});this.walk(r,i)})}}function ys(s,e,t){return[new G({definition:[new k({terminalType:s.separator})].concat(s.definition)})].concat(e,t)}function qe(s){if(s instanceof K)return qe(s.referencedRule);if(s instanceof k)return Ji(s);if(Hi(s))return Yi(s);if(Xi(s))return qi(s);throw Error("non exhaustive match")}function Yi(s){let e=[];const t=s.definition;let n=0,i=t.length>n,a,r=!0;for(;i&&r;)a=t[n],r=Tt(a),e=e.concat(qe(a)),n=n+1,i=t.length>n;return[...new Set(e)]}function qi(s){const e=s.definition.map(t=>qe(t));return[...new Set(e.flat())]}function Ji(s){return[s.terminalType]}const an="_~IN~_";class Zi extends kt{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const i=ea(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),r=new W({definition:a}),o=qe(r);this.follows[i]=o}}function Qi(s){const e={};return s.forEach(t=>{const n=new Zi(t).startWalking();Object.assign(e,n)}),e}function ea(s,e){return s.name+e+an}function y(s){return s.charCodeAt(0)}function Pt(s,e){Array.isArray(s)?s.forEach(function(t){e.push(t)}):e.push(s)}function Fe(s,e){if(s[e]===!0)throw"duplicate flag "+e;s[e],s[e]=!0}function Se(s){if(s===void 0)throw Error("Internal Error - Should never get here!");return!0}function ta(){throw Error("Internal Error - Should never get here!")}function Rs(s){return s.type==="Character"}const gt=[];for(let s=y("0");s<=y("9");s++)gt.push(s);const At=[y("_")].concat(gt);for(let s=y("a");s<=y("z");s++)At.push(s);for(let s=y("A");s<=y("Z");s++)At.push(s);const Os=[y(" "),y("\f"),y(`
2
2
  `),y("\r"),y(" "),y("\v"),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y("\u2028"),y("\u2029"),y(" "),y(" "),y(" "),y("\uFEFF")],sa=/[0-9a-fA-F]/,tt=/[0-9]/,na=/[1-9]/;class ia{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Fe(n,"global");break;case"i":Fe(n,"ignoreCase");break;case"m":Fe(n,"multiLine");break;case"u":Fe(n,"unicode");break;case"y":Fe(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}Se(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return ta()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:i,atMost:a}):t={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;Se(t);break}if(!(e===!0&&t===void 0)&&Se(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Se(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[y(`
3
3
  `),y("\r"),y("\u2028"),y("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=gt;break;case"D":e=gt,t=!0;break;case"s":e=Os;break;case"S":e=Os,t=!0;break;case"w":e=At;break;case"W":e=At,t=!0;break}if(Se(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=y("\f");break;case"n":e=y(`
4
4
  `);break;case"r":e=y("\r");break;case"t":e=y(" ");break;case"v":e=y("\v");break}if(Se(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:y("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:y(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
@@ -1,4 +1,4 @@
1
- import{b8 as Wt,s as Kt,g as Ht,v as Yt,t as Xt,a as Zt,b as Jt,_ as S,M as St,R as Qt,ar as $t,ag as te,ah as ee,ai as ne,d as se,A as ie,O as re,P as oe}from"./mermaid.core-BcRUBvZd.js";import{s as rt}from"./transform-BqqRT-Iy.js";import"./index-B6Scr7KJ.js";import"./BlintzCanvas-BCtfZPrs.js";import"./index-DsasLE1l.js";import"./index-BSxkprTm.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(h.x+a.x)*(a.y-h.y);const p={x:(a.x+h.x)/2,y:(a.y+h.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(h.parentIndex.includes(a.parentIndex[m])){const y=t[a.parentIndex[m]],M=Math.atan2(a.x-y.x,a.y-y.y),E=Math.atan2(h.x-y.x,h.y-y.y);let T=E-M;T<0&&(T+=2*Math.PI);const w=E-T/2;let g=K(p,{x:y.x+y.radius*Math.sin(w),y:y.y+y.radius*Math.cos(w)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(K(t[u],l)>Math.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function K(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){h/=2;const a=n+h,p=t(a);if(p*o>=0&&(n=a),Math.abs(h)<r||p===0)return a}return n+h}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt(tt(t,t))}function ht(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,p=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,y=new Array(m+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let v=0;v<m;++v){const c=n.slice();c[v]=c[v]?c[v]*i:r,y[v+1]=c,y[v+1].fx=t(c),y[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)y[m][c]=v[c];y[m].fx=v.fx}const E=(v,c)=>v.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(y.sort(E),s.history){const x=y.map(f=>{const O=f.slice();return O.fx=f.fx,O.id=f.id,O});x.sort((f,O)=>f.id-O.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x<m;++x)d=Math.max(d,Math.abs(y[0][x]-y[1][x]));if(Math.abs(y[0].fx-y[m].fx)<o&&d<l)break;for(let x=0;x<m;++x){T[x]=0;for(let f=0;f<m;++f)T[x]+=y[f][x];T[x]/=m}const c=y[m];if(J(w,1+h,T,-h,c),w.fx=t(w),w.fx<y[0].fx)J(b,1+u,T,-u,c),b.fx=t(b),b.fx<w.fx?M(b):M(w);else if(w.fx>=y[m-1].fx){let x=!1;if(w.fx>c.fx?(J(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*h,T,a*h,c),g.fx=t(g),g.fx<w.fx?M(g):x=!0),x){if(p>=1)break;for(let f=1;f<y.length;++f)J(y[f],1-p,y[0],p,y[f]),y[f].fx=t(y[f])}}else M(w)}return y.sort(E),{fx:y[0].fx,x:y[0]}}function ue(t,n,s,e,i,r,o){const l=s.fx,h=tt(s.fxprime,n);let u=l,a=l,p=h,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(y,M,E){for(let T=0;T<16;++T)if(i=(y+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a<u;++a){if(h=ue(t,o,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ht(o,e.fxprime,-1);else{J(r,1,i.fxprime,-1,e.fxprime);const p=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/p);J(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||et,i=fe(t,n),r=s(i,n),o=Object.keys(r),l=[];for(const a of o)l.push(r[a].x),l.push(r[a].y);const u=zt(a=>{const p={};for(let d=0;d<o.length;++d){const m=o[d];p[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(p,i)},l,n).x;for(let a=0;a<o.length;++a){const p=o[a];r[p].x=u[2*a],r[p].y=u[2*a+1]}return r}const Rt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const a=String(h.sets[u]);l.set(a,h.size+(l.get(a)||0));for(let p=u+1;p<h.sets.length;p++){const d=String(h.sets[p]),m=`${a};${d}`,y=`${d};${a}`;l.set(m,h.size+(l.get(m)||0)),l.set(y,h.size+(l.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=l.get(i(h.sets)))}const r=[],o=new Set;for(const l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){const h=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,h]))}r.sort((l,h)=>l===h?0:l<h?-1:1);for(let l=0;l<r.length;++l){const h=r[l];for(let u=l+1;u<r.length;++u){const a=r[u];o.has(i([h,a]))||e.push({sets:[h,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],l=t[2*r+1];for(let h=r+1;h<s.length;++h){const u=t[2*h],a=t[2*h+1],p=s[r][h],d=e[r][h],m=(u-o)*(u-o)+(a-l)*(a-l),y=Math.sqrt(m),M=m-p*p;d>0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=de(t,e,i);const l=ut(r.map(ut))/r.length;r=r.map(d=>d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;d<s;++d){const m=ct(r.length*2).map(Math.random),y=he(h,m,n);(!u||y.fx<u.fx)&&(u=y)}const a=u.x,p={};for(let d=0;d<e.length;++d){const m=e[d];p[m.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ht(d.x,l);return p}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const p of t)if(p.sets.length===1){const d=p.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:p.size,radius:Math.sqrt(p.size/Math.PI)},i[d]=[]}t=t.filter(p=>p.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;m<i[p].length;++m)d+=i[p][m].size*i[p][m].weight;r.push({set:p,size:d})});function o(p,d){return d.size-p.size}r.sort(o);const l={};function h(p){return p.set in l}function u(p,d){e[d].x=p.x,e[d].y=p.y,l[d]=!0}u({x:0,y:0},r[0].set);for(let p=1;p<r.length;++p){const d=r[p].set,m=i[d].filter(h),y=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ft(y.radius,w.radius,m[a].size);M.push({x:w.x+g,y:w.y}),M.push({x:w.x-g,y:w.y}),M.push({y:w.y+g,x:w.x}),M.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],c=ft(y.radius,v.radius,m[b].size),x=Tt({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,T=M[0];for(const w of M){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<E&&(E=g,T=w)}u(T,d)}return e}function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],l=t[e.sets[1]];i=xt(o.radius,l.radius,K(o,l))}else i=st(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;K(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h<i.length;)l(i[h],!0,!1),l(i[h+1],!1,!0),l(i[h+2],!0,!0),h+=3,r=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const r=Ft(t);n-=2*e,s-=2*e;const{xRange:o,yRange:l}=dt(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const m=Math.sqrt(i/Math.PI)*2;h=n/m,u=s/m}else h=n/(o.max-o.min),u=s/(l.max-l.min);const a=Math.min(u,h),p=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return Nt(r.map(m=>({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const O=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&O.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(C=>O.has(C)));let k={},D={};if(f.length>0){let I=b(f,{lossFunction:v,distinct:m});l&&(I=Dt(I,o,d)),k=Ot(I,s,e,i,h),D=Lt(k,f,M)}const X={};f.forEach(I=>{I.label&&(X[I.sets]=I.label)});function G(I){if(I.sets in X)return X[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!m&&(z=!0,V[I.sets[0]]=Me(C))});function q(I){return C=>{const H=I.sets.map(Q=>{let W=V[Q],Y=k[Q];return W||(W={x:s/2,y:e/2,radius:1}),Y||(Y={x:s/2,y:e/2,radius:1}),{x:W.x*(1-C)+Y.x*C,y:W.y*(1-C)+Y.y*C,radius:W.radius*(1-C)+Y.radius*C}});return wt(H,y)}}const R=B.selectAll(".venn-area").data(f,I=>I.sets),N=R.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),j=N.append("path"),L=N.append("text").attr("class","label").text(I=>G(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function P(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",I=>wt(I.sets.map(C=>k[C])),y);const F=_.selectAll("text").filter(I=>I.sets in D).text(I=>G(I)).attr("x",I=>Math.floor(D[I.sets].x)).attr("y",I=>Math.floor(D[I.sets].y));u&&(z?"on"in F?F.on("end",ot(k,G)):F.each("end",ot(k,G)):F.each(ot(k,G)));const A=P(R.exit()).remove();typeof R.transition=="function"&&A.selectAll("path").attrTween("d",q);const Z=A.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),F.style("font-size",p),Z.style("font-size","0px")),{circles:k,textCentres:D,nodes:R,enter:N,update:_,exit:A}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Ct:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-K(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=K(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=at(e[0],t,n);for(let a=1;a<e.length;++a){const p=at(e[a],t,n);p>=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)<a.radius){h=!1;break}if(h)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const l=s[o],h=t[l],u=K(r,h);u+h.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=h.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let r=0;r<n.length;++r){const o=n[r].sets,l={},h={};for(let d=0;d<o.length;++d){l[o[d]]=!0;const m=i[o[d]];for(let y=0;y<m.length;++y)h[m[y]]=!0}const u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in h||a.push(t[d]);const p=jt(u,a,s);e[o]=p,p.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
1
+ import{b8 as Wt,s as Kt,g as Ht,v as Yt,t as Xt,a as Zt,b as Jt,_ as S,M as St,R as Qt,ar as $t,ag as te,ah as ee,ai as ne,d as se,A as ie,O as re,P as oe}from"./mermaid.core-_ZqWvaFB.js";import{s as rt}from"./transform-BqqRT-Iy.js";import"./index-fge85Gub.js";import"./BlintzCanvas-BFJXKo1L.js";import"./index-Dsj1fDYU.js";import"./index-DZQUx5pX.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(h.x+a.x)*(a.y-h.y);const p={x:(a.x+h.x)/2,y:(a.y+h.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(h.parentIndex.includes(a.parentIndex[m])){const y=t[a.parentIndex[m]],M=Math.atan2(a.x-y.x,a.y-y.y),E=Math.atan2(h.x-y.x,h.y-y.y);let T=E-M;T<0&&(T+=2*Math.PI);const w=E-T/2;let g=K(p,{x:y.x+y.radius*Math.sin(w),y:y.y+y.radius*Math.cos(w)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(K(t[u],l)>Math.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function K(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){h/=2;const a=n+h,p=t(a);if(p*o>=0&&(n=a),Math.abs(h)<r||p===0)return a}return n+h}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt(tt(t,t))}function ht(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,p=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,y=new Array(m+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let v=0;v<m;++v){const c=n.slice();c[v]=c[v]?c[v]*i:r,y[v+1]=c,y[v+1].fx=t(c),y[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)y[m][c]=v[c];y[m].fx=v.fx}const E=(v,c)=>v.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(y.sort(E),s.history){const x=y.map(f=>{const O=f.slice();return O.fx=f.fx,O.id=f.id,O});x.sort((f,O)=>f.id-O.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x<m;++x)d=Math.max(d,Math.abs(y[0][x]-y[1][x]));if(Math.abs(y[0].fx-y[m].fx)<o&&d<l)break;for(let x=0;x<m;++x){T[x]=0;for(let f=0;f<m;++f)T[x]+=y[f][x];T[x]/=m}const c=y[m];if(J(w,1+h,T,-h,c),w.fx=t(w),w.fx<y[0].fx)J(b,1+u,T,-u,c),b.fx=t(b),b.fx<w.fx?M(b):M(w);else if(w.fx>=y[m-1].fx){let x=!1;if(w.fx>c.fx?(J(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*h,T,a*h,c),g.fx=t(g),g.fx<w.fx?M(g):x=!0),x){if(p>=1)break;for(let f=1;f<y.length;++f)J(y[f],1-p,y[0],p,y[f]),y[f].fx=t(y[f])}}else M(w)}return y.sort(E),{fx:y[0].fx,x:y[0]}}function ue(t,n,s,e,i,r,o){const l=s.fx,h=tt(s.fxprime,n);let u=l,a=l,p=h,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(y,M,E){for(let T=0;T<16;++T)if(i=(y+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a<u;++a){if(h=ue(t,o,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ht(o,e.fxprime,-1);else{J(r,1,i.fxprime,-1,e.fxprime);const p=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/p);J(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||et,i=fe(t,n),r=s(i,n),o=Object.keys(r),l=[];for(const a of o)l.push(r[a].x),l.push(r[a].y);const u=zt(a=>{const p={};for(let d=0;d<o.length;++d){const m=o[d];p[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(p,i)},l,n).x;for(let a=0;a<o.length;++a){const p=o[a];r[p].x=u[2*a],r[p].y=u[2*a+1]}return r}const Rt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const a=String(h.sets[u]);l.set(a,h.size+(l.get(a)||0));for(let p=u+1;p<h.sets.length;p++){const d=String(h.sets[p]),m=`${a};${d}`,y=`${d};${a}`;l.set(m,h.size+(l.get(m)||0)),l.set(y,h.size+(l.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=l.get(i(h.sets)))}const r=[],o=new Set;for(const l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){const h=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,h]))}r.sort((l,h)=>l===h?0:l<h?-1:1);for(let l=0;l<r.length;++l){const h=r[l];for(let u=l+1;u<r.length;++u){const a=r[u];o.has(i([h,a]))||e.push({sets:[h,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],l=t[2*r+1];for(let h=r+1;h<s.length;++h){const u=t[2*h],a=t[2*h+1],p=s[r][h],d=e[r][h],m=(u-o)*(u-o)+(a-l)*(a-l),y=Math.sqrt(m),M=m-p*p;d>0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=de(t,e,i);const l=ut(r.map(ut))/r.length;r=r.map(d=>d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;d<s;++d){const m=ct(r.length*2).map(Math.random),y=he(h,m,n);(!u||y.fx<u.fx)&&(u=y)}const a=u.x,p={};for(let d=0;d<e.length;++d){const m=e[d];p[m.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ht(d.x,l);return p}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const p of t)if(p.sets.length===1){const d=p.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:p.size,radius:Math.sqrt(p.size/Math.PI)},i[d]=[]}t=t.filter(p=>p.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;m<i[p].length;++m)d+=i[p][m].size*i[p][m].weight;r.push({set:p,size:d})});function o(p,d){return d.size-p.size}r.sort(o);const l={};function h(p){return p.set in l}function u(p,d){e[d].x=p.x,e[d].y=p.y,l[d]=!0}u({x:0,y:0},r[0].set);for(let p=1;p<r.length;++p){const d=r[p].set,m=i[d].filter(h),y=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ft(y.radius,w.radius,m[a].size);M.push({x:w.x+g,y:w.y}),M.push({x:w.x-g,y:w.y}),M.push({y:w.y+g,x:w.x}),M.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],c=ft(y.radius,v.radius,m[b].size),x=Tt({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,T=M[0];for(const w of M){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<E&&(E=g,T=w)}u(T,d)}return e}function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],l=t[e.sets[1]];i=xt(o.radius,l.radius,K(o,l))}else i=st(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;K(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h<i.length;)l(i[h],!0,!1),l(i[h+1],!1,!0),l(i[h+2],!0,!0),h+=3,r=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const r=Ft(t);n-=2*e,s-=2*e;const{xRange:o,yRange:l}=dt(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const m=Math.sqrt(i/Math.PI)*2;h=n/m,u=s/m}else h=n/(o.max-o.min),u=s/(l.max-l.min);const a=Math.min(u,h),p=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return Nt(r.map(m=>({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const O=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&O.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(C=>O.has(C)));let k={},D={};if(f.length>0){let I=b(f,{lossFunction:v,distinct:m});l&&(I=Dt(I,o,d)),k=Ot(I,s,e,i,h),D=Lt(k,f,M)}const X={};f.forEach(I=>{I.label&&(X[I.sets]=I.label)});function G(I){if(I.sets in X)return X[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!m&&(z=!0,V[I.sets[0]]=Me(C))});function q(I){return C=>{const H=I.sets.map(Q=>{let W=V[Q],Y=k[Q];return W||(W={x:s/2,y:e/2,radius:1}),Y||(Y={x:s/2,y:e/2,radius:1}),{x:W.x*(1-C)+Y.x*C,y:W.y*(1-C)+Y.y*C,radius:W.radius*(1-C)+Y.radius*C}});return wt(H,y)}}const R=B.selectAll(".venn-area").data(f,I=>I.sets),N=R.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),j=N.append("path"),L=N.append("text").attr("class","label").text(I=>G(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function P(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",I=>wt(I.sets.map(C=>k[C])),y);const F=_.selectAll("text").filter(I=>I.sets in D).text(I=>G(I)).attr("x",I=>Math.floor(D[I.sets].x)).attr("y",I=>Math.floor(D[I.sets].y));u&&(z?"on"in F?F.on("end",ot(k,G)):F.each("end",ot(k,G)):F.each(ot(k,G)));const A=P(R.exit()).remove();typeof R.transition=="function"&&A.selectAll("path").attrTween("d",q);const Z=A.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),F.style("font-size",p),Z.style("font-size","0px")),{circles:k,textCentres:D,nodes:R,enter:N,update:_,exit:A}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Ct:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-K(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=K(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=at(e[0],t,n);for(let a=1;a<e.length;++a){const p=at(e[a],t,n);p>=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)<a.radius){h=!1;break}if(h)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const l=s[o],h=t[l],u=K(r,h);u+h.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=h.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let r=0;r<n.length;++r){const o=n[r].sets,l={},h={};for(let d=0;d<o.length;++d){l[o[d]]=!0;const m=i[o[d]];for(let y=0;y<m.length;++y)h[m[y]]=!0}const u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in h||a.push(t[d]);const p=jt(u,a,s);e[o]=p,p.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
2
2
  M`,t,n),e.push(`
3
3
  m`,-s,0),e.push(`
4
4
  a`,s,s,0,1,0,s*2,0),e.push(`