decocms 4.3.1 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/client/assets/{AlertCircle-B4WPpzHx.js → AlertCircle-CM6D9elR.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-n7J2ORua.js → ArrowUpRight-Kqa5fEjt.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DGqDWZvl.js → CheckCircle-8DKF8Yx5.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BzkFMF52.js → ChevronDown-DGuR7uUZ.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-BhZIqa2P.js → ChevronRight-BswIt99A.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-CtzC0jb0.js → ChevronUp-DSdWQUoR.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-DskMPw9G.js → DotsVertical-DSosYpI1.js} +1 -1
  8. package/dist/client/assets/{Eye-Bkw15G1G.js → Eye-Dn1AISrx.js} +1 -1
  9. package/dist/client/assets/{FilterLines-CTiCp3St.js → FilterLines-CmWI-8pG.js} +1 -1
  10. package/dist/client/assets/{Globe01-CIvUZBh0.js → Globe01-CcXDI4W7.js} +1 -1
  11. package/dist/client/assets/{Globe04-By_qGXm-.js → Globe04-B9Btoycr.js} +1 -1
  12. package/dist/client/assets/{HardDrive-Da-ea-EW.js → HardDrive-BqXWgcmp.js} +1 -1
  13. package/dist/client/assets/{Key01-DugFMT5_.js → Key01-F6-x7vNY.js} +1 -1
  14. package/dist/client/assets/{LayoutLeft-DiQ60pSu.js → LayoutLeft-DpqtgcH3.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-BMDEbMBF.js → LinkExternal01-DOU6-C1w.js} +1 -1
  16. package/dist/client/assets/{Monitor01-BFD-ivVa.js → Monitor01-SkSQUhmT.js} +1 -1
  17. package/dist/client/assets/{Palette-DrmZY9bB.js → Palette-CnoObDqZ.js} +1 -1
  18. package/dist/client/assets/{Play-CiiKZLoa.js → Play-DzGcMRv3.js} +1 -1
  19. package/dist/client/assets/{Plus-hFZ_SbzL.js → Plus-DDlkoJBs.js} +1 -1
  20. package/dist/client/assets/{SearchLg-D4Hs4YLQ.js → SearchLg-CdT_y89m.js} +1 -1
  21. package/dist/client/assets/{SearchMd-RBoojwOu.js → SearchMd-UY2xUREv.js} +1 -1
  22. package/dist/client/assets/{Settings02-CuT9JazG.js → Settings02-QyYEyYyn.js} +1 -1
  23. package/dist/client/assets/{Shield01-D5Fc_Ylv.js → Shield01-V8b5EFFL.js} +1 -1
  24. package/dist/client/assets/{Star01-BMttIRxb.js → Star01-GVe4t6O1.js} +1 -1
  25. package/dist/client/assets/{Stars01-HANlppqn.js → Stars01-BIVPeWqS.js} +1 -1
  26. package/dist/client/assets/{Stars02-Call5O4Q.js → Stars02-DVZm69DV.js} +1 -1
  27. package/dist/client/assets/{Sun-B0JI-Irq.js → Sun-B2ndPBZP.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-BcqnyefE.js → SwitchHorizontal01-BL4xnvxO.js} +1 -1
  29. package/dist/client/assets/{Tool01-DFCFgRlB.js → Tool01-Ci5EQ1tM.js} +1 -1
  30. package/dist/client/assets/{Trash01-CGEeRKCz.js → Trash01-Cc007jho.js} +1 -1
  31. package/dist/client/assets/{Upload01-V0qkIpRk.js → Upload01-DB9meUjO.js} +1 -1
  32. package/dist/client/assets/{User01-Co_ACiCO.js → User01-Dz-_mMMJ.js} +1 -1
  33. package/dist/client/assets/{Users01-B-VpMOmx.js → Users01-Ctg0iuAM.js} +1 -1
  34. package/dist/client/assets/{Users03-DBa0-LbB.js → Users03-BazvU-rC.js} +1 -1
  35. package/dist/client/assets/{X-DlUiLOPC.js → X-_dGiBqSn.js} +1 -1
  36. package/dist/client/assets/{XCircle-BIxZfFEg.js → XCircle-CmN6DNsv.js} +1 -1
  37. package/dist/client/assets/{XClose-CEJj7vhn.js → XClose-BpreRuFP.js} +1 -1
  38. package/dist/client/assets/{Zap-USVmT42t.js → Zap-CWxLsQ6b.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-qeizwUPq.js → ZapSquare-D5x1wm0t.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-fkR_2hFy.js → ZoomOut-C0bVPfpC.js} +1 -1
  41. package/dist/client/assets/{access-gate-Dob1Rc1a.js → access-gate-CpQ3bOMg.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-JApa7Z44.js → add-section-modal-D22Rp_ry.js} +1 -1
  43. package/dist/client/assets/agent-icon-BjxA8YR3.js +1 -0
  44. package/dist/client/assets/agents-list-C17XwfcN.js +1 -0
  45. package/dist/client/assets/{ai-providers-boT7K-bH.js → ai-providers-DNjwL7U0.js} +1 -1
  46. package/dist/client/assets/{alert-ez0UE1C8.js → alert-CTzYtGwN.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-BZ8TrIVu.js → alert-dialog-DMWXmTGp.js} +2 -2
  48. package/dist/client/assets/app-editor-uAXMllzs.js +1 -0
  49. package/dist/client/assets/{auth-CNqDC7uO.js → auth-DraSXrC6.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-BG9GP_5W.js → auth-catchall--3ZAEbBd.js} +1 -1
  51. package/dist/client/assets/{auth-entry-BAXdJDhh.js → auth-entry-DRJ-aW15.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-BQs9JvYd.js → auth-split-layout-B77S9w6i.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-Dy2XeMqO.js → authenticate-and-persist-oauth-HBteAcVm.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-DO51bU3z.js → automation-list-row-NZNZGrlr.js} +1 -1
  55. package/dist/client/assets/automation-runs-BoQeZ1gh.js +1 -0
  56. package/dist/client/assets/automations-bd5MK3eJ.js +1 -0
  57. package/dist/client/assets/{avatar-Jhd31ejW.js → avatar-COMRxqae.js} +1 -1
  58. package/dist/client/assets/{badge-cxwmW2xd.js → badge-B1dPfLuK.js} +1 -1
  59. package/dist/client/assets/{block-document-AtpOGVAy.js → block-document-B6TgjyKW.js} +2 -2
  60. package/dist/client/assets/{brand-context-D-YGjyHl.js → brand-context-DGv078pp.js} +1 -1
  61. package/dist/client/assets/{buckets-ByuitLd7.js → buckets-LnyV7EWC.js} +1 -1
  62. package/dist/client/assets/bulk-category-panel-BP0Mtj3P.js +1 -0
  63. package/dist/client/assets/{capability-load-error-C00HLz2q.js → capability-load-error-WTr85D-I.js} +1 -1
  64. package/dist/client/assets/{card-D3bKVB8y.js → card-Bys-wDTW.js} +1 -1
  65. package/dist/client/assets/category-editor-Cm1sAVk_.js +1 -0
  66. package/dist/client/assets/{chat-context-B5uEh4ay.js → chat-context-huSCeR82.js} +4 -4
  67. package/dist/client/assets/{checkbox-PMXW46HN.js → checkbox-BIDlFz_0.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Bo07c76Z.js → cli-auth-success-DJ5lbMQC.js} +1 -1
  69. package/dist/client/assets/collection-detail-UTQtN0-J.js +1 -0
  70. package/dist/client/assets/{collection-display-button-Cu6MzTbi.js → collection-display-button-Bnm_JutP.js} +1 -1
  71. package/dist/client/assets/{collection-search-CN9TCItb.js → collection-search-CKMDHnku.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-D5o6VjHd.js → collection-tabs-CWrBkWhe.js} +1 -1
  73. package/dist/client/assets/{command-D-t5bmXW.js → command-DrgMAh0a.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-B8pBrcvE.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-DchtPbuP.js → connect-desktop-dialog-CvuFk-NY.js} +1 -1
  76. package/dist/client/assets/{connection-card-BswtsnGE.js → connection-card-DIh-SIqT.js} +1 -1
  77. package/dist/client/assets/connection-detail-CWog7XFK.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-JfkHcTGO.js → connection-form-helpers-DV-bwjt7.js} +1 -1
  79. package/dist/client/assets/connections-BkvcH3F-.js +1 -0
  80. package/dist/client/assets/{context-menu-Dln5uXsN.js → context-menu-BPHfkJEs.js} +1 -1
  81. package/dist/client/assets/{decopilot-CfDwLIyX.js → decopilot-BxOK0Z8W.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DoJkdYBA.js → decopilot-sse-pool-Chmwc1_x.js} +1 -1
  83. package/dist/client/assets/{dialog-B2cGEuOv.js → dialog-o7scRbG9.js} +1 -1
  84. package/dist/client/assets/{domain-settings-DNJMc9fW.js → domain-settings-DIv14WFm.js} +1 -1
  85. package/dist/client/assets/{drawer-Tv6bcT7w.js → drawer-B-Vy7tMY.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-Dw-pnYXI.js → dropdown-menu-D-VNET4I.js} +1 -1
  87. package/dist/client/assets/{empty-state-D7nJB9UW.js → empty-state-1p_UpPHY.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-CxK1dunT.js → extract-connection-data-BVX9Eneo.js} +1 -1
  89. package/dist/client/assets/file-explorer-Bh9kp1sm.js +2 -0
  90. package/dist/client/assets/{file-type-icon-W_AZRfzL.js → file-type-icon-LHBbJJTG.js} +1 -1
  91. package/dist/client/assets/{files-B0cAPQGO.js → files-Bw3w16xX.js} +1 -1
  92. package/dist/client/assets/{form-DI8q6OtF.js → form-DX8cQ4SA.js} +1 -1
  93. package/dist/client/assets/{general-bpWfsinD.js → general-DzJAxzRR.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker-M1TBbLot.js → github-repo-picker-ZmfhFTO6.js} +1 -1
  95. package/dist/client/assets/{hooks-DgSrpwcx.js → hooks-BUt6AoQh.js} +6 -6
  96. package/dist/client/assets/{import-from-deco-dialog-IZXHkaJ2.js → import-from-deco-dialog-DZhtwoRn.js} +1 -1
  97. package/dist/client/assets/{index-CshxsRNd.js → index-BBTFoidO.js} +1 -1
  98. package/dist/client/assets/{index-CABmrUBB.js → index-BPD9Iyv5.js} +1 -1
  99. package/dist/client/assets/index-BcXb7VeZ.css +1 -0
  100. package/dist/client/assets/index-CAV1BNai.js +173 -0
  101. package/dist/client/assets/{index-BFW_K0gJ.js → index-CL3KBg-D.js} +1 -1
  102. package/dist/client/assets/{index-5MyNR89x.js → index-CXy6rN6i.js} +3 -3
  103. package/dist/client/assets/{index-Cxp4ZtBG.js → index-CjKis1yy.js} +1 -1
  104. package/dist/client/assets/{index-BD4HYlEX.js → index-Cod7u1PQ.js} +1 -1
  105. package/dist/client/assets/{index-BWMRVcd2.js → index-CpgVJVWB.js} +27 -27
  106. package/dist/client/assets/{index-BgPTCVWL.js → index-DCwPnlYH.js} +1 -1
  107. package/dist/client/assets/index-DKs6HTlj.js +1 -0
  108. package/dist/client/assets/{index-BQIJkmZH.js → index-Db3cPjnW.js} +2 -2
  109. package/dist/client/assets/index-DvDkdoxH.js +1 -0
  110. package/dist/client/assets/{index-CO_UO0dQ.js → index-NJ9aYDVC.js} +1 -1
  111. package/dist/client/assets/{index-5XIJtJJp.js → index-VkScKLdP.js} +1 -1
  112. package/dist/client/assets/{index-redirect-Clw5irxr.js → index-redirect-B6MtHNAq.js} +1 -1
  113. package/dist/client/assets/{input-D9aeO8wK.js → input-BlhkemhH.js} +1 -1
  114. package/dist/client/assets/{integration-icon-CMGCCNyJ.js → integration-icon-BSHD1Ijr.js} +1 -1
  115. package/dist/client/assets/{label-Bj7qsNrz.js → label-CL8Vh65B.js} +1 -1
  116. package/dist/client/assets/{login-BF7DsD8r.js → login-B4UwjrwL.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-DEfvhjPc.js → mcp-oauth-CXj7zg3h.js} +1 -1
  118. package/dist/client/assets/{members-5GqN16xx.js → members-CZJJNFCT.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-B3KzPr3D.js → monaco-editor-DBScTPL_.js} +2 -2
  120. package/dist/client/assets/{monitoring-stats-row-B6byJzyf.js → monitoring-stats-row-DS-oLjL7.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-xYG2bhs8.js → oauth-callback-DmaJ1bda.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-DGwgTWgk.js → oauth-callback-ai-provider-BQMnSXh3.js} +1 -1
  123. package/dist/client/assets/{onboarding-CnEfKMnB.js → onboarding-Byb6DxyK.js} +1 -1
  124. package/dist/client/assets/{org-install-DfRej3K2.js → org-install-DE37K5KN.js} +1 -1
  125. package/dist/client/assets/{org-layout-Bc9Glt8J.js → org-layout-des0Y5a9.js} +1 -1
  126. package/dist/client/assets/{organization-choice-DGTNMrAe.js → organization-choice-COkZ5W_o.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-CcZ53r1B.js → page-seo-form-BcrUATEU.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-D1Z6hzyV.js +1 -0
  129. package/dist/client/assets/popover-SD8gnUXm.js +1 -0
  130. package/dist/client/assets/post-editor-BDlfII0z.js +1 -0
  131. package/dist/client/assets/{primitives-CAIbeS4G.js → primitives-CVsZF3ex.js} +1 -1
  132. package/dist/client/assets/{profile-BF9HkmK_.js → profile-DBUkydtR.js} +1 -1
  133. package/dist/client/assets/project-app-view-Bk8oTYIF.js +1 -0
  134. package/dist/client/assets/record-editor-DL8IQ3xy.js +1 -0
  135. package/dist/client/assets/registry-Bd0JPSYO.js +2 -0
  136. package/dist/client/assets/{registry-layout-CRS0SBoX.js → registry-layout-BL9jjFNp.js} +1 -1
  137. package/dist/client/assets/{require-capability-BclGG3Lq.js → require-capability-CLQ4GBGj.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-CZqB7vUr.js → required-auth-layout-BzYoSj-D.js} +1 -1
  139. package/dist/client/assets/{reset-password-CKTIPX2L.js → reset-password-C3Zmx-Z-.js} +1 -1
  140. package/dist/client/assets/roles-RwbAlbhC.js +1 -0
  141. package/dist/client/assets/{scroll-area-DLqMfi_N.js → scroll-area-DgIklajW.js} +54 -54
  142. package/dist/client/assets/{search-input-BXzntIcj.js → search-input-BwHA7yOt.js} +1 -1
  143. package/dist/client/assets/{secrets-D5X-Z3Mv.js → secrets-Cu_Gp7gT.js} +1 -1
  144. package/dist/client/assets/{sections-editor-jc7NLaYJ.js → sections-editor-CaNl1tLu.js} +2 -2
  145. package/dist/client/assets/select-DM3pFFAV.js +1 -0
  146. package/dist/client/assets/{select-model-BLeb_gwV.js → select-model-C1odlJ1X.js} +1 -1
  147. package/dist/client/assets/seo-editor-C28ZayGa.js +1 -0
  148. package/dist/client/assets/settings-layout-C_nc5y3_.js +1 -0
  149. package/dist/client/assets/{settings-section-Br7JxQz6.js → settings-section-6b9w_VoZ.js} +1 -1
  150. package/dist/client/assets/{sheet-M6dgbK60.js → sheet-BJF6qruz.js} +1 -1
  151. package/dist/client/assets/shell-controls-C9tE75mS.js +1 -0
  152. package/dist/client/assets/{shell-layout-CnTaR8UN.js → shell-layout-gi6XYvgE.js} +1 -1
  153. package/dist/client/assets/shell-route-loading-Agan4lHM.js +1 -0
  154. package/dist/client/assets/{sidebar-oYab2QX7.js → sidebar-BD77ZDQ1.js} +1 -1
  155. package/dist/client/assets/{skeleton-DoPnd-4p.js → skeleton-CuVDGSZE.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-D8GIYMew.js → sortable.esm-DpWg8tde.js} +2 -2
  157. package/dist/client/assets/{sso-C9l3tEYi.js → sso-B9XBpXX9.js} +1 -1
  158. package/dist/client/assets/{store-DXXRJ_VG.js → store-Il1Qjdpz.js} +1 -1
  159. package/dist/client/assets/store-registry-BN4Ygwm2.js +2 -0
  160. package/dist/client/assets/{studio-tools-4NjxmaVZ.js → studio-tools-C-Eel15b.js} +1 -1
  161. package/dist/client/assets/{switch-DLNzAYS1.js → switch-DWXEjjcR.js} +1 -1
  162. package/dist/client/assets/{tab-id-BptcWVWa.js → tab-id-AX1D_RMI.js} +1 -1
  163. package/dist/client/assets/{table-B06cGuvx.js → table-sXVKQ5vt.js} +1 -1
  164. package/dist/client/assets/{tabs-8VxbUDVb.js → tabs-BeXAqCdo.js} +1 -1
  165. package/dist/client/assets/{task-status-Cm29b2AK.js → task-status-CaQuE65s.js} +1 -1
  166. package/dist/client/assets/{textarea-Bwn2Wdf8.js → textarea-C30KYfio.js} +1 -1
  167. package/dist/client/assets/{toggle-group-CndOAl-N.js → toggle-group-B6oTaI1f.js} +1 -1
  168. package/dist/client/assets/toolbar-DuZrnshW.js +1 -0
  169. package/dist/client/assets/toolbar-icon-button-CG8gWMNZ.js +1 -0
  170. package/dist/client/assets/{tools-list-DL7ip2gg.js → tools-list-BSe55AC9.js} +1 -1
  171. package/dist/client/assets/tooltip-BRQCINXK.js +1 -0
  172. package/dist/client/assets/{types-U3TqUYrY.js → types-ywta9rZ4.js} +4 -4
  173. package/dist/client/assets/{use-ai-providers-D4m0Vu5Q.js → use-ai-providers-CpUPA2Pj.js} +1 -1
  174. package/dist/client/assets/{use-automations-ChKoVegP.js → use-automations-BSn8_z4p.js} +1 -1
  175. package/dist/client/assets/{use-capability-CQPMPR-5.js → use-capability-AkUZCu97.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-CJO5qoT7.js → use-clock-tick-7J301cSN.js} +1 -1
  177. package/dist/client/assets/{use-collections-DAKL2YGx.js → use-collections-BhzLncHB.js} +1 -1
  178. package/dist/client/assets/{use-connection-BvgL1-Da.js → use-connection-CSQdDXlG.js} +1 -1
  179. package/dist/client/assets/{use-copy-WaepYGtr.js → use-copy-3aLRhzTZ.js} +1 -1
  180. package/dist/client/assets/use-create-virtual-mcp-ClyuqzV0.js +1 -0
  181. package/dist/client/assets/{use-debounced-autosave-mA5Fw-09.js → use-debounced-autosave-DwyO4Yri.js} +1 -1
  182. package/dist/client/assets/{use-debounced-value-cQ7ZQKtl.js → use-debounced-value-BGsbVLHA.js} +1 -1
  183. package/dist/client/assets/{use-decopilot-events-BDkaUhLT.js → use-decopilot-events-B8-U5_6h.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-B9XKLaZf.js → use-delete-connection-yP5RphYi.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-Dfeoim5G.js → use-file-configs-XF2AvMPs.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-4tV6tFjB.js → use-infinite-scroll-CkXtceVR.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-CdAJlpjO.js → use-join-requests-mfteqXVe.js} +1 -1
  188. package/dist/client/assets/{use-mcp-client-CherrXvD.js → use-mcp-client-CRWIqSWI.js} +1 -1
  189. package/dist/client/assets/{use-mcp-prompts-BnOdccbh.js → use-mcp-prompts-BV9cBymv.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-w6KwNDra.js → use-mcp-tools-Dgj65Z69.js} +1 -1
  191. package/dist/client/assets/{use-members-ge80zFlj.js → use-members-BZOJ4ncQ.js} +1 -1
  192. package/dist/client/assets/{use-mobile-lIIxFH5C.js → use-mobile-DgvzRDzB.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-BtVHPn7N.js → use-navigate-to-agent-DTqeD3lq.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-Ctxe3HXF.js → use-org-auth-client-Dx974y4u.js} +1 -1
  195. package/dist/client/assets/{use-org-fs-D-40uH2W.js → use-org-fs-DI1Q1Ycz.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-BxzKK5rO.js → use-org-sso-kfQLtl8D.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-DmQYT9Pn.js → use-organization-roles-B2GmBYYT.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-CZfEdu0P.js → use-organization-settings-ClL7mSbK.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-C_VqH6te.js → use-registry-connections-DzyhBLO8.js} +1 -1
  200. package/dist/client/assets/{use-secrets-Dn4coT0R.js → use-secrets-BX0N_3N-.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-CWHPQWBO.js → use-status-sounds-BsVH7G2F.js} +1 -1
  202. package/dist/client/assets/{use-view-mode--ERDyrf1.js → use-view-mode-D4v-Vh_n.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-C5pbd140.js → use-virtual-mcp-7AWl-thI.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-DbI8AV-k.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-DT-JxV4F.js +1 -0
  206. package/dist/client/assets/{useSuspenseQueries-CRdXyKYB.js → useSuspenseQueries-D4Gfj0Tf.js} +1 -1
  207. package/dist/client/assets/variant-calendar-C9mxKuI5.js +1 -0
  208. package/dist/client/assets/{view-mode-toggle-BP4LoXpd.js → view-mode-toggle-Dcs21C2T.js} +1 -1
  209. package/dist/client/index.html +2 -2
  210. package/dist/server/cli.js +2 -2
  211. package/dist/server/server.js +1 -1
  212. package/package.json +1 -1
  213. package/dist/client/assets/ChevronLeft-B-p3uhTp.js +0 -1
  214. package/dist/client/assets/agent-icon-CCm6veEh.js +0 -1
  215. package/dist/client/assets/agents-list-CsmaOmeB.js +0 -1
  216. package/dist/client/assets/app-editor-D5hlOetk.js +0 -1
  217. package/dist/client/assets/automation-runs-CXnAhWiY.js +0 -1
  218. package/dist/client/assets/automations-akz_oClO.js +0 -1
  219. package/dist/client/assets/bulk-category-panel-Bu7vkdyV.js +0 -1
  220. package/dist/client/assets/category-editor-AxaHD2PX.js +0 -1
  221. package/dist/client/assets/collection-detail-DEEAX0DE.js +0 -1
  222. package/dist/client/assets/commerce-onboarding-CljjzqU2.js +0 -1
  223. package/dist/client/assets/connection-detail-Dt-8hGUD.js +0 -1
  224. package/dist/client/assets/connections-D2zRczhs.js +0 -1
  225. package/dist/client/assets/file-explorer-dyfhIxpy.js +0 -2
  226. package/dist/client/assets/index-BqKQnks_.css +0 -1
  227. package/dist/client/assets/index-BvxT8QID.js +0 -1
  228. package/dist/client/assets/index-CU_03aq0.js +0 -1
  229. package/dist/client/assets/index-Db0TT11B.js +0 -169
  230. package/dist/client/assets/page-seo-sheet-D8FULk67.js +0 -1
  231. package/dist/client/assets/popover-DowpnV25.js +0 -1
  232. package/dist/client/assets/post-editor-SVRg54TN.js +0 -1
  233. package/dist/client/assets/preview-dialog-CwTtT7qa.js +0 -5
  234. package/dist/client/assets/project-app-view-BQ4gYl-m.js +0 -1
  235. package/dist/client/assets/record-editor-BNOUgLnP.js +0 -1
  236. package/dist/client/assets/registry-Bo4vnNv4.js +0 -2
  237. package/dist/client/assets/roles-DTMTF-Ml.js +0 -1
  238. package/dist/client/assets/select-CZgnwyj0.js +0 -1
  239. package/dist/client/assets/seo-editor-BCj_Owpk.js +0 -1
  240. package/dist/client/assets/settings-layout-QQo5fqWD.js +0 -1
  241. package/dist/client/assets/shell-controls-CqC5zeBM.js +0 -1
  242. package/dist/client/assets/shell-route-loading-DFu6UBUI.js +0 -1
  243. package/dist/client/assets/store-registry-DuMrJjAm.js +0 -2
  244. package/dist/client/assets/toolbar-ClL4Dhs_.js +0 -1
  245. package/dist/client/assets/tooltip-DvT2WKW9.js +0 -1
  246. package/dist/client/assets/use-create-virtual-mcp-BSTwTG_J.js +0 -1
  247. package/dist/client/assets/useInfiniteQuery-_sl5B1oR.js +0 -1
  248. package/dist/client/assets/useSuspenseInfiniteQuery-_eC9d3ii.js +0 -1
  249. package/dist/client/assets/variant-calendar-Dqcgu1C1.js +0 -1
@@ -1 +0,0 @@
1
- import{c as se,j as s,B as Z,D as me,r as Y,v,t as de}from"./index-5MyNR89x.js";import{c as k,b as ne,a as ee,D as te}from"./dropdown-menu-Dw-pnYXI.js";import{s as pe}from"./Star01-BMttIRxb.js";import{a as fe}from"./Users03-DBa0-LbB.js";import{a as ge,G as ue}from"./github-repo-picker-M1TBbLot.js";import{S as he,u as xe,H as ie,W as oe,I as je}from"./import-from-deco-dialog-IZXHkaJ2.js";import{u as _e,b as Ce,c as be}from"./use-virtual-mcp-C5pbd140.js";import{P as K}from"./index-CshxsRNd.js";import{i as ye}from"./DotsVertical-DskMPw9G.js";import{a as Ne}from"./Settings02-CuT9JazG.js";import{s as Se}from"./Trash01-CGEeRKCz.js";import{A as De,ax as ve}from"./agent-icon-CCm6veEh.js";import{m as Ae}from"./use-navigate-to-agent-BtVHPn7N.js";import{C as ke}from"./card-D3bKVB8y.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as we}from"./use-capability-CQPMPR-5.js";import{E as Te}from"./empty-state-D7nJB9UW.js";import{u as ze}from"./use-create-virtual-mcp-BSTwTG_J.js";import{c as Ie,b as Pe,d as He,A as Ee,e as Me,g as Oe,a as Be,f as Ge}from"./alert-dialog-BZ8TrIVu.js";import{S as $e}from"./search-input-BXzntIcj.js";import{s as le}from"./Plus-hFZ_SbzL.js";import"./ChevronUp-CtzC0jb0.js";import"./ChevronRight-BhZIqa2P.js";import"./dialog-B2cGEuOv.js";import"./X-DlUiLOPC.js";import"./checkbox-PMXW46HN.js";import"./collection-search-CN9TCItb.js";import"./SearchMd-RBoojwOu.js";import"./use-debounced-value-cQ7ZQKtl.js";import"./use-connection-BvgL1-Da.js";import"./use-collections-DAKL2YGx.js";import"./use-mcp-client-CherrXvD.js";import"./auth-CNqDC7uO.js";import"./authenticate-and-persist-oauth-Dy2XeMqO.js";import"./mcp-oauth-DEfvhjPc.js";import"./use-mcp-tools-w6KwNDra.js";import"./extract-connection-data-CxK1dunT.js";import"./github-installations-DzN1UQ4x.js";import"./sidebar-oYab2QX7.js";import"./LayoutLeft-DiQ60pSu.js";import"./use-mobile-lIIxFH5C.js";import"./sheet-M6dgbK60.js";import"./tooltip-DvT2WKW9.js";import"./AlertCircle-B4WPpzHx.js";import"./Tool01-DFCFgRlB.js";import"./SwitchHorizontal01-BcqnyefE.js";import"./XCircle-BIxZfFEg.js";import"./ArrowUpRight-n7J2ORua.js";import"./ZapSquare-qeizwUPq.js";import"./CheckCircle-DGqDWZvl.js";import"./ChevronDown-BzkFMF52.js";import"./ChevronLeft-B-p3uhTp.js";import"./Stars02-Call5O4Q.js";import"./Eye-Bkw15G1G.js";import"./ZoomOut-fkR_2hFy.js";import"./Globe01-CIvUZBh0.js";import"./FilterLines-CTiCp3St.js";import"./Globe04-By_qGXm-.js";import"./HardDrive-Da-ea-EW.js";import"./Key01-DugFMT5_.js";import"./LinkExternal01-BMDEbMBF.js";import"./Monitor01-BFD-ivVa.js";import"./Sun-B0JI-Irq.js";import"./Palette-DrmZY9bB.js";import"./Play-CiiKZLoa.js";import"./SearchLg-D4Hs4YLQ.js";import"./Shield01-D5Fc_Ylv.js";import"./Stars01-HANlppqn.js";import"./Upload01-V0qkIpRk.js";import"./User01-Co_ACiCO.js";import"./Users01-B-VpMOmx.js";import"./XClose-CEJj7vhn.js";import"./Zap-USVmT42t.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(k,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(k,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:he,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(k,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ge,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(k,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(k,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(k,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(k,{variant:"destructive",onClick:w=>{w.stopPropagation(),l(w)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function cs(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=xe(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=we("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=K,A=K,w=K;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(K.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const q=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==w.Body||t[19]!==I||t[20]!==q?(P=s.jsxs(w.Body,{children:[I,q,J]}),t[17]=J,t[18]=w.Body,t[19]=I,t[20]=q,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(ue,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{cs as default};
@@ -1 +0,0 @@
1
- import{c as ge,r as w,j as o,l as ye,t as ue,i as Se}from"./index-5MyNR89x.js";import{i as je}from"./ChevronRight-BhZIqa2P.js";import{S as ke}from"./scroll-area-DLqMfi_N.js";import{A as _e}from"./add-section-modal-JApa7Z44.js";import{ap as Be,aq as we,ar as Ae,j as Ne,k as Re,as as Ce,Y as Ee,at as Ke,ac as Te}from"./index-BWMRVcd2.js";import"./agent-icon-CCm6veEh.js";import"./AlertCircle-B4WPpzHx.js";import"./Tool01-DFCFgRlB.js";import"./SwitchHorizontal01-BcqnyefE.js";import"./Settings02-CuT9JazG.js";import"./XCircle-BIxZfFEg.js";import"./ArrowUpRight-n7J2ORua.js";import"./ZapSquare-qeizwUPq.js";import"./Users03-DBa0-LbB.js";import"./CheckCircle-DGqDWZvl.js";import"./ChevronUp-CtzC0jb0.js";import"./ChevronDown-BzkFMF52.js";import"./ChevronLeft-B-p3uhTp.js";import"./DotsVertical-DskMPw9G.js";import"./Stars02-Call5O4Q.js";import"./Eye-Bkw15G1G.js";import"./ZoomOut-fkR_2hFy.js";import"./Globe01-CIvUZBh0.js";import"./FilterLines-CTiCp3St.js";import"./Star01-BMttIRxb.js";import"./Globe04-By_qGXm-.js";import"./HardDrive-Da-ea-EW.js";import"./Key01-DugFMT5_.js";import"./LayoutLeft-DiQ60pSu.js";import"./LinkExternal01-BMDEbMBF.js";import"./Monitor01-BFD-ivVa.js";import"./Sun-B0JI-Irq.js";import"./Palette-DrmZY9bB.js";import"./Play-CiiKZLoa.js";import"./Plus-hFZ_SbzL.js";import"./SearchLg-D4Hs4YLQ.js";import"./SearchMd-RBoojwOu.js";import"./Shield01-D5Fc_Ylv.js";import"./Stars01-HANlppqn.js";import"./Trash01-CGEeRKCz.js";import"./Upload01-V0qkIpRk.js";import"./User01-Co_ACiCO.js";import"./Users01-B-VpMOmx.js";import"./XClose-CEJj7vhn.js";import"./X-DlUiLOPC.js";import"./Zap-USVmT42t.js";import"./use-clock-tick-CJO5qoT7.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-WaepYGtr.js";import"./tooltip-DvT2WKW9.js";import"./file-type-icon-W_AZRfzL.js";import"./dialog-B2cGEuOv.js";import"./use-mobile-lIIxFH5C.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-U3TqUYrY.js";import"./use-mcp-client-CherrXvD.js";import"./auth-CNqDC7uO.js";import"./chat-context-B5uEh4ay.js";import"./hooks-DgSrpwcx.js";import"./decopilot-sse-pool-DoJkdYBA.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-C5pbd140.js";import"./use-collections-DAKL2YGx.js";import"./use-ai-providers-D4m0Vu5Q.js";import"./studio-tools-4NjxmaVZ.js";import"./use-decopilot-events-BDkaUhLT.js";import"./use-organization-settings-CZfEdu0P.js";import"./shell-layout-CnTaR8UN.js";import"./avatar-Jhd31ejW.js";import"./required-auth-layout-CZqB7vUr.js";import"./use-org-sso-BxzKK5rO.js";import"./sheet-M6dgbK60.js";import"./integration-icon-CMGCCNyJ.js";import"./use-navigate-to-agent-BtVHPn7N.js";import"./use-connection-BvgL1-Da.js";import"./use-mcp-prompts-BnOdccbh.js";import"./form-DI8q6OtF.js";import"./label-Bj7qsNrz.js";import"./input-D9aeO8wK.js";import"./select-CZgnwyj0.js";import"./index-BFW_K0gJ.js";import"./drawer-Tv6bcT7w.js";import"./collection-search-CN9TCItb.js";import"./tabs-8VxbUDVb.js";import"./toggle-group-CndOAl-N.js";import"./sortable.esm-D8GIYMew.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BswtsnGE.js";import"./use-registry-connections-C_VqH6te.js";import"./useInfiniteQuery-_sl5B1oR.js";import"./use-infinite-scroll-4tV6tFjB.js";import"./extract-connection-data-CxK1dunT.js";import"./card-D3bKVB8y.js";import"./collection-tabs-D5o6VjHd.js";import"./badge-cxwmW2xd.js";import"./textarea-Bwn2Wdf8.js";import"./connection-form-helpers-JfkHcTGO.js";import"./authenticate-and-persist-oauth-Dy2XeMqO.js";import"./mcp-oauth-DEfvhjPc.js";import"./useSuspenseInfiniteQuery-_eC9d3ii.js";import"./connect-desktop-dialog-DchtPbuP.js";import"./decopilot-CfDwLIyX.js";import"./checkbox-PMXW46HN.js";import"./skeleton-DoPnd-4p.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Br7JxQz6.js";import"./popover-DowpnV25.js";import"./command-D-t5bmXW.js";import"./index-BD4HYlEX.js";import"./use-org-fs-D-40uH2W.js";import"./dropdown-menu-Dw-pnYXI.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CWHPQWBO.js";import"./empty-state-D7nJB9UW.js";import"./toolbar-ClL4Dhs_.js";import"./preview-dialog-CwTtT7qa.js";import"./index-BgPTCVWL.js";import"./use-mcp-tools-w6KwNDra.js";import"./use-capability-CQPMPR-5.js";import"./shell-route-loading-DFu6UBUI.js";import"./tools-list-DL7ip2gg.js";import"./alert-dialog-BZ8TrIVu.js";import"./switch-DLNzAYS1.js";import"./use-debounced-autosave-mA5Fw-09.js";import"./index-CshxsRNd.js";import"./sidebar-oYab2QX7.js";import"./search-input-BXzntIcj.js";import"./github-repo-picker-M1TBbLot.js";import"./use-debounced-value-cQ7ZQKtl.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-Dn4coT0R.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./automation-runs-CXnAhWiY.js";import"./table-B06cGuvx.js";import"./use-members-ge80zFlj.js";import"./use-org-auth-client-Ctxe3HXF.js";import"./task-status-Cm29b2AK.js";import"./use-automations-ChKoVegP.js";import"./use-file-configs-Dfeoim5G.js";import"./monaco-editor-B3KzPr3D.js";import"./select-model-BLeb_gwV.js";import"./automation-list-row-DO51bU3z.js";function $e(l,e){const m=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function yr(l){const e=ge.c(77),{orgSlug:m,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:s,decofile:c,title:D,excludeFields:H,schemaPending:ae,previewBaseUrl:ne}=l,Y=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;e[0]!==H||e[1]!==s||e[2]!==x?(R=we(x,s,H),e[0]=H,e[1]=s,e[2]=x,e[3]=R):R=e[3];const h=R;let C;e[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=C):C=e[5];const G=C;let E;e[6]!==n||e[7]!==i||e[8]!==s||e[9]!==D?(E=D??(n?Ae(i,n,s):i),e[6]=n,e[7]=i,e[8]=s,e[9]=D,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==m||e[13]!==f?(K={orgSlug:m,virtualMcpId:f,branch:a},e[11]=a,e[12]=m,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:J,isPending:Q}=Ne(K);let T;e[15]!==a||e[16]!==m||e[17]!==f?(T={orgSlug:m,virtualMcpId:f,branch:a},e[15]=a,e[16]=m,e[17]=f,e[18]=T):T=e[18];const W=Re(T);let $;e[19]!==b?($=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=$):$=e[20];const X=$,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[21]=F):F=e[21];const[p,fe]=w.useState(F),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let g;e[24]!==ee?(g=ee??{},e[24]=ee,e[25]=g):g=e[25];let q;e[26]!==ie||e[27]!==g?(q={...ie,...g},e[26]=ie,e[27]=g,e[28]=q):q=e[28];const se=q;let z;e[29]!==i||e[30]!==x||e[31]!==b?(z=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=z):z=e[32];const me=z;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t=>{fe(t)},e[33]=L):L=e[33];const pe=L;let V;e[34]!==c||e[35]!==J||e[36]!==W?(V=async(t,r)=>{try{const{blockKey:d,data:N}=$e(t,c);await W.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),J()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=J,e[36]=W,e[37]=V):V=e[37];const y=V;let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=t=>{P.current=t.append,re(!0)},e[38]=I):I=e[38];const ve=I;let U;e[39]!==y?(U=async t=>{const r=P.current;if(r)try{await y(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=y,e[40]=U):U=e[40];const le=U;let M;e[41]!==p||e[42]!==v?(M=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=M):M=e[43];const A=M;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Ce(p,r)),de(Fe)},title:t,className:ye("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let j;e[48]!==Q?(j=o.jsx(Ke,{isPending:Q,isError:!1}),e[48]=Q,e[49]=j):j=e[49];let k;e[50]!==S||e[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),e[50]=S,e[51]=j,e[52]=k):k=e[52];let _;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==se||e[57]!==te||e[58]!==y||e[59]!==me||e[60]!==G||e[61]!==s||e[62]!==u||e[63]!==X||e[64]!==h||e[65]!==Y?(_=o.jsx(ke,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:G?o.jsx(Te,{schema:h,value:se,onChange:me,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:s,onSaveReferencedBlock:X,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:ve},`${i}:${te}`):Y?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=se,e[57]=te,e[58]=y,e[59]=me,e[60]=G,e[61]=s,e[62]=u,e[63]=X,e[64]=h,e[65]=Y,e[66]=_):_=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==s||e[71]!==u?(B=u&&o.jsx(_e,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:s,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=s,e[71]=u,e[72]=B):B=e[72];let Z;return e[73]!==k||e[74]!==_||e[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),e[73]=k,e[74]=_,e[75]=B,e[76]=Z):Z=e[76],Z}function Fe(l){return l+1}function Pe(l){return l+1}export{yr as AppEditor};
@@ -1 +0,0 @@
1
- import{r as F,j as s,c as le,l as ye,bM as Wt,B as Fe,K as Ee,k as Gt,E as Sn,D as Cn}from"./index-5MyNR89x.js";import{n as Pn}from"./ChevronLeft-B-p3uhTp.js";import{i as On}from"./ChevronRight-BhZIqa2P.js";import{u as Qt}from"./useInfiniteQuery-_sl5B1oR.js";import{u as Tn}from"./use-connection-BvgL1-Da.js";import{i as In,a as Wn,S as Fn,u as En}from"./use-mcp-client-CherrXvD.js";import{u as Ln}from"./use-virtual-mcp-C5pbd140.js";import{C as Rn}from"./card-D3bKVB8y.js";import{c as Kt,d as Xt,S as Yn,b as An}from"./sheet-M6dgbK60.js";import{c as Jt,d as Zt,a as Qe,e as fe,b as en,T as me}from"./table-B06cGuvx.js";import{E as st}from"./empty-state-D7nJB9UW.js";import{u as mt}from"./use-infinite-scroll-4tV6tFjB.js";import{u as Bn}from"./use-members-ge80zFlj.js";import{S as Oe}from"./task-status-Cm29b2AK.js";import{e as Hn}from"./use-automations-ChKoVegP.js";import{u as $n}from"./studio-tools-4NjxmaVZ.js";import{u as qn}from"./useSuspenseInfiniteQuery-_eC9d3ii.js";import{B as Ue}from"./badge-cxwmW2xd.js";import{b as Vn,c as Un,S as zn,a as $e,d as Gn}from"./select-CZgnwyj0.js";import{C as Ft}from"./checkbox-PMXW46HN.js";import{t as Le}from"./ChevronDown-BzkFMF52.js";import{b as Qn,C as Kn,a as Et,c as Xn,e as Jn,d as Zn}from"./command-D-t5bmXW.js";import{a as tn,b as nn,P as an}from"./popover-DowpnV25.js";import{A as rn}from"./avatar-Jhd31ejW.js";import{n as ot}from"./ChevronUp-CtzC0jb0.js";import{n as ht}from"./XCircle-BIxZfFEg.js";import{i as ea}from"./FilterLines-CTiCp3St.js";import{B as ta,J as na}from"./scroll-area-DLqMfi_N.js";import{I as vt}from"./integration-icon-CMGCCNyJ.js";function E(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function ie(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function te(t,e){const n=E(t);return isNaN(e)?ie(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function xe(t,e){const n=E(t);if(isNaN(e))return ie(t,NaN);if(!e)return n;const a=n.getDate(),r=ie(t,n.getTime());r.setMonth(n.getMonth()+e+1,0);const o=r.getDate();return a>=o?r:(n.setFullYear(r.getFullYear(),r.getMonth(),a),n)}const gt=6048e5,aa=864e5;let ra={};function Ye(){return ra}function we(t,e){const n=Ye(),a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=E(t),o=r.getDay(),i=(o<a?7:0)+o-a;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function De(t){return we(t,{weekStartsOn:1})}function sn(t){const e=E(t),n=e.getFullYear(),a=ie(t,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const r=De(a),o=ie(t,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const i=De(o);return e.getTime()>=r.getTime()?n+1:e.getTime()>=i.getTime()?n:n-1}function Te(t){const e=E(t);return e.setHours(0,0,0,0),e}function ze(t){const e=E(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function be(t,e){const n=Te(t),a=Te(e),r=+n-ze(n),o=+a-ze(a);return Math.round((r-o)/aa)}function sa(t){const e=sn(t),n=ie(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),De(n)}function it(t,e){const n=e*7;return te(t,n)}function oa(t,e){return xe(t,e*12)}function ia(t){let e;return t.forEach(function(n){const a=E(n);(e===void 0||e<a||isNaN(Number(a)))&&(e=a)}),e||new Date(NaN)}function la(t){let e;return t.forEach(n=>{const a=E(n);(!e||e>a||isNaN(+a))&&(e=a)}),e||new Date(NaN)}function ne(t,e){const n=Te(t),a=Te(e);return+n==+a}function xt(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function ca(t){if(!xt(t)&&typeof t!="number")return!1;const e=E(t);return!isNaN(Number(e))}function Re(t,e){const n=E(t),a=E(e),r=n.getFullYear()-a.getFullYear(),o=n.getMonth()-a.getMonth();return r*12+o}function da(t,e,n){const a=we(t,n),r=we(e,n),o=+a-ze(a),i=+r-ze(r);return Math.round((o-i)/gt)}function pt(t){const e=E(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function ae(t){const e=E(t);return e.setDate(1),e.setHours(0,0,0,0),e}function on(t){const e=E(t),n=ie(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function yt(t,e){const n=Ye(),a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=E(t),o=r.getDay(),i=(o<a?-7:0)+6-(o-a);return r.setDate(r.getDate()+i),r.setHours(23,59,59,999),r}function ln(t){return yt(t,{weekStartsOn:1})}const ua={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},fa=(t,e,n)=>{let a;const r=ua[t];return typeof r=="string"?a=r:e===1?a=r.one:a=r.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function Je(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const ma={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ha={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},va={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ga={date:Je({formats:ma,defaultWidth:"full"}),time:Je({formats:ha,defaultWidth:"full"}),dateTime:Je({formats:va,defaultWidth:"full"})},xa={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pa=(t,e,n,a)=>xa[t];function Ie(t){return(e,n)=>{const a=n?.context?String(n.context):"standalone";let r;if(a==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=n?.width?String(n.width):i;r=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=n?.width?String(n.width):t.defaultWidth;r=t.values[l]||t.values[i]}const o=t.argumentCallback?t.argumentCallback(e):e;return r[o]}}const ya={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ba={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wa={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Na={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_a={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ja={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ma=(t,e)=>{const n=Number(t),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ka={ordinalNumber:Ma,era:Ie({values:ya,defaultWidth:"wide"}),quarter:Ie({values:ba,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ie({values:wa,defaultWidth:"wide"}),day:Ie({values:Na,defaultWidth:"wide"}),dayPeriod:Ie({values:_a,defaultWidth:"wide",formattingValues:ja,defaultFormattingWidth:"wide"})};function We(t){return(e,n={})=>{const a=n.width,r=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;const i=o[0],l=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Sa(l,f=>f.test(i)):Da(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(i.length);return{value:d,rest:u}}}function Da(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Sa(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Ca(t){return(e,n={})=>{const a=e.match(t.matchPattern);if(!a)return null;const r=a[0],o=e.match(t.parsePattern);if(!o)return null;let i=t.valueCallback?t.valueCallback(o[0]):o[0];i=n.valueCallback?n.valueCallback(i):i;const l=e.slice(r.length);return{value:i,rest:l}}}const Pa=/^(\d+)(th|st|nd|rd)?/i,Oa=/\d+/i,Ta={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ia={any:[/^b/i,/^(a|c)/i]},Wa={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Fa={any:[/1/i,/2/i,/3/i,/4/i]},Ea={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},La={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ra={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ya={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Aa={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ba={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ha={ordinalNumber:Ca({matchPattern:Pa,parsePattern:Oa,valueCallback:t=>parseInt(t,10)}),era:We({matchPatterns:Ta,defaultMatchWidth:"wide",parsePatterns:Ia,defaultParseWidth:"any"}),quarter:We({matchPatterns:Wa,defaultMatchWidth:"wide",parsePatterns:Fa,defaultParseWidth:"any",valueCallback:t=>t+1}),month:We({matchPatterns:Ea,defaultMatchWidth:"wide",parsePatterns:La,defaultParseWidth:"any"}),day:We({matchPatterns:Ra,defaultMatchWidth:"wide",parsePatterns:Ya,defaultParseWidth:"any"}),dayPeriod:We({matchPatterns:Aa,defaultMatchWidth:"any",parsePatterns:Ba,defaultParseWidth:"any"})},cn={code:"en-US",formatDistance:fa,formatLong:ga,formatRelative:pa,localize:ka,match:Ha,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $a(t){const e=E(t);return be(e,on(e))+1}function dn(t){const e=E(t),n=+De(e)-+sa(e);return Math.round(n/gt)+1}function un(t,e){const n=E(t),a=n.getFullYear(),r=Ye(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=ie(t,0);i.setFullYear(a+1,0,o),i.setHours(0,0,0,0);const l=we(i,e),c=ie(t,0);c.setFullYear(a,0,o),c.setHours(0,0,0,0);const d=we(c,e);return n.getTime()>=l.getTime()?a+1:n.getTime()>=d.getTime()?a:a-1}function qa(t,e){const n=Ye(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=un(t,e),o=ie(t,0);return o.setFullYear(r,0,a),o.setHours(0,0,0,0),we(o,e)}function fn(t,e){const n=E(t),a=+we(n,e)-+qa(n,e);return Math.round(a/gt)+1}function A(t,e){const n=t<0?"-":"",a=Math.abs(t).toString().padStart(e,"0");return n+a}const je={y(t,e){const n=t.getFullYear(),a=n>0?n:1-n;return A(e==="yy"?a%100:a,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):A(n+1,2)},d(t,e){return A(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(t,e){return A(t.getHours()%12||12,e.length)},H(t,e){return A(t.getHours(),e.length)},m(t,e){return A(t.getMinutes(),e.length)},s(t,e){return A(t.getSeconds(),e.length)},S(t,e){const n=e.length,a=t.getMilliseconds(),r=Math.trunc(a*Math.pow(10,n-3));return A(r,e.length)}},Pe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Lt={G:function(t,e,n){const a=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});default:return n.era(a,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const a=t.getFullYear(),r=a>0?a:1-a;return n.ordinalNumber(r,{unit:"year"})}return je.y(t,e)},Y:function(t,e,n,a){const r=un(t,a),o=r>0?r:1-r;if(e==="YY"){const i=o%100;return A(i,2)}return e==="Yo"?n.ordinalNumber(o,{unit:"year"}):A(o,e.length)},R:function(t,e){const n=sn(t);return A(n,e.length)},u:function(t,e){const n=t.getFullYear();return A(n,e.length)},Q:function(t,e,n){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(a);case"QQ":return A(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,e,n){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(a);case"qq":return A(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,e,n){const a=t.getMonth();switch(e){case"M":case"MM":return je.M(t,e);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(t,e,n){const a=t.getMonth();switch(e){case"L":return String(a+1);case"LL":return A(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(t,e,n,a){const r=fn(t,a);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):A(r,e.length)},I:function(t,e,n){const a=dn(t);return e==="Io"?n.ordinalNumber(a,{unit:"week"}):A(a,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):je.d(t,e)},D:function(t,e,n){const a=$a(t);return e==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):A(a,e.length)},E:function(t,e,n){const a=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(t,e,n,a){const r=t.getDay(),o=(r-a.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return A(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,a){const r=t.getDay(),o=(r-a.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return A(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const a=t.getDay(),r=a===0?7:a;switch(e){case"i":return String(r);case"ii":return A(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const a=t.getHours();let r;switch(a===12?r=Pe.noon:a===0?r=Pe.midnight:r=a/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const a=t.getHours();let r;switch(a>=17?r=Pe.evening:a>=12?r=Pe.afternoon:a>=4?r=Pe.morning:r=Pe.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let a=t.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return je.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):je.H(t,e)},K:function(t,e,n){const a=t.getHours()%12;return e==="Ko"?n.ordinalNumber(a,{unit:"hour"}):A(a,e.length)},k:function(t,e,n){let a=t.getHours();return a===0&&(a=24),e==="ko"?n.ordinalNumber(a,{unit:"hour"}):A(a,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):je.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):je.s(t,e)},S:function(t,e){return je.S(t,e)},X:function(t,e,n){const a=t.getTimezoneOffset();if(a===0)return"Z";switch(e){case"X":return Yt(a);case"XXXX":case"XX":return ke(a);default:return ke(a,":")}},x:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"x":return Yt(a);case"xxxx":case"xx":return ke(a);default:return ke(a,":")}},O:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Rt(a,":");default:return"GMT"+ke(a,":")}},z:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Rt(a,":");default:return"GMT"+ke(a,":")}},t:function(t,e,n){const a=Math.trunc(t.getTime()/1e3);return A(a,e.length)},T:function(t,e,n){const a=t.getTime();return A(a,e.length)}};function Rt(t,e=""){const n=t>0?"-":"+",a=Math.abs(t),r=Math.trunc(a/60),o=a%60;return o===0?n+String(r):n+String(r)+e+A(o,2)}function Yt(t,e){return t%60===0?(t>0?"-":"+")+A(Math.abs(t)/60,2):ke(t,e)}function ke(t,e=""){const n=t>0?"-":"+",a=Math.abs(t),r=A(Math.trunc(a/60),2),o=A(a%60,2);return n+r+e+o}const At=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},mn=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Va=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],a=n[1],r=n[2];if(!r)return At(t,e);let o;switch(a){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",At(a,e)).replace("{{time}}",mn(r,e))},Ua={p:mn,P:Va},za=/^D+$/,Ga=/^Y+$/,Qa=["D","DD","YY","YYYY"];function Ka(t){return za.test(t)}function Xa(t){return Ga.test(t)}function Ja(t,e,n){const a=Za(t,e,n);if(console.warn(a),Qa.includes(t))throw new RangeError(a)}function Za(t,e,n){const a=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const er=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nr=/^'([^]*?)'?$/,ar=/''/g,rr=/[a-zA-Z]/;function Se(t,e,n){const a=Ye(),r=n?.locale??a.locale??cn,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,l=E(t);if(!ca(l))throw new RangeError("Invalid time value");let c=e.match(tr).map(u=>{const f=u[0];if(f==="p"||f==="P"){const m=Ua[f];return m(u,r.formatLong)}return u}).join("").match(er).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const f=u[0];if(f==="'")return{isToken:!1,value:sr(u)};if(Lt[f])return{isToken:!0,value:u};if(f.match(rr))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:u}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:i,locale:r};return c.map(u=>{if(!u.isToken)return u.value;const f=u.value;(!n?.useAdditionalWeekYearTokens&&Xa(f)||!n?.useAdditionalDayOfYearTokens&&Ka(f))&&Ja(f,e,String(t));const m=Lt[f[0]];return m(l,f,r.localize,d)}).join("")}function sr(t){const e=t.match(nr);return e?e[1].replace(ar,"'"):t}function or(t){const e=E(t),n=e.getFullYear(),a=e.getMonth(),r=ie(t,0);return r.setFullYear(n,a+1,0),r.setHours(0,0,0,0),r.getDate()}function ir(t){return Math.trunc(+E(t)/1e3)}function lr(t){const e=E(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function cr(t,e){return da(lr(t),ae(t),e)+1}function lt(t,e){const n=E(t),a=E(e);return n.getTime()>a.getTime()}function hn(t,e){const n=E(t),a=E(e);return+n<+a}function bt(t,e){const n=E(t),a=E(e);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()}function dr(t,e){const n=E(t),a=E(e);return n.getFullYear()===a.getFullYear()}function Ze(t,e){return te(t,-e)}function et(t,e){const n=E(t),a=n.getFullYear(),r=n.getDate(),o=ie(t,0);o.setFullYear(a,e,15),o.setHours(0,0,0,0);const i=or(o);return n.setMonth(e,Math.min(r,i)),n}function Bt(t,e){const n=E(t);return isNaN(+n)?ie(t,NaN):(n.setFullYear(e),n)}var C=function(){return C=Object.assign||function(e){for(var n,a=1,r=arguments.length;a<r;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},C.apply(this,arguments)};function ur(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(t);r<a.length;r++)e.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(t,a[r])&&(n[a[r]]=t[a[r]]);return n}function vn(t,e,n){for(var a=0,r=e.length,o;a<r;a++)(o||!(a in e))&&(o||(o=Array.prototype.slice.call(e,0,a)),o[a]=e[a]);return t.concat(o||Array.prototype.slice.call(e))}function Ae(t){return t.mode==="multiple"}function Be(t){return t.mode==="range"}function Ke(t){return t.mode==="single"}var fr={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function mr(t,e){return Se(t,"LLLL y",e)}function hr(t,e){return Se(t,"d",e)}function vr(t,e){return Se(t,"LLLL",e)}function gr(t){return"".concat(t)}function xr(t,e){return Se(t,"cccccc",e)}function pr(t,e){return Se(t,"yyyy",e)}var yr=Object.freeze({__proto__:null,formatCaption:mr,formatDay:hr,formatMonthCaption:vr,formatWeekNumber:gr,formatWeekdayName:xr,formatYearCaption:pr}),br=function(t,e,n){return Se(t,"do MMMM (EEEE)",n)},wr=function(){return"Month: "},Nr=function(){return"Go to next month"},_r=function(){return"Go to previous month"},jr=function(t,e){return Se(t,"cccc",e)},Mr=function(t){return"Week n. ".concat(t)},kr=function(){return"Year: "},Dr=Object.freeze({__proto__:null,labelDay:br,labelMonthDropdown:wr,labelNext:Nr,labelPrevious:_r,labelWeekNumber:Mr,labelWeekday:jr,labelYearDropdown:kr});function Sr(){var t="buttons",e=fr,n=cn,a={},r={},o=1,i={},l=new Date;return{captionLayout:t,classNames:e,formatters:yr,labels:Dr,locale:n,modifiersClassNames:a,modifiers:r,numberOfMonths:o,styles:i,today:l,mode:"default"}}function Cr(t){var e=t.fromYear,n=t.toYear,a=t.fromMonth,r=t.toMonth,o=t.fromDate,i=t.toDate;return a?o=ae(a):e&&(o=new Date(e,0,1)),r?i=pt(r):n&&(i=new Date(n,11,31)),{fromDate:o?Te(o):void 0,toDate:i?Te(i):void 0}}var gn=F.createContext(void 0);function Pr(t){var e,n=t.initialProps,a=Sr(),r=Cr(n),o=r.fromDate,i=r.toDate,l=(e=n.captionLayout)!==null&&e!==void 0?e:a.captionLayout;l!=="buttons"&&(!o||!i)&&(l="buttons");var c;(Ke(n)||Ae(n)||Be(n))&&(c=n.onSelect);var d=C(C(C({},a),n),{captionLayout:l,classNames:C(C({},a.classNames),n.classNames),components:C({},n.components),formatters:C(C({},a.formatters),n.formatters),fromDate:o,labels:C(C({},a.labels),n.labels),mode:n.mode||a.mode,modifiers:C(C({},a.modifiers),n.modifiers),modifiersClassNames:C(C({},a.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:C(C({},a.styles),n.styles),toDate:i});return s.jsx(gn.Provider,{value:d,children:t.children})}function $(){var t=F.useContext(gn);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function xn(t){var e=$(),n=e.locale,a=e.classNames,r=e.styles,o=e.formatters.formatCaption;return s.jsx("div",{className:a.caption_label,style:r.caption_label,"aria-live":"polite",role:"presentation",id:t.id,children:o(t.displayMonth,{locale:n})})}function Or(t){return s.jsx("svg",C({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},t,{children:s.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function pn(t){var e,n,a=t.onChange,r=t.value,o=t.children,i=t.caption,l=t.className,c=t.style,d=$(),u=(n=(e=d.components)===null||e===void 0?void 0:e.IconDropdown)!==null&&n!==void 0?n:Or;return s.jsxs("div",{className:l,style:c,children:[s.jsx("span",{className:d.classNames.vhidden,children:t["aria-label"]}),s.jsx("select",{name:t.name,"aria-label":t["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:r,onChange:a,children:o}),s.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[i,s.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function Tr(t){var e,n=$(),a=n.fromDate,r=n.toDate,o=n.styles,i=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,d=n.components,u=n.labels.labelMonthDropdown;if(!a)return s.jsx(s.Fragment,{});if(!r)return s.jsx(s.Fragment,{});var f=[];if(dr(a,r))for(var m=ae(a),h=a.getMonth();h<=r.getMonth();h++)f.push(et(m,h));else for(var m=ae(new Date),h=0;h<=11;h++)f.push(et(m,h));var v=function(g){var y=Number(g.target.value),p=et(ae(t.displayMonth),y);t.onChange(p)},x=(e=d?.Dropdown)!==null&&e!==void 0?e:pn;return s.jsx(x,{name:"months","aria-label":u(),className:c.dropdown_month,style:o.dropdown_month,onChange:v,value:t.displayMonth.getMonth(),caption:l(t.displayMonth,{locale:i}),children:f.map(function(g){return s.jsx("option",{value:g.getMonth(),children:l(g,{locale:i})},g.getMonth())})})}function Ir(t){var e,n=t.displayMonth,a=$(),r=a.fromDate,o=a.toDate,i=a.locale,l=a.styles,c=a.classNames,d=a.components,u=a.formatters.formatYearCaption,f=a.labels.labelYearDropdown,m=[];if(!r)return s.jsx(s.Fragment,{});if(!o)return s.jsx(s.Fragment,{});for(var h=r.getFullYear(),v=o.getFullYear(),x=h;x<=v;x++)m.push(Bt(on(new Date),x));var g=function(p){var j=Bt(ae(n),Number(p.target.value));t.onChange(j)},y=(e=d?.Dropdown)!==null&&e!==void 0?e:pn;return s.jsx(y,{name:"years","aria-label":f(),className:c.dropdown_year,style:l.dropdown_year,onChange:g,value:n.getFullYear(),caption:u(n,{locale:i}),children:m.map(function(p){return s.jsx("option",{value:p.getFullYear(),children:u(p,{locale:i})},p.getFullYear())})})}function Wr(t,e){var n=F.useState(t),a=n[0],r=n[1],o=e===void 0?a:e;return[o,r]}function Fr(t){var e=t.month,n=t.defaultMonth,a=t.today,r=e||n||a||new Date,o=t.toDate,i=t.fromDate,l=t.numberOfMonths,c=l===void 0?1:l;if(o&&Re(o,r)<0){var d=-1*(c-1);r=xe(o,d)}return i&&Re(r,i)<0&&(r=i),ae(r)}function Er(){var t=$(),e=Fr(t),n=Wr(e,t.month),a=n[0],r=n[1],o=function(i){var l;if(!t.disableNavigation){var c=ae(i);r(c),(l=t.onMonthChange)===null||l===void 0||l.call(t,c)}};return[a,o]}function Lr(t,e){for(var n=e.reverseMonths,a=e.numberOfMonths,r=ae(t),o=ae(xe(r,a)),i=Re(o,r),l=[],c=0;c<i;c++){var d=xe(r,c);l.push(d)}return n&&(l=l.reverse()),l}function Rr(t,e){if(!e.disableNavigation){var n=e.toDate,a=e.pagedNavigation,r=e.numberOfMonths,o=r===void 0?1:r,i=a?o:1,l=ae(t);if(!n)return xe(l,i);var c=Re(n,t);if(!(c<o))return xe(l,i)}}function Yr(t,e){if(!e.disableNavigation){var n=e.fromDate,a=e.pagedNavigation,r=e.numberOfMonths,o=r===void 0?1:r,i=a?o:1,l=ae(t);if(!n)return xe(l,-i);var c=Re(l,n);if(!(c<=0))return xe(l,-i)}}var yn=F.createContext(void 0);function Ar(t){var e=$(),n=Er(),a=n[0],r=n[1],o=Lr(a,e),i=Rr(a,e),l=Yr(a,e),c=function(f){return o.some(function(m){return bt(f,m)})},d=function(f,m){c(f)||(m&&hn(f,m)?r(xe(f,1+e.numberOfMonths*-1)):r(f))},u={currentMonth:a,displayMonths:o,goToMonth:r,goToDate:d,previousMonth:l,nextMonth:i,isDateDisplayed:c};return s.jsx(yn.Provider,{value:u,children:t.children})}function He(){var t=F.useContext(yn);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function Ht(t){var e,n=$(),a=n.classNames,r=n.styles,o=n.components,i=He().goToMonth,l=function(u){i(xe(u,t.displayIndex?-t.displayIndex:0))},c=(e=o?.CaptionLabel)!==null&&e!==void 0?e:xn,d=s.jsx(c,{id:t.id,displayMonth:t.displayMonth});return s.jsxs("div",{className:a.caption_dropdowns,style:r.caption_dropdowns,children:[s.jsx("div",{className:a.vhidden,children:d}),s.jsx(Tr,{onChange:l,displayMonth:t.displayMonth}),s.jsx(Ir,{onChange:l,displayMonth:t.displayMonth})]})}function Br(t){return s.jsx("svg",C({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:s.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Hr(t){return s.jsx("svg",C({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:s.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Ge=F.forwardRef(function(t,e){var n=$(),a=n.classNames,r=n.styles,o=[a.button_reset,a.button];t.className&&o.push(t.className);var i=o.join(" "),l=C(C({},r.button_reset),r.button);return t.style&&Object.assign(l,t.style),s.jsx("button",C({},t,{ref:e,type:"button",className:i,style:l}))});function $r(t){var e,n,a=$(),r=a.dir,o=a.locale,i=a.classNames,l=a.styles,c=a.labels,d=c.labelPrevious,u=c.labelNext,f=a.components;if(!t.nextMonth&&!t.previousMonth)return s.jsx(s.Fragment,{});var m=d(t.previousMonth,{locale:o}),h=[i.nav_button,i.nav_button_previous].join(" "),v=u(t.nextMonth,{locale:o}),x=[i.nav_button,i.nav_button_next].join(" "),g=(e=f?.IconRight)!==null&&e!==void 0?e:Hr,y=(n=f?.IconLeft)!==null&&n!==void 0?n:Br;return s.jsxs("div",{className:i.nav,style:l.nav,children:[!t.hidePrevious&&s.jsx(Ge,{name:"previous-month","aria-label":m,className:h,style:l.nav_button_previous,disabled:!t.previousMonth,onClick:t.onPreviousClick,children:r==="rtl"?s.jsx(g,{className:i.nav_icon,style:l.nav_icon}):s.jsx(y,{className:i.nav_icon,style:l.nav_icon})}),!t.hideNext&&s.jsx(Ge,{name:"next-month","aria-label":v,className:x,style:l.nav_button_next,disabled:!t.nextMonth,onClick:t.onNextClick,children:r==="rtl"?s.jsx(y,{className:i.nav_icon,style:l.nav_icon}):s.jsx(g,{className:i.nav_icon,style:l.nav_icon})})]})}function $t(t){var e=$().numberOfMonths,n=He(),a=n.previousMonth,r=n.nextMonth,o=n.goToMonth,i=n.displayMonths,l=i.findIndex(function(v){return bt(t.displayMonth,v)}),c=l===0,d=l===i.length-1,u=e>1&&(c||!d),f=e>1&&(d||!c),m=function(){a&&o(a)},h=function(){r&&o(r)};return s.jsx($r,{displayMonth:t.displayMonth,hideNext:u,hidePrevious:f,nextMonth:r,previousMonth:a,onPreviousClick:m,onNextClick:h})}function qr(t){var e,n=$(),a=n.classNames,r=n.disableNavigation,o=n.styles,i=n.captionLayout,l=n.components,c=(e=l?.CaptionLabel)!==null&&e!==void 0?e:xn,d;return r?d=s.jsx(c,{id:t.id,displayMonth:t.displayMonth}):i==="dropdown"?d=s.jsx(Ht,{displayMonth:t.displayMonth,id:t.id}):i==="dropdown-buttons"?d=s.jsxs(s.Fragment,{children:[s.jsx(Ht,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),s.jsx($t,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):d=s.jsxs(s.Fragment,{children:[s.jsx(c,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),s.jsx($t,{displayMonth:t.displayMonth,id:t.id})]}),s.jsx("div",{className:a.caption,style:o.caption,children:d})}function Vr(t){var e=$(),n=e.footer,a=e.styles,r=e.classNames.tfoot;return n?s.jsx("tfoot",{className:r,style:a.tfoot,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,children:n})})}):s.jsx(s.Fragment,{})}function Ur(t,e,n){for(var a=n?De(new Date):we(new Date,{locale:t,weekStartsOn:e}),r=[],o=0;o<7;o++){var i=te(a,o);r.push(i)}return r}function zr(){var t=$(),e=t.classNames,n=t.styles,a=t.showWeekNumber,r=t.locale,o=t.weekStartsOn,i=t.ISOWeek,l=t.formatters.formatWeekdayName,c=t.labels.labelWeekday,d=Ur(r,o,i);return s.jsxs("tr",{style:n.head_row,className:e.head_row,children:[a&&s.jsx("td",{style:n.head_cell,className:e.head_cell}),d.map(function(u,f){return s.jsx("th",{scope:"col",className:e.head_cell,style:n.head_cell,"aria-label":c(u,{locale:r}),children:l(u,{locale:r})},f)})]})}function Gr(){var t,e=$(),n=e.classNames,a=e.styles,r=e.components,o=(t=r?.HeadRow)!==null&&t!==void 0?t:zr;return s.jsx("thead",{style:a.head,className:n.head,children:s.jsx(o,{})})}function Qr(t){var e=$(),n=e.locale,a=e.formatters.formatDay;return s.jsx(s.Fragment,{children:a(t.date,{locale:n})})}var wt=F.createContext(void 0);function Kr(t){if(!Ae(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return s.jsx(wt.Provider,{value:e,children:t.children})}return s.jsx(Xr,{initialProps:t.initialProps,children:t.children})}function Xr(t){var e=t.initialProps,n=t.children,a=e.selected,r=e.min,o=e.max,i=function(d,u,f){var m,h;(m=e.onDayClick)===null||m===void 0||m.call(e,d,u,f);var v=!!(u.selected&&r&&a?.length===r);if(!v){var x=!!(!u.selected&&o&&a?.length===o);if(!x){var g=a?vn([],a):[];if(u.selected){var y=g.findIndex(function(p){return ne(d,p)});g.splice(y,1)}else g.push(d);(h=e.onSelect)===null||h===void 0||h.call(e,g,d,u,f)}}},l={disabled:[]};a&&l.disabled.push(function(d){var u=o&&a.length>o-1,f=a.some(function(m){return ne(m,d)});return!!(u&&!f)});var c={selected:a,onDayClick:i,modifiers:l};return s.jsx(wt.Provider,{value:c,children:n})}function Nt(){var t=F.useContext(wt);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function Jr(t,e){var n=e||{},a=n.from,r=n.to;return a&&r?ne(r,t)&&ne(a,t)?void 0:ne(r,t)?{from:r,to:void 0}:ne(a,t)?void 0:lt(a,t)?{from:t,to:r}:{from:a,to:t}:r?lt(t,r)?{from:r,to:t}:{from:t,to:r}:a?hn(t,a)?{from:t,to:a}:{from:a,to:t}:{from:t,to:void 0}}var _t=F.createContext(void 0);function Zr(t){if(!Be(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return s.jsx(_t.Provider,{value:e,children:t.children})}return s.jsx(es,{initialProps:t.initialProps,children:t.children})}function es(t){var e=t.initialProps,n=t.children,a=e.selected,r=a||{},o=r.from,i=r.to,l=e.min,c=e.max,d=function(h,v,x){var g,y;(g=e.onDayClick)===null||g===void 0||g.call(e,h,v,x);var p=Jr(h,a);(y=e.onSelect)===null||y===void 0||y.call(e,p,h,v,x)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(u.range_start=[o],i?(u.range_end=[i],ne(o,i)||(u.range_middle=[{after:o,before:i}])):u.range_end=[o]):i&&(u.range_start=[i],u.range_end=[i]),l&&(o&&!i&&u.disabled.push({after:Ze(o,l-1),before:te(o,l-1)}),o&&i&&u.disabled.push({after:o,before:te(o,l-1)}),!o&&i&&u.disabled.push({after:Ze(i,l-1),before:te(i,l-1)})),c){if(o&&!i&&(u.disabled.push({before:te(o,-c+1)}),u.disabled.push({after:te(o,c-1)})),o&&i){var f=be(i,o)+1,m=c-f;u.disabled.push({before:Ze(o,m)}),u.disabled.push({after:te(i,m)})}!o&&i&&(u.disabled.push({before:te(i,-c+1)}),u.disabled.push({after:te(i,c-1)}))}return s.jsx(_t.Provider,{value:{selected:a,onDayClick:d,modifiers:u},children:n})}function jt(){var t=F.useContext(_t);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function Ve(t){return Array.isArray(t)?vn([],t):t!==void 0?[t]:[]}function ts(t){var e={};return Object.entries(t).forEach(function(n){var a=n[0],r=n[1];e[a]=Ve(r)}),e}var pe;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"})(pe||(pe={}));var ns=pe.Selected,_e=pe.Disabled,as=pe.Hidden,rs=pe.Today,tt=pe.RangeEnd,nt=pe.RangeMiddle,at=pe.RangeStart,ss=pe.Outside;function os(t,e,n){var a,r=(a={},a[ns]=Ve(t.selected),a[_e]=Ve(t.disabled),a[as]=Ve(t.hidden),a[rs]=[t.today],a[tt]=[],a[nt]=[],a[at]=[],a[ss]=[],a);return t.fromDate&&r[_e].push({before:t.fromDate}),t.toDate&&r[_e].push({after:t.toDate}),Ae(t)?r[_e]=r[_e].concat(e.modifiers[_e]):Be(t)&&(r[_e]=r[_e].concat(n.modifiers[_e]),r[at]=n.modifiers[at],r[nt]=n.modifiers[nt],r[tt]=n.modifiers[tt]),r}var bn=F.createContext(void 0);function is(t){var e=$(),n=Nt(),a=jt(),r=os(e,n,a),o=ts(e.modifiers),i=C(C({},r),o);return s.jsx(bn.Provider,{value:i,children:t.children})}function wn(){var t=F.useContext(bn);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function ls(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function cs(t){return!!(t&&typeof t=="object"&&"from"in t)}function ds(t){return!!(t&&typeof t=="object"&&"after"in t)}function us(t){return!!(t&&typeof t=="object"&&"before"in t)}function fs(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function ms(t,e){var n,a=e.from,r=e.to;if(a&&r){var o=be(r,a)<0;o&&(n=[r,a],a=n[0],r=n[1]);var i=be(t,a)>=0&&be(r,t)>=0;return i}return r?ne(r,t):a?ne(a,t):!1}function hs(t){return xt(t)}function vs(t){return Array.isArray(t)&&t.every(xt)}function gs(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(hs(n))return ne(t,n);if(vs(n))return n.includes(t);if(cs(n))return ms(t,n);if(fs(n))return n.dayOfWeek.includes(t.getDay());if(ls(n)){var a=be(n.before,t),r=be(n.after,t),o=a>0,i=r<0,l=lt(n.before,n.after);return l?i&&o:o||i}return ds(n)?be(t,n.after)>0:us(n)?be(n.before,t)>0:typeof n=="function"?n(t):!1})}function Mt(t,e,n){var a=Object.keys(e).reduce(function(o,i){var l=e[i];return gs(t,l)&&o.push(i),o},[]),r={};return a.forEach(function(o){return r[o]=!0}),n&&!bt(t,n)&&(r.outside=!0),r}function xs(t,e){for(var n=ae(t[0]),a=pt(t[t.length-1]),r,o,i=n;i<=a;){var l=Mt(i,e),c=!l.disabled&&!l.hidden;if(!c){i=te(i,1);continue}if(l.selected)return i;l.today&&!o&&(o=i),r||(r=i),i=te(i,1)}return o||r}var ps=365;function Nn(t,e){var n=e.moveBy,a=e.direction,r=e.context,o=e.modifiers,i=e.retry,l=i===void 0?{count:0,lastFocused:t}:i,c=r.weekStartsOn,d=r.fromDate,u=r.toDate,f=r.locale,m={day:te,week:it,month:xe,year:oa,startOfWeek:function(g){return r.ISOWeek?De(g):we(g,{locale:f,weekStartsOn:c})},endOfWeek:function(g){return r.ISOWeek?ln(g):yt(g,{locale:f,weekStartsOn:c})}},h=m[n](t,a==="after"?1:-1);a==="before"&&d?h=ia([d,h]):a==="after"&&u&&(h=la([u,h]));var v=!0;if(o){var x=Mt(h,o);v=!x.disabled&&!x.hidden}return v?h:l.count>ps?l.lastFocused:Nn(h,{moveBy:n,direction:a,context:r,modifiers:o,retry:C(C({},l),{count:l.count+1})})}var _n=F.createContext(void 0);function ys(t){var e=He(),n=wn(),a=F.useState(),r=a[0],o=a[1],i=F.useState(),l=i[0],c=i[1],d=xs(e.displayMonths,n),u=r??(l&&e.isDateDisplayed(l))?l:d,f=function(){c(r),o(void 0)},m=function(g){o(g)},h=$(),v=function(g,y){if(r){var p=Nn(r,{moveBy:g,direction:y,context:h,modifiers:n});ne(r,p)||(e.goToDate(p,r),m(p))}},x={focusedDay:r,focusTarget:u,blur:f,focus:m,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return s.jsx(_n.Provider,{value:x,children:t.children})}function kt(){var t=F.useContext(_n);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function bs(t,e){var n=wn(),a=Mt(t,n,e);return a}var Dt=F.createContext(void 0);function ws(t){if(!Ke(t.initialProps)){var e={selected:void 0};return s.jsx(Dt.Provider,{value:e,children:t.children})}return s.jsx(Ns,{initialProps:t.initialProps,children:t.children})}function Ns(t){var e=t.initialProps,n=t.children,a=function(o,i,l){var c,d,u;if((c=e.onDayClick)===null||c===void 0||c.call(e,o,i,l),i.selected&&!e.required){(d=e.onSelect)===null||d===void 0||d.call(e,void 0,o,i,l);return}(u=e.onSelect)===null||u===void 0||u.call(e,o,o,i,l)},r={selected:e.selected,onDayClick:a};return s.jsx(Dt.Provider,{value:r,children:n})}function jn(){var t=F.useContext(Dt);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function _s(t,e){var n=$(),a=jn(),r=Nt(),o=jt(),i=kt(),l=i.focusDayAfter,c=i.focusDayBefore,d=i.focusWeekAfter,u=i.focusWeekBefore,f=i.blur,m=i.focus,h=i.focusMonthBefore,v=i.focusMonthAfter,x=i.focusYearBefore,g=i.focusYearAfter,y=i.focusStartOfWeek,p=i.focusEndOfWeek,j=function(b){var w,V,X,Q;Ke(n)?(w=a.onDayClick)===null||w===void 0||w.call(a,t,e,b):Ae(n)?(V=r.onDayClick)===null||V===void 0||V.call(r,t,e,b):Be(n)?(X=o.onDayClick)===null||X===void 0||X.call(o,t,e,b):(Q=n.onDayClick)===null||Q===void 0||Q.call(n,t,e,b)},N=function(b){var w;m(t),(w=n.onDayFocus)===null||w===void 0||w.call(n,t,e,b)},D=function(b){var w;f(),(w=n.onDayBlur)===null||w===void 0||w.call(n,t,e,b)},M=function(b){var w;(w=n.onDayMouseEnter)===null||w===void 0||w.call(n,t,e,b)},_=function(b){var w;(w=n.onDayMouseLeave)===null||w===void 0||w.call(n,t,e,b)},k=function(b){var w;(w=n.onDayPointerEnter)===null||w===void 0||w.call(n,t,e,b)},P=function(b){var w;(w=n.onDayPointerLeave)===null||w===void 0||w.call(n,t,e,b)},S=function(b){var w;(w=n.onDayTouchCancel)===null||w===void 0||w.call(n,t,e,b)},O=function(b){var w;(w=n.onDayTouchEnd)===null||w===void 0||w.call(n,t,e,b)},I=function(b){var w;(w=n.onDayTouchMove)===null||w===void 0||w.call(n,t,e,b)},T=function(b){var w;(w=n.onDayTouchStart)===null||w===void 0||w.call(n,t,e,b)},L=function(b){var w;(w=n.onDayKeyUp)===null||w===void 0||w.call(n,t,e,b)},W=function(b){var w;switch(b.key){case"ArrowLeft":b.preventDefault(),b.stopPropagation(),n.dir==="rtl"?l():c();break;case"ArrowRight":b.preventDefault(),b.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":b.preventDefault(),b.stopPropagation(),d();break;case"ArrowUp":b.preventDefault(),b.stopPropagation(),u();break;case"PageUp":b.preventDefault(),b.stopPropagation(),b.shiftKey?x():h();break;case"PageDown":b.preventDefault(),b.stopPropagation(),b.shiftKey?g():v();break;case"Home":b.preventDefault(),b.stopPropagation(),y();break;case"End":b.preventDefault(),b.stopPropagation(),p();break}(w=n.onDayKeyDown)===null||w===void 0||w.call(n,t,e,b)},R={onClick:j,onFocus:N,onBlur:D,onKeyDown:W,onKeyUp:L,onMouseEnter:M,onMouseLeave:_,onPointerEnter:k,onPointerLeave:P,onTouchCancel:S,onTouchEnd:O,onTouchMove:I,onTouchStart:T};return R}function js(){var t=$(),e=jn(),n=Nt(),a=jt(),r=Ke(t)?e.selected:Ae(t)?n.selected:Be(t)?a.selected:void 0;return r}function Ms(t){return Object.values(pe).includes(t)}function ks(t,e){var n=[t.classNames.day];return Object.keys(e).forEach(function(a){var r=t.modifiersClassNames[a];if(r)n.push(r);else if(Ms(a)){var o=t.classNames["day_".concat(a)];o&&n.push(o)}}),n}function Ds(t,e){var n=C({},t.styles.day);return Object.keys(e).forEach(function(a){var r;n=C(C({},n),(r=t.modifiersStyles)===null||r===void 0?void 0:r[a])}),n}function Ss(t,e,n){var a,r,o,i=$(),l=kt(),c=bs(t,e),d=_s(t,c),u=js(),f=!!(i.onDayClick||i.mode!=="default");F.useEffect(function(){var M;c.outside||l.focusedDay&&f&&ne(l.focusedDay,t)&&((M=n.current)===null||M===void 0||M.focus())},[l.focusedDay,t,n,f,c.outside]);var m=ks(i,c).join(" "),h=Ds(i,c),v=!!(c.outside&&!i.showOutsideDays||c.hidden),x=(o=(r=i.components)===null||r===void 0?void 0:r.DayContent)!==null&&o!==void 0?o:Qr,g=s.jsx(x,{date:t,displayMonth:e,activeModifiers:c}),y={style:h,className:m,children:g,role:"gridcell"},p=l.focusTarget&&ne(l.focusTarget,t)&&!c.outside,j=l.focusedDay&&ne(l.focusedDay,t),N=C(C(C({},y),(a={disabled:c.disabled,role:"gridcell"},a["aria-selected"]=c.selected,a.tabIndex=j||p?0:-1,a)),d),D={isButton:f,isHidden:v,activeModifiers:c,selectedDays:u,buttonProps:N,divProps:y};return D}function Cs(t){var e=F.useRef(null),n=Ss(t.date,t.displayMonth,e);return n.isHidden?s.jsx("div",{role:"gridcell"}):n.isButton?s.jsx(Ge,C({name:"day",ref:e},n.buttonProps)):s.jsx("div",C({},n.divProps))}function Ps(t){var e=t.number,n=t.dates,a=$(),r=a.onWeekNumberClick,o=a.styles,i=a.classNames,l=a.locale,c=a.labels.labelWeekNumber,d=a.formatters.formatWeekNumber,u=d(Number(e),{locale:l});if(!r)return s.jsx("span",{className:i.weeknumber,style:o.weeknumber,children:u});var f=c(Number(e),{locale:l}),m=function(h){r(e,n,h)};return s.jsx(Ge,{name:"week-number","aria-label":f,className:i.weeknumber,style:o.weeknumber,onClick:m,children:u})}function Os(t){var e,n,a=$(),r=a.styles,o=a.classNames,i=a.showWeekNumber,l=a.components,c=(e=l?.Day)!==null&&e!==void 0?e:Cs,d=(n=l?.WeekNumber)!==null&&n!==void 0?n:Ps,u;return i&&(u=s.jsx("td",{className:o.cell,style:r.cell,children:s.jsx(d,{number:t.weekNumber,dates:t.dates})})),s.jsxs("tr",{className:o.row,style:r.row,children:[u,t.dates.map(function(f){return s.jsx("td",{className:o.cell,style:r.cell,role:"presentation",children:s.jsx(c,{displayMonth:t.displayMonth,date:f})},ir(f))})]})}function qt(t,e,n){for(var a=n?.ISOWeek?ln(e):yt(e,n),r=n?.ISOWeek?De(t):we(t,n),o=be(a,r),i=[],l=0;l<=o;l++)i.push(te(r,l));var c=i.reduce(function(d,u){var f=n?.ISOWeek?dn(u):fn(u,n),m=d.find(function(h){return h.weekNumber===f});return m?(m.dates.push(u),d):(d.push({weekNumber:f,dates:[u]}),d)},[]);return c}function Ts(t,e){var n=qt(ae(t),pt(t),e);if(e?.useFixedWeeks){var a=cr(t,e);if(a<6){var r=n[n.length-1],o=r.dates[r.dates.length-1],i=it(o,6-a),l=qt(it(o,1),i,e);n.push.apply(n,l)}}return n}function Is(t){var e,n,a,r=$(),o=r.locale,i=r.classNames,l=r.styles,c=r.hideHead,d=r.fixedWeeks,u=r.components,f=r.weekStartsOn,m=r.firstWeekContainsDate,h=r.ISOWeek,v=Ts(t.displayMonth,{useFixedWeeks:!!d,ISOWeek:h,locale:o,weekStartsOn:f,firstWeekContainsDate:m}),x=(e=u?.Head)!==null&&e!==void 0?e:Gr,g=(n=u?.Row)!==null&&n!==void 0?n:Os,y=(a=u?.Footer)!==null&&a!==void 0?a:Vr;return s.jsxs("table",{id:t.id,className:i.table,style:l.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!c&&s.jsx(x,{}),s.jsx("tbody",{className:i.tbody,style:l.tbody,children:v.map(function(p){return s.jsx(g,{displayMonth:t.displayMonth,dates:p.dates,weekNumber:p.weekNumber},p.weekNumber)})}),s.jsx(y,{displayMonth:t.displayMonth})]})}function Ws(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Fs=Ws()?F.useLayoutEffect:F.useEffect,rt=!1,Es=0;function Vt(){return"react-day-picker-".concat(++Es)}function Ls(t){var e,n=t??(rt?Vt():null),a=F.useState(n),r=a[0],o=a[1];return Fs(function(){r===null&&o(Vt())},[]),F.useEffect(function(){rt===!1&&(rt=!0)},[]),(e=t??r)!==null&&e!==void 0?e:void 0}function Rs(t){var e,n,a=$(),r=a.dir,o=a.classNames,i=a.styles,l=a.components,c=He().displayMonths,d=Ls(a.id?"".concat(a.id,"-").concat(t.displayIndex):void 0),u=a.id?"".concat(a.id,"-grid-").concat(t.displayIndex):void 0,f=[o.month],m=i.month,h=t.displayIndex===0,v=t.displayIndex===c.length-1,x=!h&&!v;r==="rtl"&&(e=[h,v],v=e[0],h=e[1]),h&&(f.push(o.caption_start),m=C(C({},m),i.caption_start)),v&&(f.push(o.caption_end),m=C(C({},m),i.caption_end)),x&&(f.push(o.caption_between),m=C(C({},m),i.caption_between));var g=(n=l?.Caption)!==null&&n!==void 0?n:qr;return s.jsxs("div",{className:f.join(" "),style:m,children:[s.jsx(g,{id:d,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),s.jsx(Is,{id:u,"aria-labelledby":d,displayMonth:t.displayMonth})]},t.displayIndex)}function Ys(t){var e=$(),n=e.classNames,a=e.styles;return s.jsx("div",{className:n.months,style:a.months,children:t.children})}function As(t){var e,n,a=t.initialProps,r=$(),o=kt(),i=He(),l=F.useState(!1),c=l[0],d=l[1];F.useEffect(function(){r.initialFocus&&o.focusTarget&&(c||(o.focus(o.focusTarget),d(!0)))},[r.initialFocus,c,o.focus,o.focusTarget,o]);var u=[r.classNames.root,r.className];r.numberOfMonths>1&&u.push(r.classNames.multiple_months),r.showWeekNumber&&u.push(r.classNames.with_weeknumber);var f=C(C({},r.styles.root),r.style),m=Object.keys(a).filter(function(v){return v.startsWith("data-")}).reduce(function(v,x){var g;return C(C({},v),(g={},g[x]=a[x],g))},{}),h=(n=(e=a.components)===null||e===void 0?void 0:e.Months)!==null&&n!==void 0?n:Ys;return s.jsx("div",C({className:u.join(" "),style:f,dir:r.dir,id:r.id,nonce:a.nonce,title:a.title,lang:a.lang},m,{children:s.jsx(h,{children:i.displayMonths.map(function(v,x){return s.jsx(Rs,{displayIndex:x,displayMonth:v},x)})})}))}function Bs(t){var e=t.children,n=ur(t,["children"]);return s.jsx(Pr,{initialProps:n,children:s.jsx(Ar,{children:s.jsx(ws,{initialProps:n,children:s.jsx(Kr,{initialProps:n,children:s.jsx(Zr,{initialProps:n,children:s.jsx(is,{children:s.jsx(ys,{children:e})})})})})})})}function Hs(t){return s.jsx(Bs,C({},t,{children:s.jsx(As,{initialProps:t})}))}function zo(t){const e=le.c(20);let n,a,r,o;e[0]!==t?({className:n,classNames:a,showOutsideDays:o,...r}=t,e[0]=t,e[1]=n,e[2]=a,e[3]=r,e[4]=o):(n=e[1],a=e[2],r=e[3],o=e[4]);const i=o===void 0?!0:o;let l;e[5]!==n?(l=ye("p-3",n),e[5]=n,e[6]=l):l=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=ye(Wt({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),e[7]=c):c=e[7];const d=r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md";let u;e[8]!==d?(u=ye("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",d),e[8]=d,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=ye(Wt({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),e[10]=f):f=e[10];let m;e[11]!==a||e[12]!==u?(m={months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:c,nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:u,day:f,day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...a},e[11]=a,e[12]=u,e[13]=m):m=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h={IconLeft:qs,IconRight:$s},e[14]=h):h=e[14];let v;return e[15]!==r||e[16]!==i||e[17]!==l||e[18]!==m?(v=s.jsx(Hs,{showOutsideDays:i,className:l,classNames:m,components:h,...r}),e[15]=r,e[16]=i,e[17]=l,e[18]=m,e[19]=v):v=e[19],v}function $s(t){const{className:e,...n}=t;return s.jsx(On,{className:ye("size-4",e),...n})}function qs(t){const{className:e,...n}=t;return s.jsx(Pn,{className:ye("size-4",e),...n})}function Ut(t){const e=le.c(74),{options:n,onValueChange:a,defaultValue:r,placeholder:o,variant:i,animation:l,maxCount:c,modalPopover:d,asChild:u,className:f,disabled:m,onSearchChange:h}=t;let v;e[0]!==r?(v=r===void 0?[]:r,e[0]=r,e[1]=v):v=e[1];const x=v,g=o===void 0?"Select items":o,y=i===void 0?"default":i,p=l===void 0?0:l,j=c===void 0?3:c,N=d===void 0?!1:d,D=u===void 0?!1:u,M=m===void 0?!1:m,[_,k]=F.useState(x),[P,S]=F.useState(!1);let O,I;e[2]!==x||e[3]!==_?(O=()=>{JSON.stringify(_)!==JSON.stringify(x)&&k(x)},I=[x,_],e[2]=x,e[3]=_,e[4]=O,e[5]=I):(O=e[4],I=e[5]),F.useEffect(O,I);let T;e[6]!==a||e[7]!==_?(T=H=>{if(H.key==="Enter")S(!0);else if(H.key==="Backspace"&&!H.currentTarget.value){const ee=[..._];ee.pop(),k(ee),a(ee)}},e[6]=a,e[7]=_,e[8]=T):T=e[8];const L=T;let W;e[9]!==a||e[10]!==_?(W=H=>{const ee=_.includes(H.value)?_.filter(Ce=>Ce!==H.value):[..._,H.value];k(ee),a(ee)},e[9]=a,e[10]=_,e[11]=W):W=e[11];const R=W;let b;e[12]!==a?(b=()=>{k([]),a([])},e[12]=a,e[13]=b):b=e[13];const w=b;let V;e[14]===Symbol.for("react.memo_cache_sentinel")?(V=()=>{S(Gs)},e[14]=V):V=e[14];const X=V;let Q;e[15]!==w||e[16]!==a||e[17]!==n||e[18]!==_.length?(Q=()=>{if(_.length===n.length)w();else{const H=n.map(zs);k(H),a(H)}},e[15]=w,e[16]=a,e[17]=n,e[18]=_.length,e[19]=Q):Q=e[19];const B=Q;let U;e[20]!==D?(U=D?{}:{variant:"outline"},e[20]=D,e[21]=U):U=e[21];let z;e[22]!==f?(z=ye("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",f),e[22]=f,e[23]=z):z=e[23];let G;e[24]!==p||e[25]!==j||e[26]!==n||e[27]!==g||e[28]!==_||e[29]!==y?(G=_.length>0?s.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[_.slice(0,j).map(H=>{const ee=n.find(Xe=>Xe.value===H),Ce=ee?.icon;return s.jsxs(Ue,{variant:y==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${p}s`},children:[Ce&&s.jsx(Ce,{className:"h-3 w-3 shrink-0"}),s.jsx("span",{className:"truncate",children:ee?.label})]},H)}),_.length>j&&s.jsxs(Ue,{variant:y==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${p}s`},children:["+",_.length-j]})]}),s.jsx("div",{className:"flex items-center shrink-0 ml-2",children:s.jsx(Le,{size:20,className:"shrink-0 opacity-50"})})]}):s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:g}),s.jsx(Le,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=p,e[25]=j,e[26]=n,e[27]=g,e[28]=_,e[29]=y,e[30]=G):G=e[30];let q;e[31]!==M||e[32]!==U||e[33]!==z||e[34]!==G?(q=s.jsx(tn,{asChild:!0,children:s.jsx(Fe,{ref:null,...U,onClick:X,className:z,disabled:M,children:G})}),e[31]=M,e[32]=U,e[33]=z,e[34]=G,e[35]=q):q=e[35];let J;e[36]===Symbol.for("react.memo_cache_sentinel")?(J=()=>S(!1),e[36]=J):J=e[36];const ce=!h;let K;e[37]!==L||e[38]!==h?(K=s.jsx(Qn,{placeholder:"Search...",onKeyDown:L,onValueChange:h,className:"rounded-t-xl"}),e[37]=L,e[38]=h,e[39]=K):K=e[39];let de;e[40]===Symbol.for("react.memo_cache_sentinel")?(de=s.jsx(Kn,{children:"No results found."}),e[40]=de):de=e[40];let ue;e[41]!==B?(ue=()=>{B()},e[41]=B,e[42]=ue):ue=e[42];let re;e[43]!==B?(re=H=>{H.stopPropagation(),B()},e[43]=B,e[44]=re):re=e[44];const Me=_.length===n.length&&n.length>0;let he;e[45]!==Me||e[46]!==B?(he=s.jsx(Ft,{checked:Me,onCheckedChange:B,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Us}),e[45]=Me,e[46]=B,e[47]=he):he=e[47];let ve;e[48]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsx("span",{children:"(Select All)"}),e[48]=ve):ve=e[48];let se;e[49]!==re||e[50]!==he?(se=s.jsxs("div",{className:"flex items-center w-full",onClick:re,children:[he,ve]}),e[49]=re,e[50]=he,e[51]=se):se=e[51];let oe;e[52]!==ue||e[53]!==se?(oe=s.jsx(Et,{onSelect:ue,className:"cursor-pointer",children:se},"all"),e[52]=ue,e[53]=se,e[54]=oe):oe=e[54];let ge;if(e[55]!==n||e[56]!==_||e[57]!==R){let H;e[59]!==_||e[60]!==R?(H=ee=>{const Ce=_.includes(ee.value);return s.jsx(Et,{onSelect:()=>{R(ee)},className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center w-full",onClick:Xe=>{Xe.stopPropagation(),R(ee)},children:[s.jsx(Ft,{checked:Ce,onCheckedChange:()=>{R(ee)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Vs}),ee.icon&&s.jsx(ee.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),s.jsx("span",{children:ee.label})]})},ee.value)},e[59]=_,e[60]=R,e[61]=H):H=e[61],ge=n.map(H),e[55]=n,e[56]=_,e[57]=R,e[58]=ge}else ge=e[58];let Y;e[62]!==oe||e[63]!==ge?(Y=s.jsxs(Xn,{className:"rounded-b-xl",children:[de,s.jsxs(Jn,{children:[oe,ge]})]}),e[62]=oe,e[63]=ge,e[64]=Y):Y=e[64];let Z;e[65]!==ce||e[66]!==K||e[67]!==Y?(Z=s.jsx(nn,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:J,children:s.jsxs(Zn,{shouldFilter:ce,className:"rounded-xl",children:[K,Y]})}),e[65]=ce,e[66]=K,e[67]=Y,e[68]=Z):Z=e[68];let Ne;return e[69]!==P||e[70]!==N||e[71]!==q||e[72]!==Z?(Ne=s.jsxs(an,{open:P,onOpenChange:S,modal:N,children:[q,Z]}),e[69]=P,e[70]=N,e[71]=q,e[72]=Z,e[73]=Ne):Ne=e[73],Ne}function Vs(t){return t.stopPropagation()}function Us(t){return t.stopPropagation()}function zs(t){return t.value}function Gs(t){return!t}const Mn=[{ms:6e4,label:"1m"},{ms:12e4,label:"2m"},{ms:3e5,label:"5m"},{ms:6e5,label:"10m"},{ms:9e5,label:"15m"},{ms:18e5,label:"30m"},{ms:36e5,label:"1h"},{ms:72e5,label:"2h"},{ms:216e5,label:"6h"},{ms:432e5,label:"12h"},{ms:864e5,label:"1d"},{ms:6048e5,label:"7d"}],Qs=40;function Go(t){const n=(t.endDate.getTime()-t.startDate.getTime())/Qs;return Mn.find(r=>r.ms>=n)?.label??"1d"}function St(t){const e=Mn.find(o=>o.label===t);if(e)return e.ms;const n=/^(\d+)([mhd])$/.exec(t);if(!n)return 6e4;const a=parseInt(n[1],10),r=n[2];return r==="h"?a*36e5:r==="d"?a*864e5:a*6e4}function Ks(t,e){const n=new Date(t);return St(e)>=864e5?n.toLocaleDateString([],{month:"short",day:"numeric"}):n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function zt(t,e){const n=St(e);return new Date(Math.floor(t.getTime()/n)*n)}function Xs(t){return t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`}function Ct(t){return Number.isFinite(t)?t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:Math.round(t).toLocaleString():"0"}function Pt(t){return Number.isFinite(t)?`$${t.toFixed(t<1?4:2)}`:"$0.00"}function Qo(t,e,n){const a=St(n),r=zt(e.startDate,n).getTime(),o=e.endDate.getTime(),i=new Map(t.map(c=>[zt(new Date(c.timestamp),n).getTime(),c])),l=[];for(let c=r;c<=o;c+=a){const d=i.get(c),u=new Date(c).toISOString();l.push({t:u,ts:c,label:Ks(u,n),calls:d?.calls??0,errors:d?.errors??0,errorRate:d?.errorRate??0,avg:d?.avg??0,p50:d?.p50??0,p95:d?.p95??0,inputTokens:d?.inputTokens??0,outputTokens:d?.outputTokens??0,totalTokens:d?.totalTokens??0,costUsd:d?.costUsd??0})}return l}function Ko(t,e){return e==="requests"?t.calls:e==="errors"?t.errorRate:t.avgDurationMs}function Xo(t,e){return e==="requests"?t.calls.toLocaleString():e==="errors"?`${t.errorRate.toFixed(1)}%`:Xs(t.avgDurationMs)}function Ot(t){return(t.run_config??{}).agent?.id??(t.virtual_mcp_id||null)}function Tt(t,e,n,a){if(!t)return a;const r=e.find(i=>i.id===t)??n?.find(i=>i.id===t);if(r?.title)return r.title;const o=In(t);return o?Wn(o).title??a:t}function It(t,e,n){return t?(e.find(r=>r.id===t)??n?.find(r=>r.id===t))?.icon??null:null}function kn(t){return t?.data?.members??[]}function ct(t){const e=le.c(33),{thread:n,connections:a,virtualMcps:r,selectedIndex:o,total:i,onPrev:l,onNext:c}=t;let d,u;if(e[0]!==a||e[1]!==n||e[2]!==r){const O=Ot(n);d=Tt(O,r,a,""),u=It(O,r,a),e[0]=a,e[1]=n,e[2]=r,e[3]=d,e[4]=u}else d=e[3],u=e[4];const f=u,m=d||n.title;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ht,{}),e[5]=h):h=e[5];let v;e[6]!==f||e[7]!==m?(v=s.jsx(vt,{icon:f,name:m,size:"sm",fallbackIcon:h,className:"shadow-sm shrink-0 rounded-md"}),e[6]=f,e[7]=m,e[8]=v):v=e[8];let x;e[9]!==n.title?(x=s.jsx(Yn,{className:"text-sm leading-snug truncate",children:n.title}),e[9]=n.title,e[10]=x):x=e[10];let g;e[11]!==d?(g=d&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:d}),e[11]=d,e[12]=g):g=e[12];let y;e[13]!==x||e[14]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[x,g]}),e[13]=x,e[14]=g,e[15]=y):y=e[15];let p;e[16]!==v||e[17]!==y?(p=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[v,y]}),e[16]=v,e[17]=y,e[18]=p):p=e[18];const j=o===0;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ot,{size:14}),e[19]=N):N=e[19];let D;e[20]!==l||e[21]!==j?(D=s.jsx(Fe,{size:"icon",variant:"ghost",onClick:l,disabled:j,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous thread",children:N}),e[20]=l,e[21]=j,e[22]=D):D=e[22];const M=o===i-1;let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Le,{size:14}),e[23]=_):_=e[23];let k;e[24]!==c||e[25]!==M?(k=s.jsx(Fe,{size:"icon",variant:"ghost",onClick:c,disabled:M,className:"h-7 w-7 text-muted-foreground","aria-label":"Next thread",children:_}),e[24]=c,e[25]=M,e[26]=k):k=e[26];let P;e[27]!==D||e[28]!==k?(P=s.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[D,k]}),e[27]=D,e[28]=k,e[29]=P):P=e[29];let S;return e[30]!==P||e[31]!==p?(S=s.jsx(An,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:s.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[p,P]})}),e[30]=P,e[31]=p,e[32]=S):S=e[32],S}function Js(t){const e=le.c(48),{thread:n,connections:a,virtualMcps:r,members:o}=t;let i,l;if(e[0]!==a||e[1]!==n||e[2]!==r){const W=Ot(n);i=Tt(W,r,a,""),l=It(W,r,a),e[0]=a,e[1]=n,e[2]=r,e[3]=i,e[4]=l}else i=e[3],l=e[4];const c=l;let d;if(e[5]!==o||e[6]!==n.created_by){const W=kn(o);let R;e[8]!==n.created_by?(R=b=>b.userId===n.created_by,e[8]=n.created_by,e[9]=R):R=e[9],d=W.find(R),e[5]=o,e[6]=n.created_by,e[7]=d}else d=e[7];const u=d;let f;e[10]!==u?.user.email||e[11]!==u?.user.name||e[12]!==n.created_by?(f=u?.user.name??u?.user.email??n.created_by?.substring(0,8)??"—",e[10]=u?.user.email,e[11]=u?.user.name,e[12]=n.created_by,e[13]=f):f=e[13];const m=f,h=u?.user.image??void 0;let v;e[14]!==n.created_at?(v=new Date(n.created_at).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[14]=n.created_at,e[15]=v):v=e[15];const x=v,g=Oe[n.status]??Oe.completed,y=g.icon;let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Status"}),e[16]=p):p=e[16];let j;e[17]!==y||e[18]!==g.iconClassName?(j=s.jsx(y,{size:13,className:g.iconClassName}),e[17]=y,e[18]=g.iconClassName,e[19]=j):j=e[19];let N;e[20]!==g.labelColor?(N=ye("text-sm",g.labelColor),e[20]=g.labelColor,e[21]=N):N=e[21];let D;e[22]!==g.label||e[23]!==N?(D=s.jsx("span",{className:N,children:g.label}),e[22]=g.label,e[23]=N,e[24]=D):D=e[24];let M;e[25]!==j||e[26]!==D?(M=s.jsxs("div",{children:[p,s.jsxs("div",{className:"flex items-center gap-1.5",children:[j,D]})]}),e[25]=j,e[26]=D,e[27]=M):M=e[27];let _;e[28]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Date"}),e[28]=_):_=e[28];let k;e[29]!==x?(k=s.jsxs("div",{children:[_,s.jsx("div",{className:"text-sm text-foreground",children:x})]}),e[29]=x,e[30]=k):k=e[30];let P;e[31]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[31]=P):P=e[31];let S;e[32]!==h||e[33]!==m?(S=s.jsx(rn,{url:h,fallback:m,shape:"circle",size:"2xs",className:"shrink-0"}),e[32]=h,e[33]=m,e[34]=S):S=e[34];let O;e[35]!==m?(O=s.jsx("span",{className:"text-sm text-foreground",children:m}),e[35]=m,e[36]=O):O=e[36];let I;e[37]!==S||e[38]!==O?(I=s.jsxs("div",{children:[P,s.jsxs("div",{className:"flex items-center gap-2",children:[S,O]})]}),e[37]=S,e[38]=O,e[39]=I):I=e[39];let T;e[40]!==c||e[41]!==i?(T=i&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(vt,{icon:c,name:i,size:"xs",fallbackIcon:s.jsx(ht,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),s.jsx("span",{className:"text-sm text-foreground",children:i})]})]}),e[40]=c,e[41]=i,e[42]=T):T=e[42];let L;return e[43]!==k||e[44]!==I||e[45]!==T||e[46]!==M?(L=s.jsxs("div",{className:"px-5 md:px-6 py-5 border-b border-border grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4 text-sm",children:[M,k,I,T]}),e[43]=k,e[44]=I,e[45]=T,e[46]=M,e[47]=L):L=e[47],L}function Zs(t){const e=le.c(72),{thread:n,usage:a,members:r,connections:o,virtualMcps:i,onClick:l,lastRowRef:c}=t;let d,u;if(e[0]!==o||e[1]!==n||e[2]!==i){const q=Ot(n);d=Tt(q,i,o,"—"),u=It(q,i,o),e[0]=o,e[1]=n,e[2]=i,e[3]=d,e[4]=u}else d=e[3],u=e[4];const f=u;let m;if(e[5]!==r||e[6]!==n.created_by){const q=kn(r);let J;e[8]!==n.created_by?(J=ce=>ce.userId===n.created_by,e[8]=n.created_by,e[9]=J):J=e[9],m=q.find(J),e[5]=r,e[6]=n.created_by,e[7]=m}else m=e[7];const h=m;let v;e[10]!==h?.user.email||e[11]!==h?.user.name||e[12]!==n.created_by?(v=h?.user.name??h?.user.email??n.created_by?.substring(0,8)??"—",e[10]=h?.user.email,e[11]=h?.user.name,e[12]=n.created_by,e[13]=v):v=e[13];const x=v,g=h?.user.image??void 0;let y,p;if(e[14]!==n.created_at){const q=new Date(n.created_at);y=q.toLocaleDateString("en-US",{month:"short",day:"numeric"}),p=q.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[14]=n.created_at,e[15]=y,e[16]=p}else y=e[15],p=e[16];const j=p,N=Oe[n.status]??Oe.completed,D=N.icon;let M;e[17]!==n.title?(M=s.jsx(me,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:n.title})}),e[17]=n.title,e[18]=M):M=e[18];let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(ht,{}),e[19]=_):_=e[19];let k;e[20]!==f||e[21]!==d?(k=s.jsx(vt,{icon:f,name:d,size:"xs",fallbackIcon:_,className:"shrink-0 size-5! min-w-5! rounded-md"}),e[20]=f,e[21]=d,e[22]=k):k=e[22];let P;e[23]!==d?(P=s.jsx("span",{className:"truncate",children:d}),e[23]=d,e[24]=P):P=e[24];let S;e[25]!==k||e[26]!==P?(S=s.jsx(me,{className:"w-36 px-3 text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[k,P]})}),e[25]=k,e[26]=P,e[27]=S):S=e[27];let O;e[28]!==g||e[29]!==x?(O=s.jsx(rn,{url:g,fallback:x,shape:"circle",size:"2xs",className:"shrink-0"}),e[28]=g,e[29]=x,e[30]=O):O=e[30];let I;e[31]!==x?(I=s.jsx("span",{className:"truncate",children:x}),e[31]=x,e[32]=I):I=e[32];let T;e[33]!==O||e[34]!==I?(T=s.jsx(me,{className:"w-28 px-3 text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[O,I]})}),e[33]=O,e[34]=I,e[35]=T):T=e[35];let L;e[36]!==D||e[37]!==N.iconClassName?(L=s.jsx(D,{size:14,className:N.iconClassName}),e[36]=D,e[37]=N.iconClassName,e[38]=L):L=e[38];let W;e[39]!==N.labelColor?(W=ye("text-sm",N.labelColor),e[39]=N.labelColor,e[40]=W):W=e[40];let R;e[41]!==N.label||e[42]!==W?(R=s.jsx("span",{className:W,children:N.label}),e[41]=N.label,e[42]=W,e[43]=R):R=e[43];let b;e[44]!==L||e[45]!==R?(b=s.jsx(me,{className:"w-24 px-3",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[L,R]})}),e[44]=L,e[45]=R,e[46]=b):b=e[46];let w;e[47]!==a?(w=a?Ct(a.totalTokens):"—",e[47]=a,e[48]=w):w=e[48];let V;e[49]!==w?(V=s.jsx(me,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:w}),e[49]=w,e[50]=V):V=e[50];let X;e[51]!==a?(X=a&&a.costUsd>0?Pt(a.costUsd):"—",e[51]=a,e[52]=X):X=e[52];let Q;e[53]!==X?(Q=s.jsx(me,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:X}),e[53]=X,e[54]=Q):Q=e[54];let B;e[55]!==y?(B=s.jsx("div",{children:y}),e[55]=y,e[56]=B):B=e[56];let U;e[57]!==j?(U=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:j}),e[57]=j,e[58]=U):U=e[58];let z;e[59]!==B||e[60]!==U?(z=s.jsxs(me,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[B,U]}),e[59]=B,e[60]=U,e[61]=z):z=e[61];let G;return e[62]!==c||e[63]!==l||e[64]!==T||e[65]!==b||e[66]!==V||e[67]!==Q||e[68]!==z||e[69]!==M||e[70]!==S?(G=s.jsxs(Qe,{ref:c,className:"h-14 md:h-16 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:l,children:[M,S,T,b,V,Q,z]}),e[62]=c,e[63]=l,e[64]=T,e[65]=b,e[66]=V,e[67]=Q,e[68]=z,e[69]=M,e[70]=S,e[71]=G):G=e[71],G}const dt=100;function eo(t){const e=le.c(37),{client:n,locator:a,thread:r,connections:o,virtualMcps:i,members:l,selectedIndex:c,total:d,onPrev:u,onNext:f}=t;let m;e[0]!==a||e[1]!==r.id?(m=Ee.threadMessages(a,r.id),e[0]=a,e[1]=r.id,e[2]=m):m=e[2];let h;e[3]!==n||e[4]!==r.id?(h=async I=>{const{pageParam:T}=I,L=T===void 0?0:T;if(!n)throw new Error("MCP client is not available");const W=await n.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:r.id,limit:dt,offset:L}});return W.structuredContent??W},e[3]=n,e[4]=r.id,e[5]=h):h=e[5];let v;e[6]!==m||e[7]!==h?(v={queryKey:m,queryFn:h,initialPageParam:0,getNextPageParam:ao,staleTime:6e4},e[6]=m,e[7]=h,e[8]=v):v=e[8];const{data:x,fetchNextPage:g,hasNextPage:y,isFetchingNextPage:p}=qn(v);let j;e[9]!==x.pages?(j=x.pages.flatMap(no).filter(to),e[9]=x.pages,e[10]=j):j=e[10];const N=j,D=ta(N);let M;e[11]!==g||e[12]!==y||e[13]!==p?(M=()=>{y&&!p&&g()},e[11]=g,e[12]=y,e[13]=p,e[14]=M):M=e[14];const _=mt(M,y??!1,p);let k;e[15]!==o||e[16]!==f||e[17]!==u||e[18]!==c||e[19]!==r||e[20]!==d||e[21]!==i?(k=s.jsx(ct,{thread:r,connections:o,virtualMcps:i,selectedIndex:c,total:d,onPrev:u,onNext:f}),e[15]=o,e[16]=f,e[17]=u,e[18]=c,e[19]=r,e[20]=d,e[21]=i,e[22]=k):k=e[22];let P;e[23]!==o||e[24]!==l||e[25]!==r||e[26]!==i?(P=s.jsx(Js,{thread:r,connections:o,virtualMcps:i,members:l}),e[23]=o,e[24]=l,e[25]=r,e[26]=i,e[27]=P):P=e[27];let S;e[28]!==p||e[29]!==_||e[30]!==D||e[31]!==N.length?(S=N.length===0?s.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No messages in this thread"}):s.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:s.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[D.map((I,T)=>s.jsx("div",{ref:T===D.length-1?_:void 0,children:s.jsx(na,{pair:I,isLastPair:T===D.length-1,status:"ready"})},`pair-${I.user?.id??I.assistant?.id}`)),p&&s.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"Loading more\\u2026"})]})}),e[28]=p,e[29]=_,e[30]=D,e[31]=N.length,e[32]=S):S=e[32];let O;return e[33]!==k||e[34]!==P||e[35]!==S?(O=s.jsxs(s.Fragment,{children:[k,P,S]}),e[33]=k,e[34]=P,e[35]=S,e[36]=O):O=e[36],O}function to(t){return t.role==="user"||t.role==="assistant"}function no(t){return t.items??[]}function ao(t,e){const n=t,a=e;if(!((n?.items?.length??0)<dt))return a.length*dt}function Dn(t){const e=le.c(39),{thread:n,client:a,locator:r,connections:o,virtualMcps:i,members:l,selectedIndex:c,total:d,onPrev:u,onNext:f}=t;let m;e[0]!==o||e[1]!==f||e[2]!==u||e[3]!==c||e[4]!==n||e[5]!==d||e[6]!==i?(m=s.jsx(ct,{thread:n,connections:o,virtualMcps:i,selectedIndex:c,total:d,onPrev:u,onNext:f}),e[0]=o,e[1]=f,e[2]=u,e[3]=c,e[4]=n,e[5]=d,e[6]=i,e[7]=m):m=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Failed to load messages"}),e[8]=h):h=e[8];let v;e[9]!==m?(v=s.jsxs(s.Fragment,{children:[m,h]}),e[9]=m,e[10]=v):v=e[10];let x;e[11]!==o||e[12]!==f||e[13]!==u||e[14]!==c||e[15]!==n||e[16]!==d||e[17]!==i?(x=s.jsx(ct,{thread:n,connections:o,virtualMcps:i,selectedIndex:c,total:d,onPrev:u,onNext:f}),e[11]=o,e[12]=f,e[13]=u,e[14]=c,e[15]=n,e[16]=d,e[17]=i,e[18]=x):x=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Loading conversation\\u2026"}),e[19]=g):g=e[19];let y;e[20]!==x?(y=s.jsxs(s.Fragment,{children:[x,g]}),e[20]=x,e[21]=y):y=e[21];let p;e[22]!==a||e[23]!==o||e[24]!==r||e[25]!==l||e[26]!==f||e[27]!==u||e[28]!==c||e[29]!==n||e[30]!==d||e[31]!==i?(p=s.jsx(eo,{client:a,locator:r,thread:n,connections:o,virtualMcps:i,members:l,selectedIndex:c,total:d,onPrev:u,onNext:f}),e[22]=a,e[23]=o,e[24]=r,e[25]=l,e[26]=f,e[27]=u,e[28]=c,e[29]=n,e[30]=d,e[31]=i,e[32]=p):p=e[32];let j;e[33]!==y||e[34]!==p?(j=s.jsx(F.Suspense,{fallback:y,children:p}),e[33]=y,e[34]=p,e[35]=j):j=e[35];let N;return e[36]!==v||e[37]!==j?(N=s.jsx(Sn,{fallback:v,children:j}),e[36]=v,e[37]=j,e[38]=N):N=e[38],N}function Jo(t){const e=le.c(43),{filterAgentIds:n,filterUserIds:a,filterStatus:r,virtualMcpOptions:o,memberOptions:i,activeFiltersCount:l,onUpdateFilters:c}=t,[d,u]=F.useState(!1);let f,m;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ea,{size:16}),m=s.jsx("span",{className:"hidden sm:inline",children:"Filters"}),e[0]=f,e[1]=m):(f=e[0],m=e[1]);let h;e[2]!==l?(h=l>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ue,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:l}),s.jsx(Ue,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:l})]}),e[2]=l,e[3]=h):h=e[3];let v;e[4]!==h?(v=s.jsx(tn,{asChild:!0,children:s.jsxs(Fe,{variant:"outline",className:"relative",children:[f,m,h]})}),e[4]=h,e[5]=v):v=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h4",{className:"font-medium text-sm",children:"Filter Threads"}),e[6]=x):x=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agent"}),e[7]=g):g=e[7];let y;e[8]!==c?(y=W=>c({filterAgentIds:W.slice(0,1)}),e[8]=c,e[9]=y):y=e[9];let p;e[10]!==n||e[11]!==y||e[12]!==o?(p=s.jsxs("div",{children:[g,s.jsx(Ut,{options:o,defaultValue:n,onValueChange:y,placeholder:"All agents",variant:"secondary",className:"w-full",maxCount:1})]}),e[10]=n,e[11]=y,e[12]=o,e[13]=p):p=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"User"}),e[14]=j):j=e[14];let N;e[15]!==c?(N=W=>c({filterUserIds:W.slice(0,1)}),e[15]=c,e[16]=N):N=e[16];let D;e[17]!==a||e[18]!==i||e[19]!==N?(D=s.jsxs("div",{children:[j,s.jsx(Ut,{options:i,defaultValue:a,onValueChange:N,placeholder:"All users",variant:"secondary",className:"w-full",maxCount:1})]}),e[17]=a,e[18]=i,e[19]=N,e[20]=D):D=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),e[21]=M):M=e[21];let _;e[22]!==c?(_=W=>c({filterStatus:W}),e[22]=c,e[23]=_):_=e[23];let k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Vn,{className:"w-full",children:s.jsx(Un,{})}),e[24]=k):k=e[24];let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs(zn,{children:[s.jsx($e,{value:"all",children:"All statuses"}),s.jsx($e,{value:"completed",children:"Completed"}),s.jsx($e,{value:"active",children:"Active"}),s.jsx($e,{value:"failed",children:"Failed"})]}),e[25]=P):P=e[25];let S;e[26]!==r||e[27]!==_?(S=s.jsxs("div",{children:[M,s.jsxs(Gn,{value:r,onValueChange:_,children:[k,P]})]}),e[26]=r,e[27]=_,e[28]=S):S=e[28];let O;e[29]!==D||e[30]!==S||e[31]!==p?(O=s.jsxs("div",{className:"space-y-3",children:[p,D,S]}),e[29]=D,e[30]=S,e[31]=p,e[32]=O):O=e[32];let I;e[33]!==l||e[34]!==c?(I=l>0&&s.jsx(Fe,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{c({filterAgentIds:[],filterUserIds:[],filterStatus:"all"}),u(!1)},children:"Clear all filters"}),e[33]=l,e[34]=c,e[35]=I):I=e[35];let T;e[36]!==O||e[37]!==I?(T=s.jsx(nn,{align:"end",className:"w-[280px]",children:s.jsxs("div",{className:"space-y-4",children:[x,O,I]})}),e[36]=O,e[37]=I,e[38]=T):T=e[38];let L;return e[39]!==d||e[40]!==T||e[41]!==v?(L=s.jsxs(an,{open:d,onOpenChange:u,children:[v,T]}),e[39]=d,e[40]=T,e[41]=v,e[42]=L):L=e[42],L}const ut=50;function Zo(t){const e=le.c(29),{client:n,locator:a,membersData:r,allConnections:o,allVirtualMcps:i,dateRange:l,searchQuery:c,filterAgentIds:d,filterUserIds:u,filterStatus:f}=t,[m,h]=F.useState(null),v=l.startDate.toISOString(),x=l.endDate.toISOString(),g=JSON.stringify({startDate:v,endDate:x,search:c,agentIds:d,userIds:u,status:f}),{data:y,fetchNextPage:p,hasNextPage:j,isFetchingNextPage:N,isLoading:D}=Qt({queryKey:Ee.threadsInfinite(a,g),queryFn:async Y=>{const{pageParam:Z}=Y,Ne=Z===void 0?0:Z;if(!n)throw new Error("MCP client is not available");const H=await n.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:ut,offset:Ne,startDate:v,endDate:x,...c?{search:c}:{},...d&&d.length>0?{agentId:d[0]}:{},...u&&u.length>0?{userId:u[0]}:{},...f&&f!=="all"?{status:f}:{}}});return H.structuredContent??H},initialPageParam:0,getNextPageParam:co,staleTime:3e4}),M=(y?.pages??[]).flatMap(lo),_=M.map(io),{data:k}=Gt({queryKey:Ee.monitoringThreadUsage(a,JSON.stringify({ids:_,startDate:v,endDate:x})),queryFn:async()=>{if(!n)throw new Error("MCP client is not available");const Y=await n.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:_,startDate:v,endDate:x}});return Y.structuredContent??Y},enabled:!!n&&_.length>0,staleTime:3e4}),P=new Map((k?.items??[]).map(oo)),[S,O]=F.useState(null),[I,T]=F.useState("desc");let L;e[0]!==S?(L=Y=>{S===Y?T(so):(O(Y),T("desc"))},e[0]=S,e[1]=L):L=e[1];const W=L,R=Y=>{const Z=P.get(Y);return Z?S==="cost"?Z.costUsd:Z.totalTokens:0},b=S?[...M].sort((Y,Z)=>{const Ne=R(Y.id),H=R(Z.id);return I==="desc"?H-Ne:Ne-H}):M,w=m!==null?b[m]??null:null;let V;e[2]!==p||e[3]!==j||e[4]!==N?(V=()=>{j&&!N&&p()},e[2]=p,e[3]=j,e[4]=N,e[5]=V):V=e[5];const Q=mt(V,j??!1,N),B=!!c||(d?.length??0)>0||(u?.length??0)>0||f&&f!=="all";let U;e[6]===Symbol.for("react.memo_cache_sentinel")?(U=()=>h(ro),e[6]=U):U=e[6];const z=U,G=()=>h(Y=>Y!==null&&Y<b.length-1?Y+1:Y),q="flex-1 flex flex-col overflow-auto min-w-0",J="mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",ce="flex-1 flex flex-col min-w-0",K="flex-1 min-w-0 pt-1",de="min-w-0",ue=D?s.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:s.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading\\u2026"})}):M.length===0?s.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:s.jsx(st,{title:B?"No matching threads":"No threads in this time range",description:B?"Try adjusting your filters or search query.":"Try expanding the time range to see older threads."})}):s.jsxs(s.Fragment,{children:[s.jsxs(Jt,{className:"w-full border-collapse",children:[s.jsx(Zt,{className:"border-b-0 z-20",children:s.jsxs(Qe,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(fe,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Title"}),s.jsx(fe,{className:"w-36 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),s.jsx(fe,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),s.jsx(fe,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),s.jsx(fe,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:s.jsxs("button",{type:"button",onClick:()=>W("tokens"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Tokens",S==="tokens"&&(I==="desc"?s.jsx(Le,{size:12}):s.jsx(ot,{size:12}))]})}),s.jsx(fe,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:s.jsxs("button",{type:"button",onClick:()=>W("cost"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Cost",S==="cost"&&(I==="desc"?s.jsx(Le,{size:12}):s.jsx(ot,{size:12}))]})}),s.jsx(fe,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"})]})}),s.jsx(en,{children:b.map((Y,Z)=>s.jsx(Zs,{thread:Y,usage:P.get(Y.id),members:r,connections:o,virtualMcps:i,onClick:()=>h(Z),lastRowRef:Z===b.length-1?Q:void 0},Y.id))})]}),N&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more..."})]});let re;e[7]!==ue?(re=s.jsx("div",{className:J,children:s.jsx("div",{className:ce,children:s.jsx("div",{className:K,children:s.jsx("div",{className:de,children:ue})})})}),e[7]=ue,e[8]=re):re=e[8];const Me=m!==null;let he;e[9]===Symbol.for("react.memo_cache_sentinel")?(he=Y=>{Y||h(null)},e[9]=he):he=e[9];let ve;e[10]!==o||e[11]!==i||e[12]!==n||e[13]!==b||e[14]!==G||e[15]!==z||e[16]!==a||e[17]!==r||e[18]!==w||e[19]!==m?(ve=w&&m!==null&&s.jsx(Dn,{thread:w,client:n,locator:a,connections:o,virtualMcps:i,members:r,selectedIndex:m,total:b.length,onPrev:z,onNext:G}),e[10]=o,e[11]=i,e[12]=n,e[13]=b,e[14]=G,e[15]=z,e[16]=a,e[17]=r,e[18]=w,e[19]=m,e[20]=ve):ve=e[20];let se;e[21]!==ve?(se=s.jsx(Kt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:ve}),e[21]=ve,e[22]=se):se=e[22];let oe;e[23]!==Me||e[24]!==se?(oe=s.jsx(Xt,{open:Me,onOpenChange:he,children:se}),e[23]=Me,e[24]=se,e[25]=oe):oe=e[25];let ge;return e[26]!==re||e[27]!==oe?(ge=s.jsxs("div",{className:q,children:[re,oe]}),e[26]=re,e[27]=oe,e[28]=ge):ge=e[28],ge}function ro(t){return t!==null&&t>0?t-1:t}function so(t){return t==="desc"?"asc":"desc"}function oo(t){return[t.threadId,{calls:t.calls,inputTokens:t.inputTokens,outputTokens:t.outputTokens,totalTokens:t.totalTokens,costUsd:t.costUsd}]}function io(t){return t.id}function lo(t){return t.items??[]}function co(t,e){const n=t,a=e;if(!((n?.items?.length??0)<ut))return a.length*ut}const ft=50;function qe(t){const e=le.c(10),{title:n,value:a,subtitle:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-foreground/70",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==a?(i=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:a}),e[2]=a,e[3]=i):i=e[3];let l;e[4]!==r?(l=r&&s.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==o||e[7]!==i||e[8]!==l?(c=s.jsxs(Rn,{className:"pt-4 px-4 pb-5 gap-1",children:[o,i,l]}),e[6]=o,e[7]=i,e[8]=l,e[9]=c):c=e[9],c}function uo(t){const e=le.c(27),{automationId:n,range:a}=t,{data:r,isLoading:o}=Hn(n,a),i=r?.runs,l=r?.usage;let c;e[0]!==i?(c=i&&i.total>0?`${Math.round(i.completed/i.total*100)}%`:"—",e[0]=i,e[1]=c):c=e[1];const d=c,u=l&&l.truncated?`last ${l.sampledRuns} runs`:void 0;let f;e[2]!==o||e[3]!==i?.total?(f=o?"…":i?.total.toLocaleString()??"0",e[2]=o,e[3]=i?.total,e[4]=f):f=e[4];const m=i?`${i.completed} ok · ${i.failed} failed${i.inProgress>0?` · ${i.inProgress} running`:""}`:void 0;let h;e[5]!==f||e[6]!==m?(h=s.jsx(qe,{title:"Runs",value:f,subtitle:m}),e[5]=f,e[6]=m,e[7]=h):h=e[7];const v=o?"…":d;let x;e[8]!==v?(x=s.jsx(qe,{title:"Success rate",value:v}),e[8]=v,e[9]=x):x=e[9];let g;e[10]!==o||e[11]!==l?.totalTokens?(g=o?"…":Ct(l?.totalTokens??0),e[10]=o,e[11]=l?.totalTokens,e[12]=g):g=e[12];let y;e[13]!==g||e[14]!==u?(y=s.jsx(qe,{title:"Tokens",value:g,subtitle:u}),e[13]=g,e[14]=u,e[15]=y):y=e[15];let p;e[16]!==o||e[17]!==l?(p=o?"…":l&&l.costUsd>0?Pt(l.costUsd):"—",e[16]=o,e[17]=l,e[18]=p):p=e[18];let j;e[19]!==p||e[20]!==u?(j=s.jsx(qe,{title:"Cost",value:p,subtitle:u}),e[19]=p,e[20]=u,e[21]=j):j=e[21];let N;return e[22]!==j||e[23]!==h||e[24]!==x||e[25]!==y?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[h,x,y,j]}),e[22]=j,e[23]=h,e[24]=x,e[25]=y,e[26]=N):N=e[26],N}function fo(t){const e=le.c(39),{run:n,usage:a,onClick:r,lastRowRef:o}=t;let i,l;if(e[0]!==n.created_at){const k=new Date(n.created_at);i=k.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l=k.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[0]=n.created_at,e[1]=i,e[2]=l}else i=e[1],l=e[2];const c=l,d=Oe[n.status]??Oe.completed,u=d.icon;let f;e[3]!==n.title?(f=s.jsx(me,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:n.title})}),e[3]=n.title,e[4]=f):f=e[4];let m;e[5]!==u||e[6]!==d.iconClassName?(m=s.jsx(u,{size:14,className:d.iconClassName}),e[5]=u,e[6]=d.iconClassName,e[7]=m):m=e[7];let h;e[8]!==d.labelColor?(h=ye("text-sm",d.labelColor),e[8]=d.labelColor,e[9]=h):h=e[9];let v;e[10]!==d.label||e[11]!==h?(v=s.jsx("span",{className:h,children:d.label}),e[10]=d.label,e[11]=h,e[12]=v):v=e[12];let x;e[13]!==m||e[14]!==v?(x=s.jsx(me,{className:"w-28 px-3",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[m,v]})}),e[13]=m,e[14]=v,e[15]=x):x=e[15];let g;e[16]!==a?(g=a?Ct(a.totalTokens):"—",e[16]=a,e[17]=g):g=e[17];let y;e[18]!==g?(y=s.jsx(me,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:g}),e[18]=g,e[19]=y):y=e[19];let p;e[20]!==a?(p=a&&a.costUsd>0?Pt(a.costUsd):"—",e[20]=a,e[21]=p):p=e[21];let j;e[22]!==p?(j=s.jsx(me,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:p}),e[22]=p,e[23]=j):j=e[23];let N;e[24]!==i?(N=s.jsx("div",{children:i}),e[24]=i,e[25]=N):N=e[25];let D;e[26]!==c?(D=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:c}),e[26]=c,e[27]=D):D=e[27];let M;e[28]!==N||e[29]!==D?(M=s.jsxs(me,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[N,D]}),e[28]=N,e[29]=D,e[30]=M):M=e[30];let _;return e[31]!==o||e[32]!==r||e[33]!==j||e[34]!==M||e[35]!==f||e[36]!==x||e[37]!==y?(_=s.jsxs(Qe,{ref:o,className:"h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:r,children:[f,x,y,j,M]}),e[31]=o,e[32]=r,e[33]=j,e[34]=M,e[35]=f,e[36]=x,e[37]=y,e[38]=_):_=e[38],_}function ei(t){const e=le.c(48),{automationId:n,triggerIds:a,range:r}=t,{org:o,locator:i}=Cn();let l;e[0]!==o.id||e[1]!==o.slug?(l={connectionId:Fn,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=l):l=e[2];const c=En(l),d=$n(),u=Tn(),f=Ln(),{data:m}=Bn(),[h,v]=F.useState(null),x=a.length>0;let g;e[3]!==n||e[4]!==o.id||e[5]!==a?(g=Ee.automationRuns(o.id,n,a),e[3]=n,e[4]=o.id,e[5]=a,e[6]=g):g=e[6];let y;e[7]!==d||e[8]!==a?(y=async K=>{const{pageParam:de}=K,ue=de===void 0?0:de;return await d.call("COLLECTION_THREADS_LIST",{limit:ft,offset:ue,where:{trigger_ids:a}})},e[7]=d,e[8]=a,e[9]=y):y=e[9];let p;e[10]!==x||e[11]!==g||e[12]!==y?(p={queryKey:g,queryFn:y,initialPageParam:0,getNextPageParam:xo,enabled:x,staleTime:3e4},e[10]=x,e[11]=g,e[12]=y,e[13]=p):p=e[13];const{data:j,fetchNextPage:N,hasNextPage:D,isFetchingNextPage:M,isLoading:_}=Qt(p),k=(j?.pages??[]).flatMap(go),P=k.map(vo),{data:S}=Gt({queryKey:Ee.monitoringThreadUsage(i,JSON.stringify({ids:P,...r})),queryFn:async()=>await d.call("MONITORING_THREAD_USAGE",{threadIds:P,...r.startDate?{startDate:r.startDate}:{},...r.endDate?{endDate:r.endDate}:{}}),enabled:P.length>0,staleTime:3e4});let O;e[14]!==S?.items?(O=new Map((S?.items??[]).map(ho)),e[14]=S?.items,e[15]=O):O=e[15];const I=O;let T;e[16]!==N||e[17]!==D||e[18]!==M?(T=()=>{D&&!M&&N()},e[16]=N,e[17]=D,e[18]=M,e[19]=T):T=e[19];const L=mt(T,D??!1,M),W=h!==null?k[h]??null:null;let R;e[20]===Symbol.for("react.memo_cache_sentinel")?(R=()=>v(mo),e[20]=R):R=e[20];const b=R,w=()=>v(K=>K!==null&&K<k.length-1?K+1:K),V="flex flex-col gap-5";let X;e[21]!==n||e[22]!==r?(X=s.jsx(uo,{automationId:n,range:r}),e[21]=n,e[22]=r,e[23]=X):X=e[23];const Q=x?_?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading runs…"}):k.length===0?s.jsx("div",{className:"py-16",children:s.jsx(st,{title:"No runs yet",description:"This automation hasn't run yet. Trigger it or wait for a starter to fire."})}):s.jsxs(Jt,{className:"w-full border-collapse",children:[s.jsx(Zt,{className:"border-b-0",children:s.jsxs(Qe,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(fe,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Run"}),s.jsx(fe,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),s.jsx(fe,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Tokens"}),s.jsx(fe,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Cost"}),s.jsx(fe,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Started"})]})}),s.jsx(en,{children:k.map((K,de)=>s.jsx(fo,{run:K,usage:I.get(K.id),onClick:()=>v(de),lastRowRef:de===k.length-1?L:void 0},K.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(st,{title:"No starters yet",description:"Add a starter (cron, event, or webhook) to start collecting runs."})});let B;e[24]!==M?(B=M&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more…"}),e[24]=M,e[25]=B):B=e[25];const U=h!==null;let z;e[26]===Symbol.for("react.memo_cache_sentinel")?(z=K=>{K||v(null)},e[26]=z):z=e[26];let G;e[27]!==u||e[28]!==f||e[29]!==c||e[30]!==w||e[31]!==b||e[32]!==i||e[33]!==m||e[34]!==k||e[35]!==W||e[36]!==h?(G=W&&h!==null&&s.jsx(Dn,{thread:W,client:c,locator:i,connections:u,virtualMcps:f,members:m,selectedIndex:h,total:k.length,onPrev:b,onNext:w}),e[27]=u,e[28]=f,e[29]=c,e[30]=w,e[31]=b,e[32]=i,e[33]=m,e[34]=k,e[35]=W,e[36]=h,e[37]=G):G=e[37];let q;e[38]!==G?(q=s.jsx(Kt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:G}),e[38]=G,e[39]=q):q=e[39];let J;e[40]!==U||e[41]!==q?(J=s.jsx(Xt,{open:U,onOpenChange:z,children:q}),e[40]=U,e[41]=q,e[42]=J):J=e[42];let ce;return e[43]!==Q||e[44]!==B||e[45]!==J||e[46]!==X?(ce=s.jsxs("div",{className:V,children:[X,Q,B,J]}),e[43]=Q,e[44]=B,e[45]=J,e[46]=X,e[47]=ce):ce=e[47],ce}function mo(t){return t!==null&&t>0?t-1:t}function ho(t){return[t.threadId,{calls:t.calls,inputTokens:t.inputTokens,outputTokens:t.outputTokens,totalTokens:t.totalTokens,costUsd:t.costUsd}]}function vo(t){return t.id}function go(t){return t.items??[]}function xo(t,e){const n=t,a=e;if(!((n?.items?.length??0)<ft))return a.length*ft}export{ei as A,zo as C,Ut as M,Jo as T,Pt as a,Qo as b,Xs as c,Xo as d,Ko as e,Ct as f,Go as g,kn as h,Zo as i};
@@ -1 +0,0 @@
1
- import{c as B,j as o,D as L,b as T,r as $,B as M,v as N}from"./index-5MyNR89x.js";import{s as D}from"./Plus-hFZ_SbzL.js";import{i as S}from"./Zap-USVmT42t.js";import{S as q}from"./search-input-BXzntIcj.js";import{P as l}from"./index-CshxsRNd.js";import{E as b}from"./empty-state-D7nJB9UW.js";import{c as O}from"./use-automations-ChKoVegP.js";import{m as V}from"./use-navigate-to-agent-BtVHPn7N.js";import{A as F}from"./automation-list-row-DO51bU3z.js";import{o as G}from"./use-mcp-client-CherrXvD.js";import{u as H}from"./use-virtual-mcp-C5pbd140.js";import{R as J}from"./require-capability-BclGG3Lq.js";import"./SearchMd-RBoojwOu.js";import"./sidebar-oYab2QX7.js";import"./LayoutLeft-DiQ60pSu.js";import"./use-mobile-lIIxFH5C.js";import"./sheet-M6dgbK60.js";import"./X-DlUiLOPC.js";import"./tooltip-DvT2WKW9.js";import"./studio-tools-4NjxmaVZ.js";import"./alert-dialog-BZ8TrIVu.js";import"./dropdown-menu-Dw-pnYXI.js";import"./ChevronUp-CtzC0jb0.js";import"./ChevronRight-BhZIqa2P.js";import"./DotsVertical-DskMPw9G.js";import"./Stars02-Call5O4Q.js";import"./Trash01-CGEeRKCz.js";import"./agent-icon-CCm6veEh.js";import"./AlertCircle-B4WPpzHx.js";import"./Tool01-DFCFgRlB.js";import"./SwitchHorizontal01-BcqnyefE.js";import"./Settings02-CuT9JazG.js";import"./XCircle-BIxZfFEg.js";import"./ArrowUpRight-n7J2ORua.js";import"./ZapSquare-qeizwUPq.js";import"./Users03-DBa0-LbB.js";import"./CheckCircle-DGqDWZvl.js";import"./ChevronDown-BzkFMF52.js";import"./ChevronLeft-B-p3uhTp.js";import"./Eye-Bkw15G1G.js";import"./ZoomOut-fkR_2hFy.js";import"./Globe01-CIvUZBh0.js";import"./FilterLines-CTiCp3St.js";import"./Star01-BMttIRxb.js";import"./Globe04-By_qGXm-.js";import"./HardDrive-Da-ea-EW.js";import"./Key01-DugFMT5_.js";import"./LinkExternal01-BMDEbMBF.js";import"./Monitor01-BFD-ivVa.js";import"./Sun-B0JI-Irq.js";import"./Palette-DrmZY9bB.js";import"./Play-CiiKZLoa.js";import"./SearchLg-D4Hs4YLQ.js";import"./Shield01-D5Fc_Ylv.js";import"./Stars01-HANlppqn.js";import"./Upload01-V0qkIpRk.js";import"./User01-Co_ACiCO.js";import"./Users01-B-VpMOmx.js";import"./XClose-CEJj7vhn.js";import"./auth-CNqDC7uO.js";import"./use-collections-DAKL2YGx.js";import"./use-capability-CQPMPR-5.js";import"./access-gate-Dob1Rc1a.js";import"./capability-load-error-C00HLz2q.js";function K(){const t=B.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(q,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(D,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function ro(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{ro as default};
@@ -1 +0,0 @@
1
- import{c as O,l as Y,j as t,r as Q,B as H,i as le}from"./index-5MyNR89x.js";import{W as Z}from"./agent-icon-CCm6veEh.js";import{i as ie}from"./X-DlUiLOPC.js";import{L as J}from"./label-Bj7qsNrz.js";import{I as ae,R as oe,a as re}from"./index-Cxp4ZtBG.js";import{a as ce}from"./DotsVertical-DskMPw9G.js";import{d as ne,b as me,c as de,S as pe,a as xe}from"./select-CZgnwyj0.js";import{a as fe,b as ue,T as he}from"./tooltip-DvT2WKW9.js";import"./AlertCircle-B4WPpzHx.js";import"./Tool01-DFCFgRlB.js";import"./SwitchHorizontal01-BcqnyefE.js";import"./Settings02-CuT9JazG.js";import"./XCircle-BIxZfFEg.js";import"./ArrowUpRight-n7J2ORua.js";import"./ZapSquare-qeizwUPq.js";import"./Users03-DBa0-LbB.js";import"./CheckCircle-DGqDWZvl.js";import"./ChevronUp-CtzC0jb0.js";import"./ChevronDown-BzkFMF52.js";import"./ChevronLeft-B-p3uhTp.js";import"./ChevronRight-BhZIqa2P.js";import"./Stars02-Call5O4Q.js";import"./Eye-Bkw15G1G.js";import"./ZoomOut-fkR_2hFy.js";import"./Globe01-CIvUZBh0.js";import"./FilterLines-CTiCp3St.js";import"./Star01-BMttIRxb.js";import"./Globe04-By_qGXm-.js";import"./HardDrive-Da-ea-EW.js";import"./Key01-DugFMT5_.js";import"./LayoutLeft-DiQ60pSu.js";import"./LinkExternal01-BMDEbMBF.js";import"./Monitor01-BFD-ivVa.js";import"./Sun-B0JI-Irq.js";import"./Palette-DrmZY9bB.js";import"./Play-CiiKZLoa.js";import"./Plus-hFZ_SbzL.js";import"./SearchLg-D4Hs4YLQ.js";import"./SearchMd-RBoojwOu.js";import"./Shield01-D5Fc_Ylv.js";import"./Stars01-HANlppqn.js";import"./Trash01-CGEeRKCz.js";import"./Upload01-V0qkIpRk.js";import"./User01-Co_ACiCO.js";import"./Users01-B-VpMOmx.js";import"./XClose-CEJj7vhn.js";import"./Zap-USVmT42t.js";function ge(i){const e=O.c(8);let a,s;e[0]!==i?({className:a,...s}=i,e[0]=i,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let o;e[3]!==a?(o=Y("grid gap-3",a),e[3]=a,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=t.jsx(oe,{"data-slot":"radio-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function X(i){const e=O.c(9);let a,s;e[0]!==i?({className:a,...s}=i,e[0]=i,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let o;e[3]!==a?(o=Y("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",a),e[3]=a,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(re,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==o?(c=t.jsx(ae,{"data-slot":"radio-group-item",className:o,...s,children:l}),e[6]=s,e[7]=o,e[8]=c):c=e[8],c}function xt(i){const e=O.c(69),{posts:a,categories:s,initialSlug:o,isPending:l,onApply:c,onClose:d}=i,[n,ee]=Q.useState(o&&s.some(m=>m.slug===o)?o:s[0]?.slug??""),[p,te]=Q.useState("add");let T;if(e[0]!==s||e[1]!==n){let m;e[3]!==n?(m=se=>se.slug===n,e[3]=n,e[4]=m):m=e[4],T=s.find(m),e[0]=s,e[1]=n,e[2]=T}else T=e[2];const x=T,r=a.length,K=r===1?"post":"posts";let f;e[5]!==r||e[6]!==K?(f=t.jsxs("span",{className:"truncate text-sm font-medium",children:[r," ",K," selected"]}),e[5]=r,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ie,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==d?(u=t.jsx(fe,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:d,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=d,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=t.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=r===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${r} ${r===1?"post":"posts"}.`;let j;e[19]!==M?(j=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(J,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==s||e[23]!==n?(b=t.jsxs("div",{className:"space-y-2",children:[B,s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):t.jsxs(ne,{value:n,onValueChange:ee,children:[t.jsx(me,{className:"w-full",children:t.jsx(de,{placeholder:"Select a category"})}),t.jsx(pe,{children:s.map(be)})]})]}),e[22]=s,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=m=>te(m),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(X,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsxs(J,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(X,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(J,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==p?(y=t.jsxs(ge,{value:p,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=p,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==d?(N=t.jsx(H,{type:"button",variant:"outline",onClick:d,disabled:l,children:"Cancel"}),e[32]=l,e[33]=d,e[34]=N):N=e[34];const W=!x||l||r===0;let v;e[35]!==p||e[36]!==c||e[37]!==x?(v=()=>x&&c(p,{name:x.name,slug:x.slug}),e[35]=p,e[36]=c,e[37]=x,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?t.jsxs(t.Fragment,{children:[t.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==W||e[42]!==v||e[43]!==S?(_=t.jsx(H,{type:"button",disabled:W,onClick:v,children:S}),e[41]=W,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=t.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=t.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const D=r===1?"post":"posts";let w;e[53]!==r||e[54]!==D?(w=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,t.jsxs("span",{className:"text-sm",children:[r," selected ",D]})]}),e[53]=r,e[54]=D,e[55]=w):w=e[55];let R;e[56]!==r||e[57]!==a?(R=r===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):t.jsx("ul",{className:"divide-y border-t bg-background",children:a.map(je)}),e[56]=r,e[57]=a,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function be(i){return t.jsx(xe,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{xt as BulkCategoryPanel};
@@ -1 +0,0 @@
1
- import{c as J,r as S,l as Q,j as t,B as U,i as V,t as I}from"./index-5MyNR89x.js";import{i as X}from"./XCircle-BIxZfFEg.js";import{aC as Y,W as T}from"./agent-icon-CCm6veEh.js";import{n as Z}from"./LinkExternal01-BMDEbMBF.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-BZ8TrIVu.js";import{I as L}from"./input-D9aeO8wK.js";import{L as M}from"./label-Bj7qsNrz.js";import{au as at,av as nt,aD as mt,at as lt,aw as R,ay as pt,aE as ct}from"./index-BWMRVcd2.js";import{c as dt,B as ut,a as gt}from"./block-document-AtpOGVAy.js";import{u as xt,s as v,E as ft}from"./primitives-CAIbeS4G.js";import{t as ht}from"./ChevronDown-BzkFMF52.js";import{f as yt,h as jt,e as vt}from"./scroll-area-DLqMfi_N.js";import"./AlertCircle-B4WPpzHx.js";import"./Tool01-DFCFgRlB.js";import"./SwitchHorizontal01-BcqnyefE.js";import"./Settings02-CuT9JazG.js";import"./ArrowUpRight-n7J2ORua.js";import"./ZapSquare-qeizwUPq.js";import"./Users03-DBa0-LbB.js";import"./CheckCircle-DGqDWZvl.js";import"./ChevronUp-CtzC0jb0.js";import"./ChevronLeft-B-p3uhTp.js";import"./ChevronRight-BhZIqa2P.js";import"./DotsVertical-DskMPw9G.js";import"./Stars02-Call5O4Q.js";import"./Eye-Bkw15G1G.js";import"./ZoomOut-fkR_2hFy.js";import"./Globe01-CIvUZBh0.js";import"./FilterLines-CTiCp3St.js";import"./Star01-BMttIRxb.js";import"./Globe04-By_qGXm-.js";import"./HardDrive-Da-ea-EW.js";import"./Key01-DugFMT5_.js";import"./LayoutLeft-DiQ60pSu.js";import"./Monitor01-BFD-ivVa.js";import"./Sun-B0JI-Irq.js";import"./Palette-DrmZY9bB.js";import"./Play-CiiKZLoa.js";import"./Plus-hFZ_SbzL.js";import"./SearchLg-D4Hs4YLQ.js";import"./SearchMd-RBoojwOu.js";import"./Shield01-D5Fc_Ylv.js";import"./Stars01-HANlppqn.js";import"./Trash01-CGEeRKCz.js";import"./Upload01-V0qkIpRk.js";import"./User01-Co_ACiCO.js";import"./Users01-B-VpMOmx.js";import"./XClose-CEJj7vhn.js";import"./X-DlUiLOPC.js";import"./Zap-USVmT42t.js";import"./index-BFW_K0gJ.js";import"./chat-context-B5uEh4ay.js";import"./hooks-DgSrpwcx.js";import"./use-mcp-client-CherrXvD.js";import"./auth-CNqDC7uO.js";import"./decopilot-sse-pool-DoJkdYBA.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-C5pbd140.js";import"./use-collections-DAKL2YGx.js";import"./use-ai-providers-D4m0Vu5Q.js";import"./studio-tools-4NjxmaVZ.js";import"./use-decopilot-events-BDkaUhLT.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-CZfEdu0P.js";import"./tooltip-DvT2WKW9.js";import"./dialog-B2cGEuOv.js";import"./drawer-Tv6bcT7w.js";import"./collection-search-CN9TCItb.js";import"./use-mobile-lIIxFH5C.js";import"./use-mcp-prompts-BnOdccbh.js";import"./shell-layout-CnTaR8UN.js";import"./avatar-Jhd31ejW.js";import"./required-auth-layout-CZqB7vUr.js";import"./use-org-sso-BxzKK5rO.js";import"./form-DI8q6OtF.js";import"./select-CZgnwyj0.js";import"./tabs-8VxbUDVb.js";import"./toggle-group-CndOAl-N.js";import"./sortable.esm-D8GIYMew.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BswtsnGE.js";import"./use-registry-connections-C_VqH6te.js";import"./use-connection-BvgL1-Da.js";import"./useInfiniteQuery-_sl5B1oR.js";import"./use-infinite-scroll-4tV6tFjB.js";import"./extract-connection-data-CxK1dunT.js";import"./card-D3bKVB8y.js";import"./integration-icon-CMGCCNyJ.js";import"./collection-tabs-D5o6VjHd.js";import"./badge-cxwmW2xd.js";import"./textarea-Bwn2Wdf8.js";import"./connection-form-helpers-JfkHcTGO.js";import"./authenticate-and-persist-oauth-Dy2XeMqO.js";import"./mcp-oauth-DEfvhjPc.js";import"./useSuspenseInfiniteQuery-_eC9d3ii.js";import"./connect-desktop-dialog-DchtPbuP.js";import"./decopilot-CfDwLIyX.js";import"./checkbox-PMXW46HN.js";import"./skeleton-DoPnd-4p.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Br7JxQz6.js";import"./popover-DowpnV25.js";import"./command-D-t5bmXW.js";import"./index-BD4HYlEX.js";import"./use-org-fs-D-40uH2W.js";import"./dropdown-menu-Dw-pnYXI.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CWHPQWBO.js";import"./empty-state-D7nJB9UW.js";import"./toolbar-ClL4Dhs_.js";import"./preview-dialog-CwTtT7qa.js";import"./index-BgPTCVWL.js";import"./file-type-icon-W_AZRfzL.js";import"./use-mcp-tools-w6KwNDra.js";import"./types-U3TqUYrY.js";import"./use-capability-CQPMPR-5.js";import"./shell-route-loading-DFu6UBUI.js";import"./tools-list-DL7ip2gg.js";import"./switch-DLNzAYS1.js";import"./use-debounced-autosave-mA5Fw-09.js";import"./index-CshxsRNd.js";import"./sidebar-oYab2QX7.js";import"./sheet-M6dgbK60.js";import"./search-input-BXzntIcj.js";import"./github-repo-picker-M1TBbLot.js";import"./use-debounced-value-cQ7ZQKtl.js";import"./use-navigate-to-agent-BtVHPn7N.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-Dn4coT0R.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./automation-runs-CXnAhWiY.js";import"./table-B06cGuvx.js";import"./use-members-ge80zFlj.js";import"./use-org-auth-client-Ctxe3HXF.js";import"./task-status-Cm29b2AK.js";import"./use-automations-ChKoVegP.js";import"./use-file-configs-Dfeoim5G.js";import"./monaco-editor-B3KzPr3D.js";import"./select-model-BLeb_gwV.js";import"./automation-list-row-DO51bU3z.js";import"./use-clock-tick-CJO5qoT7.js";import"./use-copy-WaepYGtr.js";import"./content-blocks-o63cs2vh.js";function bt(k){const e=J.c(18),{icon:f,title:m,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==m?(i=t.jsx("span",{className:"flex-1 text-left",children:m}),e[2]=m,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function ar({orgSlug:k,virtualMcpId:e,branch:f,blockKey:m,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=nt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:m,data:R(m,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[n,C]=S.useState(null),[N,E]=S.useState(!1),$=a?mt(d).filter(o=>o.categorySlugs.includes(a)):[],j=$.length,W=o=>s("slug",o),H=async(o,w)=>{const G=v(r.name);E(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:G,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:R(P,"posts",F)}),g+=1)}const z={...r,slug:w};await i.mutateAsync({blockKey:m,data:R(m,"categories",z)}),c(z),I.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),I.error(g instanceof Error?g.message:"Rename failed")}finally{E(!1)}},q=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){W(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:q,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!n,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:n?`Changing the slug from "${n.oldSlug}" to "${n.newSlug}" will update ${n.count} ${n.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),n&&H(n.oldSlug,n.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{ar as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as y,j as t,B as F,i as X,o as Ge,s as se,E as Pe,r as T,D as ie,p as Qe,l as J,bh as Ye,u as Xe,G,t as Ze,e as ae,b2 as ke}from"./index-5MyNR89x.js";import{E as Ee}from"./empty-state-D7nJB9UW.js";import{u as et,a as Ae}from"./use-collections-DAKL2YGx.js";import{u as ce}from"./use-mcp-client-CherrXvD.js";import{F as ne,a as tt,b as de,d as me}from"./form-DI8q6OtF.js";import{I as ue}from"./input-D9aeO8wK.js";import{T as re}from"./textarea-Bwn2Wdf8.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-CABmrUBB.js";import{al as rt,y as it,aa as at,am as ct,_ as dt,an as mt,J as be}from"./agent-icon-CCm6veEh.js";import{g as ut,M as xt,a as Ne}from"./types-U3TqUYrY.js";import{A as pt,a as ft,b as ht}from"./alert-ez0UE1C8.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-CZgnwyj0.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-DvT2WKW9.js";import{i as jt}from"./AlertCircle-B4WPpzHx.js";import{s as bt}from"./Stars02-Call5O4Q.js";import{a as Nt}from"./Eye-Bkw15G1G.js";import{i as vt}from"./Play-CiiKZLoa.js";import{i as St}from"./ChevronRight-BhZIqa2P.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./tools-list-DL7ip2gg.js";import{a as Oe,u as Re}from"./use-connection-BvgL1-Da.js";import{a as It}from"./use-mcp-tools-w6KwNDra.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-CMGCCNyJ.js";import{i as Tt,l as Pt}from"./chat-context-B5uEh4ay.js";import{b as kt}from"./shell-layout-CnTaR8UN.js";import{M as Et}from"./monaco-editor-B3KzPr3D.js";import{n as At}from"./XCircle-BIxZfFEg.js";import"./auth-CNqDC7uO.js";import"./label-Bj7qsNrz.js";import"./index-CshxsRNd.js";import"./sidebar-oYab2QX7.js";import"./LayoutLeft-DiQ60pSu.js";import"./use-mobile-lIIxFH5C.js";import"./sheet-M6dgbK60.js";import"./X-DlUiLOPC.js";import"./ZoomOut-fkR_2hFy.js";import"./Key01-DugFMT5_.js";import"./extract-connection-data-CxK1dunT.js";import"./use-registry-connections-C_VqH6te.js";import"./use-organization-settings-CZfEdu0P.js";import"./studio-tools-4NjxmaVZ.js";import"./Plus-hFZ_SbzL.js";import"./index-CO_UO0dQ.js";import"./index-Cxp4ZtBG.js";import"./index-BD4HYlEX.js";import"./popover-DowpnV25.js";import"./use-virtual-mcp-C5pbd140.js";import"./ChevronUp-CtzC0jb0.js";import"./SearchMd-RBoojwOu.js";import"./Users03-DBa0-LbB.js";import"./use-create-virtual-mcp-BSTwTG_J.js";import"./use-navigate-to-agent-BtVHPn7N.js";import"./Tool01-DFCFgRlB.js";import"./SwitchHorizontal01-BcqnyefE.js";import"./Settings02-CuT9JazG.js";import"./ArrowUpRight-n7J2ORua.js";import"./ZapSquare-qeizwUPq.js";import"./CheckCircle-DGqDWZvl.js";import"./ChevronDown-BzkFMF52.js";import"./ChevronLeft-B-p3uhTp.js";import"./DotsVertical-DskMPw9G.js";import"./Globe01-CIvUZBh0.js";import"./FilterLines-CTiCp3St.js";import"./Star01-BMttIRxb.js";import"./Globe04-By_qGXm-.js";import"./HardDrive-Da-ea-EW.js";import"./LinkExternal01-BMDEbMBF.js";import"./Monitor01-BFD-ivVa.js";import"./Sun-B0JI-Irq.js";import"./Palette-DrmZY9bB.js";import"./SearchLg-D4Hs4YLQ.js";import"./Shield01-D5Fc_Ylv.js";import"./Stars01-HANlppqn.js";import"./Trash01-CGEeRKCz.js";import"./Upload01-V0qkIpRk.js";import"./User01-Co_ACiCO.js";import"./Users01-B-VpMOmx.js";import"./XClose-CEJj7vhn.js";import"./Zap-USVmT42t.js";import"./mcp-oauth-DEfvhjPc.js";import"./badge-cxwmW2xd.js";import"./hooks-DgSrpwcx.js";import"./decopilot-sse-pool-DoJkdYBA.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-D4m0Vu5Q.js";import"./use-decopilot-events-BDkaUhLT.js";import"./tab-id-BptcWVWa.js";import"./avatar-Jhd31ejW.js";import"./dialog-B2cGEuOv.js";import"./required-auth-layout-CZqB7vUr.js";import"./use-org-sso-BxzKK5rO.js";import"./index-BgPTCVWL.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Mt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Dt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Dt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Mt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=J("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=J("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=J("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=J("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=J("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=J("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Jt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Jt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),V=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const je=Number(h[M]);Number.isNaN(je)||(h[M]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Je=t.jsx(_e,{children:t.jsxs(De,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(Me,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Ve=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&D==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:V,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Je,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Ve}),qe]})})]})})}function Vt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=J("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:J(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Vt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async D=>{r&&await R.update.mutateAsync({id:r,data:D})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(Me,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(De,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let D;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(D=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let V;return s[38]!==L||s[39]!==O?(V=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=V):V=s[40],V}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Ln(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Ln as default};