decocms 2.179.2 → 2.179.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/dist/client/assets/{AlertCircle-QngH9BVd.js → AlertCircle-DcuzO-dN.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-BUW8XsMa.js → AlignLeft-DH6vJ97u.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-Ba2t7m6d.js → ArrowDown-DrJY3Wf3.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-DX2ldnBo.js → ArrowLeft-B0zQkfl0.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-Wy3Qa9X3.js → ArrowUp-B4DKDJey.js} +1 -1
  6. package/dist/client/assets/{Building02-DW6RLSwU.js → Building02-B5vUKe4K.js} +1 -1
  7. package/dist/client/assets/{Check-CLxUgI8Z.js → Check-5nIJP_0B.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-DDKCxiAn.js → CheckCircle-CPfAK_ok.js} +1 -1
  9. package/dist/client/assets/{CheckSquare-IgZnioYh.js → CheckSquare-Bd5OlGNx.js} +1 -1
  10. package/dist/client/assets/{CheckVerified02-Brnp4Z-Q.js → CheckVerified02-BImD45AM.js} +1 -1
  11. package/dist/client/assets/{ChevronDown-D0b1rvAp.js → ChevronDown-t60R5l2B.js} +1 -1
  12. package/dist/client/assets/{ChevronLeft-BOF7bp9d.js → ChevronLeft-lVdUD9SW.js} +1 -1
  13. package/dist/client/assets/{ChevronRight-BEUO8jhU.js → ChevronRight-3uKoJ2yX.js} +1 -1
  14. package/dist/client/assets/{ChevronUp-BWhuIqS7.js → ChevronUp-l7iXrppT.js} +1 -1
  15. package/dist/client/assets/{Clock-Aquumu5W.js → Clock-Cu62NiMl.js} +1 -1
  16. package/dist/client/assets/{Code01-_in0gxFd.js → Code01-DA4cXrzu.js} +1 -1
  17. package/dist/client/assets/{Container-b65PFshp.js → Container-Cvd3ILsk.js} +1 -1
  18. package/dist/client/assets/{Copy01-Ds0OKZs5.js → Copy01-DCmX2pvi.js} +1 -1
  19. package/dist/client/assets/{Dataflow03-CE4IJeUz.js → Dataflow03-SvWKmU9-.js} +1 -1
  20. package/dist/client/assets/{DotsHorizontal-EK1-V4Yv.js → DotsHorizontal-DE3Ptwny.js} +1 -1
  21. package/dist/client/assets/{DotsVertical-Bo0fAyx-.js → DotsVertical-CZep1rYf.js} +1 -1
  22. package/dist/client/assets/{Download01-CN3AkzFm.js → Download01-DOZIvPhC.js} +1 -1
  23. package/dist/client/assets/{Edit01-BeW3IgwV.js → Edit01-Bh7u1xp-.js} +1 -1
  24. package/dist/client/assets/{Edit05-DDQmnS5O.js → Edit05-DwDDlBNQ.js} +1 -1
  25. package/dist/client/assets/{Eye-Cqad01Et.js → Eye-D3Q7o9JY.js} +1 -1
  26. package/dist/client/assets/{EyeOff-rTYDCZUH.js → EyeOff--TPuyP7J.js} +1 -1
  27. package/dist/client/assets/{File02-k_9AZvHT.js → File02-6xeEPCuC.js} +1 -1
  28. package/dist/client/assets/{File06-BAp2UeVQ.js → File06-BocZAjHf.js} +1 -1
  29. package/dist/client/assets/{FilterLines-BQVg1PzI.js → FilterLines-CUdG83Ae.js} +1 -1
  30. package/dist/client/assets/{Globe01-sBw0ReRO.js → Globe01-BTdgnOS2.js} +1 -1
  31. package/dist/client/assets/{Globe02-DlxZmkSI.js → Globe02-X8fGWI0t.js} +1 -1
  32. package/dist/client/assets/{Grid01-B9zEjFyx.js → Grid01-NkSMXhQ7.js} +1 -1
  33. package/dist/client/assets/{Home02-DsMimBHw.js → Home02-BmcJp5G2.js} +1 -1
  34. package/dist/client/assets/{Image01-zSA25K9S.js → Image01-RwxwuRZg.js} +1 -1
  35. package/dist/client/assets/{Inbox01-Bcon6dDK.js → Inbox01-B7dU6IpS.js} +1 -1
  36. package/dist/client/assets/{InfoCircle-CA8mfcG6.js → InfoCircle-BO2XWy7v.js} +1 -1
  37. package/dist/client/assets/{Key01-V3zgT2bk.js → Key01-CjhxaGrC.js} +1 -1
  38. package/dist/client/assets/{LayersTwo01-D3otbQFN.js → LayersTwo01-DEwkReGL.js} +1 -1
  39. package/dist/client/assets/{Link01-VlHez4tu.js → Link01-h9aUM7NA.js} +1 -1
  40. package/dist/client/assets/{LinkExternal01-vs3DKlfq.js → LinkExternal01-CmkQ0Pr-.js} +1 -1
  41. package/dist/client/assets/{List-D6xZGoxJ.js → List-BbeB05v1.js} +1 -1
  42. package/dist/client/assets/{Loading01-DQphO9Su.js → Loading01-D0sCOwf7.js} +1 -1
  43. package/dist/client/assets/{Lock01-Cbqd9PVH.js → Lock01-DFfVnVtc.js} +1 -1
  44. package/dist/client/assets/{Play-jCDYHrdu.js → Play-hGa2UcUZ.js} +1 -1
  45. package/dist/client/assets/{Plus-CURSuoDd.js → Plus-Dcf0Y3wA.js} +1 -1
  46. package/dist/client/assets/{RefreshCcw01-oV1XFIRn.js → RefreshCcw01-BOXuamrY.js} +1 -1
  47. package/dist/client/assets/{Save01-CpNh-fPw.js → Save01-CA0I32a6.js} +1 -1
  48. package/dist/client/assets/{SearchMd-C8ADHGFY.js → SearchMd-BSRGE1t4.js} +1 -1
  49. package/dist/client/assets/{Settings01-B76KnDHb.js → Settings01-CCUkMwLj.js} +1 -1
  50. package/dist/client/assets/{Shield01-BodC6YjW.js → Shield01-BYpsgCVA.js} +1 -1
  51. package/dist/client/assets/{Terminal-BHkLJhoR.js → Terminal-ZymOmGb9.js} +1 -1
  52. package/dist/client/assets/{Tool01-DlbILfZg.js → Tool01-Doogi-IK.js} +1 -1
  53. package/dist/client/assets/{Trash01-CYMRq_nY.js → Trash01-Cs72bTP6.js} +1 -1
  54. package/dist/client/assets/{Upload01-BQ7z5iC5.js → Upload01-ByUvmqDm.js} +1 -1
  55. package/dist/client/assets/{Users03-DEpvReeu.js → Users03-CGvJARf5.js} +1 -1
  56. package/dist/client/assets/{X-BT_y3J3a.js → X-CD9ZB6hw.js} +1 -1
  57. package/dist/client/assets/{XClose-C-H07PEn.js → XClose-BxUlnJUs.js} +1 -1
  58. package/dist/client/assets/{Zap-BY3Hn1l9.js → Zap-0WHKFRes.js} +1 -1
  59. package/dist/client/assets/{agent-connections-preview-DbwllQSw.js → agent-connections-preview-BEmLqtx5.js} +1 -1
  60. package/dist/client/assets/agent-detail-jg81y7ZA.js +2 -0
  61. package/dist/client/assets/agents-PmHD6Xb_.js +1 -0
  62. package/dist/client/assets/{ai-providers-logos-DGTpC_MW.js → ai-providers-logos-C_voEDmL.js} +1 -1
  63. package/dist/client/assets/{alert-dialog-BqCiJDa8.js → alert-dialog-qmvoIx9J.js} +3 -3
  64. package/dist/client/assets/{auth-catchall-DPwCqyhO.js → auth-catchall-ByYcT8WN.js} +1 -1
  65. package/dist/client/assets/automation-detail-C1-q2EzY.js +1 -0
  66. package/dist/client/assets/automations-C9eao1B2.js +1 -0
  67. package/dist/client/assets/avatar-DeGeJRAR.js +1 -0
  68. package/dist/client/assets/badge-Cjjl_FHP.js +1 -0
  69. package/dist/client/assets/{binder-CuBUxi11.js → binder-C1eSZFT4.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-BWfepeob.js → breadcrumb-C8hDXS86.js} +1 -1
  71. package/dist/client/assets/{card-gfMzoGpr.js → card-CoyaoT6W.js} +1 -1
  72. package/dist/client/assets/{checkbox-DygphnIU.js → checkbox-D5DFx9da.js} +1 -1
  73. package/dist/client/assets/{collapsible-BJo6q_NJ.js → collapsible-DcaWkNTt.js} +1 -1
  74. package/dist/client/assets/{collection-detail-fTigPh-V.js → collection-detail-Dsgpohom.js} +3 -3
  75. package/dist/client/assets/{collection-display-button-C42ZnuS7.js → collection-display-button-BcIJp1SX.js} +1 -1
  76. package/dist/client/assets/{collection-search-Dzoe9W56.js → collection-search-nKZEJ_r3.js} +1 -1
  77. package/dist/client/assets/{collection-table-wrapper-Bka5CUqj.js → collection-table-wrapper-Bq15EL3p.js} +1 -1
  78. package/dist/client/assets/{collection-tabs-D9qLvNTu.js → collection-tabs-qLP6ozkD.js} +1 -1
  79. package/dist/client/assets/{command-D_HBfmpj.js → command-Bk-fXiVb.js} +1 -1
  80. package/dist/client/assets/connection-card-BYUbg7iO.js +1 -0
  81. package/dist/client/assets/connection-detail-Zdtj4TKi.js +1 -0
  82. package/dist/client/assets/connections-CMaQr-QY.js +1 -0
  83. package/dist/client/assets/{constants-D5QZg84_.js → constants-DclZTqHf.js} +1 -1
  84. package/dist/client/assets/{context-CGMT963w.js → context-BFi-zuf6.js} +12 -12
  85. package/dist/client/assets/{create-organization-dialog-CeMf7qju.js → create-organization-dialog-pXQ89_sr.js} +1 -1
  86. package/dist/client/assets/{create-project-dialog-Bs_mS8aj.js → create-project-dialog-M-dgrV_c.js} +1 -1
  87. package/dist/client/assets/{danger-gTdMMqBl.js → danger-DqsrtWLB.js} +1 -1
  88. package/dist/client/assets/{danger-zone-BE94J4G-.js → danger-zone-BhDM5wIc.js} +1 -1
  89. package/dist/client/assets/{dependencies-DQ9gMDrw.js → dependencies-CPYZFhhf.js} +1 -1
  90. package/dist/client/assets/dialog-DzGwvQ_K.js +1 -0
  91. package/dist/client/assets/drawer-CAX2URBi.js +1 -0
  92. package/dist/client/assets/{dropdown-menu-DE2pKopg.js → dropdown-menu-BcNYk9_F.js} +1 -1
  93. package/dist/client/assets/dynamic-plugin-layout-D0dkPO22.js +1 -0
  94. package/dist/client/assets/editable-task-title-BR-xQ-UT.js +16 -0
  95. package/dist/client/assets/{empty-state-BjCXvoyS.js → empty-state-BuGXY27l.js} +1 -1
  96. package/dist/client/assets/{empty-state-Bk9Z7Q-U.js → empty-state-CGSu9IQ9.js} +1 -1
  97. package/dist/client/assets/{env-vars-editor-BjeFjhEe.js → env-vars-editor-VoVbIy9n.js} +1 -1
  98. package/dist/client/assets/{extract-connection-data-CZxT3XNH.js → extract-connection-data-DhU56Zd0.js} +1 -1
  99. package/dist/client/assets/{file-browser-C4MCCicp.js → file-browser-DIaRK0us.js} +2 -2
  100. package/dist/client/assets/{form-tOTNzCZe.js → form-DBjkdSps.js} +1 -1
  101. package/dist/client/assets/{general-DOjbT8YE.js → general-DCfBGmuh.js} +1 -1
  102. package/dist/client/assets/{generate-id-kfQDJb0K.js → generate-id-DRuK_WRM.js} +1 -1
  103. package/dist/client/assets/{grid-view-CM2kDBxz.js → grid-view-DsY2qZrB.js} +1 -1
  104. package/dist/client/assets/{home-rO4pkzPH.js → home-C52P_wmy.js} +1 -1
  105. package/dist/client/assets/{index-BLtI6TU9.js → index-BLNBD7Tl.js} +1 -1
  106. package/dist/client/assets/index-BObCXgKJ.js +1 -0
  107. package/dist/client/assets/{index-DyL93sTY.js → index-BzPzEjOV.js} +1 -1
  108. package/dist/client/assets/index-COFAW4F5.js +1 -0
  109. package/dist/client/assets/index-CubWD7-P.css +1 -0
  110. package/dist/client/assets/index-DMmNh7jR.js +218 -0
  111. package/dist/client/assets/index-DYAF-Vgt.js +1 -0
  112. package/dist/client/assets/index-DiczHAor.js +1 -0
  113. package/dist/client/assets/{index-DjVQ8cwy.js → index-Dumm3WtY.js} +2 -2
  114. package/dist/client/assets/{index-Bwlq4qOs.js → index-PFtbLrE4.js} +1 -1
  115. package/dist/client/assets/{index-DiHcYCxZ.js → index-bHgla3gL.js} +1 -1
  116. package/dist/client/assets/index-hmkE8HuP.js +1 -0
  117. package/dist/client/assets/{infiniteQueryObserver-XS4LWR6q.js → infiniteQueryObserver-CZ8w6Ao-.js} +1 -1
  118. package/dist/client/assets/input-Bt_nejZh.js +1 -0
  119. package/dist/client/assets/{integration-icon-C9GR_8Ea.js → integration-icon-Dyr7fOYU.js} +1 -1
  120. package/dist/client/assets/{label-DJvdRQ2A.js → label-DTNkd20e.js} +1 -1
  121. package/dist/client/assets/layout-Ck4QNb1R.js +1 -0
  122. package/dist/client/assets/{layout-10Sxtyop.js → layout-VG2uM_nk.js} +1 -1
  123. package/dist/client/assets/login-x4JJuKeA.js +1 -0
  124. package/dist/client/assets/{logo-upload-iqCQyRXD.js → logo-upload-7WcycT9q.js} +1 -1
  125. package/dist/client/assets/{mcp-app-renderer-C3qFwvPf.js → mcp-app-renderer-hLmmzHl_.js} +1 -1
  126. package/dist/client/assets/{mcp-server-card-DCDS8v4f.js → mcp-server-card-CwYAe4vO.js} +1 -1
  127. package/dist/client/assets/mcp-server-detail-CjZvaa-f.js +2 -0
  128. package/dist/client/assets/{members-CykhAYWe.js → members-Sgl6kVS6.js} +1 -1
  129. package/dist/client/assets/{monaco-editor-DQf5JSy_.js → monaco-editor-BS1-hh4n.js} +4 -4
  130. package/dist/client/assets/monitoring-DWB-fw7M.js +4 -0
  131. package/dist/client/assets/monitoring-dashboard-edit-DdNrWKBz.js +1 -0
  132. package/dist/client/assets/{monitoring-dashboard-view-CXCG5P_H.js → monitoring-dashboard-view-BUxqPLpn.js} +2 -2
  133. package/dist/client/assets/{monitoring-stats-row-BfoeteQX.js → monitoring-stats-row-CiWvBCYV.js} +2 -2
  134. package/dist/client/assets/{oauth-callback-CXrwzvh_.js → oauth-callback-7ed5Z9Xs.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-bQZvbhnr.js → oauth-callback-ai-provider-qEm-Q5-E.js} +1 -1
  136. package/dist/client/assets/{org-ai-providers-4gYTufEL.js → org-ai-providers-CUAlOa9f.js} +1 -1
  137. package/dist/client/assets/page-BQl7Ie3w.js +1 -0
  138. package/dist/client/assets/page-DfQnSuW1.js +1 -0
  139. package/dist/client/assets/{plugin-empty-state-cb7GbeKy.js → plugin-empty-state-DUosCqGd.js} +1 -1
  140. package/dist/client/assets/{plugin-empty-state-CEvZCNFj.js → plugin-empty-state-qFDP0Nr2.js} +1 -1
  141. package/dist/client/assets/{plugin-header-C4ZfQdcs.js → plugin-header-BeGFVTX4.js} +1 -1
  142. package/dist/client/assets/{plugin-header-Do_HgCfI.js → plugin-header-CJlxZY-i.js} +1 -1
  143. package/dist/client/assets/plugins-CzL725OF.js +1 -0
  144. package/dist/client/assets/popover-CF2iI6mL.js +1 -0
  145. package/dist/client/assets/project-app-view-lqZ02NJN.js +1 -0
  146. package/dist/client/assets/project-layout-CBbKmowd.js +1 -0
  147. package/dist/client/assets/{project-plugins-C18qk0lc.js → project-plugins-DqmH9sWQ.js} +1 -1
  148. package/dist/client/assets/{projects-list-CtvT2y9h.js → projects-list-Bz_1RhAg.js} +1 -1
  149. package/dist/client/assets/{registry-layout-Cvu5zKVR.js → registry-layout-6H7s-msc.js} +2 -2
  150. package/dist/client/assets/{registry-utils-Bx7--rIH.js → registry-utils-DZHZD5gP.js} +1 -1
  151. package/dist/client/assets/{reset-password-CSswd9M3.js → reset-password-3HgT81EI.js} +1 -1
  152. package/dist/client/assets/{resizable-B0HQ1vuq.js → resizable-BwEPpKFX.js} +1 -1
  153. package/dist/client/assets/{save-actions-BxTuQTa4.js → save-actions-Z-_7bu1u.js} +1 -1
  154. package/dist/client/assets/scroll-area-CwrVaRUF.js +1 -0
  155. package/dist/client/assets/select-hHfKwVbN.js +1 -0
  156. package/dist/client/assets/select-virtual-mcp-DsImheli.js +1 -0
  157. package/dist/client/assets/shell-layout-Bh0wZbL8.js +3 -0
  158. package/dist/client/assets/{sidebar-settings-pZmI7pGH.js → sidebar-settings-U5rAu7py.js} +1 -1
  159. package/dist/client/assets/{skeleton-NLo71_Sb.js → skeleton-BvrwcS3X.js} +1 -1
  160. package/dist/client/assets/spinner-CSLYV8gq.js +1 -0
  161. package/dist/client/assets/{store-invite-CP9PWG-2.js → store-invite-z_eVOBRF.js} +1 -1
  162. package/dist/client/assets/switch-CoYIum7D.js +1 -0
  163. package/dist/client/assets/{table-BK1bAac3.js → table-BSLV9H8I.js} +1 -1
  164. package/dist/client/assets/tabs-sTqc1_U2.js +1 -0
  165. package/dist/client/assets/{task-status-DCsPkppQ.js → task-status-CrO2oj_v.js} +37 -37
  166. package/dist/client/assets/tasks-CazLoC59.js +1 -0
  167. package/dist/client/assets/tasks-panel-DBJx0hs6.js +1 -0
  168. package/dist/client/assets/textarea-CgJ5x-hs.js +1 -0
  169. package/dist/client/assets/{time-range-picker-CEhZhu7c.js → time-range-picker-BCm8UHQI.js} +1 -1
  170. package/dist/client/assets/toggle-group-C20N8vss.js +1 -0
  171. package/dist/client/assets/{tools-list-DGVVcYEB.js → tools-list-JehNbMf9.js} +1 -1
  172. package/dist/client/assets/tooltip-DHJtaI_Z.js +1 -0
  173. package/dist/client/assets/{topbar-portal-DLbOrsQP.js → topbar-portal-jewy4fLu.js} +1 -1
  174. package/dist/client/assets/{types-BOmhR0hZ.js → types-BtTmvTe4.js} +1 -1
  175. package/dist/client/assets/{use-automations-CPlNdxed.js → use-automations-D-X6Oij9.js} +1 -1
  176. package/dist/client/assets/{use-collections-Le9CzDbY.js → use-collections-DhavVshD.js} +1 -1
  177. package/dist/client/assets/{use-connection-CNeKPAtP.js → use-connection-CVlyXslk.js} +1 -1
  178. package/dist/client/assets/{use-copy-CR_0d0zs.js → use-copy-DkDz3lds.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-BOxl7MdZ.js → use-create-virtual-mcp-DZAv89rZ.js} +1 -1
  180. package/dist/client/assets/{use-infinite-scroll-CbBHKCjw.js → use-infinite-scroll-j2WybGGN.js} +1 -1
  181. package/dist/client/assets/{use-install-from-registry-Ckutd61H.js → use-install-from-registry-Ch6GOwHv.js} +1 -1
  182. package/dist/client/assets/{use-list-state-DrSbpG8C.js → use-list-state-Baq-X1EV.js} +1 -1
  183. package/dist/client/assets/{use-mcp-prompts-D4XXlnov.js → use-mcp-prompts-BDRKUj7D.js} +1 -1
  184. package/dist/client/assets/{use-mcp-resources-BueR0w1E.js → use-mcp-resources-BxIahbOo.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-CFyULGGP.js → use-mcp-tools-kv4r4Zvn.js} +1 -1
  186. package/dist/client/assets/{use-members-Bgz9FSqE.js → use-members-Coq2XO1k.js} +1 -1
  187. package/dist/client/assets/{use-project-RpN1fut9.js → use-project-XBmxO4XX.js} +1 -1
  188. package/dist/client/assets/{use-store-discovery-BS96E_Li.js → use-store-discovery-D-xa6Q86.js} +1 -1
  189. package/dist/client/assets/use-view-mode-CdGajc1j.js +1 -0
  190. package/dist/client/assets/{use-virtual-mcp-DGT5zflo.js → use-virtual-mcp-DCxXK_bv.js} +1 -1
  191. package/dist/client/assets/useInfiniteQuery-H-W7n7En.js +1 -0
  192. package/dist/client/assets/{useMutation-Betr8yis.js → useMutation-DrLoVqQ7.js} +1 -1
  193. package/dist/client/assets/useQuery-B-AaJTeZ.js +1 -0
  194. package/dist/client/assets/useSuspenseInfiniteQuery-Czq4y4BP.js +1 -0
  195. package/dist/client/assets/{user-ChA79mrb.js → user-8V0wpye0.js} +1 -1
  196. package/dist/client/assets/workflow-Bb3JE-XH.js +1 -0
  197. package/dist/client/index.html +3 -2
  198. package/dist/server/cli.js +1 -1
  199. package/dist/server/node_modules/pg-cloudflare/README.md +112 -0
  200. package/dist/server/node_modules/pg-cloudflare/dist/empty.d.ts +2 -0
  201. package/dist/server/node_modules/pg-cloudflare/dist/empty.js +6 -0
  202. package/dist/server/node_modules/pg-cloudflare/dist/empty.js.map +1 -0
  203. package/dist/server/node_modules/pg-cloudflare/dist/index.d.ts +31 -0
  204. package/dist/server/node_modules/pg-cloudflare/dist/index.js +152 -0
  205. package/dist/server/node_modules/pg-cloudflare/dist/index.js.map +1 -0
  206. package/dist/server/node_modules/pg-cloudflare/esm/index.mjs +3 -0
  207. package/dist/server/node_modules/pg-cloudflare/package.json +39 -0
  208. package/dist/server/node_modules/pg-cloudflare/src/empty.ts +3 -0
  209. package/dist/server/node_modules/pg-cloudflare/src/index.ts +166 -0
  210. package/dist/server/node_modules/pg-cloudflare/src/types.d.ts +25 -0
  211. package/dist/server/node_modules/pg-connection-string/LICENSE +21 -0
  212. package/dist/server/node_modules/pg-connection-string/README.md +105 -0
  213. package/dist/server/node_modules/pg-connection-string/esm/index.mjs +8 -0
  214. package/dist/server/node_modules/pg-connection-string/index.d.ts +36 -0
  215. package/dist/server/node_modules/pg-connection-string/index.js +231 -0
  216. package/dist/server/node_modules/pg-connection-string/package.json +52 -0
  217. package/dist/server/node_modules/pg-pool/LICENSE +21 -0
  218. package/dist/server/node_modules/pg-pool/README.md +357 -0
  219. package/dist/server/node_modules/pg-pool/esm/index.mjs +5 -0
  220. package/dist/server/node_modules/pg-pool/index.js +517 -0
  221. package/dist/server/node_modules/pg-pool/package.json +51 -0
  222. package/dist/server/node_modules/pg-protocol/LICENSE +21 -0
  223. package/dist/server/node_modules/pg-protocol/README.md +3 -0
  224. package/dist/server/node_modules/pg-protocol/dist/b.d.ts +1 -0
  225. package/dist/server/node_modules/pg-protocol/dist/b.js +23 -0
  226. package/dist/server/node_modules/pg-protocol/dist/b.js.map +1 -0
  227. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.d.ts +15 -0
  228. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js +55 -0
  229. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js.map +1 -0
  230. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.d.ts +16 -0
  231. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js +81 -0
  232. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -0
  233. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +1 -0
  234. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js +530 -0
  235. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js.map +1 -0
  236. package/dist/server/node_modules/pg-protocol/dist/index.d.ts +6 -0
  237. package/dist/server/node_modules/pg-protocol/dist/index.js +15 -0
  238. package/dist/server/node_modules/pg-protocol/dist/index.js.map +1 -0
  239. package/dist/server/node_modules/pg-protocol/dist/messages.d.ts +162 -0
  240. package/dist/server/node_modules/pg-protocol/dist/messages.js +160 -0
  241. package/dist/server/node_modules/pg-protocol/dist/messages.js.map +1 -0
  242. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +1 -0
  243. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js +252 -0
  244. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +1 -0
  245. package/dist/server/node_modules/pg-protocol/dist/parser.d.ts +24 -0
  246. package/dist/server/node_modules/pg-protocol/dist/parser.js +324 -0
  247. package/dist/server/node_modules/pg-protocol/dist/parser.js.map +1 -0
  248. package/dist/server/node_modules/pg-protocol/dist/serializer.d.ts +42 -0
  249. package/dist/server/node_modules/pg-protocol/dist/serializer.js +189 -0
  250. package/dist/server/node_modules/pg-protocol/dist/serializer.js.map +1 -0
  251. package/dist/server/node_modules/pg-protocol/esm/index.js +11 -0
  252. package/dist/server/node_modules/pg-protocol/package.json +45 -0
  253. package/dist/server/node_modules/pg-protocol/src/b.ts +25 -0
  254. package/dist/server/node_modules/pg-protocol/src/buffer-reader.ts +58 -0
  255. package/dist/server/node_modules/pg-protocol/src/buffer-writer.ts +85 -0
  256. package/dist/server/node_modules/pg-protocol/src/inbound-parser.test.ts +575 -0
  257. package/dist/server/node_modules/pg-protocol/src/index.ts +11 -0
  258. package/dist/server/node_modules/pg-protocol/src/messages.ts +262 -0
  259. package/dist/server/node_modules/pg-protocol/src/outbound-serializer.test.ts +276 -0
  260. package/dist/server/node_modules/pg-protocol/src/parser.ts +413 -0
  261. package/dist/server/node_modules/pg-protocol/src/serializer.ts +274 -0
  262. package/dist/server/node_modules/pg-protocol/src/testing/buffer-list.ts +67 -0
  263. package/dist/server/node_modules/pg-protocol/src/testing/test-buffers.ts +166 -0
  264. package/dist/server/node_modules/pg-protocol/src/types/chunky.d.ts +1 -0
  265. package/dist/server/node_modules/pg-types/.travis.yml +7 -0
  266. package/dist/server/node_modules/pg-types/Makefile +14 -0
  267. package/dist/server/node_modules/pg-types/README.md +75 -0
  268. package/dist/server/node_modules/pg-types/index.d.ts +137 -0
  269. package/dist/server/node_modules/pg-types/index.js +47 -0
  270. package/dist/server/node_modules/pg-types/index.test-d.ts +21 -0
  271. package/dist/server/node_modules/pg-types/lib/arrayParser.js +11 -0
  272. package/dist/server/node_modules/pg-types/lib/binaryParsers.js +257 -0
  273. package/dist/server/node_modules/pg-types/lib/builtins.js +73 -0
  274. package/dist/server/node_modules/pg-types/lib/textParsers.js +215 -0
  275. package/dist/server/node_modules/pg-types/package.json +42 -0
  276. package/dist/server/node_modules/pg-types/test/index.js +24 -0
  277. package/dist/server/node_modules/pg-types/test/types.js +597 -0
  278. package/dist/server/node_modules/pgpass/README.md +74 -0
  279. package/dist/server/node_modules/pgpass/lib/helper.js +233 -0
  280. package/dist/server/node_modules/pgpass/lib/index.js +23 -0
  281. package/dist/server/node_modules/pgpass/package.json +41 -0
  282. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  283. package/dist/server/node_modules/postgres-array/index.js +97 -0
  284. package/dist/server/node_modules/postgres-array/license +21 -0
  285. package/dist/server/node_modules/postgres-array/package.json +35 -0
  286. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  287. package/dist/server/node_modules/postgres-date/index.js +116 -0
  288. package/dist/server/node_modules/postgres-date/license +21 -0
  289. package/dist/server/node_modules/postgres-date/package.json +33 -0
  290. package/dist/server/node_modules/postgres-date/readme.md +49 -0
  291. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  292. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  293. package/dist/server/node_modules/postgres-interval/license +21 -0
  294. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  295. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  296. package/dist/server/node_modules/split2/LICENSE +13 -0
  297. package/dist/server/node_modules/split2/README.md +85 -0
  298. package/dist/server/node_modules/split2/bench.js +27 -0
  299. package/dist/server/node_modules/split2/index.js +141 -0
  300. package/dist/server/node_modules/split2/package.json +39 -0
  301. package/dist/server/node_modules/split2/test.js +409 -0
  302. package/dist/server/node_modules/xtend/.jshintrc +30 -0
  303. package/dist/server/node_modules/xtend/LICENSE +20 -0
  304. package/dist/server/node_modules/xtend/README.md +32 -0
  305. package/dist/server/node_modules/xtend/immutable.js +19 -0
  306. package/dist/server/node_modules/xtend/mutable.js +17 -0
  307. package/dist/server/node_modules/xtend/package.json +55 -0
  308. package/dist/server/node_modules/xtend/test.js +103 -0
  309. package/dist/server/server.js +1 -1
  310. package/package.json +1 -1
  311. package/dist/client/assets/LayoutLeft-CbUmiI7I.js +0 -1
  312. package/dist/client/assets/agent-detail-DqMa-yjy.js +0 -2
  313. package/dist/client/assets/agents-DXD0J3OW.js +0 -1
  314. package/dist/client/assets/automation-detail-bmoX3GK-.js +0 -1
  315. package/dist/client/assets/automations-Dp1WjxxK.js +0 -1
  316. package/dist/client/assets/avatar-BoRF-Me1.js +0 -1
  317. package/dist/client/assets/badge-DIWKuwVU.js +0 -1
  318. package/dist/client/assets/connection-card-DuHVLZ35.js +0 -1
  319. package/dist/client/assets/connection-detail-vcbLbssZ.js +0 -1
  320. package/dist/client/assets/connections-14pDMsUe.js +0 -1
  321. package/dist/client/assets/dialog-B8WS5FOh.js +0 -1
  322. package/dist/client/assets/dynamic-plugin-layout-yMvA298P.js +0 -1
  323. package/dist/client/assets/editable-task-title-oggBOZ_d.js +0 -16
  324. package/dist/client/assets/index-B09Yemt1.js +0 -1
  325. package/dist/client/assets/index-CAsAeYNN.css +0 -1
  326. package/dist/client/assets/index-CMImT9Gt.js +0 -1
  327. package/dist/client/assets/index-D-6rbOIG.js +0 -1
  328. package/dist/client/assets/index-DnJ6a24w.js +0 -218
  329. package/dist/client/assets/index-hCeFdkUk.js +0 -1
  330. package/dist/client/assets/index-qrpgIqks.js +0 -1
  331. package/dist/client/assets/input-BBKBJVKe.js +0 -1
  332. package/dist/client/assets/layout-BjyFY_1R.js +0 -1
  333. package/dist/client/assets/login-ClPbfjlJ.js +0 -1
  334. package/dist/client/assets/mcp-server-detail-lOR_wUNJ.js +0 -2
  335. package/dist/client/assets/monitoring-BPuhRE0m.js +0 -4
  336. package/dist/client/assets/monitoring-dashboard-edit-BVtLOBNe.js +0 -1
  337. package/dist/client/assets/page-CCXJyUyN.js +0 -1
  338. package/dist/client/assets/page-DB3QLlpA.js +0 -1
  339. package/dist/client/assets/plugins-pEgOY1Nz.js +0 -1
  340. package/dist/client/assets/popover-vDURg2rv.js +0 -1
  341. package/dist/client/assets/project-app-view-DfCIvrF7.js +0 -1
  342. package/dist/client/assets/project-layout-CkMdq05b.js +0 -1
  343. package/dist/client/assets/scroll-area-dsTSFUPi.js +0 -1
  344. package/dist/client/assets/select-Bbaj2HCW.js +0 -1
  345. package/dist/client/assets/select-virtual-mcp-CZJoA7HG.js +0 -1
  346. package/dist/client/assets/sheet-B_-2ygzJ.js +0 -1
  347. package/dist/client/assets/shell-layout-Ca5Bbhzi.js +0 -3
  348. package/dist/client/assets/spinner-EdHFCjIL.js +0 -1
  349. package/dist/client/assets/switch-bfk4EFAk.js +0 -1
  350. package/dist/client/assets/tabs-aIY_aIUV.js +0 -1
  351. package/dist/client/assets/tasks-Dw1i-69W.js +0 -1
  352. package/dist/client/assets/tasks-panel-CEAgXi7r.js +0 -1
  353. package/dist/client/assets/textarea-lF0m7xkk.js +0 -1
  354. package/dist/client/assets/toggle-group-Dak-s1p3.js +0 -1
  355. package/dist/client/assets/tooltip-Csc3oeTz.js +0 -1
  356. package/dist/client/assets/use-mobile-Y3tADOOl.js +0 -1
  357. package/dist/client/assets/use-view-mode-BeRbE5Df.js +0 -1
  358. package/dist/client/assets/useInfiniteQuery-ChOuKh6v.js +0 -1
  359. package/dist/client/assets/useQuery-mzOsnjYJ.js +0 -1
  360. package/dist/client/assets/useSuspenseInfiniteQuery-DFs2FFlW.js +0 -1
  361. package/dist/client/assets/workflow-CBDfcQFP.js +0 -1
  362. package/dist/server/node_modules/pg/README.md +0 -95
  363. package/dist/server/node_modules/pg/esm/index.mjs +0 -20
  364. package/dist/server/node_modules/pg/lib/client.js +0 -743
  365. package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
  366. package/dist/server/node_modules/pg/lib/connection.js +0 -221
  367. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
  368. package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
  369. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
  370. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
  371. package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
  372. package/dist/server/node_modules/pg/lib/defaults.js +0 -91
  373. package/dist/server/node_modules/pg/lib/index.js +0 -73
  374. package/dist/server/node_modules/pg/lib/native/client.js +0 -323
  375. package/dist/server/node_modules/pg/lib/native/index.js +0 -2
  376. package/dist/server/node_modules/pg/lib/native/query.js +0 -165
  377. package/dist/server/node_modules/pg/lib/query.js +0 -252
  378. package/dist/server/node_modules/pg/lib/result.js +0 -109
  379. package/dist/server/node_modules/pg/lib/stream.js +0 -83
  380. package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
  381. package/dist/server/node_modules/pg/lib/utils.js +0 -217
  382. package/dist/server/node_modules/pg/package.json +0 -76
  383. /package/dist/server/node_modules/{pg → pg-cloudflare}/LICENSE +0 -0
@@ -1 +1 @@
1
- import{a as v}from"./binder-CuBUxi11.js";import{bV as _,bQ as O,o,n as e,av as f,ax as d,bW as c,bX as L,bY as C,bm as s,ay as g,bi as u,bl as b,bj as i,aw as R,bZ as G,b_ as P,b$ as x,c0 as M,c1 as w,c2 as B,c3 as I}from"./index-DnJ6a24w.js";import{c as D}from"./constants-D5QZg84_.js";const k=O.extend({avatar:e().describe("URL or data URI to the assistant's avatar image"),system_prompt:e().describe("System prompt that defines the assistant's behavior"),virtual_mcp_id:e().describe("Virtual MCP ID to use for this assistant"),model:o({id:e().describe("Model ID"),connectionId:e().describe("Connection ID that provides the model")}).describe("Selected model reference for this assistant")}),W=_("assistant",k),U=[...W],T=G(()=>u([P(),e(),s(),b(),f(e(),T),d(T)])),m=f(e(),f(e(),T)).optional().describe("Additional provider-specific options. Outer record keyed by provider name, inner by option key"),E=o({type:i("text"),text:e().describe("The text content"),providerOptions:m}),Y=o({type:i("text"),text:e().describe("The text content"),providerMetadata:c().optional().describe("Additional provider-specific metadata")}),F=e().describe("File data as URL string"),A=o({type:i("file"),filename:e().optional().describe("Optional filename of the file"),data:F,mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),providerOptions:m}),j=o({type:i("file"),mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),data:e().describe("Generated file data as base64 encoded string")}),q=o({type:i("reasoning"),text:e().describe("The reasoning text"),providerOptions:m}),V=o({type:i("reasoning"),text:e().describe("The reasoning text"),providerMetadata:c().optional().describe("Additional provider-specific metadata")}),$=o({type:i("tool-call"),toolCallId:e().describe("ID of the tool call, used to match with tool result"),toolName:e().describe("Name of the tool being called"),input:e().describe("Arguments of the tool call (JSON-serializable object matching tool input schema)"),providerExecuted:b().optional().describe("Whether the tool call will be executed by the provider"),providerOptions:m}),H=o({type:i("tool-call"),toolCallId:e().describe("ID of the tool call"),toolName:e().describe("Name of the tool being called"),input:e().describe("Stringified JSON object with the tool call arguments"),providerExecuted:b().optional().describe("Whether the tool call will be executed by the provider"),providerMetadata:c().optional().describe("Additional provider-specific metadata")}),J=u([o({type:i("text"),value:e()}),o({type:i("json"),value:T}),o({type:i("error-text"),value:e()}),o({type:i("error-json"),value:T}),o({type:i("content"),value:d(u([o({type:i("text"),text:e().describe("Text content")}),o({type:i("media"),data:e().describe("Base-64 encoded media data"),mediaType:e().describe("IANA media type")})]))}),o({type:i("execution-denied"),reason:e().optional()}),e().describe("Raw or JSON-serialized output (e.g. from AI SDK mapToolResultOutput)")]),N=o({type:i("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),output:J.describe("Result of the tool call"),result:R().describe("Unknown result of the tool call"),providerOptions:m}),K=o({type:i("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),result:c().describe("Result of the tool call (JSON-serializable)"),isError:b().optional().describe("Whether the result is an error or error message"),providerExecuted:b().optional().describe("Whether the tool result was generated by the provider"),providerMetadata:c().optional().describe("Additional provider-specific metadata")}),z=u([o({type:i("source"),sourceType:i("url"),id:e().describe("The ID of the source"),url:e().describe("The URL of the source"),title:e().optional().describe("The title of the source"),providerMetadata:c().optional().describe("Additional provider-specific metadata")}),o({type:i("source"),sourceType:i("document"),id:e().describe("The ID of the source"),mediaType:e().describe("IANA media type of the document (e.g., application/pdf)"),title:e().describe("The title of the document"),filename:e().optional().describe("Optional filename of the document"),providerMetadata:c().optional().describe("Additional provider-specific metadata")})]),X=o({role:i("system"),content:e().describe("System message content"),providerOptions:m}),Z=o({role:i("user"),content:d(u([E,A])).describe("User message content parts (text or file)"),providerOptions:m}),Q=o({role:i("assistant"),content:d(u([E,A,q,$,N])).describe("Assistant message content parts (text, file, reasoning, tool-call, or tool-result)"),providerOptions:m}),ee=o({role:i("tool"),content:d(N).describe("Tool message content (tool results)"),providerOptions:m}),te=u([X,Z,Q,ee]),oe=d(te).describe("A list of messages forming the prompt"),ae=o({prompt:oe.describe("A language model prompt is a standardized prompt type (array of messages with roles: system, user, assistant, tool)"),maxOutputTokens:s().optional().describe("Maximum number of tokens to generate"),temperature:s().optional().describe("Temperature setting. The range depends on the provider and model"),topP:s().optional().describe("Nucleus sampling parameter"),topK:s().optional().describe("Only sample from the top K options for each subsequent token. Used to remove long tail low probability responses"),presencePenalty:s().optional().describe("Presence penalty setting. It affects the likelihood of the model to repeat information that is already in the prompt"),frequencyPenalty:s().optional().describe("Frequency penalty setting. It affects the likelihood of the model to repeatedly use the same words or phrases"),seed:s().optional().describe("The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results"),stopSequences:d(e()).optional().describe("Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated"),responseFormat:u([o({type:i("text")}),o({type:i("json"),schema:c().optional().describe("JSON schema that the generated output should conform to"),name:e().optional().describe("Name of output that should be generated"),description:e().optional().describe("Description of the output that should be generated")})]).optional().describe("Response format. The output can either be text or JSON. Default is text"),tools:d(c()).optional().describe("The tools that are available for the model"),toolChoice:c().optional().describe("Specifies how the tool should be selected. Defaults to 'auto'"),includeRawChunks:b().optional().describe("Include raw chunks in the stream. Only applicable for streaming calls"),abortSignal:c().optional().describe("Abort signal for cancelling the operation"),providerOptions:c().optional().describe("Additional provider-specific options")}),ne=o({content:d(u([Y,j,V,H,K,z])).describe("Ordered content that the model has generated (text, tool-calls, reasoning, files, sources)"),finishReason:g(["stop","length","content-filter","tool-calls","error","other","unknown"]).describe("Reason why generation stopped"),usage:C({inputTokens:s().optional(),outputTokens:s().optional(),totalTokens:s().optional(),reasoningTokens:s().optional()}).describe("Usage information for the language model call"),providerMetadata:c().optional().describe("Additional provider-specific metadata"),request:o({body:c().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:o({id:e().optional().describe("ID for the generated response"),timestamp:L().optional().describe("Timestamp for the start of the generated response"),modelId:e().optional().describe("The ID of the response model that was used"),headers:f(e(),e()).optional().describe("Response headers"),body:c().optional().describe("Response HTTP body")}).optional().describe("Optional response information for telemetry and debugging"),warnings:d(c()).describe("Warnings for the call, e.g. unsupported settings")});o({stream:c().describe("ReadableStream of LanguageModelV2StreamPart"),request:o({body:c().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:o({headers:f(e(),e()).optional().describe("Response headers")}).optional().describe("Optional response data")});const re=o({supportedUrls:f(e(),d(e())).describe("Supported URL patterns by media type for the provider")});o({modelId:e().describe("The ID of the model"),logo:e().nullable(),description:e().nullable(),capabilities:d(e()),limits:o({contextWindow:s(),maxOutputTokens:s()}).nullable(),costs:o({input:s(),output:s()}).nullable(),provider:g(["openai","anthropic","google","x-ai","deepseek","openai-compatible","openrouter"]).nullable()});const S=o({modelId:e().describe("The ID of the model"),callOptions:ae}),ie=O.extend({logo:e().nullable(),description:e().nullable(),capabilities:d(e()),limits:o({contextWindow:s(),maxOutputTokens:s()}).nullable(),costs:o({input:s(),output:s()}).nullable(),provider:g(["openai","anthropic","google","xai","deepseek","openai-compatible","openrouter"]).nullable()}),se=_("llm",ie,{readOnly:!0}),le=[{name:"LLM_METADATA",inputSchema:o({modelId:e().describe("The ID of the model")}),outputSchema:re},{name:"LLM_DO_STREAM",inputSchema:S,streamable:!0},{name:"LLM_DO_GENERATE",inputSchema:S,outputSchema:ne},...se],ce=o({scopes:d(e()).describe("List of scopes available"),stateSchema:f(e(),R()).describe("JSON Schema (draft-07) defining the state structure")}),de=[{name:"MCP_CONFIGURATION",inputSchema:o({}),outputSchema:ce}],pe=o({}).strict(),ue=o({billing:o({mode:g(["prepaid","postpaid"]),limitPeriod:g(["daily","weekly","monthly"]).nullable()}),limit:o({total:s().nullable(),remaining:s().nullable(),reset:e().nullable()}),usage:o({total:s(),daily:s(),weekly:s(),monthly:s()}),alert:o({enabled:b(),threshold_usd:s(),email:e().nullable()}),connectionId:e()}),me=[{name:"GATEWAY_USAGE",inputSchema:pe,outputSchema:ue},{name:"GATEWAY_SET_LIMIT",inputSchema:o({}),outputSchema:o({}),opt:!0},{name:"GATEWAY_SET_ALERT",inputSchema:o({}),outputSchema:o({}),opt:!0}],y={LLMS:le,WORKFLOW:B,WORKFLOW_EXECUTION:w,ASSISTANTS:U,MCP:de,AI_GATEWAY_BILLING:me,EVENT_BUS:M,TRIGGER:x},he={"@deco/event-bus":"EVENT_BUS","@deco/llm":"LLMS","@deco/trigger":"TRIGGER"};function Re(t){if(t)return he[t]}function fe(t){return t.map(a=>({name:a.name,inputSchema:a.inputSchema?(()=>{try{return I(a.inputSchema)}catch(n){return console.error(`Failed to convert input schema for ${a.name}:`,n),o({})}})():o({}),outputSchema:a.outputSchema?(()=>{try{return I(a.outputSchema)}catch(n){return console.error(`Failed to convert output schema for ${a.name}:`,n),o({})}})():o({})}))}function be(t,a){const n=t.tools;if(!n||n.length===0)return!1;const l=n.map(p=>({name:p.name,inputSchema:p.inputSchema})),r=a.map(p=>({name:p.name,inputSchema:p.inputSchema,opt:p.opt}));return v(r).isImplementedBy(l)}function Ee({connections:t,binding:a}){const n=(()=>{if(a){if(typeof a=="string"){const l=a.toUpperCase(),r=y[l];if(!r){console.warn(`[useBindingConnections] Unknown binding "${a}". Available bindings: ${Object.keys(y).join(", ")}. Returning all connections without filtering.`);return}return r}if(a.length===0){console.warn("[useBindingConnections] Empty binding array provided. Returning all connections without filtering.");return}return fe(a)}})();return t?n?t.filter(l=>be(l,n)):t:[]}function ge(t){if(!t||t.length===0)return[];const a=/^COLLECTION_(.+)_LIST$/,n=[];for(const l of t){const r=l.name.match(a);r?.[1]&&n.push(r[1])}return n}function Te(t){return!t||t.length===0?!1:t.some(a=>a.name==="REGISTRY_ITEM_LIST"||a.name==="COLLECTION_REGISTRY_APP_LIST"?!0:a.name.startsWith("COLLECTION_REGISTRY_APP_"))}function Ae(t){return t?t.filter(a=>ge(a.tools).includes("REGISTRY_APP")||Te(a.tools)):[]}function Ie(t){if(!t)return null;const a=typeof t=="string"?t:t.url;if(!a)return null;const n=a.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function Ne(t){const a=Ie(t);if(!a)return null;const n=`https://github.com/${a.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function ve(t){if(!t)return"";const a=t.find(r=>r.name==="COLLECTION_REGISTRY_APP_LIST");if(a)return a.name;const n=t.find(r=>r.name==="REGISTRY_ITEM_LIST");if(n)return n.name;const l=t.find(r=>r.name.startsWith("COLLECTION_REGISTRY_APP_")&&r.name.endsWith("_LIST"));return l?l.name:""}function Le(t){if(!t)return"";const a=t.find(r=>r.name==="COLLECTION_REGISTRY_APP_FILTERS");if(a)return a.name;const n=t.find(r=>r.name==="REGISTRY_ITEM_FILTERS");if(n)return n.name;const l=t.find(r=>r.name.startsWith("COLLECTION_REGISTRY_APP_")&&r.name.endsWith("_FILTERS"));return l?l.name:""}function Ce(t,a){if(!t)return"";const n=t.find(p=>p.name===`COLLECTION_REGISTRY_APP${a}`);if(n)return n.name;const l={_GET:"REGISTRY_ITEM_GET",_VERSIONS:"REGISTRY_ITEM_VERSIONS",_SEARCH:"REGISTRY_ITEM_SEARCH"},r=t.find(p=>p.name===l[a]);if(r)return r.name;const h=t.find(p=>p.name.startsWith("COLLECTION_REGISTRY_APP_")&&p.name.endsWith(a));return h?h.name:""}function Ge(t){if(!t)return[];const a=[];for(const n of t){let l=[];if(Array.isArray(n))l=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(h=>Array.isArray(n[h]));r&&(l=n[r])}a.push(...l)}return a}const Se={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Pe(t){return t?Se[t]??t.toUpperCase():null}function xe(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function Me(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const a=Object.keys(t).find(n=>Array.isArray(t[n]));if(a)return t[a]}return[]}async function we(t,a,n,l){const r=await D({connectionId:t,orgId:a});try{const h=await r.callTool({name:n,arguments:l});return h.structuredContent??h}finally{await r.close().catch(console.error)}}export{Ge as a,Pe as b,we as c,Ee as d,Me as e,ve as f,Ne as g,be as h,Le as i,Ie as j,Ce as k,xe as l,Re as r,Ae as u};
1
+ import{a as v}from"./binder-C1eSZFT4.js";import{bW as _,bR as O,o,n as e,aw as f,ay as d,bX as c,bY as L,bZ as C,bn as s,az as g,bj as u,bm as b,bk as i,ax as R,b_ as G,b$ as P,c0 as x,c1 as M,c2 as w,c3 as B,c4 as I}from"./index-DMmNh7jR.js";import{c as D}from"./constants-DclZTqHf.js";const k=O.extend({avatar:e().describe("URL or data URI to the assistant's avatar image"),system_prompt:e().describe("System prompt that defines the assistant's behavior"),virtual_mcp_id:e().describe("Virtual MCP ID to use for this assistant"),model:o({id:e().describe("Model ID"),connectionId:e().describe("Connection ID that provides the model")}).describe("Selected model reference for this assistant")}),W=_("assistant",k),U=[...W],T=G(()=>u([P(),e(),s(),b(),f(e(),T),d(T)])),m=f(e(),f(e(),T)).optional().describe("Additional provider-specific options. Outer record keyed by provider name, inner by option key"),E=o({type:i("text"),text:e().describe("The text content"),providerOptions:m}),Y=o({type:i("text"),text:e().describe("The text content"),providerMetadata:c().optional().describe("Additional provider-specific metadata")}),F=e().describe("File data as URL string"),A=o({type:i("file"),filename:e().optional().describe("Optional filename of the file"),data:F,mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),providerOptions:m}),j=o({type:i("file"),mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),data:e().describe("Generated file data as base64 encoded string")}),q=o({type:i("reasoning"),text:e().describe("The reasoning text"),providerOptions:m}),$=o({type:i("reasoning"),text:e().describe("The reasoning text"),providerMetadata:c().optional().describe("Additional provider-specific metadata")}),H=o({type:i("tool-call"),toolCallId:e().describe("ID of the tool call, used to match with tool result"),toolName:e().describe("Name of the tool being called"),input:e().describe("Arguments of the tool call (JSON-serializable object matching tool input schema)"),providerExecuted:b().optional().describe("Whether the tool call will be executed by the provider"),providerOptions:m}),J=o({type:i("tool-call"),toolCallId:e().describe("ID of the tool call"),toolName:e().describe("Name of the tool being called"),input:e().describe("Stringified JSON object with the tool call arguments"),providerExecuted:b().optional().describe("Whether the tool call will be executed by the provider"),providerMetadata:c().optional().describe("Additional provider-specific metadata")}),K=u([o({type:i("text"),value:e()}),o({type:i("json"),value:T}),o({type:i("error-text"),value:e()}),o({type:i("error-json"),value:T}),o({type:i("content"),value:d(u([o({type:i("text"),text:e().describe("Text content")}),o({type:i("media"),data:e().describe("Base-64 encoded media data"),mediaType:e().describe("IANA media type")})]))}),o({type:i("execution-denied"),reason:e().optional()}),e().describe("Raw or JSON-serialized output (e.g. from AI SDK mapToolResultOutput)")]),N=o({type:i("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),output:K.describe("Result of the tool call"),result:R().describe("Unknown result of the tool call"),providerOptions:m}),V=o({type:i("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),result:c().describe("Result of the tool call (JSON-serializable)"),isError:b().optional().describe("Whether the result is an error or error message"),providerExecuted:b().optional().describe("Whether the tool result was generated by the provider"),providerMetadata:c().optional().describe("Additional provider-specific metadata")}),z=u([o({type:i("source"),sourceType:i("url"),id:e().describe("The ID of the source"),url:e().describe("The URL of the source"),title:e().optional().describe("The title of the source"),providerMetadata:c().optional().describe("Additional provider-specific metadata")}),o({type:i("source"),sourceType:i("document"),id:e().describe("The ID of the source"),mediaType:e().describe("IANA media type of the document (e.g., application/pdf)"),title:e().describe("The title of the document"),filename:e().optional().describe("Optional filename of the document"),providerMetadata:c().optional().describe("Additional provider-specific metadata")})]),X=o({role:i("system"),content:e().describe("System message content"),providerOptions:m}),Z=o({role:i("user"),content:d(u([E,A])).describe("User message content parts (text or file)"),providerOptions:m}),Q=o({role:i("assistant"),content:d(u([E,A,q,H,N])).describe("Assistant message content parts (text, file, reasoning, tool-call, or tool-result)"),providerOptions:m}),ee=o({role:i("tool"),content:d(N).describe("Tool message content (tool results)"),providerOptions:m}),te=u([X,Z,Q,ee]),oe=d(te).describe("A list of messages forming the prompt"),ae=o({prompt:oe.describe("A language model prompt is a standardized prompt type (array of messages with roles: system, user, assistant, tool)"),maxOutputTokens:s().optional().describe("Maximum number of tokens to generate"),temperature:s().optional().describe("Temperature setting. The range depends on the provider and model"),topP:s().optional().describe("Nucleus sampling parameter"),topK:s().optional().describe("Only sample from the top K options for each subsequent token. Used to remove long tail low probability responses"),presencePenalty:s().optional().describe("Presence penalty setting. It affects the likelihood of the model to repeat information that is already in the prompt"),frequencyPenalty:s().optional().describe("Frequency penalty setting. It affects the likelihood of the model to repeatedly use the same words or phrases"),seed:s().optional().describe("The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results"),stopSequences:d(e()).optional().describe("Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated"),responseFormat:u([o({type:i("text")}),o({type:i("json"),schema:c().optional().describe("JSON schema that the generated output should conform to"),name:e().optional().describe("Name of output that should be generated"),description:e().optional().describe("Description of the output that should be generated")})]).optional().describe("Response format. The output can either be text or JSON. Default is text"),tools:d(c()).optional().describe("The tools that are available for the model"),toolChoice:c().optional().describe("Specifies how the tool should be selected. Defaults to 'auto'"),includeRawChunks:b().optional().describe("Include raw chunks in the stream. Only applicable for streaming calls"),abortSignal:c().optional().describe("Abort signal for cancelling the operation"),providerOptions:c().optional().describe("Additional provider-specific options")}),ne=o({content:d(u([Y,j,$,J,V,z])).describe("Ordered content that the model has generated (text, tool-calls, reasoning, files, sources)"),finishReason:g(["stop","length","content-filter","tool-calls","error","other","unknown"]).describe("Reason why generation stopped"),usage:C({inputTokens:s().optional(),outputTokens:s().optional(),totalTokens:s().optional(),reasoningTokens:s().optional()}).describe("Usage information for the language model call"),providerMetadata:c().optional().describe("Additional provider-specific metadata"),request:o({body:c().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:o({id:e().optional().describe("ID for the generated response"),timestamp:L().optional().describe("Timestamp for the start of the generated response"),modelId:e().optional().describe("The ID of the response model that was used"),headers:f(e(),e()).optional().describe("Response headers"),body:c().optional().describe("Response HTTP body")}).optional().describe("Optional response information for telemetry and debugging"),warnings:d(c()).describe("Warnings for the call, e.g. unsupported settings")});o({stream:c().describe("ReadableStream of LanguageModelV2StreamPart"),request:o({body:c().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:o({headers:f(e(),e()).optional().describe("Response headers")}).optional().describe("Optional response data")});const re=o({supportedUrls:f(e(),d(e())).describe("Supported URL patterns by media type for the provider")});o({modelId:e().describe("The ID of the model"),logo:e().nullable(),description:e().nullable(),capabilities:d(e()),limits:o({contextWindow:s(),maxOutputTokens:s()}).nullable(),costs:o({input:s(),output:s()}).nullable(),provider:g(["openai","anthropic","google","x-ai","deepseek","openai-compatible","openrouter"]).nullable()});const S=o({modelId:e().describe("The ID of the model"),callOptions:ae}),ie=O.extend({logo:e().nullable(),description:e().nullable(),capabilities:d(e()),limits:o({contextWindow:s(),maxOutputTokens:s()}).nullable(),costs:o({input:s(),output:s()}).nullable(),provider:g(["openai","anthropic","google","xai","deepseek","openai-compatible","openrouter"]).nullable()}),se=_("llm",ie,{readOnly:!0}),le=[{name:"LLM_METADATA",inputSchema:o({modelId:e().describe("The ID of the model")}),outputSchema:re},{name:"LLM_DO_STREAM",inputSchema:S,streamable:!0},{name:"LLM_DO_GENERATE",inputSchema:S,outputSchema:ne},...se],ce=o({scopes:d(e()).describe("List of scopes available"),stateSchema:f(e(),R()).describe("JSON Schema (draft-07) defining the state structure")}),de=[{name:"MCP_CONFIGURATION",inputSchema:o({}),outputSchema:ce}],pe=o({}).strict(),ue=o({billing:o({mode:g(["prepaid","postpaid"]),limitPeriod:g(["daily","weekly","monthly"]).nullable()}),limit:o({total:s().nullable(),remaining:s().nullable(),reset:e().nullable()}),usage:o({total:s(),daily:s(),weekly:s(),monthly:s()}),alert:o({enabled:b(),threshold_usd:s(),email:e().nullable()}),connectionId:e()}),me=[{name:"GATEWAY_USAGE",inputSchema:pe,outputSchema:ue},{name:"GATEWAY_SET_LIMIT",inputSchema:o({}),outputSchema:o({}),opt:!0},{name:"GATEWAY_SET_ALERT",inputSchema:o({}),outputSchema:o({}),opt:!0}],y={LLMS:le,WORKFLOW:B,WORKFLOW_EXECUTION:w,ASSISTANTS:U,MCP:de,AI_GATEWAY_BILLING:me,EVENT_BUS:M,TRIGGER:x},he={"@deco/event-bus":"EVENT_BUS","@deco/llm":"LLMS","@deco/trigger":"TRIGGER"};function Re(t){if(t)return he[t]}function fe(t){return t.map(a=>({name:a.name,inputSchema:a.inputSchema?(()=>{try{return I(a.inputSchema)}catch(n){return console.error(`Failed to convert input schema for ${a.name}:`,n),o({})}})():o({}),outputSchema:a.outputSchema?(()=>{try{return I(a.outputSchema)}catch(n){return console.error(`Failed to convert output schema for ${a.name}:`,n),o({})}})():o({})}))}function be(t,a){const n=t.tools;if(!n||n.length===0)return!1;const l=n.map(p=>({name:p.name,inputSchema:p.inputSchema})),r=a.map(p=>({name:p.name,inputSchema:p.inputSchema,opt:p.opt}));return v(r).isImplementedBy(l)}function Ee({connections:t,binding:a}){const n=(()=>{if(a){if(typeof a=="string"){const l=a.toUpperCase(),r=y[l];if(!r){console.warn(`[useBindingConnections] Unknown binding "${a}". Available bindings: ${Object.keys(y).join(", ")}. Returning all connections without filtering.`);return}return r}if(a.length===0){console.warn("[useBindingConnections] Empty binding array provided. Returning all connections without filtering.");return}return fe(a)}})();return t?n?t.filter(l=>be(l,n)):t:[]}function ge(t){if(!t||t.length===0)return[];const a=/^COLLECTION_(.+)_LIST$/,n=[];for(const l of t){const r=l.name.match(a);r?.[1]&&n.push(r[1])}return n}function Te(t){return!t||t.length===0?!1:t.some(a=>a.name==="REGISTRY_ITEM_LIST"||a.name==="COLLECTION_REGISTRY_APP_LIST"?!0:a.name.startsWith("COLLECTION_REGISTRY_APP_"))}function Ae(t){return t?t.filter(a=>ge(a.tools).includes("REGISTRY_APP")||Te(a.tools)):[]}function Ie(t){if(!t)return null;const a=typeof t=="string"?t:t.url;if(!a)return null;const n=a.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function Ne(t){const a=Ie(t);if(!a)return null;const n=`https://github.com/${a.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function ve(t){if(!t)return"";const a=t.find(r=>r.name==="COLLECTION_REGISTRY_APP_LIST");if(a)return a.name;const n=t.find(r=>r.name==="REGISTRY_ITEM_LIST");if(n)return n.name;const l=t.find(r=>r.name.startsWith("COLLECTION_REGISTRY_APP_")&&r.name.endsWith("_LIST"));return l?l.name:""}function Le(t){if(!t)return"";const a=t.find(r=>r.name==="COLLECTION_REGISTRY_APP_FILTERS");if(a)return a.name;const n=t.find(r=>r.name==="REGISTRY_ITEM_FILTERS");if(n)return n.name;const l=t.find(r=>r.name.startsWith("COLLECTION_REGISTRY_APP_")&&r.name.endsWith("_FILTERS"));return l?l.name:""}function Ce(t,a){if(!t)return"";const n=t.find(p=>p.name===`COLLECTION_REGISTRY_APP${a}`);if(n)return n.name;const l={_GET:"REGISTRY_ITEM_GET",_VERSIONS:"REGISTRY_ITEM_VERSIONS",_SEARCH:"REGISTRY_ITEM_SEARCH"},r=t.find(p=>p.name===l[a]);if(r)return r.name;const h=t.find(p=>p.name.startsWith("COLLECTION_REGISTRY_APP_")&&p.name.endsWith(a));return h?h.name:""}function Ge(t){if(!t)return[];const a=[];for(const n of t){let l=[];if(Array.isArray(n))l=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(h=>Array.isArray(n[h]));r&&(l=n[r])}a.push(...l)}return a}const Se={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Pe(t){return t?Se[t]??t.toUpperCase():null}function xe(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function Me(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const a=Object.keys(t).find(n=>Array.isArray(t[n]));if(a)return t[a]}return[]}async function we(t,a,n,l){const r=await D({connectionId:t,orgId:a});try{const h=await r.callTool({name:n,arguments:l});return h.structuredContent??h}finally{await r.close().catch(console.error)}}export{Ge as a,Pe as b,we as c,Ee as d,Me as e,ve as f,Ne as g,be as h,Le as i,Ie as j,Ce as k,xe as l,Re as r,Ae as u};
@@ -1 +1 @@
1
- import{c as q,d as Y,e as A,r as B,j as s,B as z,f as G}from"./index-DnJ6a24w.js";import{u as K}from"./useMutation-Betr8yis.js";import{I as L}from"./input-BBKBJVKe.js";function J(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=K(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let f;e[22]!==a||e[23]!==t?(f=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=f):f=e[24];let g;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(g=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=g):g=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==f||e[42]!==g||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,f,g,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=f,e[42]=g,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await G.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{J as default};
1
+ import{c as q,d as Y,e as A,r as B,j as s,B as z,f as G}from"./index-DMmNh7jR.js";import{u as K}from"./useMutation-DrLoVqQ7.js";import{I as L}from"./input-Bt_nejZh.js";function J(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=K(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let f;e[22]!==a||e[23]!==t?(f=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=f):f=e[24];let g;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(g=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=g):g=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==f||e[42]!==g||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,f,g,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=f,e[42]=g,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await G.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{J as default};
@@ -1 +1 @@
1
- import{r as f,bh as Pn,c as He,D as Je,j as he}from"./index-DnJ6a24w.js";const Ye=({size:n=24,color:e="currentColor",...t})=>f.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},f.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));Ye.displayName="DotsGrid";const Ee=f.createContext(null);Ee.displayName="PanelGroupContext";const A={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},_e=10,ne=f.useLayoutEffect,Fe=Pn.useId,wn=typeof Fe=="function"?Fe:()=>null;let En=0;function Ge(n=null){const e=wn(),t=f.useRef(n||e||null);return t.current===null&&(t.current=""+En++),n??t.current}function Qe({children:n,className:e="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:a,minSize:s,onCollapse:h,onExpand:w,onResize:p,order:u,style:v,tagName:z="div",...C}){const E=f.useContext(Ee);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:S,expandPanel:L,getPanelSize:M,getPanelStyle:$,groupId:V,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:F,resizePanel:q,unregisterPanel:W}=E,G=Ge(l),D=f.useRef({callbacks:{onCollapse:h,onExpand:w,onResize:p},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:a,minSize:s},id:G,idIsFromProps:l!==void 0,order:u});f.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:_,constraints:H}=D.current,B={...H};D.current.id=G,D.current.idIsFromProps=l!==void 0,D.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,H.collapsedSize=t,H.collapsible=r,H.defaultSize=i,H.maxSize=a,H.minSize=s,(B.collapsedSize!==H.collapsedSize||B.collapsible!==H.collapsible||B.maxSize!==H.maxSize||B.minSize!==H.minSize)&&P(D.current,B)}),ne(()=>{const _=D.current;return F(_),()=>{W(_)}},[u,G,F,W]),f.useImperativeHandle(o,()=>({collapse:()=>{S(D.current)},expand:_=>{L(D.current,_)},getId(){return G},getSize(){return M(D.current)},isCollapsed(){return R(D.current)},isExpanded(){return!R(D.current)},resize:_=>{q(D.current,_)}}),[S,L,M,R,G,q]);const Y=$(D.current,i);return f.createElement(z,{...C,children:n,className:e,id:G,style:{...Y,...v},[A.groupId]:V,[A.panel]:"",[A.panelCollapsible]:r||void 0,[A.panelId]:G,[A.panelSize]:parseFloat(""+Y.flexGrow).toFixed(1)})}const en=f.forwardRef((n,e)=>f.createElement(Qe,{...n,forwardedRef:e}));Qe.displayName="Panel";en.displayName="forwardRef(Panel)";let $e=null,Se=-1,J=null;function Cn(n,e){if(e){const t=(e&ln)!==0,r=(e&an)!==0,i=(e&sn)!==0,o=(e&un)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function In(){J!==null&&(document.head.removeChild(J),$e=null,J=null,Se=-1)}function ke(n,e){var t,r;const i=Cn(n,e);if($e!==i){if($e=i,J===null&&(J=document.createElement("style"),document.head.appendChild(J)),Se>=0){var o;(o=J.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=J.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function nn(n){return n.type==="keydown"}function tn(n){return n.type.startsWith("pointer")}function rn(n){return n.type.startsWith("mouse")}function Ce(n){if(tn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(rn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Rn(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ln(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function kn(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:Ve(n),b:Ve(e)};let r;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),r=n;x(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ue(Ke(t.a)),b:Ue(Ke(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let a=o.length;for(;a--;){const s=o[a];if(s===l.a)return 1;if(s===l.b)return-1}}return Math.sign(i.a-i.b)}const An=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Dn(n){var e;const t=getComputedStyle((e=on(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Mn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Dn(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||An.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ke(n){let e=n.length;for(;e--;){const t=n[e];if(x(t,"Missing node"),Mn(t))return t}return null}function Ue(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Ve(n){const e=[];for(;n;)e.push(n),n=on(n);return e}function on(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const ln=1,an=2,sn=4,un=8,Nn=Rn()==="coarse";let U=[],ae=!1,ee=new Map,Ie=new Map;const ze=new Set;function $n(n,e,t,r,i){var o;const{ownerDocument:l}=e,a={direction:t,element:e,hitAreaMargins:r,setResizeHandlerState:i},s=(o=ee.get(l))!==null&&o!==void 0?o:0;return ee.set(l,s+1),ze.add(a),Pe(),function(){var w;Ie.delete(n),ze.delete(a);const p=(w=ee.get(l))!==null&&w!==void 0?w:1;if(ee.set(l,p-1),Pe(),p===1&&ee.delete(l),U.includes(a)){const u=U.indexOf(a);u>=0&&U.splice(u,1),Te(),i("up",!0,null)}}}function Hn(n){const{target:e}=n,{x:t,y:r}=Ce(n);ae=!0,Be({target:e,x:t,y:r}),Pe(),U.length>0&&(we("down",n),n.preventDefault(),cn(e)||n.stopImmediatePropagation())}function Ae(n){const{x:e,y:t}=Ce(n);if(ae&&n.buttons===0&&(ae=!1,we("up",n)),!ae){const{target:r}=n;Be({target:r,x:e,y:t})}we("move",n),Te(),U.length>0&&n.preventDefault()}function De(n){const{target:e}=n,{x:t,y:r}=Ce(n);Ie.clear(),ae=!1,U.length>0&&(n.preventDefault(),cn(e)||n.stopImmediatePropagation()),we("up",n),Be({target:e,x:t,y:r}),Te(),Pe()}function cn(n){let e=n;for(;e;){if(e.hasAttribute(A.resizeHandle))return!0;e=e.parentElement}return!1}function Be({target:n,x:e,y:t}){U.splice(0);let r=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(r=n),ze.forEach(i=>{const{element:o,hitAreaMargins:l}=i,a=o.getBoundingClientRect(),{bottom:s,left:h,right:w,top:p}=a,u=Nn?l.coarse:l.fine;if(e>=h-u&&e<=w+u&&t>=p-u&&t<=s+u){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&kn(r,o)>0){let z=r,C=!1;for(;z&&!z.contains(o);){if(Ln(z.getBoundingClientRect(),a)){C=!0;break}z=z.parentElement}if(C)return}U.push(i)}})}function Me(n,e){Ie.set(n,e)}function Te(){let n=!1,e=!1;U.forEach(r=>{const{direction:i}=r;i==="horizontal"?n=!0:e=!0});let t=0;Ie.forEach(r=>{t|=r}),n&&e?ke("intersection",t):n?ke("horizontal",t):e?ke("vertical",t):In()}let Ne=new AbortController;function Pe(){Ne.abort(),Ne=new AbortController;const n={capture:!0,signal:Ne.signal};ze.size&&(ae?(U.length>0&&ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("contextmenu",De,n),r.addEventListener("pointerleave",Ae,n),r.addEventListener("pointermove",Ae,n))}),window.addEventListener("pointerup",De,n),window.addEventListener("pointercancel",De,n)):ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("pointerdown",Hn,n),r.addEventListener("pointermove",Ae,n))}))}function we(n,e){ze.forEach(t=>{const{setResizeHandlerState:r}=t,i=U.includes(t);r(n,i,e)})}function _n(){const[n,e]=f.useState(0);return f.useCallback(()=>e(t=>t+1),[])}function x(n,e){if(!n)throw console.error(e),Error(e)}function te(n,e,t=_e){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function X(n,e,t=_e){return te(n,e,t)===0}function j(n,e,t){return te(n,e,t)===0}function Gn(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++){const i=n[r],o=e[r];if(!j(i,o,t))return!1}return!0}function le({panelConstraints:n,panelIndex:e,size:t}){const r=n[e];x(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:a=0}=r;if(te(t,a)<0)if(o){const s=(i+a)/2;te(t,s)<0?t=i:t=a}else t=a;return t=Math.min(l,t),t=parseFloat(t.toFixed(_e)),t}function ge({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(j(n,0))return e;const l=[...e],[a,s]=r;x(a!=null,"Invalid first pivot index"),x(s!=null,"Invalid second pivot index");let h=0;if(o==="keyboard"){{const p=n<0?s:a,u=t[p];x(u,`Panel constraints not found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,v)){const S=C-E;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}{const p=n<0?a:s,u=t[p];x(u,`No panel constraints found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,C)){const S=E-v;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}}{const p=n<0?1:-1;let u=n<0?s:a,v=0;for(;;){const C=e[u];x(C!=null,`Previous layout not found for panel index ${u}`);const S=le({panelConstraints:t,panelIndex:u,size:100})-C;if(v+=S,u+=p,u<0||u>=t.length)break}const z=Math.min(Math.abs(n),Math.abs(v));n=n<0?0-z:z}{let u=n<0?a:s;for(;u>=0&&u<t.length;){const v=Math.abs(n)-Math.abs(h),z=e[u];x(z!=null,`Previous layout not found for panel index ${u}`);const C=z-v,E=le({panelConstraints:t,panelIndex:u,size:C});if(!j(z,E)&&(h+=z-E,l[u]=E,h.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?u--:u++}}if(Gn(i,l))return i;{const p=n<0?s:a,u=e[p];x(u!=null,`Previous layout not found for panel index ${p}`);const v=u+h,z=le({panelConstraints:t,panelIndex:p,size:v});if(l[p]=z,!j(z,v)){let C=v-z,S=n<0?s:a;for(;S>=0&&S<t.length;){const L=l[S];x(L!=null,`Previous layout not found for panel index ${S}`);const M=L+C,$=le({panelConstraints:t,panelIndex:S,size:M});if(j(L,$)||(C-=$-L,l[S]=$),j(C,0))break;n>0?S--:S++}}}const w=l.reduce((p,u)=>u+p,0);return j(w,100)?l:i}function Bn({layout:n,panelsArray:e,pivotIndices:t}){let r=0,i=100,o=0,l=0;const a=t[0];x(a!=null,"No pivot index found"),e.forEach((p,u)=>{const{constraints:v}=p,{maxSize:z=100,minSize:C=0}=v;u===a?(r=C,i=z):(o+=C,l+=z)});const s=Math.min(i,100-o),h=Math.max(r,100-l),w=n[a];return{valueMax:s,valueMin:h,valueNow:w}}function ye(n,e=document){return Array.from(e.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${n}"]`))}function fn(n,e,t=document){const i=ye(n,t).findIndex(o=>o.getAttribute(A.resizeHandleId)===e);return i??null}function dn(n,e,t){const r=fn(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function pn(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return r||null}function Re(n,e=document){const t=e.querySelector(`[${A.resizeHandleId}="${n}"]`);return t||null}function Tn(n,e,t,r=document){var i,o,l,a;const s=Re(e,r),h=ye(n,r),w=s?h.indexOf(s):-1,p=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,u=(l=(a=t[w+1])===null||a===void 0?void 0:a.id)!==null&&l!==void 0?l:null;return[p,u]}function Wn({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){f.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const a=ye(t,o);for(let s=0;s<i.length-1;s++){const{valueMax:h,valueMin:w,valueNow:p}=Bn({layout:r,panelsArray:i,pivotIndices:[s,s+1]}),u=a[s];if(u!=null){const v=i[s];x(v,`No panel data found for index "${s}"`),u.setAttribute("aria-controls",v.id),u.setAttribute("aria-valuemax",""+Math.round(h)),u.setAttribute("aria-valuemin",""+Math.round(w)),u.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{a.forEach((s,h)=>{s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")})}},[t,r,i,o]),f.useEffect(()=>{if(!o)return;const a=e.current;x(a,"Eager values not found");const{panelDataArray:s}=a,h=pn(t,o);x(h!=null,`No group found for id "${t}"`);const w=ye(t,o);x(w,`No resize handles found for group id "${t}"`);const p=w.map(u=>{const v=u.getAttribute(A.resizeHandleId);x(v,"Resize handle element has no handle id attribute");const[z,C]=Tn(t,v,s,o);if(z==null||C==null)return()=>{};const E=S=>{if(!S.defaultPrevented)switch(S.key){case"Enter":{S.preventDefault();const L=s.findIndex(M=>M.id===z);if(L>=0){const M=s[L];x(M,`No panel data found for index ${L}`);const $=r[L],{collapsedSize:V=0,collapsible:R,minSize:P=0}=M.constraints;if($!=null&&R){const F=ge({delta:j($,V)?P-V:V-$,initialLayout:r,panelConstraints:s.map(q=>q.constraints),pivotIndices:dn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==F&&l(F)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,n,e,t,r,i,l])}function Ze(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function gn(n,e){const t=n==="horizontal",{x:r,y:i}=Ce(e);return t?r:i}function jn(n,e,t,r,i){const o=t==="horizontal",l=Re(e,i);x(l,`No resize handle element found for id "${e}"`);const a=l.getAttribute(A.groupId);x(a,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=r;const h=gn(t,n),w=pn(a,i);x(w,`No group element found for id "${a}"`);const p=w.getBoundingClientRect(),u=o?p.width:p.height;return(h-s)/u*100}function Fn(n,e,t,r,i,o){if(nn(n)){const l=t==="horizontal";let a=0;n.shiftKey?a=100:i!=null?a=i:a=10;let s=0;switch(n.key){case"ArrowDown":s=l?0:a;break;case"ArrowLeft":s=l?-a:0;break;case"ArrowRight":s=l?a:0;break;case"ArrowUp":s=l?0:-a;break;case"End":s=100;break;case"Home":s=-100;break}return s}else return r==null?0:jn(n,e,t,r,o)}function Kn({panelDataArray:n}){const e=Array(n.length),t=n.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;a!=null&&(r++,e[o]=a,i-=a)}for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;if(a!=null)continue;const s=n.length-r,h=i/s;r++,e[o]=h,i-=h}return e}function oe(n,e,t){e.forEach((r,i)=>{const o=n[i];x(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:a,id:s}=o,{collapsedSize:h=0,collapsible:w}=a,p=t[s];if(p==null||r!==p){t[s]=r;const{onCollapse:u,onExpand:v,onResize:z}=l;z&&z(r,p),w&&(u||v)&&(v&&(p==null||X(p,h))&&!X(r,h)&&v(),u&&(p==null||!X(p,h))&&X(r,h)&&u())}})}function be(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function Un({defaultSize:n,dragState:e,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let a;return l==null?a=n!=null?n.toPrecision(o):"1":r.length===1?a="1":a=l.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Vn(n,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...i)},e)}}function Oe(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function mn(n){return`react-resizable-panels:${n}`}function hn(n){return n.map(e=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=e;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function zn(n,e){try{const t=mn(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Zn(n,e,t){var r,i;const o=(r=zn(n,t))!==null&&r!==void 0?r:{},l=hn(e);return(i=o[l])!==null&&i!==void 0?i:null}function On(n,e,t,r,i){var o;const l=mn(n),a=hn(e),s=(o=zn(n,i))!==null&&o!==void 0?o:{};s[a]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(s))}catch(h){console.error(h)}}function qe({layout:n,panelConstraints:e}){const t=[...n],r=t.reduce((o,l)=>o+l,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!j(r,100)&&t.length>0)for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=100/r*l;t[o]=a}let i=0;for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=le({panelConstraints:e,panelIndex:o,size:l});l!=a&&(i+=l-a,t[o]=a)}if(!j(i,0))for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=l+i,s=le({panelConstraints:e,panelIndex:o,size:a});if(l!==s&&(i-=s-l,t[o]=s,j(i,0)))break}return t}const qn=100,me={getItem:n=>(Oe(me),me.getItem(n)),setItem:(n,e)=>{Oe(me),me.setItem(n,e)}},Xe={};function yn({autoSaveId:n=null,children:e,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:a=null,storage:s=me,style:h,tagName:w="div",...p}){const u=Ge(o),v=f.useRef(null),[z,C]=f.useState(null),[E,S]=f.useState([]),L=_n(),M=f.useRef({}),$=f.useRef(new Map),V=f.useRef(0),R=f.useRef({autoSaveId:n,direction:r,dragState:z,id:u,keyboardResizeBy:a,onLayout:l,storage:s}),P=f.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});f.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f.useImperativeHandle(i,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:c}=P.current;return c},setLayout:c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current,d=qe({layout:c,panelConstraints:g.map(y=>y.constraints)});Ze(b,d)||(S(d),P.current.layout=d,m&&m(d),oe(g,d,M.current))}}),[]),ne(()=>{R.current.autoSaveId=n,R.current.direction=r,R.current.dragState=z,R.current.id=u,R.current.onLayout=l,R.current.storage=s}),Wn({committedValuesRef:R,eagerValuesRef:P,groupId:u,layout:E,panelDataArray:P.current.panelDataArray,setLayout:S,panelGroupElement:v.current}),f.useEffect(()=>{const{panelDataArray:c}=P.current;if(n){if(E.length===0||E.length!==c.length)return;let m=Xe[n];m==null&&(m=Vn(On,qn),Xe[n]=m);const b=[...c],g=new Map($.current);m(n,b,g,E,s)}},[n,E,s]),f.useEffect(()=>{});const F=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(Z=>Z.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:N}=Q(g,c,b);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!X(I,y)){$.current.set(c.id,I);const O=ie(g,c)===g.length-1?I-y:y-I,k=ge({delta:O,initialLayout:b,panelConstraints:d,pivotIndices:N,prevLayout:b,trigger:"imperative-api"});be(b,k)||(S(k),P.current.layout=k,m&&m(k),oe(g,k,M.current))}}},[]),q=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current;if(c.constraints.collapsible){const y=d.map(K=>K.constraints),{collapsedSize:I=0,panelSize:N=0,minSize:Z=0,pivotIndices:O}=Q(d,c,g),k=m??Z;if(X(N,I)){const K=$.current.get(c.id),de=K!=null&&K>=k?K:k,Le=ie(d,c)===d.length-1?N-de:de-N,T=ge({delta:Le,initialLayout:g,panelConstraints:y,pivotIndices:O,prevLayout:g,trigger:"imperative-api"});be(g,T)||(S(T),P.current.layout=T,b&&b(T),oe(d,T,M.current))}}},[]),W=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{panelSize:g}=Q(b,c,m);return x(g!=null,`Panel size not found for panel "${c.id}"`),g},[]),G=f.useCallback((c,m)=>{const{panelDataArray:b}=P.current,g=ie(b,c);return Un({defaultSize:m,dragState:z,layout:E,panelData:b,panelIndex:g})},[z,E]),D=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),d===!0&&X(y,g)},[]),Y=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),!d||te(y,g)>0},[]),_=f.useCallback(c=>{const{panelDataArray:m}=P.current;m.push(c),m.sort((b,g)=>{const d=b.order,y=g.order;return d==null&&y==null?0:d==null?-1:y==null?1:d-y}),P.current.panelDataArrayChanged=!0,L()},[L]);ne(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:c,onLayout:m,storage:b}=R.current,{layout:g,panelDataArray:d}=P.current;let y=null;if(c){const N=Zn(c,d,b);N&&($.current=new Map(Object.entries(N.expandToSizes)),y=N.layout)}y==null&&(y=Kn({panelDataArray:d}));const I=qe({layout:y,panelConstraints:d.map(N=>N.constraints)});Ze(g,I)||(S(I),P.current.layout=I,m&&m(I),oe(d,I,M.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const H=f.useCallback(c=>{let m=!1;const b=v.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(m=!0),function(d){d.preventDefault();const y=v.current;if(!y)return()=>null;const{direction:I,dragState:N,id:Z,keyboardResizeBy:O,onLayout:k}=R.current,{layout:K,panelDataArray:de}=P.current,{initialLayout:ve}=N??{},Le=dn(Z,c,y);let T=Fn(d,c,I,N,O,y);const We=I==="horizontal";We&&m&&(T=-T);const bn=de.map(Sn=>Sn.constraints),pe=ge({delta:T,initialLayout:ve??K,panelConstraints:bn,pivotIndices:Le,prevLayout:K,trigger:nn(d)?"keyboard":"mouse-or-touch"}),je=!be(K,pe);(tn(d)||rn(d))&&V.current!=T&&(V.current=T,!je&&T!==0?We?Me(c,T<0?ln:an):Me(c,T<0?sn:un):Me(c,0)),je&&(S(pe),P.current.layout=pe,k&&k(pe),oe(de,pe,M.current))}},[]),B=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current,y=d.map(K=>K.constraints),{panelSize:I,pivotIndices:N}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const O=ie(d,c)===d.length-1?I-m:m-I,k=ge({delta:O,initialLayout:g,panelConstraints:y,pivotIndices:N,prevLayout:g,trigger:"imperative-api"});be(g,k)||(S(k),P.current.layout=k,b&&b(k),oe(d,k,M.current))},[]),se=f.useCallback((c,m)=>{const{layout:b,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:N,maxSize:Z=100,minSize:O=0}=c.constraints,{panelSize:k}=Q(g,c,b);k!=null&&(y&&N&&X(k,d)?X(d,I)||B(c,I):k<O?B(c,O):k>Z&&B(c,Z))},[B]),ue=f.useCallback((c,m)=>{const{direction:b}=R.current,{layout:g}=P.current;if(!v.current)return;const d=Re(c,v.current);x(d,`Drag handle element not found for id "${c}"`);const y=gn(b,m);C({dragHandleId:c,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:y,initialLayout:g})},[]),ce=f.useCallback(()=>{C(null)},[]),xe=f.useCallback(c=>{const{panelDataArray:m}=P.current,b=ie(m,c);b>=0&&(m.splice(b,1),delete M.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:F,direction:r,dragState:z,expandPanel:q,getPanelSize:W,getPanelStyle:G,groupId:u,isPanelCollapsed:D,isPanelExpanded:Y,reevaluatePanelConstraints:se,registerPanel:_,registerResizeHandle:H,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:xe,panelGroupElement:v.current}),[F,z,r,q,W,G,u,D,Y,se,_,H,B,ue,ce,xe]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return f.createElement(Ee.Provider,{value:re},f.createElement(w,{...p,children:e,className:t,id:o,ref:v,style:{...fe,...h},[A.group]:"",[A.groupDirection]:r,[A.groupId]:u}))}const xn=f.forwardRef((n,e)=>f.createElement(yn,{...n,forwardedRef:e}));yn.displayName="PanelGroup";xn.displayName="forwardRef(PanelGroup)";function ie(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Q(n,e,t){const r=ie(n,e),o=r===n.length-1?[r-1,r]:[r,r+1],l=t[r];return{...e.constraints,panelSize:l,pivotIndices:o}}function Xn({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:r}){f.useEffect(()=>{if(n||t==null||r==null)return;const i=Re(e,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const a=i.getAttribute(A.groupId);x(a,`No group element found for id "${a}"`);const s=ye(a,r),h=fn(a,e,r);x(h!==null,`No resize element found for id "${e}"`);const w=l.shiftKey?h>0?h-1:s.length-1:h+1<s.length?h+1:0;s[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,n,e,t])}function vn({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:a,onFocus:s,onPointerDown:h,onPointerUp:w,style:p={},tabIndex:u=0,tagName:v="div",...z}){var C,E;const S=f.useRef(null),L=f.useRef({onClick:l,onDragging:a,onPointerDown:h,onPointerUp:w});f.useEffect(()=>{L.current.onClick=l,L.current.onDragging=a,L.current.onPointerDown=h,L.current.onPointerUp=w});const M=f.useContext(Ee);if(M===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:$,groupId:V,registerResizeHandle:R,startDragging:P,stopDragging:F,panelGroupElement:q}=M,W=Ge(i),[G,D]=f.useState("inactive"),[Y,_]=f.useState(!1),[H,B]=f.useState(null),se=f.useRef({state:G});ne(()=>{se.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(W);B(()=>re)}},[t,W,R]);const ue=(C=r?.coarse)!==null&&C!==void 0?C:15,ce=(E=r?.fine)!==null&&E!==void 0?E:5;f.useEffect(()=>{if(t||H==null)return;const re=S.current;x(re,"Element ref not attached");let fe=!1;return $n(W,re,$,{coarse:ue,fine:ce},(m,b,g)=>{if(!b){D("inactive");return}switch(m){case"down":{D("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(W,g);const{onDragging:d,onPointerDown:y}=L.current;d?.(!0),y?.();break}case"move":{const{state:d}=se.current;fe=!0,d!=="drag"&&D("hover"),x(g,'Expected event to be defined for "move" action'),H(g);break}case"up":{D("hover"),F();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y?.(!1),I?.(),fe||d?.();break}}})},[ue,$,t,ce,R,W,H,P,F]),Xn({disabled:t,handleId:W,resizeHandler:H,panelGroupElement:q});const xe={touchAction:"none",userSelect:"none"};return f.createElement(v,{...z,children:n,className:e,id:i,onBlur:()=>{_(!1),o?.()},onFocus:()=>{_(!0),s?.()},ref:S,role:"separator",style:{...xe,...p},tabIndex:u,[A.groupDirection]:$,[A.groupId]:V,[A.resizeHandle]:"",[A.resizeHandleActive]:G==="drag"?"pointer":Y?"keyboard":void 0,[A.resizeHandleEnabled]:!t,[A.resizeHandleId]:W,[A.resizeHandleState]:G})}vn.displayName="PanelResizeHandle";function Yn(n){const e=He.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=Je("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[3]=t,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=he.jsx(xn,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function Qn(n){const e=He.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let r;return e[2]!==t?(r=he.jsx(en,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=r):r=e[3],r}function et(n){const e=He.c(12);let t,r,i;e[0]!==n?({withHandle:i,className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i):(t=e[1],r=e[2],i=e[3]);let o;e[4]!==t?(o=Je("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=o):o=e[5];let l;e[6]!==i?(l=i&&he.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:he.jsx(Ye,{className:"size-2.5"})}),e[6]=i,e[7]=l):l=e[7];let a;return e[8]!==r||e[9]!==o||e[10]!==l?(a=he.jsx(vn,{"data-slot":"resizable-handle",className:o,...r,children:l}),e[8]=r,e[9]=o,e[10]=l,e[11]=a):a=e[11],a}export{Qn as R,et as a,Yn as b};
1
+ import{r as f,bi as Pn,c as He,D as Je,j as he}from"./index-DMmNh7jR.js";const Ye=({size:n=24,color:e="currentColor",...t})=>f.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},f.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));Ye.displayName="DotsGrid";const Ee=f.createContext(null);Ee.displayName="PanelGroupContext";const A={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},_e=10,ne=f.useLayoutEffect,Fe=Pn.useId,wn=typeof Fe=="function"?Fe:()=>null;let En=0;function Ge(n=null){const e=wn(),t=f.useRef(n||e||null);return t.current===null&&(t.current=""+En++),n??t.current}function Qe({children:n,className:e="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:a,minSize:s,onCollapse:h,onExpand:w,onResize:p,order:u,style:v,tagName:z="div",...C}){const E=f.useContext(Ee);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:S,expandPanel:L,getPanelSize:M,getPanelStyle:$,groupId:V,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:F,resizePanel:q,unregisterPanel:W}=E,G=Ge(l),D=f.useRef({callbacks:{onCollapse:h,onExpand:w,onResize:p},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:a,minSize:s},id:G,idIsFromProps:l!==void 0,order:u});f.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:_,constraints:H}=D.current,B={...H};D.current.id=G,D.current.idIsFromProps=l!==void 0,D.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,H.collapsedSize=t,H.collapsible=r,H.defaultSize=i,H.maxSize=a,H.minSize=s,(B.collapsedSize!==H.collapsedSize||B.collapsible!==H.collapsible||B.maxSize!==H.maxSize||B.minSize!==H.minSize)&&P(D.current,B)}),ne(()=>{const _=D.current;return F(_),()=>{W(_)}},[u,G,F,W]),f.useImperativeHandle(o,()=>({collapse:()=>{S(D.current)},expand:_=>{L(D.current,_)},getId(){return G},getSize(){return M(D.current)},isCollapsed(){return R(D.current)},isExpanded(){return!R(D.current)},resize:_=>{q(D.current,_)}}),[S,L,M,R,G,q]);const Y=$(D.current,i);return f.createElement(z,{...C,children:n,className:e,id:G,style:{...Y,...v},[A.groupId]:V,[A.panel]:"",[A.panelCollapsible]:r||void 0,[A.panelId]:G,[A.panelSize]:parseFloat(""+Y.flexGrow).toFixed(1)})}const en=f.forwardRef((n,e)=>f.createElement(Qe,{...n,forwardedRef:e}));Qe.displayName="Panel";en.displayName="forwardRef(Panel)";let $e=null,Se=-1,J=null;function Cn(n,e){if(e){const t=(e&ln)!==0,r=(e&an)!==0,i=(e&sn)!==0,o=(e&un)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function In(){J!==null&&(document.head.removeChild(J),$e=null,J=null,Se=-1)}function ke(n,e){var t,r;const i=Cn(n,e);if($e!==i){if($e=i,J===null&&(J=document.createElement("style"),document.head.appendChild(J)),Se>=0){var o;(o=J.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=J.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function nn(n){return n.type==="keydown"}function tn(n){return n.type.startsWith("pointer")}function rn(n){return n.type.startsWith("mouse")}function Ce(n){if(tn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(rn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Rn(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ln(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function kn(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:Ve(n),b:Ve(e)};let r;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),r=n;x(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ue(Ke(t.a)),b:Ue(Ke(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let a=o.length;for(;a--;){const s=o[a];if(s===l.a)return 1;if(s===l.b)return-1}}return Math.sign(i.a-i.b)}const An=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Dn(n){var e;const t=getComputedStyle((e=on(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Mn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Dn(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||An.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ke(n){let e=n.length;for(;e--;){const t=n[e];if(x(t,"Missing node"),Mn(t))return t}return null}function Ue(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Ve(n){const e=[];for(;n;)e.push(n),n=on(n);return e}function on(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const ln=1,an=2,sn=4,un=8,Nn=Rn()==="coarse";let U=[],ae=!1,ee=new Map,Ie=new Map;const ze=new Set;function $n(n,e,t,r,i){var o;const{ownerDocument:l}=e,a={direction:t,element:e,hitAreaMargins:r,setResizeHandlerState:i},s=(o=ee.get(l))!==null&&o!==void 0?o:0;return ee.set(l,s+1),ze.add(a),Pe(),function(){var w;Ie.delete(n),ze.delete(a);const p=(w=ee.get(l))!==null&&w!==void 0?w:1;if(ee.set(l,p-1),Pe(),p===1&&ee.delete(l),U.includes(a)){const u=U.indexOf(a);u>=0&&U.splice(u,1),Te(),i("up",!0,null)}}}function Hn(n){const{target:e}=n,{x:t,y:r}=Ce(n);ae=!0,Be({target:e,x:t,y:r}),Pe(),U.length>0&&(we("down",n),n.preventDefault(),cn(e)||n.stopImmediatePropagation())}function Ae(n){const{x:e,y:t}=Ce(n);if(ae&&n.buttons===0&&(ae=!1,we("up",n)),!ae){const{target:r}=n;Be({target:r,x:e,y:t})}we("move",n),Te(),U.length>0&&n.preventDefault()}function De(n){const{target:e}=n,{x:t,y:r}=Ce(n);Ie.clear(),ae=!1,U.length>0&&(n.preventDefault(),cn(e)||n.stopImmediatePropagation()),we("up",n),Be({target:e,x:t,y:r}),Te(),Pe()}function cn(n){let e=n;for(;e;){if(e.hasAttribute(A.resizeHandle))return!0;e=e.parentElement}return!1}function Be({target:n,x:e,y:t}){U.splice(0);let r=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(r=n),ze.forEach(i=>{const{element:o,hitAreaMargins:l}=i,a=o.getBoundingClientRect(),{bottom:s,left:h,right:w,top:p}=a,u=Nn?l.coarse:l.fine;if(e>=h-u&&e<=w+u&&t>=p-u&&t<=s+u){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&kn(r,o)>0){let z=r,C=!1;for(;z&&!z.contains(o);){if(Ln(z.getBoundingClientRect(),a)){C=!0;break}z=z.parentElement}if(C)return}U.push(i)}})}function Me(n,e){Ie.set(n,e)}function Te(){let n=!1,e=!1;U.forEach(r=>{const{direction:i}=r;i==="horizontal"?n=!0:e=!0});let t=0;Ie.forEach(r=>{t|=r}),n&&e?ke("intersection",t):n?ke("horizontal",t):e?ke("vertical",t):In()}let Ne=new AbortController;function Pe(){Ne.abort(),Ne=new AbortController;const n={capture:!0,signal:Ne.signal};ze.size&&(ae?(U.length>0&&ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("contextmenu",De,n),r.addEventListener("pointerleave",Ae,n),r.addEventListener("pointermove",Ae,n))}),window.addEventListener("pointerup",De,n),window.addEventListener("pointercancel",De,n)):ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("pointerdown",Hn,n),r.addEventListener("pointermove",Ae,n))}))}function we(n,e){ze.forEach(t=>{const{setResizeHandlerState:r}=t,i=U.includes(t);r(n,i,e)})}function _n(){const[n,e]=f.useState(0);return f.useCallback(()=>e(t=>t+1),[])}function x(n,e){if(!n)throw console.error(e),Error(e)}function te(n,e,t=_e){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function X(n,e,t=_e){return te(n,e,t)===0}function j(n,e,t){return te(n,e,t)===0}function Gn(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++){const i=n[r],o=e[r];if(!j(i,o,t))return!1}return!0}function le({panelConstraints:n,panelIndex:e,size:t}){const r=n[e];x(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:a=0}=r;if(te(t,a)<0)if(o){const s=(i+a)/2;te(t,s)<0?t=i:t=a}else t=a;return t=Math.min(l,t),t=parseFloat(t.toFixed(_e)),t}function ge({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(j(n,0))return e;const l=[...e],[a,s]=r;x(a!=null,"Invalid first pivot index"),x(s!=null,"Invalid second pivot index");let h=0;if(o==="keyboard"){{const p=n<0?s:a,u=t[p];x(u,`Panel constraints not found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,v)){const S=C-E;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}{const p=n<0?a:s,u=t[p];x(u,`No panel constraints found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,C)){const S=E-v;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}}{const p=n<0?1:-1;let u=n<0?s:a,v=0;for(;;){const C=e[u];x(C!=null,`Previous layout not found for panel index ${u}`);const S=le({panelConstraints:t,panelIndex:u,size:100})-C;if(v+=S,u+=p,u<0||u>=t.length)break}const z=Math.min(Math.abs(n),Math.abs(v));n=n<0?0-z:z}{let u=n<0?a:s;for(;u>=0&&u<t.length;){const v=Math.abs(n)-Math.abs(h),z=e[u];x(z!=null,`Previous layout not found for panel index ${u}`);const C=z-v,E=le({panelConstraints:t,panelIndex:u,size:C});if(!j(z,E)&&(h+=z-E,l[u]=E,h.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?u--:u++}}if(Gn(i,l))return i;{const p=n<0?s:a,u=e[p];x(u!=null,`Previous layout not found for panel index ${p}`);const v=u+h,z=le({panelConstraints:t,panelIndex:p,size:v});if(l[p]=z,!j(z,v)){let C=v-z,S=n<0?s:a;for(;S>=0&&S<t.length;){const L=l[S];x(L!=null,`Previous layout not found for panel index ${S}`);const M=L+C,$=le({panelConstraints:t,panelIndex:S,size:M});if(j(L,$)||(C-=$-L,l[S]=$),j(C,0))break;n>0?S--:S++}}}const w=l.reduce((p,u)=>u+p,0);return j(w,100)?l:i}function Bn({layout:n,panelsArray:e,pivotIndices:t}){let r=0,i=100,o=0,l=0;const a=t[0];x(a!=null,"No pivot index found"),e.forEach((p,u)=>{const{constraints:v}=p,{maxSize:z=100,minSize:C=0}=v;u===a?(r=C,i=z):(o+=C,l+=z)});const s=Math.min(i,100-o),h=Math.max(r,100-l),w=n[a];return{valueMax:s,valueMin:h,valueNow:w}}function ye(n,e=document){return Array.from(e.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${n}"]`))}function fn(n,e,t=document){const i=ye(n,t).findIndex(o=>o.getAttribute(A.resizeHandleId)===e);return i??null}function dn(n,e,t){const r=fn(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function pn(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return r||null}function Re(n,e=document){const t=e.querySelector(`[${A.resizeHandleId}="${n}"]`);return t||null}function Tn(n,e,t,r=document){var i,o,l,a;const s=Re(e,r),h=ye(n,r),w=s?h.indexOf(s):-1,p=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,u=(l=(a=t[w+1])===null||a===void 0?void 0:a.id)!==null&&l!==void 0?l:null;return[p,u]}function Wn({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){f.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const a=ye(t,o);for(let s=0;s<i.length-1;s++){const{valueMax:h,valueMin:w,valueNow:p}=Bn({layout:r,panelsArray:i,pivotIndices:[s,s+1]}),u=a[s];if(u!=null){const v=i[s];x(v,`No panel data found for index "${s}"`),u.setAttribute("aria-controls",v.id),u.setAttribute("aria-valuemax",""+Math.round(h)),u.setAttribute("aria-valuemin",""+Math.round(w)),u.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{a.forEach((s,h)=>{s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")})}},[t,r,i,o]),f.useEffect(()=>{if(!o)return;const a=e.current;x(a,"Eager values not found");const{panelDataArray:s}=a,h=pn(t,o);x(h!=null,`No group found for id "${t}"`);const w=ye(t,o);x(w,`No resize handles found for group id "${t}"`);const p=w.map(u=>{const v=u.getAttribute(A.resizeHandleId);x(v,"Resize handle element has no handle id attribute");const[z,C]=Tn(t,v,s,o);if(z==null||C==null)return()=>{};const E=S=>{if(!S.defaultPrevented)switch(S.key){case"Enter":{S.preventDefault();const L=s.findIndex(M=>M.id===z);if(L>=0){const M=s[L];x(M,`No panel data found for index ${L}`);const $=r[L],{collapsedSize:V=0,collapsible:R,minSize:P=0}=M.constraints;if($!=null&&R){const F=ge({delta:j($,V)?P-V:V-$,initialLayout:r,panelConstraints:s.map(q=>q.constraints),pivotIndices:dn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==F&&l(F)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,n,e,t,r,i,l])}function Ze(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function gn(n,e){const t=n==="horizontal",{x:r,y:i}=Ce(e);return t?r:i}function jn(n,e,t,r,i){const o=t==="horizontal",l=Re(e,i);x(l,`No resize handle element found for id "${e}"`);const a=l.getAttribute(A.groupId);x(a,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=r;const h=gn(t,n),w=pn(a,i);x(w,`No group element found for id "${a}"`);const p=w.getBoundingClientRect(),u=o?p.width:p.height;return(h-s)/u*100}function Fn(n,e,t,r,i,o){if(nn(n)){const l=t==="horizontal";let a=0;n.shiftKey?a=100:i!=null?a=i:a=10;let s=0;switch(n.key){case"ArrowDown":s=l?0:a;break;case"ArrowLeft":s=l?-a:0;break;case"ArrowRight":s=l?a:0;break;case"ArrowUp":s=l?0:-a;break;case"End":s=100;break;case"Home":s=-100;break}return s}else return r==null?0:jn(n,e,t,r,o)}function Kn({panelDataArray:n}){const e=Array(n.length),t=n.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;a!=null&&(r++,e[o]=a,i-=a)}for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;if(a!=null)continue;const s=n.length-r,h=i/s;r++,e[o]=h,i-=h}return e}function oe(n,e,t){e.forEach((r,i)=>{const o=n[i];x(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:a,id:s}=o,{collapsedSize:h=0,collapsible:w}=a,p=t[s];if(p==null||r!==p){t[s]=r;const{onCollapse:u,onExpand:v,onResize:z}=l;z&&z(r,p),w&&(u||v)&&(v&&(p==null||X(p,h))&&!X(r,h)&&v(),u&&(p==null||!X(p,h))&&X(r,h)&&u())}})}function be(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function Un({defaultSize:n,dragState:e,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let a;return l==null?a=n!=null?n.toPrecision(o):"1":r.length===1?a="1":a=l.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Vn(n,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...i)},e)}}function Oe(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function mn(n){return`react-resizable-panels:${n}`}function hn(n){return n.map(e=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=e;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function zn(n,e){try{const t=mn(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Zn(n,e,t){var r,i;const o=(r=zn(n,t))!==null&&r!==void 0?r:{},l=hn(e);return(i=o[l])!==null&&i!==void 0?i:null}function On(n,e,t,r,i){var o;const l=mn(n),a=hn(e),s=(o=zn(n,i))!==null&&o!==void 0?o:{};s[a]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(s))}catch(h){console.error(h)}}function qe({layout:n,panelConstraints:e}){const t=[...n],r=t.reduce((o,l)=>o+l,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!j(r,100)&&t.length>0)for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=100/r*l;t[o]=a}let i=0;for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=le({panelConstraints:e,panelIndex:o,size:l});l!=a&&(i+=l-a,t[o]=a)}if(!j(i,0))for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=l+i,s=le({panelConstraints:e,panelIndex:o,size:a});if(l!==s&&(i-=s-l,t[o]=s,j(i,0)))break}return t}const qn=100,me={getItem:n=>(Oe(me),me.getItem(n)),setItem:(n,e)=>{Oe(me),me.setItem(n,e)}},Xe={};function yn({autoSaveId:n=null,children:e,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:a=null,storage:s=me,style:h,tagName:w="div",...p}){const u=Ge(o),v=f.useRef(null),[z,C]=f.useState(null),[E,S]=f.useState([]),L=_n(),M=f.useRef({}),$=f.useRef(new Map),V=f.useRef(0),R=f.useRef({autoSaveId:n,direction:r,dragState:z,id:u,keyboardResizeBy:a,onLayout:l,storage:s}),P=f.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});f.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f.useImperativeHandle(i,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:c}=P.current;return c},setLayout:c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current,d=qe({layout:c,panelConstraints:g.map(y=>y.constraints)});Ze(b,d)||(S(d),P.current.layout=d,m&&m(d),oe(g,d,M.current))}}),[]),ne(()=>{R.current.autoSaveId=n,R.current.direction=r,R.current.dragState=z,R.current.id=u,R.current.onLayout=l,R.current.storage=s}),Wn({committedValuesRef:R,eagerValuesRef:P,groupId:u,layout:E,panelDataArray:P.current.panelDataArray,setLayout:S,panelGroupElement:v.current}),f.useEffect(()=>{const{panelDataArray:c}=P.current;if(n){if(E.length===0||E.length!==c.length)return;let m=Xe[n];m==null&&(m=Vn(On,qn),Xe[n]=m);const b=[...c],g=new Map($.current);m(n,b,g,E,s)}},[n,E,s]),f.useEffect(()=>{});const F=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(Z=>Z.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:N}=Q(g,c,b);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!X(I,y)){$.current.set(c.id,I);const O=ie(g,c)===g.length-1?I-y:y-I,k=ge({delta:O,initialLayout:b,panelConstraints:d,pivotIndices:N,prevLayout:b,trigger:"imperative-api"});be(b,k)||(S(k),P.current.layout=k,m&&m(k),oe(g,k,M.current))}}},[]),q=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current;if(c.constraints.collapsible){const y=d.map(K=>K.constraints),{collapsedSize:I=0,panelSize:N=0,minSize:Z=0,pivotIndices:O}=Q(d,c,g),k=m??Z;if(X(N,I)){const K=$.current.get(c.id),de=K!=null&&K>=k?K:k,Le=ie(d,c)===d.length-1?N-de:de-N,T=ge({delta:Le,initialLayout:g,panelConstraints:y,pivotIndices:O,prevLayout:g,trigger:"imperative-api"});be(g,T)||(S(T),P.current.layout=T,b&&b(T),oe(d,T,M.current))}}},[]),W=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{panelSize:g}=Q(b,c,m);return x(g!=null,`Panel size not found for panel "${c.id}"`),g},[]),G=f.useCallback((c,m)=>{const{panelDataArray:b}=P.current,g=ie(b,c);return Un({defaultSize:m,dragState:z,layout:E,panelData:b,panelIndex:g})},[z,E]),D=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),d===!0&&X(y,g)},[]),Y=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),!d||te(y,g)>0},[]),_=f.useCallback(c=>{const{panelDataArray:m}=P.current;m.push(c),m.sort((b,g)=>{const d=b.order,y=g.order;return d==null&&y==null?0:d==null?-1:y==null?1:d-y}),P.current.panelDataArrayChanged=!0,L()},[L]);ne(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:c,onLayout:m,storage:b}=R.current,{layout:g,panelDataArray:d}=P.current;let y=null;if(c){const N=Zn(c,d,b);N&&($.current=new Map(Object.entries(N.expandToSizes)),y=N.layout)}y==null&&(y=Kn({panelDataArray:d}));const I=qe({layout:y,panelConstraints:d.map(N=>N.constraints)});Ze(g,I)||(S(I),P.current.layout=I,m&&m(I),oe(d,I,M.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const H=f.useCallback(c=>{let m=!1;const b=v.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(m=!0),function(d){d.preventDefault();const y=v.current;if(!y)return()=>null;const{direction:I,dragState:N,id:Z,keyboardResizeBy:O,onLayout:k}=R.current,{layout:K,panelDataArray:de}=P.current,{initialLayout:ve}=N??{},Le=dn(Z,c,y);let T=Fn(d,c,I,N,O,y);const We=I==="horizontal";We&&m&&(T=-T);const bn=de.map(Sn=>Sn.constraints),pe=ge({delta:T,initialLayout:ve??K,panelConstraints:bn,pivotIndices:Le,prevLayout:K,trigger:nn(d)?"keyboard":"mouse-or-touch"}),je=!be(K,pe);(tn(d)||rn(d))&&V.current!=T&&(V.current=T,!je&&T!==0?We?Me(c,T<0?ln:an):Me(c,T<0?sn:un):Me(c,0)),je&&(S(pe),P.current.layout=pe,k&&k(pe),oe(de,pe,M.current))}},[]),B=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current,y=d.map(K=>K.constraints),{panelSize:I,pivotIndices:N}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const O=ie(d,c)===d.length-1?I-m:m-I,k=ge({delta:O,initialLayout:g,panelConstraints:y,pivotIndices:N,prevLayout:g,trigger:"imperative-api"});be(g,k)||(S(k),P.current.layout=k,b&&b(k),oe(d,k,M.current))},[]),se=f.useCallback((c,m)=>{const{layout:b,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:N,maxSize:Z=100,minSize:O=0}=c.constraints,{panelSize:k}=Q(g,c,b);k!=null&&(y&&N&&X(k,d)?X(d,I)||B(c,I):k<O?B(c,O):k>Z&&B(c,Z))},[B]),ue=f.useCallback((c,m)=>{const{direction:b}=R.current,{layout:g}=P.current;if(!v.current)return;const d=Re(c,v.current);x(d,`Drag handle element not found for id "${c}"`);const y=gn(b,m);C({dragHandleId:c,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:y,initialLayout:g})},[]),ce=f.useCallback(()=>{C(null)},[]),xe=f.useCallback(c=>{const{panelDataArray:m}=P.current,b=ie(m,c);b>=0&&(m.splice(b,1),delete M.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:F,direction:r,dragState:z,expandPanel:q,getPanelSize:W,getPanelStyle:G,groupId:u,isPanelCollapsed:D,isPanelExpanded:Y,reevaluatePanelConstraints:se,registerPanel:_,registerResizeHandle:H,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:xe,panelGroupElement:v.current}),[F,z,r,q,W,G,u,D,Y,se,_,H,B,ue,ce,xe]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return f.createElement(Ee.Provider,{value:re},f.createElement(w,{...p,children:e,className:t,id:o,ref:v,style:{...fe,...h},[A.group]:"",[A.groupDirection]:r,[A.groupId]:u}))}const xn=f.forwardRef((n,e)=>f.createElement(yn,{...n,forwardedRef:e}));yn.displayName="PanelGroup";xn.displayName="forwardRef(PanelGroup)";function ie(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Q(n,e,t){const r=ie(n,e),o=r===n.length-1?[r-1,r]:[r,r+1],l=t[r];return{...e.constraints,panelSize:l,pivotIndices:o}}function Xn({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:r}){f.useEffect(()=>{if(n||t==null||r==null)return;const i=Re(e,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const a=i.getAttribute(A.groupId);x(a,`No group element found for id "${a}"`);const s=ye(a,r),h=fn(a,e,r);x(h!==null,`No resize element found for id "${e}"`);const w=l.shiftKey?h>0?h-1:s.length-1:h+1<s.length?h+1:0;s[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,n,e,t])}function vn({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:a,onFocus:s,onPointerDown:h,onPointerUp:w,style:p={},tabIndex:u=0,tagName:v="div",...z}){var C,E;const S=f.useRef(null),L=f.useRef({onClick:l,onDragging:a,onPointerDown:h,onPointerUp:w});f.useEffect(()=>{L.current.onClick=l,L.current.onDragging=a,L.current.onPointerDown=h,L.current.onPointerUp=w});const M=f.useContext(Ee);if(M===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:$,groupId:V,registerResizeHandle:R,startDragging:P,stopDragging:F,panelGroupElement:q}=M,W=Ge(i),[G,D]=f.useState("inactive"),[Y,_]=f.useState(!1),[H,B]=f.useState(null),se=f.useRef({state:G});ne(()=>{se.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(W);B(()=>re)}},[t,W,R]);const ue=(C=r?.coarse)!==null&&C!==void 0?C:15,ce=(E=r?.fine)!==null&&E!==void 0?E:5;f.useEffect(()=>{if(t||H==null)return;const re=S.current;x(re,"Element ref not attached");let fe=!1;return $n(W,re,$,{coarse:ue,fine:ce},(m,b,g)=>{if(!b){D("inactive");return}switch(m){case"down":{D("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(W,g);const{onDragging:d,onPointerDown:y}=L.current;d?.(!0),y?.();break}case"move":{const{state:d}=se.current;fe=!0,d!=="drag"&&D("hover"),x(g,'Expected event to be defined for "move" action'),H(g);break}case"up":{D("hover"),F();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y?.(!1),I?.(),fe||d?.();break}}})},[ue,$,t,ce,R,W,H,P,F]),Xn({disabled:t,handleId:W,resizeHandler:H,panelGroupElement:q});const xe={touchAction:"none",userSelect:"none"};return f.createElement(v,{...z,children:n,className:e,id:i,onBlur:()=>{_(!1),o?.()},onFocus:()=>{_(!0),s?.()},ref:S,role:"separator",style:{...xe,...p},tabIndex:u,[A.groupDirection]:$,[A.groupId]:V,[A.resizeHandle]:"",[A.resizeHandleActive]:G==="drag"?"pointer":Y?"keyboard":void 0,[A.resizeHandleEnabled]:!t,[A.resizeHandleId]:W,[A.resizeHandleState]:G})}vn.displayName="PanelResizeHandle";function Yn(n){const e=He.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=Je("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[3]=t,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=he.jsx(xn,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function Qn(n){const e=He.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let r;return e[2]!==t?(r=he.jsx(en,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=r):r=e[3],r}function et(n){const e=He.c(12);let t,r,i;e[0]!==n?({withHandle:i,className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i):(t=e[1],r=e[2],i=e[3]);let o;e[4]!==t?(o=Je("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=o):o=e[5];let l;e[6]!==i?(l=i&&he.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:he.jsx(Ye,{className:"size-2.5"})}),e[6]=i,e[7]=l):l=e[7];let a;return e[8]!==r||e[9]!==o||e[10]!==l?(a=he.jsx(vn,{"data-slot":"resizable-handle",className:o,...r,children:l}),e[8]=r,e[9]=o,e[10]=l,e[11]=a):a=e[11],a}export{Qn as R,et as a,Yn as b};
@@ -1 +1 @@
1
- import{c as j,j as i,B as v}from"./index-DnJ6a24w.js";import{i as p,a as S}from"./Save01-CpNh-fPw.js";import{i as z}from"./Loading01-DQphO9Su.js";function k(x){const e=j.c(15),{onSave:m,onUndo:d,isDirty:b,isSaving:s,saveLabel:f,undoLabel:u}=x,n=f===void 0?"Save":f,o=u===void 0?"Undo":u;if(!b)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(p,{size:14}),e[0]=r):r=e[0];let t;e[1]!==s||e[2]!==d||e[3]!==o?(t=i.jsxs(v,{variant:"outline",size:"sm",onClick:d,disabled:s,"aria-label":o,children:[r,o]}),e[1]=s,e[2]=d,e[3]=o,e[4]=t):t=e[4];let a;e[5]!==s?(a=s?i.jsx(z,{size:14,className:"animate-spin"}):i.jsx(S,{size:14}),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==s||e[8]!==m||e[9]!==n||e[10]!==a?(l=i.jsxs(v,{variant:"default",size:"sm",onClick:m,disabled:s,"aria-label":n,children:[a,n]}),e[7]=s,e[8]=m,e[9]=n,e[10]=a,e[11]=l):l=e[11];let c;return e[12]!==t||e[13]!==l?(c=i.jsxs(i.Fragment,{children:[t,l]}),e[12]=t,e[13]=l,e[14]=c):c=e[14],c}export{k as S};
1
+ import{c as j,j as i,B as v}from"./index-DMmNh7jR.js";import{i as p,a as S}from"./Save01-CA0I32a6.js";import{i as z}from"./Loading01-D0sCOwf7.js";function k(x){const e=j.c(15),{onSave:m,onUndo:d,isDirty:b,isSaving:s,saveLabel:f,undoLabel:u}=x,n=f===void 0?"Save":f,o=u===void 0?"Undo":u;if(!b)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(p,{size:14}),e[0]=r):r=e[0];let t;e[1]!==s||e[2]!==d||e[3]!==o?(t=i.jsxs(v,{variant:"outline",size:"sm",onClick:d,disabled:s,"aria-label":o,children:[r,o]}),e[1]=s,e[2]=d,e[3]=o,e[4]=t):t=e[4];let a;e[5]!==s?(a=s?i.jsx(z,{size:14,className:"animate-spin"}):i.jsx(S,{size:14}),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==s||e[8]!==m||e[9]!==n||e[10]!==a?(l=i.jsxs(v,{variant:"default",size:"sm",onClick:m,disabled:s,"aria-label":n,children:[a,n]}),e[7]=s,e[8]=m,e[9]=n,e[10]=a,e[11]=l):l=e[11];let c;return e[12]!==t||e[13]!==l?(c=i.jsxs(i.Fragment,{children:[t,l]}),e[12]=t,e[13]=l,e[14]=c):c=e[14],c}export{k as S};
@@ -0,0 +1 @@
1
+ import{r as i,_ as T,W as ce,j as b,Z as _,a3 as ae,a2 as O,a0 as C,aC as P,aa as ie,c as F,D as $}from"./index-DMmNh7jR.js";import{c as de}from"./ChevronUp-l7iXrppT.js";function ue(r,e){return i.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),Z=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[c,a]=i.useState(null),[u,d]=i.useState(null),[h,f]=i.useState(null),[S,w]=i.useState(null),[A,Y]=i.useState(null),[x,L]=i.useState(0),[M,D]=i.useState(0),[j,y]=i.useState(!1),[N,W]=i.useState(!1),v=T(e,E=>a(E)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:c,viewport:u,onViewportChange:d,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:j,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:D,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});Z.displayName=U;var G="ScrollAreaViewport",J=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(G,o),c=i.useRef(null),a=T(e,c,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:a,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});J.displayName=G;var g="ScrollAreaScrollbar",K=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,c=r.orientation==="horizontal";return i.useEffect(()=>(c?n(!0):s(!0),()=>{c?n(!1):s(!1)}),[c,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Q,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});K.displayName=g;var he=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=i.useState(!1);return i.useEffect(()=>{const c=t.scrollArea;let a=0;if(c){const u=()=>{window.clearTimeout(a),s(!0)},d=()=>{a=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(a),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",d)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Q,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>a("SCROLL_END"),100),[c,a]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return i.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>a("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,t.scrollHideDelay,a]),i.useEffect(()=>{const u=t.viewport,d=n?"scrollLeft":"scrollTop";if(u){let h=u[d];const f=()=>{const S=u[d];h!==S&&(a("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,a,s]),b.jsx(O,{present:o||c!=="hidden",children:b.jsx(V,{"data-state":c==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Q=i.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=i.useState(!1),c=r.orientation==="horizontal",a=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,d=o.viewport.offsetHeight<o.viewport.scrollHeight;s(c?u:d)}},10);return R(o.viewport,a),R(o.content,a),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=i.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=i.useRef(null),s=i.useRef(0),[c,a]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(c.viewport,c.content),d={...l,sizes:c,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,c,S)}return o==="horizontal"?b.jsx(Se,{...d,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,c,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...d,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,c);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=i.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,c]=i.useState(),a=i.useRef(null),u=T(e,a,n.onScrollbarXChange);return i.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:d=>r.onThumbPointerDown(d.x),onDragScroll:d=>r.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+d.deltaX;r.onWheelScroll(f),se(f,h)&&d.preventDefault()}},onResize:()=>{a.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=i.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,c]=i.useState(),a=i.useRef(null),u=T(e,a,n.onScrollbarYChange);return i.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:d=>r.onThumbPointerDown(d.y),onDragScroll:d=>r.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(n.viewport){const f=n.viewport.scrollTop+d.deltaY;r.onWheelScroll(f),se(f,h)&&d.preventDefault()}},onResize:()=>{a.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:d,onResize:h,...f}=r,S=m(g,o),[w,A]=i.useState(null),Y=T(e,v=>A(v)),x=i.useRef(null),L=i.useRef(""),M=S.viewport,D=l.content-l.viewport,j=P(d),y=P(a),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,E=v.clientY-x.current.top;u({x:p,y:E})}}return i.useEffect(()=>{const v=p=>{const E=p.target;w?.contains(E)&&j(p,D)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,D,j]),i.useEffect(y,[l,y]),R(w,N),R(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(c),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:c}=s,a=T(e,h=>s.onThumbChange(h)),u=i.useRef(void 0),d=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return i.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(d(),!u.current){const S=xe(h,c);u.current=S,c()}};return c(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,d,c]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=i.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=i.useState(0),[c,a]=i.useState(0),u=!!(n&&c);return R(t.scrollbarX,()=>{const d=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(d),a(d)}),R(t.scrollbarY,()=>{const d=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(d),s(d)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:c,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,c=t-s,a=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-c,d=o.content-o.viewport,h=l==="ltr"?[0,d]:[d*-1,0];return le([a,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,c=n-l,a=o==="ltr"?[0,s]:[s*-1,0],u=de(r,a);return le([0,s],[0,c])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,c=o.top!==n.top;(s||c)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(l.current),[]),i.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function R(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=Z,Ce=J,Ee=te;function _e(r){const e=F.c(17);let o,l,t,n;e[0]!==r?({className:l,children:o,hideScrollbar:n,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=n===void 0?!1:n;let c;e[5]!==l?(c=$("relative h-full w-full",l),e[5]=l,e[6]=c):c=e[6];let a;e[7]!==o?(a=b.jsx(Ce,{"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:ring-ring/50",children:b.jsx("div",{className:"flex min-w-0 flex-col",children:o})}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==s?(u=b.jsx(Re,{hideScrollbar:s}),e[9]=s,e[10]=u):u=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=b.jsx(Ee,{}),e[11]=d):d=e[11];let h;return e[12]!==t||e[13]!==c||e[14]!==a||e[15]!==u?(h=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[a,u,d]}),e[12]=t,e[13]=c,e[14]=a,e[15]=u,e[16]=h):h=e[16],h}function Re(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,c=n===void 0?!1:n,a=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",d=c&&"hidden";let h;e[5]!==o||e[6]!==a||e[7]!==u||e[8]!==d?(h=$("select-none touch-none p-px transition-colors",a,u,d,o),e[5]=o,e[6]=a,e[7]=u,e[8]=d,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(K,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S,Re as a};
@@ -0,0 +1 @@
1
+ import{r as c,W as nt,X as Pe,j as d,a$ as rt,a9 as Ie,_ as k,b0 as st,Z as j,a0 as _,aa as $,b1 as lt,as as Ne,b2 as Ee,bb as at,a4 as it,aC as ct,b3 as dt,b6 as ut,b4 as pt,b7 as ft,b8 as mt,a3 as ht,b5 as vt,b9 as gt,ba as xt,c as ee,D as oe}from"./index-DMmNh7jR.js";import{c as _e,n as St}from"./ChevronUp-l7iXrppT.js";import{V as wt}from"./index-COFAW4F5.js";import{i as Ct}from"./Check-5nIJP_0B.js";import{t as Re}from"./ChevronDown-t60R5l2B.js";var yt=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],J="Select",[de,ue,It]=at(J),[ne]=ht(J,[It,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,_t]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:I,required:w,form:S}=r,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:J}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:I,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:I,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,I,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&I(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var Nt="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:I,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,F]=c.useState(null),[M,re]=c.useState(null),N=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),b=document.activeElement;for(const P of f)if(P===b||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==b))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:I,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const b=f.target,P=y.indexOf(b);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,N=>h(N)),I=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const N=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const b=q.left-O.left,P=U.left-b,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const b=O.right-q.right,P=window.innerWidth-U.right-b,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=I(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const b=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(b?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const b=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[I,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(gt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Fe=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:I}=s;if(I?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[I,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=Ie(),v=c.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":I?"":void 0,"aria-selected":u&&I,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(bt.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=c.useState(null),I=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:I}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var be="SelectArrow",Ft=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(be,t),s=Y(be,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ft.displayName=be;var Ut="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ut;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-7 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const I=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==I?(w=oe("p-1",I),e[11]=I,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(Ct,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(St,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d};
@@ -0,0 +1 @@
1
+ import{c as F,r as _,D as U,j as t,B as H}from"./index-DMmNh7jR.js";import{I as q}from"./integration-icon-Dyr7fOYU.js";import{I as K}from"./input-Bt_nejZh.js";import{P as W,a as J,b as Q}from"./popover-CF2iI6mL.js";import{u as X,b as Y,a as Z,c as ee,T as te}from"./tooltip-DHJtaI_Z.js";import{i as G}from"./constants-DclZTqHf.js";import{b as se}from"./use-virtual-mcp-DCxXK_bv.js";import{i as ie}from"./Check-5nIJP_0B.js";import{i as le}from"./SearchMd-BSRGE1t4.js";import{t as B}from"./Users03-CGvJARf5.js";import{u as oe}from"./use-create-virtual-mcp-DZAv89rZ.js";function re(p){const e=F.c(24),{virtualMcp:s,isSelected:f}=p,x=f&&"bg-accent";let m;e[0]!==x?(m=U("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",x),e[0]=x,e[1]=m):m=e[1];let o;e[2]!==s.fallbackIcon?(o=s.fallbackIcon??t.jsx(B,{}),e[2]=s.fallbackIcon,e[3]=o):o=e[3];let u;e[4]!==o||e[5]!==s.icon||e[6]!==s.title?(u=t.jsx(q,{icon:s.icon,name:s.title,size:"sm",fallbackIcon:o,className:"rounded-xl border border-border shadow-sm shrink-0 aspect-square"}),e[4]=o,e[5]=s.icon,e[6]=s.title,e[7]=u):u=e[7];let h;e[8]!==s.title?(h=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=h):h=e[9];let r;e[10]!==f?(r=f&&t.jsx(ie,{size:16,className:"text-foreground shrink-0"}),e[10]=f,e[11]=r):r=e[11];let a;e[12]!==h||e[13]!==r?(a=t.jsxs("div",{className:"flex items-center justify-between",children:[h,r]}),e[12]=h,e[13]=r,e[14]=a):a=e[14];let l;e[15]!==s.description?(l=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:s.description}),e[15]=s.description,e[16]=l):l=e[16];let i;e[17]!==a||e[18]!==l?(i=t.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[a,l]}),e[17]=a,e[18]=l,e[19]=i):i=e[19];let d;return e[20]!==m||e[21]!==u||e[22]!==i?(d=t.jsxs("div",{className:m,children:[u,i]}),e[20]=m,e[21]=u,e[22]=i,e[23]=d):d=e[23],d}function ne(p){const e=F.c(33),{virtualMcps:s,selectedVirtualMcpId:f,onVirtualMcpChange:x,searchInputRef:m}=p,[o,u]=_.useState(""),h=_.useRef(null),r=m??h;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={navigateOnCreate:!0},e[0]=a):a=e[0];const{createVirtualMCP:l,isCreating:i}=oe(a);let d,C,M,c;if(e[1]!==l||e[2]!==r||e[3]!==i||e[4]!==x||e[5]!==o||e[6]!==f||e[7]!==s){let I;e:{const n=s.filter(ae);if(!o.trim()){I=n;break e}const v=o.toLowerCase();I=n.filter(T=>T.title.toLowerCase().includes(v)||T.description?.toLowerCase().includes(v))}const b=I;let N;e[12]!==x?(N=n=>{x(n),u("")},e[12]=x,e[13]=N):N=e[13];const S=N;M="flex flex-col max-h-[min(400px,60dvh)]";let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(le,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[14]=y):y=e[14];let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=n=>u(n.target.value),e[15]=k):k=e[15];let V;e[16]!==r||e[17]!==o?(V=t.jsx(K,{ref:r,type:"text",placeholder:"Search for an agent...",value:o,onChange:k,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[16]=r,e[17]=o,e[18]=V):V=e[18];const P=i?"Creating...":"Create Agent";let j;e[19]!==l||e[20]!==i||e[21]!==P?(j=t.jsx(H,{onClick:l,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:i,children:P}),e[19]=l,e[20]=i,e[21]=P,e[22]=j):j=e[22],e[23]!==V||e[24]!==j?(c=t.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:t.jsxs("div",{className:"relative flex items-center gap-2",children:[y,V,j]})}),e[23]=V,e[24]=j,e[25]=c):c=e[25],d="overflow-y-auto p-1.5 flex-1 min-h-0 [touch-action:pan-y]",C=b.length>0?t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-0.5",children:b.map(n=>t.jsx("div",{role:"button",tabIndex:0,onClick:()=>S(n.id),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),S(n.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:t.jsx(re,{virtualMcp:n,isSelected:n.id===f})},n.id))}):t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"}),e[1]=l,e[2]=r,e[3]=i,e[4]=x,e[5]=o,e[6]=f,e[7]=s,e[8]=d,e[9]=C,e[10]=M,e[11]=c}else d=e[8],C=e[9],M=e[10],c=e[11];let g;e[26]!==d||e[27]!==C?(g=t.jsx("div",{className:d,children:C}),e[26]=d,e[27]=C,e[28]=g):g=e[28];let w;return e[29]!==M||e[30]!==c||e[31]!==g?(w=t.jsxs("div",{className:M,children:[c,g]}),e[29]=M,e[30]=c,e[31]=g,e[32]=w):w=e[32],w}function ae(p){return!p.id||!G(p.id)}function Ce(p){const e=F.c(38),{selectedVirtualMcpId:s,onVirtualMcpChange:f,virtualMcps:x,className:m,placeholder:o,showTooltip:u,disabled:h}=p,r=o===void 0?"Select Agent":o,a=u===void 0?!0:u,l=h===void 0?!1:h,[i,d]=_.useState(!1),C=_.useRef(null),M=se(),c=x??M;let g;e[0]!==c?(g=c.filter(ce),e[0]=c,e[1]=g):g=e[1];const w=g;let I;e[2]!==c||e[3]!==s?(I=s?c.find(L=>L.id===s):null,e[2]=c,e[3]=s,e[4]=I):I=e[4];const b=I;let N;e[5]!==f?(N=L=>{f(L),d(!1)},e[5]=f,e[6]=N):N=e[6];const S=N,y=X();let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=L=>{d(L)},e[7]=k):k=e[7];const V=k;let P,j;e[8]!==y||e[9]!==i?(P=()=>{i&&!y&&setTimeout(()=>{C.current?.focus()},0)},j=[i,y],e[8]=y,e[9]=i,e[10]=P,e[11]=j):(P=e[10],j=e[11]),_.useEffect(P,j);const n=l?!1:i,v=l?void 0:V,T=l?"cursor-not-allowed opacity-50":"cursor-pointer hover:text-muted-foreground";let z;e[12]!==m||e[13]!==T?(z=U("relative flex items-center justify-center size-8 rounded-md text-muted-foreground/75 transition-colors shrink-0",T,m),e[12]=m,e[13]=T,e[14]=z):z=e[14];let R;e[15]!==b?(R=b?t.jsx(q,{icon:b.icon,name:b.title,size:"sm",fallbackIcon:t.jsx(B,{size:16}),className:"rounded-md shrink-0 absolute inset-0 size-full"}):t.jsxs(t.Fragment,{children:[t.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"agent-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[t.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),t.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),t.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),t.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"5.5",stroke:"url(#agent-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),t.jsx(B,{size:16})]}),e[15]=b,e[16]=R):R=e[16];let D;e[17]!==l||e[18]!==r||e[19]!==z||e[20]!==R?(D=t.jsx(Z,{asChild:!0,children:t.jsx(W,{asChild:!0,children:t.jsx("button",{type:"button",disabled:l,className:z,"aria-label":r,children:R})})}),e[17]=l,e[18]=r,e[19]=z,e[20]=R,e[21]=D):D=e[21];let O;e[22]!==i||e[23]!==b?.title||e[24]!==a?(O=a&&!i&&t.jsx(Y,{side:"top",className:"text-xs",children:b?.title??"Choose an agent to chat with"}),e[22]=i,e[23]=b?.title,e[24]=a,e[25]=O):O=e[25];let E;e[26]!==D||e[27]!==O?(E=t.jsx(ee,{children:t.jsxs(te,{children:[D,O]})}),e[26]=D,e[27]=O,e[28]=E):E=e[28];let $;e[29]!==S||e[30]!==s||e[31]!==w?($=t.jsx(J,{className:"w-[min(550px,calc(100vw-2rem))] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,collisionPadding:16,children:t.jsx(ne,{virtualMcps:w,selectedVirtualMcpId:s,onVirtualMcpChange:S,searchInputRef:C})}),e[29]=S,e[30]=s,e[31]=w,e[32]=$):$=e[32];let A;return e[33]!==n||e[34]!==v||e[35]!==E||e[36]!==$?(A=t.jsxs(Q,{open:n,onOpenChange:v,children:[E,$]}),e[33]=n,e[34]=v,e[35]=E,e[36]=$,e[37]=A):A=e[37],A}function ce(p){return!p.id||!G(p.id)}export{ne as V,Ce as a};
@@ -0,0 +1,3 @@
1
+ import{r as $,c as P,j as s,E as Le,u as Ne,D as R,e as Re,au as He,L as Ae,cc as ht,bh as gt,O as Y,at as jt,g as Qe,f as xe,v as pe,cd as bt,bL as Nt,w as yt,B as Oe,A as vt,S as Ye,k as St,m as kt,N as Ct,x as _t,z as Pe,K as wt,av as Je,P as $t}from"./index-DMmNh7jR.js";import{C as X,c as zt,i as It,d as Pt}from"./task-status-CrO2oj_v.js";import{I as At}from"./integration-icon-Dyr7fOYU.js";import{a as Ze,P as me,i as Ee,f as Ue,g as ue,h as ce,j as ke,k as Ce,l as _e,m as Ot,n as Et,o as Tt,p as Xe,q as Mt,u as Fe,r as Dt,s as Lt,t as Rt,v as Ht}from"./index-DYAF-Vgt.js";import{d as Ut,a as Ft,u as Bt}from"./constants-DclZTqHf.js";import{E as Wt,n as Te,C as Gt}from"./editable-task-title-BR-xQ-UT.js";import{n as Kt}from"./ChevronLeft-lVdUD9SW.js";import{i as qt}from"./Loading01-D0sCOwf7.js";import{s as ve}from"./Plus-Dcf0Y3wA.js";import{t as Be}from"./Users03-CGvJARf5.js";import{i as Ge}from"./X-CD9ZB6hw.js";import{T as Vt}from"./tasks-panel-DBJx0hs6.js";import{a as Qt,b as Yt}from"./ai-providers-logos-C_voEDmL.js";import{a as Jt}from"./context-BFi-zuf6.js";import{C as et}from"./create-project-dialog-M-dgrV_c.js";import{a as Zt,b as Xt,c as es,D as ts}from"./dialog-DzGwvQ_K.js";import{n as ss}from"./Container-Cvd3ILsk.js";import{e as ns}from"./Dataflow03-SvWKmU9-.js";import{a as is}from"./Home02-BmcJp5G2.js";import{s as rs}from"./RefreshCcw01-BOXuamrY.js";import{t as Ie}from"./Settings01-CCUkMwLj.js";import{u as os,a as tt}from"./org-ai-providers-CUAlOa9f.js";import{u as st,a as nt}from"./use-project-XBmxO4XX.js";import{S as ee}from"./skeleton-BvrwcS3X.js";import{n as ge}from"./LinkExternal01-CmkQ0Pr-.js";import{t as it}from"./ChevronDown-t60R5l2B.js";import{A as je}from"./avatar-DeGeJRAR.js";import{c as q,h as Se,e as ls,d as as,f as cs,b as rt,D as ot,a as lt}from"./dropdown-menu-BcNYk9_F.js";import{t as Ke}from"./Building02-B5vUKe4K.js";import{i as be}from"./Check-5nIJP_0B.js";import{C as ds}from"./create-organization-dialog-pXQ89_sr.js";import{u as We}from"./tooltip-DHJtaI_Z.js";import{a as ms}from"./Copy01-DCmX2pvi.js";import{i as us}from"./File06-BocZAjHf.js";import{i as fs}from"./Globe01-BTdgnOS2.js";import{i as ps}from"./Shield01-BYpsgCVA.js";import{a as xs,P as hs,b as gs}from"./popover-CF2iI6mL.js";import{n as qe}from"./Inbox01-B7dU6IpS.js";import{s as js}from"./XClose-BxUlnJUs.js";import{b as bs}from"./use-mcp-tools-kv4r4Zvn.js";import{C as Ns,a as ys,b as vs}from"./collapsible-DcaWkNTt.js";import{i as Ss}from"./ChevronRight-3uKoJ2yX.js";import{D as ks,a as Cs}from"./drawer-CAX2URBi.js";import{a as _s,R as at,b as ws}from"./resizable-BwEPpKFX.js";import"./spinner-CSLYV8gq.js";import"./use-mcp-prompts-BDRKUj7D.js";import"./useQuery-B-AaJTeZ.js";import"./form-DBjkdSps.js";import"./label-DTNkd20e.js";import"./input-Bt_nejZh.js";import"./index-BLNBD7Tl.js";import"./usage-BW6ztpN6.js";import"./ArrowUp-B4DKDJey.js";import"./Edit01-Bh7u1xp-.js";import"./Lock01-DFfVnVtc.js";import"./use-copy-DkDz3lds.js";import"./AlertCircle-DcuzO-dN.js";import"./select-hHfKwVbN.js";import"./ChevronUp-l7iXrppT.js";import"./index-COFAW4F5.js";import"./ArrowLeft-B0zQkfl0.js";import"./tabs-sTqc1_U2.js";import"./checkbox-D5DFx9da.js";import"./AlignLeft-DH6vJ97u.js";import"./Image01-RwxwuRZg.js";import"./Key01-CjhxaGrC.js";import"./SearchMd-BSRGE1t4.js";import"./Tool01-Doogi-IK.js";import"./select-virtual-mcp-DsImheli.js";import"./use-virtual-mcp-DCxXK_bv.js";import"./use-collections-DhavVshD.js";import"./useMutation-DrLoVqQ7.js";import"./use-create-virtual-mcp-DZAv89rZ.js";import"./use-mcp-resources-BxIahbOo.js";import"./marked.esm-BaswSlok.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-hLmmzHl_.js";import"./types-BtTmvTe4.js";import"./Eye-D3Q7o9JY.js";import"./Globe02-X8fGWI0t.js";import"./LayersTwo01-DEwkReGL.js";import"./Clock-Cu62NiMl.js";import"./Trash01-Cs72bTP6.js";import"./useSuspenseInfiniteQuery-Czq4y4BP.js";import"./infiniteQueryObserver-CZ8w6Ao-.js";import"./CheckCircle-CPfAK_ok.js";import"./collection-search-nKZEJ_r3.js";import"./user-8V0wpye0.js";import"./format-time-CMKyl-GC.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./empty-state-BuGXY27l.js";import"./decopilot-events-Brt4gAR6.js";import"./index-PFtbLrE4.js";import"./textarea-CgJ5x-hs.js";import"./EyeOff--TPuyP7J.js";import"./card-CoyaoT6W.js";import"./toggle-group-C20N8vss.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./alert-dialog-qmvoIx9J.js";import"./index-BObCXgKJ.js";const ct=({size:t=24,color:e="currentColor",...n})=>$.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},$.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));ct.displayName="BarChart10";const dt=({size:t=24,color:e="currentColor",...n})=>$.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},$.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));dt.displayName="Coins01";const mt=({size:t=24,color:e="currentColor",...n})=>$.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},$.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));mt.displayName="LogOut01";function $s(){const t=P.c(70),{org:e}=Ne(),[,n]=Ze(),r=Qt(),{selectedVirtualMcp:o,isChatEmpty:l,activeTaskId:i,createTask:a,switchToTask:c,tasks:m}=Jt();let d;if(t[0]!==i||t[1]!==m){let K;t[3]!==i?(K=ne=>ne.id===i,t[3]=i,t[4]=K):K=t[4],d=m.find(K),t[0]=i,t[1]=m,t[2]=d}else d=t[2];const u=d,[f,p]=$.useState("chat"),[h,N]=$.useTransition();let j;t[5]!==e.id?(j=Ut(e.id),t[5]=e.id,t[6]=j):j=t[6];const y=o??j;let x;t[7]!==a?(x=()=>{N(()=>{a()})},t[7]=a,t[8]=x):x=t[8];const k=x;if(r?.providers?.length===0){let K;t[9]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(me.Header.Left,{className:"gap-2"}),t[9]=K):K=t[9];let ne;t[10]!==n?(ne=()=>n(!1),t[10]=n,t[11]=ne):ne=t[11];let he;t[12]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(Ge,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[12]=he):he=t[12];let ae;t[13]!==ne?(ae=s.jsxs(me.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[K,s.jsx(me.Header.Right,{className:"gap-1",children:s.jsx("button",{type:"button",onClick:ne,className:"flex size-10 md:size-6 items-center justify-center rounded-full p-1 outline-none focus-visible:ring-0 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:he})})]}),t[13]=ne,t[14]=ae):ae=t[14];let ye;t[15]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(X.Main,{className:"flex flex-col items-center",children:s.jsx(X.EmptyState,{children:s.jsx(X.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features."})})}),t[15]=ye):ye=t[15];let de;return t[16]!==ae?(de=s.jsxs(X,{className:"animate-in fade-in-0 duration-200",children:[ae,ye]}),t[16]=ae,t[17]=de):de=t[17],de}const z=f!=="chat"||h?"opacity-0 pointer-events-none":"opacity-100";let S;t[18]!==z?(S=R("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",z),t[18]=z,t[19]=S):S=t[19];let _;t[20]!==u||t[21]!==l?(_=!l&&u?.title&&s.jsx(Wt,{taskId:u.id,text:u.title,className:"text-sm font-medium text-foreground"}),t[20]=u,t[21]=l,t[22]=_):_=t[22];let C;t[23]!==_?(C=s.jsx(me.Header.Left,{className:"gap-2",children:_}),t[23]=_,t[24]=C):C=t[24];let H;t[25]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(ve,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[25]=H):H=t[25];let w;t[26]!==k||t[27]!==h?(w=s.jsx("button",{type:"button",onClick:k,disabled:h,className:"flex size-10 md:size-6 items-center justify-center rounded-full p-1 outline-none focus-visible:ring-0 hover:bg-transparent group cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"New chat",children:H}),t[26]=k,t[27]=h,t[28]=w):w=t[28];let U;t[29]===Symbol.for("react.memo_cache_sentinel")?(U=()=>p("tasks"),t[29]=U):U=t[29];let T;t[30]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("button",{type:"button",onClick:U,className:"flex size-10 md:size-6 items-center justify-center rounded-full p-1 outline-none focus-visible:ring-0 hover:bg-transparent group cursor-pointer",title:"Tasks",children:s.jsx(Te,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t[30]=T):T=t[30];let W;t[31]!==n?(W=()=>n(!1),t[31]=n,t[32]=W):W=t[32];let L;t[33]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Ge,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[33]=L):L=t[33];let M;t[34]!==W?(M=s.jsx("button",{type:"button",onClick:W,className:"flex size-10 md:size-6 items-center justify-center rounded-full p-1 outline-none focus-visible:ring-0 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:L}),t[34]=W,t[35]=M):M=t[35];let O;t[36]!==M||t[37]!==w?(O=s.jsxs(me.Header.Right,{className:"gap-1",children:[w,T,M]}),t[36]=M,t[37]=w,t[38]=O):O=t[38];let E;t[39]!==O||t[40]!==C?(E=s.jsxs(me.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[C,O]}),t[39]=O,t[40]=C,t[41]=E):E=t[41];let I;t[42]!==y||t[43]!==l?(I=s.jsx(X.Main,{children:l?s.jsx(X.EmptyState,{children:s.jsxs("div",{className:"flex flex-col items-center gap-3 md:gap-6 w-full px-4",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 md:gap-4 p-0 text-center",children:[s.jsx(At,{icon:y.icon,name:y.title,size:"lg",fallbackIcon:s.jsx(Be,{size:32}),className:"size-10 min-w-10 md:size-[60px]! md:min-w-[60px] rounded-xl md:rounded-[18px]!"}),s.jsx("h3",{className:"text-base md:text-xl font-medium text-foreground",children:y.title}),s.jsx("div",{className:"text-muted-foreground text-center text-xs md:text-sm max-w-md line-clamp-2",children:y.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),s.jsx(X.IceBreakers,{})]})}):s.jsx(X.Messages,{})}),t[42]=y,t[43]=l,t[44]=I):I=t[44];let A;t[45]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(X.Footer,{children:s.jsx(X.Input,{onOpenContextPanel:()=>p("context")})}),t[45]=A):A=t[45];let D;t[46]!==E||t[47]!==I||t[48]!==S?(D=s.jsxs("div",{className:S,children:[E,I,A]}),t[46]=E,t[47]=I,t[48]=S,t[49]=D):D=t[49];const B=f==="tasks"?"opacity-100":"opacity-0 pointer-events-none";let te;t[50]!==B?(te=R("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",B),t[50]=B,t[51]=te):te=t[51];let re;t[52]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx(me.Header.Left,{className:"gap-2",children:s.jsx("span",{className:"text-sm font-normal text-foreground",children:"Tasks"})}),t[52]=re):re=t[52];let oe;t[53]===Symbol.for("react.memo_cache_sentinel")?(oe=()=>p("chat"),t[53]=oe):oe=t[53];let se;t[54]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsxs(me.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[re,s.jsx(me.Header.Right,{className:"gap-1",children:s.jsx("button",{type:"button",onClick:oe,className:"flex size-10 md:size-6 items-center justify-center rounded-full p-1 outline-none focus-visible:ring-0 hover:bg-transparent transition-colors group cursor-pointer",title:"Back to chat",children:s.jsx(Kt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})})]}),t[54]=se):se=t[54];let J;t[55]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(qt,{size:16,className:"animate-spin text-muted-foreground"})}),t[55]=J):J=t[55];let F;t[56]!==c?(F=s.jsx(Le,{fallback:zs,children:s.jsx($.Suspense,{fallback:J,children:s.jsx(Vt,{onTaskSelect:async K=>{await c(K),p("chat")}})})}),t[56]=c,t[57]=F):F=t[57];let G;t[58]!==te||t[59]!==F?(G=s.jsxs("div",{className:te,children:[se,F]}),t[58]=te,t[59]=F,t[60]=G):G=t[60];const ie=f==="context"?"opacity-100":"opacity-0 pointer-events-none";let V;t[61]!==ie?(V=R("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",ie),t[61]=ie,t[62]=V):V=t[62];let b;t[63]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Gt,{back:!0,onClose:()=>p("chat")}),t[63]=b):b=t[63];let Q;t[64]!==V?(Q=s.jsx("div",{className:V,children:b}),t[64]=V,t[65]=Q):Q=t[65];let le;return t[66]!==D||t[67]!==G||t[68]!==Q?(le=s.jsxs(X,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[D,G,Q]}),t[66]=D,t[67]=G,t[68]=Q,t[69]=le):le=t[69],le}function zs(){return s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Unable to load tasks"})})}function Ve(){const t=P.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X.Skeleton,{}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Le,{fallback:e,children:s.jsx($.Suspense,{fallback:s.jsx(X.Skeleton,{}),children:s.jsx($s,{})})}),t[1]=n):n=t[1],n}function Is(t){const e=P.c(5),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Xt,{children:s.jsx(es,{children:"Keyboard Shortcuts"})}),e[0]=o):o=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(Zt,{className:"sm:max-w-md",children:[o,s.jsx("div",{className:"flex flex-col gap-4",children:zt.map(Ps)})]}),e[1]=l):l=e[1];let i;return e[2]!==r||e[3]!==n?(i=s.jsx(ts,{open:n,onOpenChange:r,children:l}),e[2]=r,e[3]=n,e[4]=i):i=e[4],i}function Ps(t){return s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),s.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(As)})]},t.label)}function As(t){return s.jsxs("div",{className:"flex items-center justify-between py-1",children:[s.jsx("span",{className:"text-sm",children:t.description}),s.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(Os)})]},t.description)}function Os(t){return s.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}function Es(){const t=P.c(60),{locator:e,org:n}=Ne(),r=Re(),o=He(),[l]=os(),{org:i,project:a}=Ae.parse(e),c=Ae.isOrgAdminProject(e),{data:m}=st(n.id,a);let d;t[0]!==m?.enabledPlugins?(d=m?.enabledPlugins??[],t[0]=m?.enabledPlugins,t[1]=d):d=t[1];const u=d,f=m?.ui?.pinnedViews??[];let p;t[2]!==u?(p=g=>u.includes(g.pluginId),t[2]=u,t[3]=p):p=t[3];const h=ht.filter(p),N=o.location.pathname,j=`/${i}/${a}`,v=N===j||N===`${j}/`;let y;t[4]!==j||t[5]!==N?(y=g=>N.startsWith(`${j}/${g}`),t[4]=j,t[5]=N,t[6]=y):y=t[6];const x=y;let k;t[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(is,{}),t[7]=k):k=t[7];const z={key:"home",label:"Home",icon:k,isActive:v,onClick:()=>{v?window.dispatchEvent(new CustomEvent("reset-home-view")):r({to:"/$org/$project",params:{org:i,project:a}})}};let S;t[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Te,{}),t[8]=S):S=t[8];const _={key:"tasks",label:"Tasks",icon:S,isActive:x("tasks"),onClick:()=>r({to:"/$org/$project/tasks",params:{org:i,project:Y}})};let C;t[9]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(ss,{}),t[9]=C):C=t[9];const H={key:"mcps",label:"Connections",icon:C,isActive:x("mcps"),onClick:()=>r({to:"/$org/$project/mcps",params:{org:i,project:Y}})};let w;t[10]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(jt,{}),t[10]=w):w=t[10];const U={key:"projects",label:"Projects",icon:w,isActive:x("projects"),onClick:()=>r({to:"/$org/$project/projects",params:{org:i,project:Y}})};let T;t[11]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Be,{}),t[11]=T):T=t[11];const W={key:"agents",label:"Agents",icon:T,isActive:x("agents"),onClick:()=>r({to:"/$org/$project/agents",params:{org:i,project:Y}})};let L;t[12]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(rs,{}),t[12]=L):L=t[12];const M={key:"automations",label:"Automations",icon:L,isActive:x("automations"),onClick:()=>r({to:"/$org/$project/automations",params:{org:i,project:Y}})};let O;t[13]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(ct,{}),t[13]=O):O=t[13];const E={key:"monitoring",label:"Monitor",icon:O,isActive:x("monitoring"),onClick:()=>r({to:"/$org/$project/monitoring",params:{org:i,project:Y}})},I=h.map(g=>({key:g.pluginId,label:g.label,icon:g.icon,isActive:x(g.pluginId),onClick:()=>r({to:"/$org/$project/$pluginId",params:{org:i,project:a,pluginId:g.pluginId}})}));let A;t[14]!==u?(A=g=>u.includes(g.pluginId),t[14]=u,t[15]=A):A=t[15];const B=gt.filter(A).map(g=>({type:"group",group:{id:`${g.pluginId}-${g.id}`,label:g.label,items:g.items.map((Z,fe)=>({key:`${g.pluginId}-${g.id}-${fe}`,label:Z.label,icon:Z.icon,isActive:x(g.pluginId),onClick:()=>r({to:"/$org/$project/$pluginId",params:{org:i,project:a,pluginId:g.pluginId}})})),defaultExpanded:g.defaultExpanded??!0}})),te=f.map(g=>({key:`app-${g.connectionId}-${g.toolName}`,label:g.label||g.toolName,icon:g.icon?s.jsx("img",{src:g.icon,alt:"",className:"size-4 rounded"}):s.jsx(Ee,{}),isActive:x(`apps/${g.connectionId}/${encodeURIComponent(g.toolName)}`),onClick:()=>r({to:"/$org/$project/apps/$connectionId/$toolName",params:{org:i,project:a,connectionId:g.connectionId,toolName:g.toolName}})}));let re;t[16]!==te?(re=te.length>0?{type:"group",group:{id:"apps",label:"Apps",items:te,defaultExpanded:!0}}:null,t[16]=te,t[17]=re):re=t[17];const oe=re;if(c){let g;t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ie,{}),t[18]=g):g=t[18];let Z;t[19]!==x?(Z=x("settings"),t[19]=x,t[20]=Z):Z=t[20];let fe;t[21]!==r||t[22]!==i?(fe=()=>r({to:"/$org/$project/settings",params:{org:i,project:Y}}),t[21]=r,t[22]=i,t[23]=fe):fe=t[23];let we;t[24]!==Z||t[25]!==fe?(we={key:"settings",label:"Settings",icon:g,isActive:Z,onClick:fe},t[24]=Z,t[25]=fe,t[26]=we):we=t[26];const xt=we,$e=[{type:"items",items:[z,_,U]},{type:"group",group:{id:"build",label:"Build",items:[...l.experimentalAutomations?[M]:[],W,H],defaultExpanded:!0}},{type:"group",group:{id:"manage",label:"Manage",items:[E,xt],defaultExpanded:!0}}];if(I.length>0){let ze;t[27]!==I?(ze={type:"items",items:I},t[27]=I,t[28]=ze):ze=t[28],$e.push(ze)}return B.length>0&&$e.push(...B),oe&&$e.push(oe),$e}let se;t[29]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsx(Te,{}),t[29]=se):se=t[29];let J;t[30]!==x?(J=x("tasks"),t[30]=x,t[31]=J):J=t[31];let F;t[32]!==r||t[33]!==i||t[34]!==a?(F=()=>r({to:"/$org/$project/tasks",params:{org:i,project:a}}),t[32]=r,t[33]=i,t[34]=a,t[35]=F):F=t[35];let G;t[36]!==J||t[37]!==F?(G={key:"tasks",label:"Tasks",icon:se,isActive:J,onClick:F},t[36]=J,t[37]=F,t[38]=G):G=t[38];const ie=G;let V;t[39]!==u||t[40]!==x||t[41]!==r||t[42]!==i||t[43]!==a?(V=u.includes("workflows")?{key:"workflows",label:"Workflows",icon:s.jsx(ns,{}),isActive:x("workflows"),onClick:()=>r({to:"/$org/$project/workflows",params:{org:i,project:a}})}:null,t[39]=u,t[40]=x,t[41]=r,t[42]=i,t[43]=a,t[44]=V):V=t[44];const b=V;let Q;t[45]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(Ie,{}),t[45]=Q):Q=t[45];let le;t[46]!==x?(le=x("settings"),t[46]=x,t[47]=le):le=t[47];let K;t[48]!==r||t[49]!==i||t[50]!==a?(K=()=>r({to:"/$org/$project/settings/general",params:{org:i,project:a}}),t[48]=r,t[49]=i,t[50]=a,t[51]=K):K=t[51];let ne;t[52]!==le||t[53]!==K?(ne={key:"configure",label:"Settings",icon:Q,isActive:le,onClick:K},t[52]=le,t[53]=K,t[54]=ne):ne=t[54];const he=ne;let ae;t[55]!==b?(ae=b?[b]:[],t[55]=b,t[56]=ae):ae=t[56];const de=[{type:"items",items:[z,ie,...ae,he]}];if(I.length>0){let g;t[57]===Symbol.for("react.memo_cache_sentinel")?(g={type:"divider"},t[57]=g):g=t[57],de.push(g);let Z;t[58]!==I?(Z={type:"items",items:I},t[58]=I,t[59]=Z):Z=t[59],de.push(Z)}return B.length>0&&de.push(...B),oe&&de.push(oe),de}function Ts(t){const e=P.c(11),{label:n,children:r,defaultExpanded:o}=t,l=o===void 0?!0:o,[i,a]=$.useState(l),{state:c}=Ue(),m=c==="collapsed";let d;e[0]!==i||e[1]!==m||e[2]!==n?(d=m?s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-8 rounded-full bg-sidebar-foreground/15"})}):s.jsx(ue,{children:s.jsx(ce,{children:s.jsxs(ke,{className:"h-6 cursor-pointer select-none gap-1 [&>svg]:size-3",onClick:()=>a(!i),children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),s.jsx(it,{size:12,className:R("text-muted-foreground transition-transform duration-200",!i&&"-rotate-90")})]})})}),e[0]=i,e[1]=m,e[2]=n,e[3]=d):d=e[3];let u;e[4]!==r||e[5]!==i||e[6]!==m?(u=(m||i)&&s.jsx(Ce,{children:s.jsx(ue,{className:"gap-0.5",children:r})}),e[4]=r,e[5]=i,e[6]=m,e[7]=u):u=e[7];let f;return e[8]!==d||e[9]!==u?(f=s.jsxs(_e,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[d,u]}),e[8]=d,e[9]=u,e[10]=f):f=e[10],f}function ut(t){const e=P.c(24),{item:n}=t,{isMobile:r,setOpenMobile:o}=Ue();let l;e[0]!==r||e[1]!==n||e[2]!==o?(l=()=>{n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=l):l=e[3];const i=l,a=n.key,c=n.isActive,m=n.label,d=n.isExternal&&"group/external";let u;e[4]!==d?(u=R(d),e[4]=d,e[5]=u):u=e[5];let f;e[6]!==n.icon?(f=s.jsx("span",{className:"[&>svg]:size-4",children:n.icon}),e[6]=n.icon,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=R("truncate group-data-[collapsible=icon]:hidden"),e[8]=p):p=e[8];let h;e[9]!==n.label?(h=s.jsx("span",{className:p,children:n.label}),e[9]=n.label,e[10]=h):h=e[10];let N;e[11]!==n.isExternal?(N=n.isExternal&&s.jsx(ge,{size:12,className:"ml-auto mr-1 shrink-0 opacity-0 group-hover/external:opacity-60 transition-opacity group-data-[collapsible=icon]:hidden"}),e[11]=n.isExternal,e[12]=N):N=e[12];let j;e[13]!==i||e[14]!==n.isActive||e[15]!==n.label||e[16]!==N||e[17]!==u||e[18]!==f||e[19]!==h?(j=s.jsxs(ke,{onClick:i,isActive:c,tooltip:m,className:u,children:[f,h,N]}),e[13]=i,e[14]=n.isActive,e[15]=n.label,e[16]=N,e[17]=u,e[18]=f,e[19]=h,e[20]=j):j=e[20];let v;return e[21]!==n.key||e[22]!==j?(v=s.jsx(ce,{children:j},a),e[21]=n.key,e[22]=j,e[23]=v):v=e[23],v}function Ms(t){const e=P.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ot,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let l;e[2]!==n.group.items?(l=n.group.items.map(Ls),e[2]=n.group.items,e[3]=l):l=e[3];let i;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==l?(i=s.jsx(Ts,{label:r,defaultExpanded:o,children:l}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=l,e[7]=i):i=e[7],i}case"items":{let r;e[8]!==n.items?(r=n.items.map(Ds),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(_e,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ce,{children:s.jsx(ue,{className:"gap-0.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}}}function Ds(t){return s.jsx(ut,{item:t},t.key)}function Ls(t){return s.jsx(ut,{item:t},t.key)}function ft(t){const e=P.c(14),{sections:n,header:r,footer:o,additionalContent:l,variant:i,collapsible:a,contentClassName:c}=t,m=i===void 0?"sidebar":i,d=a===void 0?"icon":a;let u;e[0]!==c?(u=R("flex flex-col flex-1 overflow-x-hidden mt-1 px-3.5 pb-2 group-data-[collapsible=icon]:px-2",c),e[0]=c,e[1]=u):u=e[1];let f;e[2]!==n?(f=n.map(Rs),e[2]=n,e[3]=f):f=e[3];let p;e[4]!==l||e[5]!==u||e[6]!==f?(p=s.jsxs(Et,{className:u,children:[f,l]}),e[4]=l,e[5]=u,e[6]=f,e[7]=p):p=e[7];let h;return e[8]!==d||e[9]!==o||e[10]!==r||e[11]!==p||e[12]!==m?(h=s.jsxs(Tt,{variant:m,collapsible:d,children:[r,p,o]}),e[8]=d,e[9]=o,e[10]=r,e[11]=p,e[12]=m,e[13]=h):h=e[13],h}function Rs(t,e){return s.jsx(Ms,{section:t},e)}ft.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(ee,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Hs(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"space-y-0.5 px-1 py-1",children:[s.jsx(ee,{className:"h-8 w-full rounded-lg"}),s.jsx(ee,{className:"h-8 w-full rounded-lg"})]}),t[0]=e):e=t[0],e}function Us(t){const e=P.c(12),{organizationId:n,currentProjectSlug:r,onSelect:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={suspense:!0},e[0]=l):l=e[0];const{data:i}=nt(n,l);let a,c;if(e[1]!==r||e[2]!==o||e[3]!==i){c=Symbol.for("react.early_return_sentinel");e:{const d=i?.filter(Fs)??[];if(d.length===0){let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:"No projects yet"}),e[6]=f):f=e[6],c=f;break e}let u;e[7]!==r||e[8]!==o?(u=f=>{const p=r===f.slug,h=f.ui?.themeColor??"#3B82F6";return s.jsxs(q,{className:R("gap-2.5",p&&"bg-accent"),onClick:()=>o(f.slug),children:[s.jsx("div",{className:"size-6 rounded-md shrink-0 flex items-center justify-center overflow-hidden border border-border/50",style:f.ui?.icon?void 0:{backgroundColor:h},children:f.ui?.icon?s.jsx("img",{src:f.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"text-xs font-semibold text-white",children:f.name.charAt(0).toUpperCase()})}),s.jsx("span",{className:"flex-1 truncate",children:f.name}),p&&s.jsx(be,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},f.id)},e[7]=r,e[8]=o,e[9]=u):u=e[9],a=d.map(u)}e[1]=r,e[2]=o,e[3]=i,e[4]=a,e[5]=c}else a=e[4],c=e[5];if(c!==Symbol.for("react.early_return_sentinel"))return c;let m;return e[10]!==a?(m=s.jsx(s.Fragment,{children:a}),e[10]=a,e[11]=m):m=e[11],m}function Fs(t){return t.slug!==Y}function Bs(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Me(t){const e=P.c(45),{isCollapsed:n,onCreateProject:r}=t,o=n===void 0?!1:n;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[0]=l):l=e[0];const{org:i,project:a}=Qe(l),{data:c}=xe.useListOrganizations(),m=Re(),d=c?.find(b=>b.slug===i),[u,f]=$.useState(!1),[p,h]=$.useState(!1),N=We(),j=a===Y,{data:v}=st(d?.id??"",j?"":a??"");let y;e[1]!==i?(y=(b,Q)=>b.slug===i?-1:Q.slug===i?1:b.name.localeCompare(Q.name),e[1]=i,e[2]=y):y=e[2];const x=[...c??[]].sort(y);let k;e[3]!==m||e[4]!==i?(k=()=>{i&&m({to:"/$org/$project",params:{org:i,project:Y}})},e[3]=m,e[4]=i,e[5]=k):k=e[5];const z=k;let S;e[6]!==m||e[7]!==i?(S=b=>{i&&m({to:"/$org/$project",params:{org:i,project:b}})},e[6]=m,e[7]=i,e[8]=S):S=e[8];const _=S;let C;e[9]!==m?(C=b=>{m({to:"/$org/$project",params:{org:b,project:Y}})},e[9]=m,e[10]=C):C=e[10];const H=C;let w;e[11]!==r?(w=r?()=>r():void 0,e[11]=r,e[12]=w):w=e[12];const U=w;let T;e[13]!==m||e[14]!==i||e[15]!==a?(T=()=>{if(!i||!a)return;const b=a===Y;m({to:"/$org/$project",params:{org:i,project:a},search:Q=>({...Q,settings:b?"org.general":`project:${a}:general`})})},e[13]=m,e[14]=i,e[15]=a,e[16]=T):T=e[16];const W=T,L=ot;let M;e[17]===Symbol.for("react.memo_cache_sentinel")?(M=b=>{b||h(!1)},e[17]=M):M=e[17];const O=o?"w-auto pr-1.5":"w-full";let E;e[18]!==O?(E=R("flex items-center gap-3 rounded-md p-1.5 pr-2 text-left hover:bg-sidebar-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring min-h-[2.75rem]",O),e[18]=O,e[19]=E):E=e[19];const I=j?s.jsx("div",{className:R("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",o?"size-6":"size-8"),style:d?.logo?void 0:Bs(d?.name??""),children:d?.logo?s.jsx("img",{src:d.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:R("font-semibold leading-none",o?"text-[9px]":"text-xs"),children:(d?.name??"?").slice(0,2).toUpperCase()})}):s.jsx("div",{className:R("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",o?"size-6":"size-8"),style:v?.ui?.icon?void 0:{backgroundColor:v?.ui?.themeColor??"#60a5fa"},children:v?.ui?.icon?s.jsx("img",{src:v.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:R("font-semibold text-white",o?"text-xs":"text-lg"),children:(v?.name??a??"?").charAt(0).toUpperCase()})});let A;e[20]!==d?.name||e[21]!==v?.name||e[22]!==o||e[23]!==j||e[24]!==a?(A=!o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[s.jsx("span",{className:"block text-[11px] text-sidebar-foreground/50 leading-tight truncate",children:d?.name??"Select org"}),s.jsx("span",{className:"block text-sm font-semibold text-sidebar-foreground truncate leading-tight",children:j?"Studio":v?.name??a??""})]}),s.jsx(It,{size:16,className:"shrink-0 text-sidebar-foreground/40"})]}),e[20]=d?.name,e[21]=v?.name,e[22]=o,e[23]=j,e[24]=a,e[25]=A):A=e[25];let D;e[26]!==E||e[27]!==I||e[28]!==A?(D=s.jsx(lt,{asChild:!0,children:s.jsxs("button",{type:"button",className:E,children:[I,A]})}),e[26]=E,e[27]=I,e[28]=A,e[29]=D):D=e[29];const B=rt,te="start",re="bottom",oe="w-64 flex flex-col gap-0.5",se=Ws,J=N&&p?s.jsxs(s.Fragment,{children:[x.map(b=>s.jsxs(q,{className:R("gap-2.5",b.slug===i&&"bg-accent"),onClick:()=>H(b.slug),children:[s.jsx(je,{url:b.logo??"",fallback:b.name,size:"xs",className:"size-5 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:b.name}),b.slug===i&&s.jsx(be,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},b.id)),s.jsx(Se,{}),s.jsxs(q,{className:"gap-2.5",onClick:()=>f(!0),children:[s.jsx(ve,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create organization"})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs(q,{className:R("gap-2.5",j&&"bg-accent"),onClick:z,children:[s.jsx(je,{url:d?.logo??"",fallback:d?.name??"",size:"sm",className:"size-6 rounded-md shrink-0",objectFit:"cover"}),s.jsxs("span",{className:"flex-1 truncate",children:["Studio · ",d?.name]}),j&&s.jsx(be,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]}),s.jsx("p",{className:"px-2 pt-2 pb-0.5 text-[11px] font-medium text-muted-foreground/50 uppercase tracking-wider",children:"Projects"}),d&&s.jsx($.Suspense,{fallback:s.jsx(Hs,{}),children:s.jsx(Us,{organizationId:d.id,currentProjectSlug:a,orgSlug:i??"",onSelect:_})}),U&&s.jsxs(q,{className:"gap-2.5",onClick:U,children:[s.jsx(ve,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create project"})]}),s.jsx(Se,{}),N?s.jsxs(q,{className:"gap-2.5",onSelect:b=>{b.preventDefault(),h(!0)},children:[s.jsx(Ke,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Switch organization"})]}):s.jsxs(ls,{children:[s.jsxs(as,{className:"gap-2.5",children:[s.jsx(Ke,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Switch organization"})]}),s.jsxs(cs,{className:"w-48 flex flex-col gap-0.5",children:[x.map(b=>s.jsxs(q,{className:R("gap-2.5",b.slug===i&&"bg-accent"),onClick:()=>H(b.slug),children:[s.jsx(je,{url:b.logo??"",fallback:b.name,size:"xs",className:"size-5 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:b.name}),b.slug===i&&s.jsx(be,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},b.id)),s.jsx(Se,{}),s.jsxs(q,{className:"gap-2.5",onClick:()=>f(!0),children:[s.jsx(ve,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create organization"})]})]})]}),s.jsxs(q,{className:"gap-2.5",onClick:W,children:[s.jsx(Ie,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Settings"})]})]});let F;e[30]!==B||e[31]!==se||e[32]!==J?(F=s.jsx(B,{align:te,side:re,className:oe,onCloseAutoFocus:se,children:J}),e[30]=B,e[31]=se,e[32]=J,e[33]=F):F=e[33];let G;e[34]!==L||e[35]!==D||e[36]!==F||e[37]!==M?(G=s.jsxs(L,{onOpenChange:M,children:[D,F]}),e[34]=L,e[35]=D,e[36]=F,e[37]=M,e[38]=G):G=e[38];let ie;e[39]!==u||e[40]!==f?(ie=s.jsx(ds,{open:u,onOpenChange:f}),e[39]=u,e[40]=f,e[41]=ie):ie=e[41];let V;return e[42]!==G||e[43]!==ie?(V=s.jsxs(s.Fragment,{children:[G,ie]}),e[42]=G,e[43]=ie,e[44]=V):V=e[44],V}function Ws(t){return t.preventDefault()}Me.Skeleton=function(){return s.jsxs("div",{className:"flex items-center gap-1.5 h-7 px-1.5 w-full",children:[s.jsx(ee,{className:"size-5 rounded-[5px] shrink-0 bg-sidebar-accent"}),s.jsx(ee,{className:"h-3.5 flex-1 bg-sidebar-accent"})]})};function De(t){const e=P.c(4),{onCreateProject:n}=t,{state:r,toggleSidebar:o}=Ue(),l=r==="collapsed";let i;return e[0]!==l||e[1]!==n||e[2]!==o?(i=s.jsx(Xe,{className:"px-3 group-data-[collapsible=icon]:px-2 animate-in fade-in-0 duration-200",children:s.jsx(ue,{children:s.jsx(ce,{children:l?s.jsxs("div",{className:"flex flex-col w-full gap-0.5",children:[s.jsx(Me,{isCollapsed:!0,onCreateProject:n}),s.jsx(ke,{onClick:o,tooltip:"Expand sidebar",children:s.jsx(Ee,{})})]}):s.jsxs("div",{className:"flex items-center justify-between w-full gap-1",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(Me,{isCollapsed:!1,onCreateProject:n})}),s.jsx(ke,{onClick:o,tooltip:"Collapse sidebar",className:"size-7 shrink-0",children:s.jsx(Ee,{})})]})})})}),e[0]=l,e[1]=n,e[2]=o,e[3]=i):i=e[3],i}De.Skeleton=function(){return s.jsx(Xe,{className:"px-3",children:s.jsx(ue,{children:s.jsx(ce,{children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 p-1.5",children:[s.jsx(ee,{className:"size-8 rounded-md shrink-0 bg-sidebar-accent"}),s.jsx(ee,{className:"h-3.5 w-16 bg-sidebar-accent"})]}),s.jsx("div",{className:"flex items-center gap-0.5",children:s.jsx(ee,{className:"size-7 rounded-lg bg-sidebar-accent"})})]})})})})};function Gs(t){const e=P.c(50),{user:n,userImage:r}=t,{open:o}=tt(),[l,i]=$.useState(!1);let a;e[0]!==n.email||e[1]!==n.id||e[2]!==n.name?(a=()=>{const B=`ID: ${n.id}
2
+ Name: ${n.name||"N/A"}
3
+ Email: ${n.email}`;navigator.clipboard.writeText(B),i(!0),pe.success("User info copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=n.email,e[1]=n.id,e[2]=n.name,e[3]=a):a=e[3];const c=a,m=n.name||n.email||"U";let d;e[4]!==m||e[5]!==r?(d=s.jsx(je,{url:r,fallback:m,shape:"circle",size:"2xs",className:"shrink-0 size-5"}),e[4]=m,e[5]=r,e[6]=d):d=e[6];const u=n.name||"User";let f;e[7]!==u?(f=s.jsx("div",{className:"flex-1 min-w-0 group-data-[collapsible=icon]:hidden",children:s.jsx("div",{className:"text-sm font-medium truncate text-sidebar-foreground leading-none",children:u})}),e[7]=u,e[8]=f):f=e[8];let p;e[9]!==d||e[10]!==f?(p=s.jsx(lt,{asChild:!0,children:s.jsxs("button",{className:"flex w-full h-8 items-center gap-2 rounded-md px-1 hover:bg-sidebar-accent transition-colors text-left min-w-0",children:[d,f]})}),e[9]=d,e[10]=f,e[11]=p):p=e[11];const h=n.name||n.email||"U";let N;e[12]!==h||e[13]!==r?(N=s.jsx(je,{url:r,fallback:h,shape:"circle",size:"sm",className:"shrink-0"}),e[12]=h,e[13]=r,e[14]=N):N=e[14];const j=n.name||"User";let v;e[15]!==j?(v=s.jsx("div",{className:"text-sm font-medium truncate",children:j}),e[15]=j,e[16]=v):v=e[16];let y;e[17]!==n.email?(y=s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:n.email}),e[17]=n.email,e[18]=y):y=e[18];let x;e[19]!==v||e[20]!==y?(x=s.jsxs("div",{className:"flex-1 min-w-0",children:[v,y]}),e[19]=v,e[20]=y,e[21]=x):x=e[21];let k;e[22]!==l?(k=s.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:l?s.jsx(be,{size:14,className:"text-green-600"}):s.jsx(ms,{size:14,className:"text-muted-foreground"})}),e[22]=l,e[23]=k):k=e[23];let z;e[24]!==c||e[25]!==x||e[26]!==k||e[27]!==N?(z=s.jsxs(q,{onClick:c,className:"gap-2.5 group",children:[N,x,k]}),e[24]=c,e[25]=x,e[26]=k,e[27]=N,e[28]=z):z=e[28];let S;e[29]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Se,{}),e[29]=S):S=e[29];let _;e[30]!==o?(_=()=>o("account.preferences"),e[30]=o,e[31]=_):_=e[31];let C,H;e[32]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ie,{size:14,className:"shrink-0 text-muted-foreground"}),H=s.jsx("span",{children:"Settings"}),e[32]=C,e[33]=H):(C=e[32],H=e[33]);let w;e[34]!==_?(w=s.jsxs(q,{className:"gap-2.5",onClick:_,children:[C,H]}),e[34]=_,e[35]=w):w=e[35];let U;e[36]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(q,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(us,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Terms of Use"}),s.jsx(ge,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[36]=U):U=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(q,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(ps,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Privacy Policy"}),s.jsx(ge,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[37]=T):T=e[37];let W;e[38]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(q,{asChild:!0,children:s.jsxs("a",{href:"https://github.com/decocms/mesh",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(bt,{className:"w-3.5 h-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"decocms/mesh"}),s.jsx(ge,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[38]=W):W=e[38];let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(q,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com/discord",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(Be,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Community"}),s.jsx(ge,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[39]=L):L=e[39];let M,O;e[40]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(q,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(fs,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Homepage"}),s.jsx(ge,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),O=s.jsx(Se,{}),e[40]=M,e[41]=O):(M=e[40],O=e[41]);let E;e[42]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs(q,{className:"gap-2.5",onClick:Ks,children:[s.jsx(mt,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Sign out"})]}),e[42]=E):E=e[42];let I;e[43]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{className:"px-2 py-1.5",children:s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.179.3"]})}),e[43]=I):I=e[43];let A;e[44]!==z||e[45]!==w?(A=s.jsxs(rt,{side:"top",align:"end",collisionPadding:8,className:"w-64 flex flex-col gap-0.5",onCloseAutoFocus:qs,children:[z,S,w,U,T,W,L,M,O,E,I]}),e[44]=z,e[45]=w,e[46]=A):A=e[46];let D;return e[47]!==A||e[48]!==p?(D=s.jsxs(ot,{children:[p,A]}),e[47]=A,e[48]=p,e[49]=D):D=e[49],D}function Ks(){return xe.signOut()}function qs(t){return t.preventDefault()}function pt(){const t=P.c(7),{data:e}=xe.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(je,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=c):c=t[0],c}const n=e.user,r=n.name??void 0;let o;t[1]!==r||t[2]!==n?(o={...n,name:r},t[1]=r,t[2]=n,t[3]=o):o=t[3];const l=o,i=n.image;let a;return t[4]!==i||t[5]!==l?(a=s.jsx(Gs,{user:l,userImage:i}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function Vs({invitation:t}){const[e,n]=$.useState(!1),[r,o]=$.useState(!1),l=yt(),i=async()=>{n(!0);try{const c=await xe.organization.acceptInvitation({invitationId:t.id});if(c.error)pe.error(c.error.message),n(!1);else{const m=await xe.organization.setActive({organizationId:t.organizationId});pe.success("Invitation accepted!");const d=m?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{pe.error("Failed to accept invitation"),n(!1)}},a=async()=>{o(!0);try{const c=await xe.organization.rejectInvitation({invitationId:t.id});c.error?(pe.error(c.error.message),o(!1)):(pe.success("Invitation declined"),l.invalidateQueries())}catch{pe.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Oe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:i,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(be,{size:14})}),s.jsx(Oe,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(js,{size:14})})]})]})}function Qs(){const t=$.useContext(Nt),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}class Ys extends $.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Js(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Zs(){const t=P.c(15),{open:e}=tt(),{org:n}=Ne();let r;t[0]!==n.id?(r={connectionId:Ft,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=Bt(r);let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l={providerId:"deco"},t[2]=l):l=t[2];let i;t[3]!==o?(i={client:o,toolName:"AI_PROVIDER_CREDITS",toolArguments:l,staleTime:6e4,select:Xs},t[3]=o,t[4]=i):i=t[4];const{data:a,isPending:c,isError:m}=bs(i),d=a?.balanceCents!=null?a.balanceCents/100:null;let u;t[5]!==e?(u=()=>e("org.billing"),t[5]=e,t[6]=u):u=t[6];let f;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(dt,{size:13,className:"text-muted-foreground/60 shrink-0"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Credits"})]}),t[7]=f):f=t[7];let p;t[8]!==d||t[9]!==m||t[10]!==c?(p=c||m||d==null?s.jsx("span",{className:"text-xs font-medium tabular-nums text-muted-foreground/40",children:"—"}):s.jsxs("span",{className:R("text-xs font-medium tabular-nums",Js(d)),children:["$",d.toFixed(2)]}),t[8]=d,t[9]=m,t[10]=c,t[11]=p):p=t[11];let h;return t[12]!==u||t[13]!==p?(h=s.jsxs("button",{type:"button",onClick:u,className:"group-data-[collapsible=icon]:hidden flex items-center justify-between w-full px-2 py-1.5 rounded-md hover:bg-sidebar-accent transition-colors",children:[f,p]}),t[12]=u,t[13]=p,t[14]=h):h=t[14],h}function Xs(t){return t.structuredContent}function en(){const t=P.c(1);if(!Yt().some(tn))return null;let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Zs,{}),t[0]=r):r=t[0],r}function tn(t){return t.providerId==="deco"}function sn(){const t=P.c(13),e=Qs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ys,{children:s.jsx($.Suspense,{fallback:null,children:s.jsx(en,{})})}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(pt,{})}),t[1]=r):r=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(hs,{asChild:!0,children:s.jsx(Oe,{variant:"ghost",size:"icon",className:"size-8 text-sidebar-foreground/50 hover:text-sidebar-foreground hover:bg-sidebar-accent","aria-label":"Open inbox",children:s.jsx(qe,{size:16})})}),t[2]=o):o=t[2];let l;t[3]!==e.length?(l=e.length>0&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 ring-2 ring-sidebar pointer-events-none"}),t[3]=e.length,t[4]=l):l=t[4];let i;t[5]!==l?(i=s.jsxs("div",{className:"relative",children:[o,l]}),t[5]=l,t[6]=i):i=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[7]=a):a=t[7];let c;t[8]!==e?(c=s.jsxs(xs,{side:"right",align:"end",sideOffset:24,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:[a,e.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(qe,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No messages or invites pending"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Messages, workspace and project invitations will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(nn)})]}),t[8]=e,t[9]=c):c=t[9];let m;return t[10]!==i||t[11]!==c?(m=s.jsxs(Mt,{className:"px-3.5 pb-3 group-data-[collapsible=icon]:px-2",children:[n,s.jsx(ue,{children:s.jsx(ce,{children:s.jsxs("div",{className:"flex items-center w-full gap-1",children:[r,s.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs(gs,{children:[i,c]})})]})})})]}),t[10]=i,t[11]=c,t[12]=m):m=t[12],m}function nn(t){return s.jsx(Vs,{invitation:t},t.id)}function rn(t){const e=P.c(11),{project:n}=t,r=n.ui?.themeColor??"#60a5fa";if(n.ui?.icon){let c;return e[0]!==n.ui.icon?(c=s.jsx("img",{src:n.ui.icon,alt:"",className:"size-4 rounded object-cover border border-border/50"}),e[0]=n.ui.icon,e[1]=c):c=e[1],c}let o;e[2]!==r?(o={backgroundColor:r},e[2]=r,e[3]=o):o=e[3];let l;e[4]!==n.name?(l=n.name.charAt(0).toUpperCase(),e[4]=n.name,e[5]=l):l=e[5];let i;e[6]!==l?(i=s.jsx("span",{className:"text-[10px] font-medium text-white",children:l}),e[6]=l,e[7]=i):i=e[7];let a;return e[8]!==o||e[9]!==i?(a=s.jsx("div",{className:"size-4 rounded flex items-center justify-center border border-border/50",style:o,children:i}),e[8]=o,e[9]=i,e[10]=a):a=e[10],a}function on(t){const e=P.c(14),{project:n}=t,r=Re(),{org:o}=Ne();let l;e[0]!==r||e[1]!==o.slug||e[2]!==n.slug?(l=()=>{r({to:"/$org/$project",params:{org:o.slug,project:n.slug}})},e[0]=r,e[1]=o.slug,e[2]=n.slug,e[3]=l):l=e[3];let i;e[4]!==n?(i=s.jsx(rn,{project:n}),e[4]=n,e[5]=i):i=e[5];let a;e[6]!==n.name?(a=s.jsx("span",{className:"truncate flex-1 group-data-[collapsible=icon]:hidden",children:n.name}),e[6]=n.name,e[7]=a):a=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ss,{size:12,className:"text-muted-foreground opacity-0 group-hover/item:opacity-100 transition-opacity group-data-[collapsible=icon]:hidden"}),e[8]=c):c=e[8];let m;return e[9]!==n.name||e[10]!==l||e[11]!==i||e[12]!==a?(m=s.jsx(ce,{children:s.jsxs(ke,{onClick:l,tooltip:n.name,children:[i,a,c]})}),e[9]=n.name,e[10]=l,e[11]=i,e[12]=a,e[13]=m):m=e[13],m}function ln(){const t=P.c(55),{org:e}=Ne(),{data:n,isLoading:r}=nt(e.id),[o,l]=$.useState(!0),[i,a]=$.useState(!1);let c,m,d,u,f,p,h,N,j,v,y,x,k;if(t[0]!==r||t[1]!==o||t[2]!==n){k=Symbol.for("react.early_return_sentinel");e:{const W=n?.filter(cn)??[];if(r){let D;t[16]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(ce,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(ee,{className:"h-4 w-4 rounded"}),s.jsx(ee,{className:"h-4 flex-1"})]})}),t[16]=D):D=t[16];let B;t[17]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(_e,{className:"py-0 px-0",children:s.jsx(Ce,{children:s.jsxs(ue,{className:"gap-0.5",children:[D,s.jsx(ce,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(ee,{className:"h-4 w-4 rounded"}),s.jsx(ee,{className:"h-4 flex-1"})]})})]})})}),t[17]=B):B=t[17],k=B;break e}x="group/projects-section mt-2",f=Ns,v=o,y=l,u=_e,j="py-0 px-0",d=Ce,m=ue,h="gap-0.5";let L;t[18]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Projects"}),t[18]=L):L=t[18];const M=!o&&"-rotate-90";let O;t[19]!==M?(O=R("text-muted-foreground shrink-0 transition-transform duration-200",M),t[19]=M,t[20]=O):O=t[20];let E;t[21]!==O?(E=s.jsx(ys,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex flex-1 items-center gap-1 cursor-pointer min-w-0",children:[L,s.jsx(it,{size:12,className:O})]})}),t[21]=O,t[22]=E):E=t[22];let I;t[23]===Symbol.for("react.memo_cache_sentinel")?(I=()=>a(!0),t[23]=I):I=t[23];let A;t[24]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("button",{type:"button",onClick:I,title:"Create new project",className:"opacity-0 group-hover/projects-section:opacity-100 transition-opacity text-muted-foreground hover:text-foreground flex items-center justify-center h-4 rounded shrink-0",children:s.jsx(ve,{size:16})}),t[24]=A):A=t[24],t[25]!==E?(N=s.jsx(ce,{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs("div",{className:"flex h-6 w-full items-center gap-1 rounded-md pl-1.5 pr-0.5 hover:bg-sidebar-accent transition-colors",children:[E,A]})}),t[25]=E,t[26]=N):N=t[26],c=vs,p=W.length===0?s.jsx(ce,{children:s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"No projects yet"})}):W.map(an)}t[0]=r,t[1]=o,t[2]=n,t[3]=c,t[4]=m,t[5]=d,t[6]=u,t[7]=f,t[8]=p,t[9]=h,t[10]=N,t[11]=j,t[12]=v,t[13]=y,t[14]=x,t[15]=k}else c=t[3],m=t[4],d=t[5],u=t[6],f=t[7],p=t[8],h=t[9],N=t[10],j=t[11],v=t[12],y=t[13],x=t[14],k=t[15];if(k!==Symbol.for("react.early_return_sentinel"))return k;let z;t[27]!==c||t[28]!==p?(z=s.jsx(c,{children:p}),t[27]=c,t[28]=p,t[29]=z):z=t[29];let S;t[30]!==m||t[31]!==h||t[32]!==N||t[33]!==z?(S=s.jsxs(m,{className:h,children:[N,z]}),t[30]=m,t[31]=h,t[32]=N,t[33]=z,t[34]=S):S=t[34];let _;t[35]!==d||t[36]!==S?(_=s.jsx(d,{children:S}),t[35]=d,t[36]=S,t[37]=_):_=t[37];let C;t[38]!==u||t[39]!==_||t[40]!==j?(C=s.jsx(u,{className:j,children:_}),t[38]=u,t[39]=_,t[40]=j,t[41]=C):C=t[41];let H;t[42]!==f||t[43]!==C||t[44]!==v||t[45]!==y?(H=s.jsx(f,{open:v,onOpenChange:y,children:C}),t[42]=f,t[43]=C,t[44]=v,t[45]=y,t[46]=H):H=t[46];let w;t[47]!==H||t[48]!==x?(w=s.jsx("div",{className:x,children:H}),t[47]=H,t[48]=x,t[49]=w):w=t[49];let U;t[50]!==i?(U=s.jsx(et,{open:i,onOpenChange:a}),t[50]=i,t[51]=U):U=t[51];let T;return t[52]!==w||t[53]!==U?(T=s.jsxs(s.Fragment,{children:[w,U]}),t[52]=w,t[53]=U,t[54]=T):T=t[54],T}function an(t){return s.jsx(on,{project:t},t.id)}function cn(t){return t.slug!==Y}function dn(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($.Suspense,{fallback:s.jsx(_e,{className:"py-0 px-0",children:s.jsx(Ce,{children:s.jsx(ue,{className:"gap-0.5",children:s.jsx(ce,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(ee,{className:"h-4 w-4 rounded"}),s.jsx(ee,{className:"h-4 flex-1"})]})})})})}),children:s.jsx(ln,{})}),t[0]=e):e=t[0],e}function mn(t){const e=P.c(12),{onCreateProject:n}=t,r=Es(),{locator:o}=Ne();let l;e[0]!==o?(l=Ae.isOrgAdminProject(o),e[0]=o,e[1]=l):l=e[1];const i=l;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(De.Skeleton,{}),e[2]=a):a=e[2];let c;e[3]!==n?(c=s.jsx($.Suspense,{fallback:a,children:s.jsx(De,{onCreateProject:n})}),e[3]=n,e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(sn,{}),e[5]=m):m=e[5];let d;e[6]!==i?(d=i?s.jsx(Le,{children:s.jsx($.Suspense,{fallback:null,children:s.jsx(dn,{})})}):null,e[6]=i,e[7]=d):d=e[7];let u;return e[8]!==r||e[9]!==c||e[10]!==d?(u=s.jsx(ft,{sections:r,header:c,footer:m,additionalContent:d}),e[8]=r,e[9]=c,e[10]=d,e[11]=u):u=e[11],u}function un(){const t=P.c(5),n=He().location.href;let r;t[0]!==n?(r=n==="/login"||n.startsWith("/login?"),t[0]=n,t[1]=r):r=t[1];const o=r;let l;if(t[2]!==n||t[3]!==o){const i=o?{}:{next:n};l=s.jsx(Ct,{to:"/login",search:i,replace:!0}),t[2]=n,t[3]=o,t[4]=l}else l=t[4];return l}function fn(t){const e=P.c(6),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(vt,{children:s.jsx(Ye,{})}),e[0]=r):r=e[0];let o;e[1]!==n?(o=s.jsx(St,{children:n}),e[1]=n,e[2]=o):o=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(kt,{children:s.jsx(un,{})}),e[3]=l):l=e[3];let i;return e[4]!==o?(i=s.jsxs(s.Fragment,{children:[r,o,l]}),e[4]=o,e[5]=i):i=e[5],i}function pn(t){const e=P.c(10),{children:n,className:r}=t,[,o]=$.useTransition();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Pe.decoChatPanelWidth(),e[0]=l):l=e[0];const[i,a]=Fe(l,30);let c;e[1]!==a?(c=f=>o(()=>a(f)),e[1]=a,e[2]=c):c=e[2];const m=c;let d;e[3]!==r?(d=R("min-w-0",r),e[3]=r,e[4]=d):d=e[4];let u;return e[5]!==i||e[6]!==n||e[7]!==m||e[8]!==d?(u=s.jsx(at,{defaultSize:i,minSize:20,className:d,onResize:m,children:n}),e[5]=i,e[6]=n,e[7]=m,e[8]=d,e[9]=u):u=e[9],u}function xn(t){const e=P.c(5),{children:n}=t,r=We();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Pe.sidebarOpen(),e[0]=o):o=e[0];const[l,i]=Fe(o,!0),a=r?!0:l;let c;return e[1]!==n||e[2]!==i||e[3]!==a?(c=s.jsx(Dt,{open:a,onOpenChange:i,children:n}),e[1]=n,e[2]=i,e[3]=a,e[4]=c):c=e[4],c}function hn(t){const e=P.c(6),{onClick:n,isOpen:r}=t,o=r&&"bg-accent text-foreground";let l;e[0]!==o?(l=R("fixed bottom-4 right-4 z-40 flex size-12 items-center justify-center rounded-full shadow-lg transition-colors","bg-primary text-primary-foreground hover:bg-primary/90",o),e[0]=o,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ht,{size:20}),e[2]=i):i=e[2];let a;return e[3]!==n||e[4]!==l?(a=s.jsx("button",{type:"button",onClick:n,className:l,"aria-label":"Toggle chat",children:i}),e[3]=n,e[4]=l,e[5]=a):a=e[5],a}function gn(t){const e=P.c(31),{isHomeRoute:n,onCreateProject:r}=t,[o,l]=Ze(),i=We();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Pe.decoChatPanelWidth(),e[0]=a):a=e[0];const[c]=Fe(a,30),m=`${c}cqi`;let d;e[1]!==m?(d={"--sidebar-width":"13.5rem","--sidebar-width-mobile":"11rem","--chat-panel-w":m},e[1]=m,e[2]=d):d=e[2];const u=d;let f;e[3]!==r?(f=s.jsx(mn,{onCreateProject:r}),e[3]=r,e[4]=f):f=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p={background:"transparent",containerType:"inline-size"},e[5]=p):p=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h={overflow:"visible"},e[6]=h):h=e[6];let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N={overflow:"visible"},e[7]=N):N=e[7];const j=!i&&o&&"rounded-tr-[0.75rem] border-r",v=i&&"rounded-tr-[0.75rem] border-r";let y;e[8]!==v||e[9]!==j?(y=R("flex flex-col flex-1 min-h-0 bg-card overflow-hidden","border-t border-l border-sidebar-border","rounded-tl-[0.75rem]","transition-[border-radius] duration-200 ease-[var(--ease-out-quart)]",j,v),e[8]=v,e[9]=j,e[10]=y):y=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(Je,{})}),e[11]=x):x=e[11];let k;e[12]!==y?(k=s.jsx(at,{className:"min-w-0 flex flex-col",style:N,children:s.jsx("div",{className:y,children:x})}),e[12]=y,e[13]=k):k=e[13];let z;e[14]!==o||e[15]!==n||e[16]!==i?(z=!n&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(_s,{className:"bg-sidebar"}),s.jsx(pn,{className:R("transition-[max-width] duration-200 ease-[var(--ease-out-quart)] overflow-hidden",o?"max-w-[var(--chat-panel-w)] bg-sidebar":"max-w-0"),children:s.jsx("div",{className:"h-full min-w-[var(--chat-panel-w)] pl-1.5 pr-1.5 pb-1.5",children:s.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden border border-sidebar-border shadow-sm",children:s.jsx(Ve,{})})})})]}),e[14]=o,e[15]=n,e[16]=i,e[17]=z):z=e[17];let S;e[18]!==k||e[19]!==z?(S=s.jsx(Lt,{className:"pt-1.5",style:p,children:s.jsxs(ws,{direction:"horizontal",className:"h-full",style:h,children:[k,z]})}),e[18]=k,e[19]=z,e[20]=S):S=e[20];let _;e[21]!==o||e[22]!==n||e[23]!==i||e[24]!==l?(_=!n&&i&&s.jsxs(s.Fragment,{children:[s.jsx(hn,{onClick:()=>l(jn),isOpen:o}),s.jsx(ks,{open:o,onOpenChange:l,direction:"bottom",children:s.jsx(Cs,{className:"h-[95dvh] max-h-[95dvh]",children:s.jsx(Ve,{})})})]}),e[21]=o,e[22]=n,e[23]=i,e[24]=l,e[25]=_):_=e[25];let C;return e[26]!==S||e[27]!==_||e[28]!==u||e[29]!==f?(C=s.jsxs(Rt,{className:"flex-1 bg-sidebar",style:u,children:[f,S,_]}),e[26]=S,e[27]=_,e[28]=u,e[29]=f,e[30]=C):C=e[30],C}function jn(t){return!t}function bn(){const{org:t,project:e}=Qe({strict:!1}),n=He(),[r,o]=$.useState(!1),[l,i]=$.useState(!1);$.useEffect(()=>{const u=f=>{Pt(f)&&f.code==="KeyK"&&(f.preventDefault(),i(!0))};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[]);const a=n.location.pathname===`/${t}/${e}`||n.location.pathname===`/${t}/${e}/`,c=e??Y,{data:m}=_t({queryKey:wt.activeOrganization(t),queryFn:async()=>{if(!t)return null;const{data:u}=await xe.organization.setActive({organizationSlug:t});return u&&localStorage.setItem(Pe.lastOrgSlug(),t),{org:u,project:{slug:c,isOrgAdmin:c===Y}}},gcTime:1/0,refetchOnWindowFocus:!1});if(!m)return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"h-12 flex items-center justify-end px-4 border-b border-border",children:s.jsx("div",{className:"w-fit",children:s.jsx(pt,{})})}),s.jsx(Je,{})]});if(!m.org)return window.location.pathname!=="/"&&(window.location.href="/"),null;const d={...m,project:{...m.project,slug:c,isOrgAdmin:c===Y}};return s.jsxs($t,{...d,children:[s.jsx(xn,{children:s.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:s.jsx(X.Provider,{children:s.jsx(gn,{isHomeRoute:a,onCreateProject:()=>o(!0)})})})}),s.jsx(et,{open:r,onOpenChange:o}),s.jsx(Is,{open:l,onOpenChange:i})]})}function ur(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(fn,{children:s.jsx($.Suspense,{fallback:s.jsx(Ye,{}),children:s.jsx(bn,{})})}),t[0]=e):e=t[0],e}export{ur as default};