decocms 3.36.0 → 3.36.2

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 (237) hide show
  1. package/dist/client/assets/{AlertCircle-sZfVKKIU.js → AlertCircle-Bdl8L7il.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CnGG2N1Q.js → ArrowUpRight-C4gNBzMY.js} +1 -1
  3. package/dist/client/assets/{Check-eedT9M4f.js → Check-Cb8huOHH.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CAOK_nhg.js → CheckCircle-CGJnw6dP.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-D6-hnD5Z.js → ChevronDown-D_ybfzhh.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-k-DiQ61D.js → ChevronLeft-CBi5hL_n.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CBibu88R.js → ChevronRight-D0iMeTJ5.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-D19kYmIs.js → ChevronUp-BXLaNqVW.js} +1 -1
  9. package/dist/client/assets/{Container-Z2j0OuNG.js → Container-BGdfxKsK.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-tAZhaZW5.js → DotsVertical-BhoFPdMN.js} +1 -1
  11. package/dist/client/assets/{Eye-BMnHz-k1.js → Eye-DcL-kKgm.js} +1 -1
  12. package/dist/client/assets/{FilterLines-K_WBOHf8.js → FilterLines-DSwseOu_.js} +1 -1
  13. package/dist/client/assets/{Globe01-KlLmxZ2g.js → Globe01-BX4SSb6A.js} +1 -1
  14. package/dist/client/assets/{HardDrive-C7yJ_w8P.js → HardDrive-DcbBi9w_.js} +1 -1
  15. package/dist/client/assets/{Key01-CckfZB0A.js → Key01-R_z_EgAZ.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-ZmlpRdpE.js → LayoutLeft-hGFocSnW.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-N2hkztS6.js → LinkExternal01-DQiI5oxv.js} +1 -1
  18. package/dist/client/assets/{Monitor01-Bn333I91.js → Monitor01-CRf7BSF8.js} +1 -1
  19. package/dist/client/assets/{Palette-CcCpCoEe.js → Palette-EMfX7hNs.js} +1 -1
  20. package/dist/client/assets/{Play-CsIlBltu.js → Play-mcRrv0lp.js} +1 -1
  21. package/dist/client/assets/{Plus-D9X97D1u.js → Plus-_ThoLvvV.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-DaIOSJey.js → RefreshCcw01-CyAHVf6q.js} +1 -1
  23. package/dist/client/assets/{SearchMd-DuNbf8h_.js → SearchMd-D6F8AHrW.js} +1 -1
  24. package/dist/client/assets/{Settings02-Dg39zp7t.js → Settings02-B100KruV.js} +1 -1
  25. package/dist/client/assets/{Shield01-MKov2U7D.js → Shield01-DxJYzxVh.js} +1 -1
  26. package/dist/client/assets/{Star01-5MkCH9IF.js → Star01-DgOBkoy7.js} +1 -1
  27. package/dist/client/assets/{Stars01-BAVDvS6u.js → Stars01-CF50N3iu.js} +1 -1
  28. package/dist/client/assets/{Stars02-DHgD3n9i.js → Stars02-AWskXgtc.js} +1 -1
  29. package/dist/client/assets/{Sun-DY49aLCe.js → Sun-Ddl5HYpL.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-BuDlamMt.js → SwitchHorizontal01-DHHfKBMD.js} +1 -1
  31. package/dist/client/assets/{Tool01-CiezpOWI.js → Tool01-BLdHAOru.js} +1 -1
  32. package/dist/client/assets/{Trash01-DLl5cvJP.js → Trash01-4Tg-x6Q1.js} +1 -1
  33. package/dist/client/assets/{Upload01-CXSIztYx.js → Upload01-CBpPl05N.js} +1 -1
  34. package/dist/client/assets/{User01-eSBkatOS.js → User01-CChZgMNn.js} +1 -1
  35. package/dist/client/assets/{Users01-BYl8o0Rk.js → Users01-CxX1e6cq.js} +1 -1
  36. package/dist/client/assets/{Users03--pS_AKxh.js → Users03-DE6tDcyz.js} +1 -1
  37. package/dist/client/assets/{X-Br2l6mA-.js → X-BRH2Y8Wq.js} +1 -1
  38. package/dist/client/assets/{XCircle-RMZbZptd.js → XCircle-CShXLucc.js} +1 -1
  39. package/dist/client/assets/{XClose-WgHqvoCp.js → XClose-BFJ573RS.js} +1 -1
  40. package/dist/client/assets/{Zap-04Dx-3Fy.js → Zap-ZgVQTmT-.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-B5l4FlG5.js → ZapSquare-Cz0n89qc.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-rJJ-xaWS.js → ZoomOut-CqeB-Ycx.js} +1 -1
  43. package/dist/client/assets/{access-gate-BfYLjAxI.js → access-gate-qCShaDhO.js} +1 -1
  44. package/dist/client/assets/{accordion-VLPWQbMf.js → accordion-QuD2RrzW.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-DwhDzMiU.js → add-section-modal-Xr54wDg5.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-Bp0VRyoH.js → agent-capabilities-CFJ9p-mV.js} +1 -1
  47. package/dist/client/assets/{agent-icon-DWieO6vE.js → agent-icon-rbRaklR8.js} +1 -1
  48. package/dist/client/assets/{agents-list-vq1mZM9e.js → agents-list-Dcl00RIN.js} +1 -1
  49. package/dist/client/assets/{ai-providers-MJsvCa64.js → ai-providers-B3fmOzya.js} +1 -1
  50. package/dist/client/assets/{alert-HqJ_IB4U.js → alert-NPCB1uGq.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-DieQSpJJ.js → alert-dialog-DU_hTH_e.js} +1 -1
  52. package/dist/client/assets/app-editor-vPhjMJAN.js +1 -0
  53. package/dist/client/assets/{auth-CEd3xQ2M.js → auth-DOEa4Xg-.js} +1 -1
  54. package/dist/client/assets/{auth-catchall-C-8kcQ7W.js → auth-catchall-C9GzLyRU.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-CX30rRHT.js → auth-split-layout-D-gXvj1z.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-Ch8kIzZ2.js → automation-list-row-BmMbzVcz.js} +1 -1
  57. package/dist/client/assets/{automation-runs-C8idnx0B.js → automation-runs-CHOhgiKg.js} +1 -1
  58. package/dist/client/assets/{automations-jJXUtE3E.js → automations-vinGS7sH.js} +1 -1
  59. package/dist/client/assets/{avatar-C15JHojT.js → avatar-BqZJEvBP.js} +1 -1
  60. package/dist/client/assets/{badge-JwkDS5Iu.js → badge-B2khBz0-.js} +1 -1
  61. package/dist/client/assets/{brand-context-BT47WAzQ.js → brand-context-B_nK7LrX.js} +1 -1
  62. package/dist/client/assets/{buckets-CyuvSdAu.js → buckets-B0he9ykT.js} +1 -1
  63. package/dist/client/assets/{calendar-CWIwfYwe.js → calendar-DTQK53My.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-BKOu-NPD.js → capability-load-error-ErUeqyMr.js} +1 -1
  65. package/dist/client/assets/{card-CgBn2dE1.js → card-C0ZJxFoq.js} +1 -1
  66. package/dist/client/assets/{chat-context-DqZ1Ibm0.js → chat-context-D-8AD0J7.js} +1 -1
  67. package/dist/client/assets/{checkbox-qrM9_H9O.js → checkbox-DxApZ9yh.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Bs1vaEZW.js → cli-auth-success-D_1gXhC0.js} +1 -1
  69. package/dist/client/assets/{collection-detail-gZtr1UQJ.js → collection-detail-7xb9CmFQ.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-DLfQMrjc.js → collection-display-button-BAzLR9Of.js} +1 -1
  71. package/dist/client/assets/{collection-search-D1oAy2sU.js → collection-search-DTKnEcQS.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-C2gSo7v5.js → collection-table-wrapper-injrdYM-.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-BIQAfryC.js → collection-tabs-BDWQ17XJ.js} +1 -1
  74. package/dist/client/assets/{collections-D0YZfwq6.js → collections-DFjqouMx.js} +1 -1
  75. package/dist/client/assets/{command-BLE2ssDn.js → command-DYklD3Up.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-CrC9Oh0l.js → connect-desktop-dialog-C4HCeyrm.js} +1 -1
  77. package/dist/client/assets/{connection-card-CHJN3shf.js → connection-card-BjkWUX4T.js} +1 -1
  78. package/dist/client/assets/{connection-detail-C48cRXbS.js → connection-detail-S0rM47Fu.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-Drt7n4SC.js → connection-form-helpers-DTy5Iwrw.js} +1 -1
  80. package/dist/client/assets/{connections-4mKaz-pj.js → connections-C9XIC_5l.js} +1 -1
  81. package/dist/client/assets/{decopilot-DvM9Gb5y.js → decopilot-D05Xyy-k.js} +1 -1
  82. package/dist/client/assets/decopilot-sse-pool-Bs8CtAgZ.js +1 -0
  83. package/dist/client/assets/{dialog-DK12sdoJ.js → dialog-B2mbqsst.js} +1 -1
  84. package/dist/client/assets/{domain-settings-BlIFrkY9.js → domain-settings-BGmkBDeq.js} +1 -1
  85. package/dist/client/assets/{drawer-CIXkng7i.js → drawer-iJV16qgy.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-BLKuf1Kf.js → dropdown-menu-D2SV-kWF.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-Cao3Fk3O.js → dynamic-plugin-layout-BI5KEXy_.js} +1 -1
  88. package/dist/client/assets/{empty-state-BbCSQSCb.js → empty-state-BvWByj-2.js} +1 -1
  89. package/dist/client/assets/{empty-state-tzNEOnER.js → empty-state-C_DVBzcU.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-CQzU46AZ.js → extract-connection-data-bssph-WQ.js} +1 -1
  91. package/dist/client/assets/{features-DdBVqCME.js → features-iKNVVztW.js} +1 -1
  92. package/dist/client/assets/{file-explorer-DnZXmyKJ.js → file-explorer-jTZzWDYA.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-BQHeWto0.js → file-type-icon-C6U2veNU.js} +1 -1
  94. package/dist/client/assets/{files-BsjLUCm4.js → files-BMloqr5Z.js} +1 -1
  95. package/dist/client/assets/{form-FCvC7hbQ.js → form-CU3vQdRi.js} +1 -1
  96. package/dist/client/assets/{general-Dd6sqRin.js → general-BgdjTbWO.js} +1 -1
  97. package/dist/client/assets/{generate-id-zSg_956X.js → generate-id-yj5Hc06j.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-CTRiJHmK.js → github-repo-picker-Bp_Rai-x.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-B1HaLlT-.js → header-tab-button-D3vC9cXp.js} +1 -1
  100. package/dist/client/assets/{hover-card-D0jPa1wE.js → hover-card-BUcaRmlM.js} +1 -1
  101. package/dist/client/assets/{image-field-mUCDr9Zc.js → image-field-FQeZHP_K.js} +1 -1
  102. package/dist/client/assets/{index-CaaIYkny.js → index--7JSPThb.js} +1 -1
  103. package/dist/client/assets/{index-DElySjov.js → index-3ttoiVWU.js} +3 -3
  104. package/dist/client/assets/{index-BD1xF-xP.js → index-B0th8sGF.js} +1 -1
  105. package/dist/client/assets/{index-DiZRyNnN.js → index-B3hxsYs6.js} +1 -1
  106. package/dist/client/assets/{index-tV6K0vzd.js → index-BZhcIh0y.js} +1 -1
  107. package/dist/client/assets/{index-D8rSD1e2.js → index-C1Lwsift.js} +1 -1
  108. package/dist/client/assets/{index-CeLy70Xu.js → index-C7sErToY.js} +1 -1
  109. package/dist/client/assets/{index-C8Oy1v-k.js → index-COSo4xcs.js} +1 -1
  110. package/dist/client/assets/{index-DOUSj-_V.js → index-CZzfDV_a.js} +1 -1
  111. package/dist/client/assets/{index-B-btDb3P.js → index-CeYNxCgl.js} +1 -1
  112. package/dist/client/assets/{index-jep-xxRB.js → index-DusmqmHr.js} +1 -1
  113. package/dist/client/assets/{index-BaVV-6LB.js → index-DyEqkA0D.js} +1 -1
  114. package/dist/client/assets/{index-8TuYuCCk.js → index-RSpfYKVW.js} +1 -1
  115. package/dist/client/assets/{index-p33ao2cf.js → index-TaHJgDzY.js} +1 -1
  116. package/dist/client/assets/{index-redirect-C9ZhbisF.js → index-redirect-B3cJS778.js} +1 -1
  117. package/dist/client/assets/{index-zawK8irL.js → index-xWbPmICt.js} +4 -4
  118. package/dist/client/assets/{input-Cdm1NEie.js → input-DVih3Sjm.js} +1 -1
  119. package/dist/client/assets/{integration-icon-hz4amrfY.js → integration-icon-BRZNp1S0.js} +1 -1
  120. package/dist/client/assets/{label-Vh7XtQX1.js → label-C0uUNmvX.js} +1 -1
  121. package/dist/client/assets/{layout-C4bROUGO.js → layout-BP4_ZWgl.js} +1 -1
  122. package/dist/client/assets/{login-BbHLsX9y.js → login-rd7n3mUN.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-DIztaHu2.js → mcp-oauth-BQWbsE1s.js} +1 -1
  124. package/dist/client/assets/{members-uiNPsB6a.js → members-D60AKUfH.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-CzCLI82l.js → monaco-editor-D-Xn_h_i.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-BS4JmiNh.js → monitoring-stats-row-DIUkTh7Z.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-C-boMM2j.js → oauth-callback-CN_Q3L8-.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-b_VkYeBz.js → oauth-callback-ai-provider-CXBvt-3U.js} +1 -1
  129. package/dist/client/assets/{onboarding-B4lsc8p6.js → onboarding-4vgLSBnB.js} +1 -1
  130. package/dist/client/assets/{org-install-BqE8DCpi.js → org-install-BAfI3ABO.js} +1 -1
  131. package/dist/client/assets/{org-layout-CuY9xdZF.js → org-layout-BX9VaywI.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-BoXoiIeY.js → org-plugin-layout-CPX7c1_z.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-BAxbjdXf.js → page-seo-form-BQBXyb0O.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-DoMYq7bJ.js +1 -0
  135. package/dist/client/assets/{pair-BMgj9p8o.js → pair-vWhfM9EW.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-DEB-1M8s.js → plugin-empty-state-e0Wbrqvl.js} +1 -1
  137. package/dist/client/assets/{plugin-header-tcd0nLNy.js → plugin-header-wAvZu5-j.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-Ba8uQ5F9.js → plugin-layout-BYUyfvt2.js} +1 -1
  139. package/dist/client/assets/{popover-CQUbCY9L.js → popover-CydIugVg.js} +1 -1
  140. package/dist/client/assets/{post-editor-h8Kl9Dat.js → post-editor--xRkfN-u.js} +1 -1
  141. package/dist/client/assets/{primitives-DMqPWXCZ.js → primitives-D1vGUoIn.js} +1 -1
  142. package/dist/client/assets/{profile-BX6NyJ96.js → profile-L6NxK-ky.js} +1 -1
  143. package/dist/client/assets/project-app-view-BZMnBtvK.js +1 -0
  144. package/dist/client/assets/record-editor-DV9l-O7a.js +1 -0
  145. package/dist/client/assets/registry-HfyP6hgN.js +2 -0
  146. package/dist/client/assets/{registry-layout-Dr55jSnu.js → registry-layout-lkoxfdjb.js} +1 -1
  147. package/dist/client/assets/{require-capability-CMu5fNDT.js → require-capability-ctj3w0Hy.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-D9j7jy0d.js → required-auth-layout-1KnSml1h.js} +1 -1
  149. package/dist/client/assets/{reset-password-neZebU-f.js → reset-password-Cncp0vG1.js} +1 -1
  150. package/dist/client/assets/{resizable-_yQxq9nx.js → resizable-DUax5XQL.js} +1 -1
  151. package/dist/client/assets/{roles-B4FWWYZy.js → roles-CX88Wo-B.js} +1 -1
  152. package/dist/client/assets/save-referenced-block-BCkoUa1r.js +1 -0
  153. package/dist/client/assets/{save-status-C6xYTbl3.js → save-status-CilJNEDS.js} +1 -1
  154. package/dist/client/assets/{schema-form-DAx4_84I.js → schema-form-36ITxJTs.js} +1 -1
  155. package/dist/client/assets/{scroll-area-C_pJDhCx.js → scroll-area-G2D-rhCe.js} +1 -1
  156. package/dist/client/assets/{search-input-wftXnsYu.js → search-input-DZtcJZGI.js} +1 -1
  157. package/dist/client/assets/{secrets-C0HtJ-0L.js → secrets-B-dXGiHw.js} +1 -1
  158. package/dist/client/assets/{sections-editor-CQQfy9r_.js → sections-editor-Bh4-voaV.js} +1 -1
  159. package/dist/client/assets/{select-CvY3LM8v.js → select-C8qI9qzJ.js} +1 -1
  160. package/dist/client/assets/{select-model-DzBvb94i.js → select-model-CJrkcp8L.js} +1 -1
  161. package/dist/client/assets/{seo-editor-BPGCTV6C.js → seo-editor-CTlhny9b.js} +1 -1
  162. package/dist/client/assets/{settings-layout-DY5er7_5.js → settings-layout-CpbacBmZ.js} +1 -1
  163. package/dist/client/assets/{settings-section-bgBc23Sj.js → settings-section-7sN_1nHI.js} +1 -1
  164. package/dist/client/assets/{sheet-CUbQ8u3K.js → sheet-B6uVK7Gd.js} +1 -1
  165. package/dist/client/assets/{shell-controls-Cz7KRwiK.js → shell-controls-BrMNTCJc.js} +1 -1
  166. package/dist/client/assets/{shell-layout-CTILiI6W.js → shell-layout-B0RfVT3C.js} +1 -1
  167. package/dist/client/assets/shell-route-loading-BdonEPNR.js +1 -0
  168. package/dist/client/assets/{sidebar-DUDIX5oW.js → sidebar-CeOOq5ye.js} +1 -1
  169. package/dist/client/assets/{skeleton-DOuDuLeH.js → skeleton-vEwazeas.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-BRp5_cYM.js → sortable.esm-CH8RPvw-.js} +1 -1
  171. package/dist/client/assets/{spinner-Ct4FnHpR.js → spinner-2N-kj7x0.js} +1 -1
  172. package/dist/client/assets/{sso-BdyN6bt5.js → sso-Wq5ejlq_.js} +1 -1
  173. package/dist/client/assets/{store-B1cXtP5r.js → store-CvprJD_R.js} +1 -1
  174. package/dist/client/assets/store-registry-BzpUZbWs.js +2 -0
  175. package/dist/client/assets/{studio-tools-BniDnWv9.js → studio-tools-C7SlPTsZ.js} +1 -1
  176. package/dist/client/assets/{switch-DKWXZfes.js → switch-DDUT3a8C.js} +1 -1
  177. package/dist/client/assets/{tab-id-CidWBQZm.js → tab-id-rjh-jKlB.js} +1 -1
  178. package/dist/client/assets/{table-Dey_Txdo.js → table-CXgtsUd4.js} +1 -1
  179. package/dist/client/assets/{tabs-Hef74NAR.js → tabs-DkUWsc-a.js} +1 -1
  180. package/dist/client/assets/{task-status-CMI8T9Bj.js → task-status-DczQDaYF.js} +1 -1
  181. package/dist/client/assets/{textarea-DI0l_iOE.js → textarea-RmWXPTvx.js} +1 -1
  182. package/dist/client/assets/{toggle-group-CKd_s4i6.js → toggle-group-CBraKNJ7.js} +1 -1
  183. package/dist/client/assets/{toolbar-I4LrNcZp.js → toolbar-CE9gJtYo.js} +1 -1
  184. package/dist/client/assets/{tools-list-BqO9ZnTK.js → tools-list-yuhbQkhw.js} +1 -1
  185. package/dist/client/assets/{tooltip-BJIwJ20V.js → tooltip-FBNw4nVO.js} +1 -1
  186. package/dist/client/assets/{types-DkSHL0JO.js → types-n2YDSxA4.js} +1 -1
  187. package/dist/client/assets/{use-ai-providers-BgB6wf9K.js → use-ai-providers-suUCAMGx.js} +1 -1
  188. package/dist/client/assets/{use-automations-C2phvVRr.js → use-automations-F8sxpovP.js} +1 -1
  189. package/dist/client/assets/{use-capability-C2a1p0-_.js → use-capability-CVFP3WhT.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-BsB0gkiC.js → use-clock-tick-DervAiLh.js} +1 -1
  191. package/dist/client/assets/{use-collections-CSzXbKpT.js → use-collections-BENY1kCP.js} +1 -1
  192. package/dist/client/assets/{use-connection-DWiJ60zQ.js → use-connection-DYg5H00C.js} +1 -1
  193. package/dist/client/assets/{use-copy-B92V5YyR.js → use-copy-CeVxNpud.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-CznuB8H8.js → use-create-virtual-mcp-izJw-zXR.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-Dlx1T484.js → use-debounced-autosave-DSCKWvQF.js} +1 -1
  196. package/dist/client/assets/{use-delete-connection-DflATvAp.js → use-delete-connection-DP7dz4xf.js} +1 -1
  197. package/dist/client/assets/{use-file-configs-SLkVSBqH.js → use-file-configs-B9X5drJT.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-BovhyqJC.js → use-infinite-scroll--_mmqYnT.js} +1 -1
  199. package/dist/client/assets/{use-list-state-Bq0IeuWL.js → use-list-state-DsyTKO23.js} +1 -1
  200. package/dist/client/assets/{use-mcp-client-4hZRsKeH.js → use-mcp-client-CLwLq9Vl.js} +1 -1
  201. package/dist/client/assets/{use-mcp-prompts-DW6p58bx.js → use-mcp-prompts-B267X-_C.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-DahL_-yT.js → use-mcp-tools-D4ZIO9iv.js} +1 -1
  203. package/dist/client/assets/{use-members-CJ3raof8.js → use-members-CPWF2UIp.js} +1 -1
  204. package/dist/client/assets/{use-navigate-to-agent-CG5oz4s3.js → use-navigate-to-agent-B002vpC6.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-CUK5hmPG.js → use-org-auth-client-bsfac5xt.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-B2AgOe3M.js → use-org-sso-C1kwoIRD.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-k4iypw0t.js → use-organization-roles-_DPpq5Wg.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-C5AMVC8s.js → use-organization-settings-25l1s_BF.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-YslMFzn6.js → use-registry-connections-CMrhWNW5.js} +1 -1
  210. package/dist/client/assets/{use-secrets-D9xuZ4ne.js → use-secrets-B00xpt4M.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-BZklskfJ.js → use-status-sounds-C7cE6rna.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-D5aD93Zo.js → use-view-mode-BrzlZey1.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-Csq3tX42.js → use-virtual-mcp-BgfAZ5Jr.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-mF7h7Kib.js +1 -0
  215. package/dist/client/assets/{useRouterState-C9mG29tS.js → useRouterState-CcHttnTA.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-D6t37oXN.js +1 -0
  217. package/dist/client/assets/{user-BLO2fGFf.js → user-D2mv81pj.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-4w01MVLK.js → view-mode-toggle-dEyORvRn.js} +1 -1
  219. package/dist/client/assets/{watch-sse-pool-DpnWhDEt.js → watch-sse-pool-ymdzZonG.js} +1 -1
  220. package/dist/client/assets/{workflow-D13SKBQn.js → workflow-BhoGGrwE.js} +1 -1
  221. package/dist/client/assets/workflow-detail-y0Js5k1o.js +1 -0
  222. package/dist/client/index.html +1 -1
  223. package/dist/server/cli.js +69 -69
  224. package/dist/server/server.js +102 -102
  225. package/package.json +1 -1
  226. package/dist/client/assets/app-editor-8FQlu5Bg.js +0 -1
  227. package/dist/client/assets/decopilot-sse-pool-BvjD1ex-.js +0 -1
  228. package/dist/client/assets/page-seo-sheet-BmI1u_IU.js +0 -1
  229. package/dist/client/assets/project-app-view-C-BhQ4Z6.js +0 -1
  230. package/dist/client/assets/record-editor-vpJHbkV7.js +0 -1
  231. package/dist/client/assets/registry-B-LobrAM.js +0 -2
  232. package/dist/client/assets/save-referenced-block-D7Am-8ol.js +0 -1
  233. package/dist/client/assets/shell-route-loading-ByskgJGc.js +0 -1
  234. package/dist/client/assets/store-registry-DmabX9qc.js +0 -2
  235. package/dist/client/assets/useInfiniteQuery-DFIrNW-C.js +0 -1
  236. package/dist/client/assets/useSuspenseInfiniteQuery-kjS8l72l.js +0 -1
  237. package/dist/client/assets/workflow-detail-W7As-1ka.js +0 -1
@@ -1 +1 @@
1
- import{r,j as e,l as d}from"./index-DElySjov.js";function m(){const[s,i]=r.useState("loading"),[o,l]=r.useState(null),c=r.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),a=t.get("code"),n=t.get("state");if(!a||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:a,stateToken:n},window.location.origin),i("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),l(t instanceof Error?t.message:String(t)),i("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(d,{size:32,className:"animate-spin text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s==="error"?"Authentication Failed":s==="success"?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:o}),e.jsx("p",{className:"mt-2",children:"This window will close automatically."})]}):s==="success"?e.jsx("p",{children:"Authentication complete. This window will close automatically."}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{m as default};
1
+ import{r,j as e,l as d}from"./index-3ttoiVWU.js";function m(){const[s,i]=r.useState("loading"),[o,l]=r.useState(null),c=r.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),a=t.get("code"),n=t.get("state");if(!a||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:a,stateToken:n},window.location.origin),i("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),l(t instanceof Error?t.message:String(t)),i("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(d,{size:32,className:"animate-spin text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s==="error"?"Authentication Failed":s==="success"?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:o}),e.jsx("p",{className:"mt-2",children:"This window will close automatically."})]}):s==="success"?e.jsx("p",{children:"Authentication complete. This window will close automatically."}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{m as default};
@@ -1 +1 @@
1
- import{e as K,j as t,b as me,l as Q,a as ne,r as F,m as he,K as pe,B as oe,c as H,n as de}from"./index-DElySjov.js";import{R as xe}from"./required-auth-layout-D9j7jy0d.js";import{A as Y}from"./auth-split-layout-CX30rRHT.js";import{A as ee}from"./avatar-C15JHojT.js";import{I as be}from"./input-Cdm1NEie.js";import{L as je}from"./label-Vh7XtQX1.js";import{S as ye}from"./switch-DKWXZfes.js";import{t as Ne,a as ve}from"./Users03--pS_AKxh.js";import{i as we}from"./CheckCircle-CAOK_nhg.js";import{t as Se,a as ke}from"./Palette-CcCpCoEe.js";import{i as ze}from"./Upload01-CXSIztYx.js";import"./useRouterState-C9mG29tS.js";import"./User01-eSBkatOS.js";const Ce=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function le(r){return r.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function He(){const r=K.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(_e,{})}),r[0]=e):e=r[0],e}function te(r){const e=K.c(13),{title:g,description:l,logoUrl:f,logoFallback:s}=r;let a;e[0]!==s||e[1]!==f?(a=t.jsx("div",{children:f?t.jsx(ee,{url:f,fallback:s??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=s,e[1]=f,e[2]=a):a=e[2];let i;e[3]!==g?(i=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:g}),e[3]=g,e[4]=i):i=e[4];let o;e[5]!==l?(o=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:l}),e[5]=l,e[6]=o):o=e[6];let h;e[7]!==i||e[8]!==o?(h=t.jsxs("div",{className:"space-y-2",children:[i,o]}),e[7]=i,e[8]=o,e[9]=h):h=e[9];let n;return e[10]!==a||e[11]!==h?(n=t.jsxs("div",{className:"grid gap-10",children:[a,h]}),e[10]=a,e[11]=h,e[12]=n):n=e[12],n}function _e(){const r=K.c(4),{data:e,isPending:g}=me.useSession();if(g){let a;return r[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Y,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(Q,{size:14,className:"animate-spin text-muted-foreground"})})}),r[0]=a):a=r[0],a}const l=e?.user?.email??"",f=e?.user?.name;let s;return r[1]!==f||r[2]!==l?(s=t.jsx(Oe,{email:l,userName:f}),r[1]=f,r[2]=l,r[3]=s):s=r[3],s}function Oe(r){const e=K.c(70),{email:g,userName:l}=r;let f,s,a,i,o,h;if(e[0]!==g||e[1]!==l){a=g.split("@")[1]?.toLowerCase()??"",i=!!a&&!Ce.has(a);const m=a.split(".")[0]??"";s=m.charAt(0).toUpperCase()+m.slice(1);let x;e[8]!==s||e[9]!==i||e[10]!==l?(x=i?s:l?.split(" ")[0]??"",e[8]=s,e[9]=i,e[10]=l,e[11]=x):x=e[11],f=x,h=he,o=pe.domainLookup(a),e[0]=g,e[1]=l,e[2]=f,e[3]=s,e[4]=a,e[5]=i,e[6]=o,e[7]=h}else f=e[2],s=e[3],a=e[4],i=e[5],o=e[6],h=e[7];let n;e[12]!==i||e[13]!==o?(n={queryKey:o,queryFn:Ae,enabled:i},e[12]=i,e[13]=o,e[14]=n):n=e[14];const{data:v,isLoading:d}=h(n);let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k={mutationFn:Pe},e[15]=k):k=e[15];const c=ne(k),[D,P]=F.useState(!1);if(d){let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Q,{size:14,className:"animate-spin text-muted-foreground"}),e[16]=m):m=e[16];let x;return e[17]!==a?(x=t.jsx(Y,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[m,t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Checking ",a,"..."]})]})}),e[17]=a,e[18]=x):x=e[18],x}let E,y,z;if(e[19]!==D||e[20]!==s||e[21]!==v?.organizations||e[22]!==a||e[23]!==i||e[24]!==c||e[25]!==l){z=Symbol.for("react.early_return_sentinel");e:{y=v?.organizations??[];const m=y.filter(Ee);E=y.length>0;const x=m.length>0,N=c.variables??null;if(D){let u;e[29]!==l?(u=l?.split(" ")[0]??"",e[29]=l,e[30]=u):u=e[30];let b;e[31]===Symbol.for("react.memo_cache_sentinel")?(b=()=>P(!1),e[31]=b):b=e[31];let p;e[32]!==s||e[33]!==a||e[34]!==i||e[35]!==u?(p=t.jsx(re,{isCorporateEmail:i,emailDomain:a,domainLabel:s,defaultName:u,allowDomainClaim:!1,onBack:b}),e[32]=s,e[33]=a,e[34]=i,e[35]=u,e[36]=p):p=e[36],z=p;break e}if(x){const u=m.length===1?"You have access to an organization":"You have access to multiple organizations",b=m.length===1?"Your email domain matches an existing organization.":"Your email domain matches more than one. Pick one to join.";let p;e[37]!==u||e[38]!==b?(p=t.jsx(te,{title:u,description:b}),e[37]=u,e[38]=b,e[39]=p):p=e[39];let w;e[40]!==a||e[41]!==c||e[42]!==N?(w=O=>{const G=c.isPending&&N===O.slug;return t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[t.jsx(ee,{url:O.logo??`https://www.google.com/s2/favicons?domain=${a}&sz=128`,fallback:O.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:O.name}),t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",a]})]}),t.jsx(oe,{size:"default",onClick:()=>c.mutate(O.slug),disabled:c.isPending,children:G?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Q,{size:14,className:"animate-spin"})," ","Joining..."]}):"Join"})]},O.id)},e[40]=a,e[41]=c,e[42]=N,e[43]=w):w=e[43];const _=t.jsx("div",{className:"grid gap-2",children:m.map(w)});let S;e[44]!==c.error?(S=c.error&&t.jsx("p",{className:"text-xs text-destructive",children:c.error instanceof Error?c.error.message:"Failed to join organization"}),e[44]=c.error,e[45]=S):S=e[45];let $;e[46]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:()=>P(!0),children:"Create a new organization instead"}),e[46]=$):$=e[46];let L;e[47]!==_||e[48]!==S||e[49]!==p?(L=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[p,_,S,$]})}),e[47]=_,e[48]=S,e[49]=p,e[50]=L):L=e[50],z=L;break e}}e[19]=D,e[20]=s,e[21]=v?.organizations,e[22]=a,e[23]=i,e[24]=c,e[25]=l,e[26]=E,e[27]=y,e[28]=z}else E=e[26],y=e[27],z=e[28];if(z!==Symbol.for("react.early_return_sentinel"))return z;if(E){const m=y.length===1?`${y[0].name} is already set up`:`${y.length} organizations use @${a}`,x=y.length===1?"This organization doesn't have auto-join enabled.":"None of them have auto-join enabled — ask an admin for an invitation, or create your own.";let N;e[51]!==m||e[52]!==x?(N=t.jsx(te,{title:m,description:x}),e[51]=m,e[52]=x,e[53]=N):N=e[53];let u;if(e[54]!==a||e[55]!==y){let _;e[57]!==a?(_=S=>t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[t.jsx(ee,{url:S.logo??`https://www.google.com/s2/favicons?domain=${a}&sz=128`,fallback:S.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:S.name}),t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",a]})]}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Ask admin for invitation"})]},S.id),e[57]=a,e[58]=_):_=e[58],u=y.map(_),e[54]=a,e[55]=y,e[56]=u}else u=e[56];let b;e[59]!==u?(b=t.jsx("div",{className:"grid gap-2",children:u}),e[59]=u,e[60]=b):b=e[60];let p;e[61]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(oe,{size:"xl",className:"w-full",onClick:()=>P(!0),children:"Create a new organization"}),e[61]=p):p=e[61];let w;return e[62]!==b||e[63]!==N?(w=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[N,b,p]})}),e[62]=b,e[63]=N,e[64]=w):w=e[64],w}let A;return e[65]!==f||e[66]!==s||e[67]!==a||e[68]!==i?(A=t.jsx(re,{isCorporateEmail:i,emailDomain:a,domainLabel:s,defaultName:f}),e[65]=f,e[66]=s,e[67]=a,e[68]=i,e[69]=A):A=e[69],A}function Ee(r){return r.autoJoinEnabled}async function Pe(r){const e=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r})}),g=await e.json();if(!e.ok||!g.success)throw new Error(g.error||"Failed to join organization");window.location.href=`/${g.slug}`}async function Ae(){return(await fetch("/api/auth/custom/domain-lookup",{credentials:"include"})).json()}function re(r){const e=K.c(70),{isCorporateEmail:g,emailDomain:l,domainLabel:f,defaultName:s,allowDomainClaim:a,onBack:i}=r,o=a===void 0?!0:a,h=g&&o?`https://www.google.com/s2/favicons?domain=${l}&sz=128`:null,[n,v]=F.useState(s),[d,k]=F.useState(h),[c,D]=F.useState(!0),[P,E]=F.useState(null);let y;e[0]!==c||e[1]!==d||e[2]!==n?(y=async()=>{const j=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n.trim()||void 0,logo:d??void 0,claimDomain:c})}),C=await j.json();if(!j.ok||!C.success)throw new Error(C.error||"Failed to set up organization");return C},e[0]=c,e[1]=d,e[2]=n,e[3]=y):y=e[3];let z;e[4]!==c?(z=j=>{if(!j.slug)return;const C=ue.filter(ge=>c||!ge.claimOnly).length,W=fe*(C-1)+800;E(j.slug),setTimeout(()=>{window.location.href=`/${j.slug}`},W)},e[4]=c,e[5]=z):z=e[5];let A;e[6]!==y||e[7]!==z?(A={mutationFn:y,onSuccess:z},e[6]=y,e[7]=z,e[8]=A):A=e[8];const m=ne(A);let x;e[9]!==d||e[10]!==n?(x={mutationFn:async()=>{const j=n.trim(),C=le(j);if(!C)throw new Error("Invalid organization name");const W=await me.organization.create({name:j,slug:C,...d?{logo:d}:{}});if(W?.error)throw new Error(W.error.message||"Failed to create organization");window.location.href=`/${W?.data?.slug??C}`}},e[9]=d,e[10]=n,e[11]=x):x=e[11];const N=ne(x);if(m.isPending||P){let j;e[12]!==f||e[13]!==n?(j=n.trim()||f,e[12]=f,e[13]=n,e[14]=j):j=e[14];let C;return e[15]!==c||e[16]!==l||e[17]!==d||e[18]!==j?(C=t.jsx(Y,{children:t.jsx(Fe,{orgName:j,domain:l,claimDomain:c,logoUrl:d})}),e[15]=c,e[16]=l,e[17]=d,e[18]=j,e[19]=C):C=e[19],C}const u=N.isPending;let b;e[20]!==n?(b=le(n.trim()),e[20]=n,e[21]=b):b=e[21];const p=!!b,w=m.error||N.error||null;let _;e[22]!==o||e[23]!==p||e[24]!==N||e[25]!==m||e[26]!==g?(_=j=>{j.preventDefault(),p&&(g&&o?m.mutate():N.mutate())},e[22]=o,e[23]=p,e[24]=N,e[25]=m,e[26]=g,e[27]=_):_=e[27];const S=_;let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(te,{title:"Welcome to deco",description:"Set up your organization to get started"}),e[28]=$):$=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:"Organization avatar"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional"})]}),e[29]=L):L=e[29];let O;e[30]!==s||e[31]!==n?(O=(n.trim()||s||"?").charAt(0).toUpperCase(),e[30]=s,e[31]=n,e[32]=O):O=e[32];const G=u||m.isPending;let R;e[33]!==d||e[34]!==O||e[35]!==G?(R=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[L,t.jsx($e,{value:d,fallback:O,onChange:k,disabled:G})]}),e[33]=d,e[34]=O,e[35]=G,e[36]=R):R=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(je,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:"Organization name"}),e[37]=V):V=e[37];let X;e[38]===Symbol.for("react.memo_cache_sentinel")?(X=j=>v(j.target.value),e[38]=X):X=e[38];const ae=s||"My Organization",se=u||m.isPending;let T;e[39]!==n||e[40]!==ae||e[41]!==se?(T=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[V,t.jsx(be,{id:"org-name",value:n,onChange:X,placeholder:ae,disabled:se,className:"h-10 max-w-[220px]"})]}),e[39]=n,e[40]=ae,e[41]=se,e[42]=T):T=e[42];let U;e[43]!==o||e[44]!==c||e[45]!==m.isPending||e[46]!==l||e[47]!==g||e[48]!==u?(U=g&&o&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsxs("p",{className:"text-sm font-medium",children:["Allow @",l," sign-ups"]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anyone with a verified @",l," email can join this org"]})]}),t.jsx(ye,{checked:c,onCheckedChange:D,disabled:u||m.isPending})]}),e[43]=o,e[44]=c,e[45]=m.isPending,e[46]=l,e[47]=g,e[48]=u,e[49]=U):U=e[49];let M;e[50]!==R||e[51]!==T||e[52]!==U?(M=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[R,T,U]}),e[50]=R,e[51]=T,e[52]=U,e[53]=M):M=e[53];let I;e[54]!==w?(I=w&&t.jsx("p",{className:"text-xs text-destructive",children:w instanceof Error?w.message:"Failed to create organization"}),e[54]=w,e[55]=I):I=e[55];const ie=!p||u||m.isPending;let J;e[56]!==m.isPending||e[57]!==u?(J=u||m.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Q,{size:14,className:"animate-spin"})," Creating..."]}):"Continue",e[56]=m.isPending,e[57]=u,e[58]=J):J=e[58];let q;e[59]!==ie||e[60]!==J?(q=t.jsx(oe,{type:"submit",size:"xl",className:"w-full",disabled:ie,children:J}),e[59]=ie,e[60]=J,e[61]=q):q=e[61];let B;e[62]!==i?(B=i&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:i,children:"See available organizations"}),e[62]=i,e[63]=B):B=e[63];let Z;return e[64]!==S||e[65]!==M||e[66]!==I||e[67]!==q||e[68]!==B?(Z=t.jsx(Y,{children:t.jsxs("form",{onSubmit:S,className:"grid gap-10",children:[$,M,I,q,B]})}),e[64]=S,e[65]=M,e[66]=I,e[67]=q,e[68]=B,e[69]=Z):Z=e[69],Z}function $e(r){const e=K.c(14),{value:g,fallback:l,onChange:f,disabled:s}=r,a=F.useRef(null);let i;e[0]!==f?(i=D=>{const P=D.target.files?.[0];if(!P)return;if(P.size>2097152){de.error("Image must be smaller than 2MB"),a.current&&(a.current.value="");return}const E=new FileReader;E.onerror=Le,E.onloadend=()=>{E.result&&f(E.result),a.current&&(a.current.value="")},E.readAsDataURL(P)},e[0]=f,e[1]=i):i=e[1];const o=i;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>a.current?.click(),e[2]=h):h=e[2];let n;e[3]!==s||e[4]!==o?(n=t.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:s}),e[3]=s,e[4]=o,e[5]=n):n=e[5];const v=g??void 0;let d;e[6]!==l||e[7]!==v?(d=t.jsx(ee,{url:v,fallback:l,shape:"square",size:"base"}),e[6]=l,e[7]=v,e[8]=d):d=e[8];let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ze,{size:14,className:"text-white"})}),e[9]=k):k=e[9];let c;return e[10]!==s||e[11]!==n||e[12]!==d?(c=t.jsxs("button",{type:"button",onClick:h,disabled:s,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":"Upload organization logo",children:[n,d,k]}),e[10]=s,e[11]=n,e[12]=d,e[13]=c):c=e[13],c}function Le(){return de.error("Failed to read image")}const ue=[{icon:Ne,label:"Creating organization",claimOnly:!1},{icon:Se,label:"Claiming email domain",claimOnly:!0},{icon:ve,label:"Enabling auto-join for your team",claimOnly:!0},{icon:ke,label:"Extracting brand context",claimOnly:!1}],fe=1500,ce=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Fe({orgName:r,domain:e,claimDomain:g,logoUrl:l}){const f=ue.filter(o=>g||!o.claimOnly),[s,a]=F.useState(0),i=F.useRef(!1);if(!i.current){i.current=!0;for(let o=1;o<f.length;o++)setTimeout(()=>a(o),fe*o)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(te,{title:`Setting up ${r}`,description:`Getting everything ready from ${e}`,logoUrl:l??null,logoFallback:r.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:f.map((o,h)=>{const n=o.icon,v=h===s,d=h<s,k=ce[h%ce.length];return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:d||v?1:.4},children:[t.jsxs("span",{className:H("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!d&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:d?{backgroundColor:k.bg,color:k.fg}:void 0,children:[t.jsx(we,{size:16,className:H("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",d?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(Q,{size:16,className:H("absolute animate-spin","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0"),"aria-hidden":"true"}),t.jsx(n,{size:16,className:H("absolute motion-safe:transition-opacity motion-safe:duration-200",!d&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:H("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||d?"text-foreground":"text-muted-foreground"),children:o.label})]},o.label)})})]})}export{He as default};
1
+ import{e as K,j as t,b as me,l as Q,a as ne,r as F,m as he,K as pe,B as oe,c as H,n as de}from"./index-3ttoiVWU.js";import{R as xe}from"./required-auth-layout-1KnSml1h.js";import{A as Y}from"./auth-split-layout-D-gXvj1z.js";import{A as ee}from"./avatar-BqZJEvBP.js";import{I as be}from"./input-DVih3Sjm.js";import{L as je}from"./label-C0uUNmvX.js";import{S as ye}from"./switch-DDUT3a8C.js";import{t as Ne,a as ve}from"./Users03-DE6tDcyz.js";import{i as we}from"./CheckCircle-CGJnw6dP.js";import{t as Se,a as ke}from"./Palette-EMfX7hNs.js";import{i as ze}from"./Upload01-CBpPl05N.js";import"./useRouterState-CcHttnTA.js";import"./User01-CChZgMNn.js";const Ce=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function le(r){return r.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function He(){const r=K.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(_e,{})}),r[0]=e):e=r[0],e}function te(r){const e=K.c(13),{title:g,description:l,logoUrl:f,logoFallback:s}=r;let a;e[0]!==s||e[1]!==f?(a=t.jsx("div",{children:f?t.jsx(ee,{url:f,fallback:s??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=s,e[1]=f,e[2]=a):a=e[2];let i;e[3]!==g?(i=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:g}),e[3]=g,e[4]=i):i=e[4];let o;e[5]!==l?(o=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:l}),e[5]=l,e[6]=o):o=e[6];let h;e[7]!==i||e[8]!==o?(h=t.jsxs("div",{className:"space-y-2",children:[i,o]}),e[7]=i,e[8]=o,e[9]=h):h=e[9];let n;return e[10]!==a||e[11]!==h?(n=t.jsxs("div",{className:"grid gap-10",children:[a,h]}),e[10]=a,e[11]=h,e[12]=n):n=e[12],n}function _e(){const r=K.c(4),{data:e,isPending:g}=me.useSession();if(g){let a;return r[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Y,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(Q,{size:14,className:"animate-spin text-muted-foreground"})})}),r[0]=a):a=r[0],a}const l=e?.user?.email??"",f=e?.user?.name;let s;return r[1]!==f||r[2]!==l?(s=t.jsx(Oe,{email:l,userName:f}),r[1]=f,r[2]=l,r[3]=s):s=r[3],s}function Oe(r){const e=K.c(70),{email:g,userName:l}=r;let f,s,a,i,o,h;if(e[0]!==g||e[1]!==l){a=g.split("@")[1]?.toLowerCase()??"",i=!!a&&!Ce.has(a);const m=a.split(".")[0]??"";s=m.charAt(0).toUpperCase()+m.slice(1);let x;e[8]!==s||e[9]!==i||e[10]!==l?(x=i?s:l?.split(" ")[0]??"",e[8]=s,e[9]=i,e[10]=l,e[11]=x):x=e[11],f=x,h=he,o=pe.domainLookup(a),e[0]=g,e[1]=l,e[2]=f,e[3]=s,e[4]=a,e[5]=i,e[6]=o,e[7]=h}else f=e[2],s=e[3],a=e[4],i=e[5],o=e[6],h=e[7];let n;e[12]!==i||e[13]!==o?(n={queryKey:o,queryFn:Ae,enabled:i},e[12]=i,e[13]=o,e[14]=n):n=e[14];const{data:v,isLoading:d}=h(n);let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k={mutationFn:Pe},e[15]=k):k=e[15];const c=ne(k),[D,P]=F.useState(!1);if(d){let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Q,{size:14,className:"animate-spin text-muted-foreground"}),e[16]=m):m=e[16];let x;return e[17]!==a?(x=t.jsx(Y,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[m,t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Checking ",a,"..."]})]})}),e[17]=a,e[18]=x):x=e[18],x}let E,y,z;if(e[19]!==D||e[20]!==s||e[21]!==v?.organizations||e[22]!==a||e[23]!==i||e[24]!==c||e[25]!==l){z=Symbol.for("react.early_return_sentinel");e:{y=v?.organizations??[];const m=y.filter(Ee);E=y.length>0;const x=m.length>0,N=c.variables??null;if(D){let u;e[29]!==l?(u=l?.split(" ")[0]??"",e[29]=l,e[30]=u):u=e[30];let b;e[31]===Symbol.for("react.memo_cache_sentinel")?(b=()=>P(!1),e[31]=b):b=e[31];let p;e[32]!==s||e[33]!==a||e[34]!==i||e[35]!==u?(p=t.jsx(re,{isCorporateEmail:i,emailDomain:a,domainLabel:s,defaultName:u,allowDomainClaim:!1,onBack:b}),e[32]=s,e[33]=a,e[34]=i,e[35]=u,e[36]=p):p=e[36],z=p;break e}if(x){const u=m.length===1?"You have access to an organization":"You have access to multiple organizations",b=m.length===1?"Your email domain matches an existing organization.":"Your email domain matches more than one. Pick one to join.";let p;e[37]!==u||e[38]!==b?(p=t.jsx(te,{title:u,description:b}),e[37]=u,e[38]=b,e[39]=p):p=e[39];let w;e[40]!==a||e[41]!==c||e[42]!==N?(w=O=>{const G=c.isPending&&N===O.slug;return t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[t.jsx(ee,{url:O.logo??`https://www.google.com/s2/favicons?domain=${a}&sz=128`,fallback:O.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:O.name}),t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",a]})]}),t.jsx(oe,{size:"default",onClick:()=>c.mutate(O.slug),disabled:c.isPending,children:G?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Q,{size:14,className:"animate-spin"})," ","Joining..."]}):"Join"})]},O.id)},e[40]=a,e[41]=c,e[42]=N,e[43]=w):w=e[43];const _=t.jsx("div",{className:"grid gap-2",children:m.map(w)});let S;e[44]!==c.error?(S=c.error&&t.jsx("p",{className:"text-xs text-destructive",children:c.error instanceof Error?c.error.message:"Failed to join organization"}),e[44]=c.error,e[45]=S):S=e[45];let $;e[46]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:()=>P(!0),children:"Create a new organization instead"}),e[46]=$):$=e[46];let L;e[47]!==_||e[48]!==S||e[49]!==p?(L=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[p,_,S,$]})}),e[47]=_,e[48]=S,e[49]=p,e[50]=L):L=e[50],z=L;break e}}e[19]=D,e[20]=s,e[21]=v?.organizations,e[22]=a,e[23]=i,e[24]=c,e[25]=l,e[26]=E,e[27]=y,e[28]=z}else E=e[26],y=e[27],z=e[28];if(z!==Symbol.for("react.early_return_sentinel"))return z;if(E){const m=y.length===1?`${y[0].name} is already set up`:`${y.length} organizations use @${a}`,x=y.length===1?"This organization doesn't have auto-join enabled.":"None of them have auto-join enabled — ask an admin for an invitation, or create your own.";let N;e[51]!==m||e[52]!==x?(N=t.jsx(te,{title:m,description:x}),e[51]=m,e[52]=x,e[53]=N):N=e[53];let u;if(e[54]!==a||e[55]!==y){let _;e[57]!==a?(_=S=>t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[t.jsx(ee,{url:S.logo??`https://www.google.com/s2/favicons?domain=${a}&sz=128`,fallback:S.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:S.name}),t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",a]})]}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Ask admin for invitation"})]},S.id),e[57]=a,e[58]=_):_=e[58],u=y.map(_),e[54]=a,e[55]=y,e[56]=u}else u=e[56];let b;e[59]!==u?(b=t.jsx("div",{className:"grid gap-2",children:u}),e[59]=u,e[60]=b):b=e[60];let p;e[61]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(oe,{size:"xl",className:"w-full",onClick:()=>P(!0),children:"Create a new organization"}),e[61]=p):p=e[61];let w;return e[62]!==b||e[63]!==N?(w=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[N,b,p]})}),e[62]=b,e[63]=N,e[64]=w):w=e[64],w}let A;return e[65]!==f||e[66]!==s||e[67]!==a||e[68]!==i?(A=t.jsx(re,{isCorporateEmail:i,emailDomain:a,domainLabel:s,defaultName:f}),e[65]=f,e[66]=s,e[67]=a,e[68]=i,e[69]=A):A=e[69],A}function Ee(r){return r.autoJoinEnabled}async function Pe(r){const e=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r})}),g=await e.json();if(!e.ok||!g.success)throw new Error(g.error||"Failed to join organization");window.location.href=`/${g.slug}`}async function Ae(){return(await fetch("/api/auth/custom/domain-lookup",{credentials:"include"})).json()}function re(r){const e=K.c(70),{isCorporateEmail:g,emailDomain:l,domainLabel:f,defaultName:s,allowDomainClaim:a,onBack:i}=r,o=a===void 0?!0:a,h=g&&o?`https://www.google.com/s2/favicons?domain=${l}&sz=128`:null,[n,v]=F.useState(s),[d,k]=F.useState(h),[c,D]=F.useState(!0),[P,E]=F.useState(null);let y;e[0]!==c||e[1]!==d||e[2]!==n?(y=async()=>{const j=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n.trim()||void 0,logo:d??void 0,claimDomain:c})}),C=await j.json();if(!j.ok||!C.success)throw new Error(C.error||"Failed to set up organization");return C},e[0]=c,e[1]=d,e[2]=n,e[3]=y):y=e[3];let z;e[4]!==c?(z=j=>{if(!j.slug)return;const C=ue.filter(ge=>c||!ge.claimOnly).length,W=fe*(C-1)+800;E(j.slug),setTimeout(()=>{window.location.href=`/${j.slug}`},W)},e[4]=c,e[5]=z):z=e[5];let A;e[6]!==y||e[7]!==z?(A={mutationFn:y,onSuccess:z},e[6]=y,e[7]=z,e[8]=A):A=e[8];const m=ne(A);let x;e[9]!==d||e[10]!==n?(x={mutationFn:async()=>{const j=n.trim(),C=le(j);if(!C)throw new Error("Invalid organization name");const W=await me.organization.create({name:j,slug:C,...d?{logo:d}:{}});if(W?.error)throw new Error(W.error.message||"Failed to create organization");window.location.href=`/${W?.data?.slug??C}`}},e[9]=d,e[10]=n,e[11]=x):x=e[11];const N=ne(x);if(m.isPending||P){let j;e[12]!==f||e[13]!==n?(j=n.trim()||f,e[12]=f,e[13]=n,e[14]=j):j=e[14];let C;return e[15]!==c||e[16]!==l||e[17]!==d||e[18]!==j?(C=t.jsx(Y,{children:t.jsx(Fe,{orgName:j,domain:l,claimDomain:c,logoUrl:d})}),e[15]=c,e[16]=l,e[17]=d,e[18]=j,e[19]=C):C=e[19],C}const u=N.isPending;let b;e[20]!==n?(b=le(n.trim()),e[20]=n,e[21]=b):b=e[21];const p=!!b,w=m.error||N.error||null;let _;e[22]!==o||e[23]!==p||e[24]!==N||e[25]!==m||e[26]!==g?(_=j=>{j.preventDefault(),p&&(g&&o?m.mutate():N.mutate())},e[22]=o,e[23]=p,e[24]=N,e[25]=m,e[26]=g,e[27]=_):_=e[27];const S=_;let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(te,{title:"Welcome to deco",description:"Set up your organization to get started"}),e[28]=$):$=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:"Organization avatar"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional"})]}),e[29]=L):L=e[29];let O;e[30]!==s||e[31]!==n?(O=(n.trim()||s||"?").charAt(0).toUpperCase(),e[30]=s,e[31]=n,e[32]=O):O=e[32];const G=u||m.isPending;let R;e[33]!==d||e[34]!==O||e[35]!==G?(R=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[L,t.jsx($e,{value:d,fallback:O,onChange:k,disabled:G})]}),e[33]=d,e[34]=O,e[35]=G,e[36]=R):R=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(je,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:"Organization name"}),e[37]=V):V=e[37];let X;e[38]===Symbol.for("react.memo_cache_sentinel")?(X=j=>v(j.target.value),e[38]=X):X=e[38];const ae=s||"My Organization",se=u||m.isPending;let T;e[39]!==n||e[40]!==ae||e[41]!==se?(T=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[V,t.jsx(be,{id:"org-name",value:n,onChange:X,placeholder:ae,disabled:se,className:"h-10 max-w-[220px]"})]}),e[39]=n,e[40]=ae,e[41]=se,e[42]=T):T=e[42];let U;e[43]!==o||e[44]!==c||e[45]!==m.isPending||e[46]!==l||e[47]!==g||e[48]!==u?(U=g&&o&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsxs("p",{className:"text-sm font-medium",children:["Allow @",l," sign-ups"]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anyone with a verified @",l," email can join this org"]})]}),t.jsx(ye,{checked:c,onCheckedChange:D,disabled:u||m.isPending})]}),e[43]=o,e[44]=c,e[45]=m.isPending,e[46]=l,e[47]=g,e[48]=u,e[49]=U):U=e[49];let M;e[50]!==R||e[51]!==T||e[52]!==U?(M=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[R,T,U]}),e[50]=R,e[51]=T,e[52]=U,e[53]=M):M=e[53];let I;e[54]!==w?(I=w&&t.jsx("p",{className:"text-xs text-destructive",children:w instanceof Error?w.message:"Failed to create organization"}),e[54]=w,e[55]=I):I=e[55];const ie=!p||u||m.isPending;let J;e[56]!==m.isPending||e[57]!==u?(J=u||m.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Q,{size:14,className:"animate-spin"})," Creating..."]}):"Continue",e[56]=m.isPending,e[57]=u,e[58]=J):J=e[58];let q;e[59]!==ie||e[60]!==J?(q=t.jsx(oe,{type:"submit",size:"xl",className:"w-full",disabled:ie,children:J}),e[59]=ie,e[60]=J,e[61]=q):q=e[61];let B;e[62]!==i?(B=i&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:i,children:"See available organizations"}),e[62]=i,e[63]=B):B=e[63];let Z;return e[64]!==S||e[65]!==M||e[66]!==I||e[67]!==q||e[68]!==B?(Z=t.jsx(Y,{children:t.jsxs("form",{onSubmit:S,className:"grid gap-10",children:[$,M,I,q,B]})}),e[64]=S,e[65]=M,e[66]=I,e[67]=q,e[68]=B,e[69]=Z):Z=e[69],Z}function $e(r){const e=K.c(14),{value:g,fallback:l,onChange:f,disabled:s}=r,a=F.useRef(null);let i;e[0]!==f?(i=D=>{const P=D.target.files?.[0];if(!P)return;if(P.size>2097152){de.error("Image must be smaller than 2MB"),a.current&&(a.current.value="");return}const E=new FileReader;E.onerror=Le,E.onloadend=()=>{E.result&&f(E.result),a.current&&(a.current.value="")},E.readAsDataURL(P)},e[0]=f,e[1]=i):i=e[1];const o=i;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>a.current?.click(),e[2]=h):h=e[2];let n;e[3]!==s||e[4]!==o?(n=t.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:s}),e[3]=s,e[4]=o,e[5]=n):n=e[5];const v=g??void 0;let d;e[6]!==l||e[7]!==v?(d=t.jsx(ee,{url:v,fallback:l,shape:"square",size:"base"}),e[6]=l,e[7]=v,e[8]=d):d=e[8];let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ze,{size:14,className:"text-white"})}),e[9]=k):k=e[9];let c;return e[10]!==s||e[11]!==n||e[12]!==d?(c=t.jsxs("button",{type:"button",onClick:h,disabled:s,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":"Upload organization logo",children:[n,d,k]}),e[10]=s,e[11]=n,e[12]=d,e[13]=c):c=e[13],c}function Le(){return de.error("Failed to read image")}const ue=[{icon:Ne,label:"Creating organization",claimOnly:!1},{icon:Se,label:"Claiming email domain",claimOnly:!0},{icon:ve,label:"Enabling auto-join for your team",claimOnly:!0},{icon:ke,label:"Extracting brand context",claimOnly:!1}],fe=1500,ce=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Fe({orgName:r,domain:e,claimDomain:g,logoUrl:l}){const f=ue.filter(o=>g||!o.claimOnly),[s,a]=F.useState(0),i=F.useRef(!1);if(!i.current){i.current=!0;for(let o=1;o<f.length;o++)setTimeout(()=>a(o),fe*o)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(te,{title:`Setting up ${r}`,description:`Getting everything ready from ${e}`,logoUrl:l??null,logoFallback:r.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:f.map((o,h)=>{const n=o.icon,v=h===s,d=h<s,k=ce[h%ce.length];return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:d||v?1:.4},children:[t.jsxs("span",{className:H("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!d&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:d?{backgroundColor:k.bg,color:k.fg}:void 0,children:[t.jsx(we,{size:16,className:H("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",d?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(Q,{size:16,className:H("absolute animate-spin","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0"),"aria-hidden":"true"}),t.jsx(n,{size:16,className:H("absolute motion-safe:transition-opacity motion-safe:duration-200",!d&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:H("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||d?"text-foreground":"text-muted-foreground"),children:o.label})]},o.label)})})]})}export{He as default};
@@ -1 +1 @@
1
- import{e as k,r as z,b5 as S,g as _,a0 as E,b6 as T,j as o,I as $}from"./index-DElySjov.js";const L="#f6f4ed",P="#ffffff",H=[{src:"/icons/icon-192.png",sizes:"192x192",type:"image/png"},{src:"/icons/icon-512.png",sizes:"512x512",type:"image/png"}];function R(e,n){const t=`${n}/${e.slug}`,i=[...e.logo?[{src:e.logo,sizes:"192x192",purpose:"any"},{src:e.logo,sizes:"512x512",purpose:"any"},{src:e.logo,sizes:"any",purpose:"any"}]:[],...H],l={id:t,name:e.name,short_name:e.name,start_url:t,scope:t,display:"standalone",display_override:["window-controls-overlay"],background_color:P,theme_color:L,icons:i};return`data:application/manifest+json,${encodeURIComponent(JSON.stringify(l))}`}function O(e){const n=document.querySelector(`link[rel="${e}"]`);if(n)return n;const t=document.createElement("link");return t.rel=e,document.head.appendChild(t),t}function U(e){const n=document.querySelector(`meta[name="${e}"]`);if(n)return n;const t=document.createElement("meta");return t.name=e,document.head.appendChild(t),t}function M(e){const n=k.c(5),t=e?.name??"",i=e?.slug??"",l=e?.logo??"";let a,c;n[0]!==l||n[1]!==t||n[2]!==i?(a=()=>{if(!i||!t||typeof document>"u"||typeof window>"u")return;const d=O("manifest"),m=O("apple-touch-icon"),u=U("apple-mobile-web-app-title"),r={manifest:d.getAttribute("href"),appleIcon:m.getAttribute("href"),appleTitle:u.getAttribute("content"),title:document.title};return d.setAttribute("href",R({name:t,slug:i,logo:l||null},window.location.origin)),l&&m.setAttribute("href",l),u.setAttribute("content",t),document.title=t,S(),()=>{r.manifest!==null&&d.setAttribute("href",r.manifest),r.appleIcon!==null&&m.setAttribute("href",r.appleIcon),r.appleTitle!==null&&u.setAttribute("content",r.appleTitle),document.title=r.title,S()}},c=[t,i,l],n[0]=l,n[1]=t,n[2]=i,n[3]=a,n[4]=c):(a=n[3],c=n[4]),z.useLayoutEffect(a,c)}function q(){const e=k.c(31);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const{org:t}=_(n),{data:i}=E();let l;e[1]!==i||e[2]!==t?(l=i?.find(N=>N.slug===t),e[1]=i,e[2]=t,e[3]=l):l=e[3];const a=l;let c;e[4]!==a?(c=a?{name:a.name,slug:a.slug,logo:a.logo??null}:null,e[4]=a,e[5]=c):c=e[5],M(c);const{canPrompt:d,installed:m,ios:u,promptInstall:r}=T(),[y,w]=z.useState(null),s=a?.name??"this organization",C=a?.logo;let b;e[6]!==s||e[7]!==r?(b=async()=>{const N=await r();w(N==="accepted"?`Installing ${s}…`:N==="dismissed"?"Install dismissed.":null)},e[6]=s,e[7]=r,e[8]=b):b=e[8];const I=b,A=C||"/icons/icon-192.png";let p;e[9]!==s||e[10]!==A?(p=o.jsx("img",{src:A,alt:s,className:"size-20 rounded-2xl border border-border/50 object-cover"}),e[9]=s,e[10]=A,e[11]=p):p=e[11];let f;e[12]!==s?(f=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("h1",{className:"text-xl font-semibold text-foreground",children:["Add ",s," to your Home Screen"]}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Install ",s," as its own app — a standalone window that opens straight into this organization. To install the full deco Studio app instead, use your browser's “Add to Home Screen” from any other page."]})]}),e[12]=s,e[13]=f):f=e[13];let g;e[14]!==d||e[15]!==I||e[16]!==m||e[17]!==u||e[18]!==s||e[19]!==y?(g=m?o.jsxs("p",{className:"rounded-lg bg-muted px-4 py-3 text-sm text-foreground",children:[s," is already installed on this device."]}):u?o.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted px-4 py-3 text-sm text-foreground",children:[o.jsx("p",{className:"font-medium",children:"Install on iOS"}),o.jsxs("p",{className:"text-muted-foreground",children:["Tap the ",o.jsx("span",{className:"font-medium",children:"Share"})," button, then choose ",o.jsx("span",{className:"font-medium",children:"Add to Home Screen"}),"."]})]}):d?o.jsxs("div",{className:"flex flex-col items-center gap-3",children:[o.jsxs("button",{type:"button",onClick:I,className:"rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:["Add ",s," to Home Screen"]}),y&&o.jsx("p",{className:"text-sm text-muted-foreground",children:y})]}):o.jsxs("p",{className:"rounded-lg bg-muted px-4 py-3 text-sm text-muted-foreground",children:["To install, open your browser's menu and choose"," ",o.jsxs("span",{className:"font-medium text-foreground",children:["Install ",s]})," ","(or “Add to Home Screen”). If you don't see it yet, interact with the app for a moment and try again."]}),e[14]=d,e[15]=I,e[16]=m,e[17]=u,e[18]=s,e[19]=y,e[20]=g):g=e[20];const v=t??"";let x;e[21]!==v?(x={org:v},e[21]=v,e[22]=x):x=e[22];let h;e[23]!==s||e[24]!==x?(h=o.jsxs($,{to:"/$org",params:x,className:"text-sm text-primary hover:underline",replace:!0,children:["Back to ",s]}),e[23]=s,e[24]=x,e[25]=h):h=e[25];let j;return e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==g?(j=o.jsx("div",{className:"flex min-h-dvh items-center justify-center bg-background p-6",children:o.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-6 text-center",children:[p,f,g,h]})}),e[26]=h,e[27]=p,e[28]=f,e[29]=g,e[30]=j):j=e[30],j}export{q as default};
1
+ import{e as k,r as z,b5 as S,g as _,a0 as E,b6 as T,j as o,I as $}from"./index-3ttoiVWU.js";const L="#f6f4ed",P="#ffffff",H=[{src:"/icons/icon-192.png",sizes:"192x192",type:"image/png"},{src:"/icons/icon-512.png",sizes:"512x512",type:"image/png"}];function R(e,n){const t=`${n}/${e.slug}`,i=[...e.logo?[{src:e.logo,sizes:"192x192",purpose:"any"},{src:e.logo,sizes:"512x512",purpose:"any"},{src:e.logo,sizes:"any",purpose:"any"}]:[],...H],l={id:t,name:e.name,short_name:e.name,start_url:t,scope:t,display:"standalone",display_override:["window-controls-overlay"],background_color:P,theme_color:L,icons:i};return`data:application/manifest+json,${encodeURIComponent(JSON.stringify(l))}`}function O(e){const n=document.querySelector(`link[rel="${e}"]`);if(n)return n;const t=document.createElement("link");return t.rel=e,document.head.appendChild(t),t}function U(e){const n=document.querySelector(`meta[name="${e}"]`);if(n)return n;const t=document.createElement("meta");return t.name=e,document.head.appendChild(t),t}function M(e){const n=k.c(5),t=e?.name??"",i=e?.slug??"",l=e?.logo??"";let a,c;n[0]!==l||n[1]!==t||n[2]!==i?(a=()=>{if(!i||!t||typeof document>"u"||typeof window>"u")return;const d=O("manifest"),m=O("apple-touch-icon"),u=U("apple-mobile-web-app-title"),r={manifest:d.getAttribute("href"),appleIcon:m.getAttribute("href"),appleTitle:u.getAttribute("content"),title:document.title};return d.setAttribute("href",R({name:t,slug:i,logo:l||null},window.location.origin)),l&&m.setAttribute("href",l),u.setAttribute("content",t),document.title=t,S(),()=>{r.manifest!==null&&d.setAttribute("href",r.manifest),r.appleIcon!==null&&m.setAttribute("href",r.appleIcon),r.appleTitle!==null&&u.setAttribute("content",r.appleTitle),document.title=r.title,S()}},c=[t,i,l],n[0]=l,n[1]=t,n[2]=i,n[3]=a,n[4]=c):(a=n[3],c=n[4]),z.useLayoutEffect(a,c)}function q(){const e=k.c(31);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const{org:t}=_(n),{data:i}=E();let l;e[1]!==i||e[2]!==t?(l=i?.find(N=>N.slug===t),e[1]=i,e[2]=t,e[3]=l):l=e[3];const a=l;let c;e[4]!==a?(c=a?{name:a.name,slug:a.slug,logo:a.logo??null}:null,e[4]=a,e[5]=c):c=e[5],M(c);const{canPrompt:d,installed:m,ios:u,promptInstall:r}=T(),[y,w]=z.useState(null),s=a?.name??"this organization",C=a?.logo;let b;e[6]!==s||e[7]!==r?(b=async()=>{const N=await r();w(N==="accepted"?`Installing ${s}…`:N==="dismissed"?"Install dismissed.":null)},e[6]=s,e[7]=r,e[8]=b):b=e[8];const I=b,A=C||"/icons/icon-192.png";let p;e[9]!==s||e[10]!==A?(p=o.jsx("img",{src:A,alt:s,className:"size-20 rounded-2xl border border-border/50 object-cover"}),e[9]=s,e[10]=A,e[11]=p):p=e[11];let f;e[12]!==s?(f=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("h1",{className:"text-xl font-semibold text-foreground",children:["Add ",s," to your Home Screen"]}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Install ",s," as its own app — a standalone window that opens straight into this organization. To install the full deco Studio app instead, use your browser's “Add to Home Screen” from any other page."]})]}),e[12]=s,e[13]=f):f=e[13];let g;e[14]!==d||e[15]!==I||e[16]!==m||e[17]!==u||e[18]!==s||e[19]!==y?(g=m?o.jsxs("p",{className:"rounded-lg bg-muted px-4 py-3 text-sm text-foreground",children:[s," is already installed on this device."]}):u?o.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted px-4 py-3 text-sm text-foreground",children:[o.jsx("p",{className:"font-medium",children:"Install on iOS"}),o.jsxs("p",{className:"text-muted-foreground",children:["Tap the ",o.jsx("span",{className:"font-medium",children:"Share"})," button, then choose ",o.jsx("span",{className:"font-medium",children:"Add to Home Screen"}),"."]})]}):d?o.jsxs("div",{className:"flex flex-col items-center gap-3",children:[o.jsxs("button",{type:"button",onClick:I,className:"rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:["Add ",s," to Home Screen"]}),y&&o.jsx("p",{className:"text-sm text-muted-foreground",children:y})]}):o.jsxs("p",{className:"rounded-lg bg-muted px-4 py-3 text-sm text-muted-foreground",children:["To install, open your browser's menu and choose"," ",o.jsxs("span",{className:"font-medium text-foreground",children:["Install ",s]})," ","(or “Add to Home Screen”). If you don't see it yet, interact with the app for a moment and try again."]}),e[14]=d,e[15]=I,e[16]=m,e[17]=u,e[18]=s,e[19]=y,e[20]=g):g=e[20];const v=t??"";let x;e[21]!==v?(x={org:v},e[21]=v,e[22]=x):x=e[22];let h;e[23]!==s||e[24]!==x?(h=o.jsxs($,{to:"/$org",params:x,className:"text-sm text-primary hover:underline",replace:!0,children:["Back to ",s]}),e[23]=s,e[24]=x,e[25]=h):h=e[25];let j;return e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==g?(j=o.jsx("div",{className:"flex min-h-dvh items-center justify-center bg-background p-6",children:o.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-6 text-center",children:[p,f,g,h]})}),e[26]=h,e[27]=p,e[28]=f,e[29]=g,e[30]=j):j=e[30],j}export{q as default};
@@ -1 +1 @@
1
- import{e as o,j as r,O as s}from"./index-DElySjov.js";function m(){const e=o.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx(s,{}),e[0]=t):t=e[0],t}export{m as default};
1
+ import{e as o,j as r,O as s}from"./index-3ttoiVWU.js";function m(){const e=o.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx(s,{}),e[0]=t):t=e[0],t}export{m as default};
@@ -1 +1 @@
1
- import{e as p,g as f,cj as x,j as r,r as c,l as u}from"./index-DElySjov.js";import{P as g}from"./plugin-layout-Ba8uQ5F9.js";import"./use-connection-DWiJ60zQ.js";import"./use-collections-CSzXbKpT.js";import"./use-mcp-client-4hZRsKeH.js";import"./auth-CEd3xQ2M.js";import"./studio-tools-BniDnWv9.js";import"./Settings02-Dg39zp7t.js";import"./index-BD1xF-xP.js";import"./sidebar-DUDIX5oW.js";import"./LayoutLeft-ZmlpRdpE.js";import"./tooltip-BJIwJ20V.js";import"./sheet-CUbQ8u3K.js";import"./X-Br2l6mA-.js";function z(){const e=p.c(13);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/plugins/$pluginId"},e[0]=i):i=e[0];const{pluginId:s}=f(i);let l;e[1]!==s?(l=x.find(n=>n.id===s),e[1]=s,e[2]=l):l=e[2];const t=l;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=n):n=e[3];let d;return e[4]!==t.bindingName||e[5]!==t.renderEmptyState||e[6]!==t.renderHeader?(d=r.jsx(c.Suspense,{fallback:n,children:r.jsx(g,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState})}),e[4]=t.bindingName,e[5]=t.renderEmptyState,e[6]=t.renderHeader,e[7]=d):d=e[7],d}const m=t?.LayoutComponent;if(!m){let n;return e[8]!==s?(n=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:['Plugin "',s,'" not found']})}),e[8]=s,e[9]=n):n=e[9],n}let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[10]=a):a=e[10];let o;return e[11]!==m?(o=r.jsx(c.Suspense,{fallback:a,children:r.jsx(m,{})}),e[11]=m,e[12]=o):o=e[12],o}export{z as default};
1
+ import{e as p,g as f,cj as x,j as r,r as c,l as u}from"./index-3ttoiVWU.js";import{P as g}from"./plugin-layout-BYUyfvt2.js";import"./use-connection-DYg5H00C.js";import"./use-collections-BENY1kCP.js";import"./use-mcp-client-CLwLq9Vl.js";import"./auth-DOEa4Xg-.js";import"./studio-tools-C7SlPTsZ.js";import"./Settings02-B100KruV.js";import"./index-B0th8sGF.js";import"./sidebar-CeOOq5ye.js";import"./LayoutLeft-hGFocSnW.js";import"./tooltip-FBNw4nVO.js";import"./sheet-B6uVK7Gd.js";import"./X-BRH2Y8Wq.js";function z(){const e=p.c(13);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/plugins/$pluginId"},e[0]=i):i=e[0];const{pluginId:s}=f(i);let l;e[1]!==s?(l=x.find(n=>n.id===s),e[1]=s,e[2]=l):l=e[2];const t=l;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=n):n=e[3];let d;return e[4]!==t.bindingName||e[5]!==t.renderEmptyState||e[6]!==t.renderHeader?(d=r.jsx(c.Suspense,{fallback:n,children:r.jsx(g,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState})}),e[4]=t.bindingName,e[5]=t.renderEmptyState,e[6]=t.renderHeader,e[7]=d):d=e[7],d}const m=t?.LayoutComponent;if(!m){let n;return e[8]!==s?(n=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:['Plugin "',s,'" not found']})}),e[8]=s,e[9]=n):n=e[9],n}let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[10]=a):a=e[10];let o;return e[11]!==m?(o=r.jsx(c.Suspense,{fallback:a,children:r.jsx(m,{})}),e[11]=m,e[12]=o):o=e[12],o}export{z as default};
@@ -1 +1 @@
1
- import{e as F,F as te,K as U,j as a,r as M,c as ne}from"./index-DElySjov.js";import{i as oe,n as z,a2 as se,a3 as re,a as ie,f as le}from"./index-zawK8irL.js";import{L as Y}from"./label-Vh7XtQX1.js";import{S as $}from"./switch-DKWXZfes.js";import{a as ce,S as ae}from"./schema-form-DAx4_84I.js";import{c as ue,S as fe,a as pe,b as de,d as ye}from"./select-CvY3LM8v.js";const he="website/sections/Rendering/Lazy.tsx";function K(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function N(t){if(!K(t))return!1;const e=t.__resolveType;return typeof e=="string"&&oe(e)}function k(t){return t!=null}function w(t){if(t==null)return t;if(N(t)){const e=t.section;return e==null?null:K(e)?e:{}}return K(t)?t:void 0}function G(t,e){return t===null?null:N(e)?{...e,section:t}:t}function me(t){return{__resolveType:t}}function Se(t,e){if(!k(e))return null;if(t){const n=w(e)??{};return{__resolveType:he,section:n}}return N(e)?w(e)??null:K(e)?e:null}const ge="General";function O(t){return/\/Seo(V\d+)?\.tsx$/i.test(t)||t.includes("/sections/Seo")}function Q(t,e){return t===C?ge:e}function W(t){const e=re(t),n=new Set,o=[];for(const s of e)O(s.resolveType)&&(ie(s.resolveType)||n.has(s.resolveType)||(n.add(s.resolveType),o.push({resolveType:s.resolveType,title:Q(s.resolveType,s.title),description:s.description})));return o}function V(t){const e=se(t),n=z(e,t),o=W(n?.properties?.seo);return o.length>0?o:ve(t)}function ve(t){const e=t.manifest?.blocks??{},n=[];for(const[o,s]of Object.entries(e))if(o.includes("sections"))for(const r of Object.keys(s)){if(!O(r))continue;const i=r.split("/").pop()?.replace(/\.tsx?$/,"")??r;n.push({resolveType:r,title:Q(r,i)})}return n}function Z(t){const e=V(t),n=e.find(o=>o.resolveType===C);return n?n.resolveType:e[0]?.resolveType??C}function q(t,e){const n=e.__resolveType;if(typeof n=="string"){const o=z(n,t),s=W(o?.properties?.seo);if(s.length>0)return s}return V(t)}function be(t,e){const n=q(t,e),o=n.find(s=>s.resolveType===C);return o?o.resolveType:n[0]?.resolveType??Z(t)}function Te(t,e){const n=e?.__resolveType;return typeof n=="string"&&n.length>0?n:Z(t)}function xe(t,e,n){const o=n.__resolveType;return typeof o=="string"&&O(o)?o:be(t,e)}const _e=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]),C="website/sections/Seo/SeoV2.tsx",Re=["title","titleTemplate","description","descriptionTemplate","image","favicon","type","noIndexing"];function L(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ee(t){return typeof t.__resolveType=="string"&&O(t.__resolveType)?!0:Re.some(e=>e in t)}function je(t,e){for(const[n,o]of Object.entries(t)){if(!L(o))continue;const s=o,r=s.__resolveType;if(typeof r=="string"&&_e.has(r))continue;const i=s.seo;if(L(i)){const c=i;if(Ee(c))return{blockKey:n,kind:"nested",seoData:c,blockData:s,seoResolveType:e?xe(e,s,c):typeof c.__resolveType=="string"&&O(c.__resolveType)?c.__resolveType:C}}}for(const[n,o]of Object.entries(t)){if(!L(o))continue;const s=o;if(typeof s.__resolveType=="string"&&O(s.__resolveType))return{blockKey:n,kind:"block",seoData:s,blockData:s,seoResolveType:s.__resolveType}}return null}function De(t,e){return t.kind==="block"?e:{...t.blockData,seo:e}}function qe(t,e,n){if(e.kind==="site"){const l=je(t,n);return l?{blockKey:l.blockKey,seoData:l.seoData,seoResolveType:l.seoResolveType,siteKind:l.kind,seoTypeOptions:n?q(n,l.blockData):void 0,build:d=>De(l,d)}:null}const o=t[e.pageKey];if(!L(o))return null;const s=o,r=s.seo,i=w(r),c=i&&L(i)?i:void 0;return{blockKey:e.pageKey,seoData:c,rawSeoData:r,seoResolveType:n?Te(n,c):typeof c?.__resolveType=="string"?c.__resolveType:C,seoTypeOptions:n?V(n):void 0,build:l=>({...s,seo:l===null?null:G(l,r)})}}function I(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ce(t,e,n,o){if(t.kind==="page"){if(!I(n))return null;const s=n.seo!==void 0?n.seo:e.rawSeoData;return{...n,seo:o===null?null:G(o,s)}}return I(n)?e.siteKind==="block"?o:{...n,seo:o}:null}function He(t,e){const n=t.__resolveType;return typeof n=="string"&&n.length>0?n:e.seoResolveType}function Je(t){const e=F.c(23),{orgSlug:n,virtualMcpId:o,branch:s,target:r,resolved:i,onSaved:c}=t,l=te(),d=`${n}/${o}/${s}`;let y;e[0]!==s||e[1]!==n||e[2]!==o?(y={orgSlug:n,virtualMcpId:o,branch:s},e[0]=s,e[1]=n,e[2]=o,e[3]=y):y=e[3];let p;e[4]!==c?(p={onSaved:c},e[4]=c,e[5]=p):p=e[5];const{save:f,flush:S,isPending:h}=le(y,p);let m;e[6]!==d||e[7]!==l||e[8]!==i||e[9]!==f||e[10]!==r?(m=E=>{i&&f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return Ce(r,i,b,E)})},e[6]=d,e[7]=l,e[8]=i,e[9]=f,e[10]=r,e[11]=m):m=e[11];const g=m;let v;e[12]!==d||e[13]!==l||e[14]!==i||e[15]!==f||e[16]!==r?(v=E=>{!i||r.kind!=="page"||f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return I(b)?{...b,seo:E}:null})},e[12]=d,e[13]=l,e[14]=i,e[15]=f,e[16]=r,e[17]=v):v=e[17];const R=v;let x;return e[18]!==S||e[19]!==h||e[20]!==R||e[21]!==g?(x={persistSeo:g,persistRawSeo:R,flush:S,isPending:h},e[18]=S,e[19]=h,e[20]=R,e[21]=g,e[22]=x):x=e[22],x}const Pe="https://deco.cx/docs/en/performance/edge-async-render";function Oe(t){const e=F.c(16),{rawSeo:n,onEnableChange:o,onAsyncRenderChange:s,children:r}=t;let i;e[0]!==n?(i=k(n),e[0]=n,e[1]=i):i=e[1];const c=i;let l;e[2]!==n?(l=N(n),e[2]=n,e[3]=l):l=e[3];const d=l;let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Y,{htmlFor:"seo-enable",className:"text-sm font-medium",children:"Enable SEO"}),e[4]=y):y=e[4];let p;e[5]!==c||e[6]!==o?(p=a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,a.jsx($,{id:"seo-enable",checked:c,onCheckedChange:o})]}),e[5]=c,e[6]=o,e[7]=p):p=e[7];let f;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==s?(f=c&&a.jsxs(a.Fragment,{children:[r,a.jsxs("div",{className:"flex items-start justify-between gap-3 border-t pt-4",children:[a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Async render"}),a.jsxs("p",{className:"text-xs leading-normal text-muted-foreground",children:["Render SEO asynchronously with edge caching. Learn more in our"," ",a.jsx("a",{href:Pe,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"documentation"}),"."]})]}),a.jsx($,{id:"seo-async-render",checked:d,onCheckedChange:s,className:"shrink-0"})]})]}),e[8]=d,e[9]=r,e[10]=c,e[11]=s,e[12]=f):f=e[12];let S;return e[13]!==p||e[14]!==f?(S=a.jsxs("div",{className:"space-y-4",children:[p,f]}),e[13]=p,e[14]=f,e[15]=S):S=e[15],S}const B=["type","title","description","canonical","favicon","image","themeColor"],Fe=["jsonLD","omitVariants","title","description","noIndexing","ignoreStructuredData"],Le=["jsonLD","title","description","noIndexing","configJsonLD"];function H(t){return t===C||/\/Seo\/SeoV2\.tsx$/i.test(t)?"general":/\/Seo\/SeoPDP/i.test(t)?"pdp":/\/Seo\/SeoPLP/i.test(t)?"plp":"full"}function Ke(t){switch(t){case"general":return B;case"pdp":return Fe;case"plp":return Le;default:return null}}function J(t,e){const n=Ke(H(e));if(!n||!t.properties)return t;const o={};for(const s of n){const r=t.properties[s];r&&(o[s]=r)}return{...t,properties:o}}function ke(){return B.filter(t=>t!=="type")}function Ne(t){return t.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase()).trim()}function Ae(t,e){return t[e]===void 0}function $e(t){const e=F.c(13),{schema:n,value:o,onChange:s,siteDefaultSeo:r,formResetKey:i}=t,l=J(n,C).properties??{},d=ke();let y;e[0]!==r?(y=!!r&&Object.keys(r).length>0,e[0]=r,e[1]=y):y=e[1];const p=y,[f,S]=M.useState(i);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];const[m,g]=M.useState(h);f!==i&&(S(i),g({}));let v;e[3]!==m||e[4]!==o?(v=u=>m[u]!==void 0?m[u]:Ae(o,u),e[3]=m,e[4]=o,e[5]=v):v=e[5];const R=v;let x;e[6]!==s||e[7]!==r||e[8]!==o?(x=(u,T)=>{g(D=>({...D,[u]:T}));const j={...o};if(T)delete j[u];else{const D=r?.[u];j[u]=D??(u==="type"?"website":"")}s(j)},e[6]=s,e[7]=r,e[8]=o,e[9]=x):x=e[9];const E=x,P="min-w-0 space-y-6",b=B.map(u=>{const T=l[u];if(!T)return null;const j=p&&d.includes(u),D=j&&R(u),X=D?r?.[u]??o[u]:o[u],ee=T.title??Ne(u);return a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:ne(D&&"pointer-events-none opacity-60"),children:ce({schema:T,value:X,onChange:A=>{D||s({...o,[u]:A})},path:u,label:ee,breadcrumbPath:[],onBreadcrumbChange:we})}),j&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($,{id:`seo-use-default-${u}`,checked:D,onCheckedChange:A=>E(u,A)}),a.jsx(Y,{htmlFor:`seo-use-default-${u}`,className:"text-xs font-normal text-muted-foreground",children:"Use default"})]})]},u)});let _;return e[10]!==i||e[11]!==b?(_=a.jsx("div",{className:P,children:b},i),e[10]=i,e[11]=b,e[12]=_):_=e[12],_}function we(){}function Ie(t){const e=F.c(18),{schema:n,resolveType:o,value:s,formResetKey:r,onChange:i,onBreadcrumbChange:c,siteDefaultSeo:l}=t;if(H(o)==="general"){let m;e[0]!==i?(m=v=>i(v),e[0]=i,e[1]=m):m=e[1];let g;return e[2]!==r||e[3]!==n||e[4]!==l||e[5]!==m||e[6]!==s?(g=a.jsx($e,{schema:n,value:s,onChange:m,siteDefaultSeo:l,formResetKey:r}),e[2]=r,e[3]=n,e[4]=l,e[5]=m,e[6]=s,e[7]=g):g=e[7],g}let y;e[8]!==o||e[9]!==n?(y=J(n,o),e[8]=o,e[9]=n,e[10]=y):y=e[10];const p=y;let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[11]=f):f=e[11];const S=c??Ye;let h;return e[12]!==p||e[13]!==r||e[14]!==i||e[15]!==S||e[16]!==s?(h=a.jsx(ae,{schema:p,value:s,onChange:i,basePath:"",breadcrumbPath:f,onBreadcrumbChange:S},r),e[12]=p,e[13]=r,e[14]=i,e[15]=S,e[16]=s,e[17]=h):h=e[17],h}function Ye(){}function Ve(t){const e=F.c(10),{options:n,value:o,onChange:s}=t;if(n.length<=1)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx(Y,{className:"text-xs text-muted-foreground",children:"SEO type"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(fe,{className:"w-full",children:a.jsx(pe,{placeholder:"Select SEO type"})}),e[1]=i):i=e[1];let c;e[2]!==n?(c=n.filter(Ue).map(Be),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==c?(l=a.jsx(de,{children:c}),e[4]=c,e[5]=l):l=e[5];let d;return e[6]!==s||e[7]!==l||e[8]!==o?(d=a.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[r,a.jsxs(ye,{value:o,onValueChange:s,children:[i,l]})]}),e[6]=s,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}function Be(t){return a.jsx(ue,{value:t.resolveType,children:t.title},t.resolveType)}function Ue(t){return t.resolveType.length>0}function Xe(t){const e=F.c(33),{rawSeo:n,innerSeo:o,defaultResolveType:s,seoSchema:r,activeResolveType:i,seoTypeOptions:c,formResetKey:l,siteDefaultSeo:d,onBreadcrumbChange:y,onPersistRaw:p,onInnerChange:f,onClearForm:S,onBumpFormKey:h,beforeFields:m}=t;let g;e[0]!==s||e[1]!==h||e[2]!==S||e[3]!==p?(g=T=>{if(T){const j=me(s);p(j),S(),h();return}p(null),S(),h()},e[0]=s,e[1]=h,e[2]=S,e[3]=p,e[4]=g):g=e[4];const v=g;let R;e[5]!==p||e[6]!==n?(R=T=>{const j=Se(T,n);p(j)},e[5]=p,e[6]=n,e[7]=R):R=e[7];const x=R;let E;e[8]!==h||e[9]!==f?(E=T=>{f({__resolveType:T}),h()},e[8]=h,e[9]=f,e[10]=E):E=e[10];const P=E;let b;e[11]!==i||e[12]!==P||e[13]!==n||e[14]!==r||e[15]!==c?(b=k(n)&&r&&i&&c&&c.length>0&&a.jsx(Ve,{options:c,value:i,onChange:P}),e[11]=i,e[12]=P,e[13]=n,e[14]=r,e[15]=c,e[16]=b):b=e[16];let _;e[17]!==i||e[18]!==l||e[19]!==o||e[20]!==y||e[21]!==f||e[22]!==n||e[23]!==r||e[24]!==d?(_=k(n)&&r&&i&&a.jsx(Ie,{schema:r,resolveType:i,value:o,formResetKey:l,onChange:T=>f(T),onBreadcrumbChange:y,siteDefaultSeo:d}),e[17]=i,e[18]=l,e[19]=o,e[20]=y,e[21]=f,e[22]=n,e[23]=r,e[24]=d,e[25]=_):_=e[25];let u;return e[26]!==m||e[27]!==x||e[28]!==v||e[29]!==n||e[30]!==b||e[31]!==_?(u=a.jsxs(Oe,{rawSeo:n,onEnableChange:v,onAsyncRenderChange:x,children:[m,b,_]}),e[26]=m,e[27]=x,e[28]=v,e[29]=n,e[30]=b,e[31]=_,e[32]=u):u=e[32],u}export{Xe as P,Ie as S,He as a,Ce as b,Je as c,Z as d,je as f,k as i,qe as r,w as u};
1
+ import{e as F,F as te,K as U,j as a,r as M,c as ne}from"./index-3ttoiVWU.js";import{i as oe,n as z,a2 as se,a3 as re,a as ie,f as le}from"./index-xWbPmICt.js";import{L as Y}from"./label-C0uUNmvX.js";import{S as $}from"./switch-DDUT3a8C.js";import{a as ce,S as ae}from"./schema-form-36ITxJTs.js";import{c as ue,S as fe,a as pe,b as de,d as ye}from"./select-C8qI9qzJ.js";const he="website/sections/Rendering/Lazy.tsx";function K(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function N(t){if(!K(t))return!1;const e=t.__resolveType;return typeof e=="string"&&oe(e)}function k(t){return t!=null}function w(t){if(t==null)return t;if(N(t)){const e=t.section;return e==null?null:K(e)?e:{}}return K(t)?t:void 0}function G(t,e){return t===null?null:N(e)?{...e,section:t}:t}function me(t){return{__resolveType:t}}function Se(t,e){if(!k(e))return null;if(t){const n=w(e)??{};return{__resolveType:he,section:n}}return N(e)?w(e)??null:K(e)?e:null}const ge="General";function O(t){return/\/Seo(V\d+)?\.tsx$/i.test(t)||t.includes("/sections/Seo")}function Q(t,e){return t===C?ge:e}function W(t){const e=re(t),n=new Set,o=[];for(const s of e)O(s.resolveType)&&(ie(s.resolveType)||n.has(s.resolveType)||(n.add(s.resolveType),o.push({resolveType:s.resolveType,title:Q(s.resolveType,s.title),description:s.description})));return o}function V(t){const e=se(t),n=z(e,t),o=W(n?.properties?.seo);return o.length>0?o:ve(t)}function ve(t){const e=t.manifest?.blocks??{},n=[];for(const[o,s]of Object.entries(e))if(o.includes("sections"))for(const r of Object.keys(s)){if(!O(r))continue;const i=r.split("/").pop()?.replace(/\.tsx?$/,"")??r;n.push({resolveType:r,title:Q(r,i)})}return n}function Z(t){const e=V(t),n=e.find(o=>o.resolveType===C);return n?n.resolveType:e[0]?.resolveType??C}function q(t,e){const n=e.__resolveType;if(typeof n=="string"){const o=z(n,t),s=W(o?.properties?.seo);if(s.length>0)return s}return V(t)}function be(t,e){const n=q(t,e),o=n.find(s=>s.resolveType===C);return o?o.resolveType:n[0]?.resolveType??Z(t)}function Te(t,e){const n=e?.__resolveType;return typeof n=="string"&&n.length>0?n:Z(t)}function xe(t,e,n){const o=n.__resolveType;return typeof o=="string"&&O(o)?o:be(t,e)}const _e=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]),C="website/sections/Seo/SeoV2.tsx",Re=["title","titleTemplate","description","descriptionTemplate","image","favicon","type","noIndexing"];function L(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ee(t){return typeof t.__resolveType=="string"&&O(t.__resolveType)?!0:Re.some(e=>e in t)}function je(t,e){for(const[n,o]of Object.entries(t)){if(!L(o))continue;const s=o,r=s.__resolveType;if(typeof r=="string"&&_e.has(r))continue;const i=s.seo;if(L(i)){const c=i;if(Ee(c))return{blockKey:n,kind:"nested",seoData:c,blockData:s,seoResolveType:e?xe(e,s,c):typeof c.__resolveType=="string"&&O(c.__resolveType)?c.__resolveType:C}}}for(const[n,o]of Object.entries(t)){if(!L(o))continue;const s=o;if(typeof s.__resolveType=="string"&&O(s.__resolveType))return{blockKey:n,kind:"block",seoData:s,blockData:s,seoResolveType:s.__resolveType}}return null}function De(t,e){return t.kind==="block"?e:{...t.blockData,seo:e}}function qe(t,e,n){if(e.kind==="site"){const l=je(t,n);return l?{blockKey:l.blockKey,seoData:l.seoData,seoResolveType:l.seoResolveType,siteKind:l.kind,seoTypeOptions:n?q(n,l.blockData):void 0,build:d=>De(l,d)}:null}const o=t[e.pageKey];if(!L(o))return null;const s=o,r=s.seo,i=w(r),c=i&&L(i)?i:void 0;return{blockKey:e.pageKey,seoData:c,rawSeoData:r,seoResolveType:n?Te(n,c):typeof c?.__resolveType=="string"?c.__resolveType:C,seoTypeOptions:n?V(n):void 0,build:l=>({...s,seo:l===null?null:G(l,r)})}}function I(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ce(t,e,n,o){if(t.kind==="page"){if(!I(n))return null;const s=n.seo!==void 0?n.seo:e.rawSeoData;return{...n,seo:o===null?null:G(o,s)}}return I(n)?e.siteKind==="block"?o:{...n,seo:o}:null}function He(t,e){const n=t.__resolveType;return typeof n=="string"&&n.length>0?n:e.seoResolveType}function Je(t){const e=F.c(23),{orgSlug:n,virtualMcpId:o,branch:s,target:r,resolved:i,onSaved:c}=t,l=te(),d=`${n}/${o}/${s}`;let y;e[0]!==s||e[1]!==n||e[2]!==o?(y={orgSlug:n,virtualMcpId:o,branch:s},e[0]=s,e[1]=n,e[2]=o,e[3]=y):y=e[3];let p;e[4]!==c?(p={onSaved:c},e[4]=c,e[5]=p):p=e[5];const{save:f,flush:S,isPending:h}=le(y,p);let m;e[6]!==d||e[7]!==l||e[8]!==i||e[9]!==f||e[10]!==r?(m=E=>{i&&f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return Ce(r,i,b,E)})},e[6]=d,e[7]=l,e[8]=i,e[9]=f,e[10]=r,e[11]=m):m=e[11];const g=m;let v;e[12]!==d||e[13]!==l||e[14]!==i||e[15]!==f||e[16]!==r?(v=E=>{!i||r.kind!=="page"||f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return I(b)?{...b,seo:E}:null})},e[12]=d,e[13]=l,e[14]=i,e[15]=f,e[16]=r,e[17]=v):v=e[17];const R=v;let x;return e[18]!==S||e[19]!==h||e[20]!==R||e[21]!==g?(x={persistSeo:g,persistRawSeo:R,flush:S,isPending:h},e[18]=S,e[19]=h,e[20]=R,e[21]=g,e[22]=x):x=e[22],x}const Pe="https://deco.cx/docs/en/performance/edge-async-render";function Oe(t){const e=F.c(16),{rawSeo:n,onEnableChange:o,onAsyncRenderChange:s,children:r}=t;let i;e[0]!==n?(i=k(n),e[0]=n,e[1]=i):i=e[1];const c=i;let l;e[2]!==n?(l=N(n),e[2]=n,e[3]=l):l=e[3];const d=l;let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Y,{htmlFor:"seo-enable",className:"text-sm font-medium",children:"Enable SEO"}),e[4]=y):y=e[4];let p;e[5]!==c||e[6]!==o?(p=a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,a.jsx($,{id:"seo-enable",checked:c,onCheckedChange:o})]}),e[5]=c,e[6]=o,e[7]=p):p=e[7];let f;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==s?(f=c&&a.jsxs(a.Fragment,{children:[r,a.jsxs("div",{className:"flex items-start justify-between gap-3 border-t pt-4",children:[a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Async render"}),a.jsxs("p",{className:"text-xs leading-normal text-muted-foreground",children:["Render SEO asynchronously with edge caching. Learn more in our"," ",a.jsx("a",{href:Pe,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"documentation"}),"."]})]}),a.jsx($,{id:"seo-async-render",checked:d,onCheckedChange:s,className:"shrink-0"})]})]}),e[8]=d,e[9]=r,e[10]=c,e[11]=s,e[12]=f):f=e[12];let S;return e[13]!==p||e[14]!==f?(S=a.jsxs("div",{className:"space-y-4",children:[p,f]}),e[13]=p,e[14]=f,e[15]=S):S=e[15],S}const B=["type","title","description","canonical","favicon","image","themeColor"],Fe=["jsonLD","omitVariants","title","description","noIndexing","ignoreStructuredData"],Le=["jsonLD","title","description","noIndexing","configJsonLD"];function H(t){return t===C||/\/Seo\/SeoV2\.tsx$/i.test(t)?"general":/\/Seo\/SeoPDP/i.test(t)?"pdp":/\/Seo\/SeoPLP/i.test(t)?"plp":"full"}function Ke(t){switch(t){case"general":return B;case"pdp":return Fe;case"plp":return Le;default:return null}}function J(t,e){const n=Ke(H(e));if(!n||!t.properties)return t;const o={};for(const s of n){const r=t.properties[s];r&&(o[s]=r)}return{...t,properties:o}}function ke(){return B.filter(t=>t!=="type")}function Ne(t){return t.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase()).trim()}function Ae(t,e){return t[e]===void 0}function $e(t){const e=F.c(13),{schema:n,value:o,onChange:s,siteDefaultSeo:r,formResetKey:i}=t,l=J(n,C).properties??{},d=ke();let y;e[0]!==r?(y=!!r&&Object.keys(r).length>0,e[0]=r,e[1]=y):y=e[1];const p=y,[f,S]=M.useState(i);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];const[m,g]=M.useState(h);f!==i&&(S(i),g({}));let v;e[3]!==m||e[4]!==o?(v=u=>m[u]!==void 0?m[u]:Ae(o,u),e[3]=m,e[4]=o,e[5]=v):v=e[5];const R=v;let x;e[6]!==s||e[7]!==r||e[8]!==o?(x=(u,T)=>{g(D=>({...D,[u]:T}));const j={...o};if(T)delete j[u];else{const D=r?.[u];j[u]=D??(u==="type"?"website":"")}s(j)},e[6]=s,e[7]=r,e[8]=o,e[9]=x):x=e[9];const E=x,P="min-w-0 space-y-6",b=B.map(u=>{const T=l[u];if(!T)return null;const j=p&&d.includes(u),D=j&&R(u),X=D?r?.[u]??o[u]:o[u],ee=T.title??Ne(u);return a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:ne(D&&"pointer-events-none opacity-60"),children:ce({schema:T,value:X,onChange:A=>{D||s({...o,[u]:A})},path:u,label:ee,breadcrumbPath:[],onBreadcrumbChange:we})}),j&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($,{id:`seo-use-default-${u}`,checked:D,onCheckedChange:A=>E(u,A)}),a.jsx(Y,{htmlFor:`seo-use-default-${u}`,className:"text-xs font-normal text-muted-foreground",children:"Use default"})]})]},u)});let _;return e[10]!==i||e[11]!==b?(_=a.jsx("div",{className:P,children:b},i),e[10]=i,e[11]=b,e[12]=_):_=e[12],_}function we(){}function Ie(t){const e=F.c(18),{schema:n,resolveType:o,value:s,formResetKey:r,onChange:i,onBreadcrumbChange:c,siteDefaultSeo:l}=t;if(H(o)==="general"){let m;e[0]!==i?(m=v=>i(v),e[0]=i,e[1]=m):m=e[1];let g;return e[2]!==r||e[3]!==n||e[4]!==l||e[5]!==m||e[6]!==s?(g=a.jsx($e,{schema:n,value:s,onChange:m,siteDefaultSeo:l,formResetKey:r}),e[2]=r,e[3]=n,e[4]=l,e[5]=m,e[6]=s,e[7]=g):g=e[7],g}let y;e[8]!==o||e[9]!==n?(y=J(n,o),e[8]=o,e[9]=n,e[10]=y):y=e[10];const p=y;let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[11]=f):f=e[11];const S=c??Ye;let h;return e[12]!==p||e[13]!==r||e[14]!==i||e[15]!==S||e[16]!==s?(h=a.jsx(ae,{schema:p,value:s,onChange:i,basePath:"",breadcrumbPath:f,onBreadcrumbChange:S},r),e[12]=p,e[13]=r,e[14]=i,e[15]=S,e[16]=s,e[17]=h):h=e[17],h}function Ye(){}function Ve(t){const e=F.c(10),{options:n,value:o,onChange:s}=t;if(n.length<=1)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx(Y,{className:"text-xs text-muted-foreground",children:"SEO type"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(fe,{className:"w-full",children:a.jsx(pe,{placeholder:"Select SEO type"})}),e[1]=i):i=e[1];let c;e[2]!==n?(c=n.filter(Ue).map(Be),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==c?(l=a.jsx(de,{children:c}),e[4]=c,e[5]=l):l=e[5];let d;return e[6]!==s||e[7]!==l||e[8]!==o?(d=a.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[r,a.jsxs(ye,{value:o,onValueChange:s,children:[i,l]})]}),e[6]=s,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}function Be(t){return a.jsx(ue,{value:t.resolveType,children:t.title},t.resolveType)}function Ue(t){return t.resolveType.length>0}function Xe(t){const e=F.c(33),{rawSeo:n,innerSeo:o,defaultResolveType:s,seoSchema:r,activeResolveType:i,seoTypeOptions:c,formResetKey:l,siteDefaultSeo:d,onBreadcrumbChange:y,onPersistRaw:p,onInnerChange:f,onClearForm:S,onBumpFormKey:h,beforeFields:m}=t;let g;e[0]!==s||e[1]!==h||e[2]!==S||e[3]!==p?(g=T=>{if(T){const j=me(s);p(j),S(),h();return}p(null),S(),h()},e[0]=s,e[1]=h,e[2]=S,e[3]=p,e[4]=g):g=e[4];const v=g;let R;e[5]!==p||e[6]!==n?(R=T=>{const j=Se(T,n);p(j)},e[5]=p,e[6]=n,e[7]=R):R=e[7];const x=R;let E;e[8]!==h||e[9]!==f?(E=T=>{f({__resolveType:T}),h()},e[8]=h,e[9]=f,e[10]=E):E=e[10];const P=E;let b;e[11]!==i||e[12]!==P||e[13]!==n||e[14]!==r||e[15]!==c?(b=k(n)&&r&&i&&c&&c.length>0&&a.jsx(Ve,{options:c,value:i,onChange:P}),e[11]=i,e[12]=P,e[13]=n,e[14]=r,e[15]=c,e[16]=b):b=e[16];let _;e[17]!==i||e[18]!==l||e[19]!==o||e[20]!==y||e[21]!==f||e[22]!==n||e[23]!==r||e[24]!==d?(_=k(n)&&r&&i&&a.jsx(Ie,{schema:r,resolveType:i,value:o,formResetKey:l,onChange:T=>f(T),onBreadcrumbChange:y,siteDefaultSeo:d}),e[17]=i,e[18]=l,e[19]=o,e[20]=y,e[21]=f,e[22]=n,e[23]=r,e[24]=d,e[25]=_):_=e[25];let u;return e[26]!==m||e[27]!==x||e[28]!==v||e[29]!==n||e[30]!==b||e[31]!==_?(u=a.jsxs(Oe,{rawSeo:n,onEnableChange:v,onAsyncRenderChange:x,children:[m,b,_]}),e[26]=m,e[27]=x,e[28]=v,e[29]=n,e[30]=b,e[31]=_,e[32]=u):u=e[32],u}export{Xe as P,Ie as S,He as a,Ce as b,Je as c,Z as d,je as f,k as i,qe as r,w as u};
@@ -0,0 +1 @@
1
+ import{e as it,r as E,j as e,l as rt}from"./index-3ttoiVWU.js";import{S as mt,d as pt,a as st,b as at}from"./sheet-B6uVK7Gd.js";import{S as nt}from"./scroll-area-G2D-rhCe.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-BQBXyb0O.js";import{n as xt}from"./index-xWbPmICt.js";import"./X-BRH2Y8Wq.js";import"./select-C8qI9qzJ.js";import"./tooltip-FBNw4nVO.js";import"./Check-Cb8huOHH.js";import"./ChevronDown-D_ybfzhh.js";import"./ChevronUp-BXLaNqVW.js";import"./label-C0uUNmvX.js";import"./switch-DDUT3a8C.js";import"./schema-form-36ITxJTs.js";import"./agent-icon-rbRaklR8.js";import"./AlertCircle-Bdl8L7il.js";import"./Tool01-BLdHAOru.js";import"./SwitchHorizontal01-DHHfKBMD.js";import"./RefreshCcw01-CyAHVf6q.js";import"./XCircle-CShXLucc.js";import"./ArrowUpRight-C4gNBzMY.js";import"./ZapSquare-Cz0n89qc.js";import"./Users03-DE6tDcyz.js";import"./CheckCircle-CGJnw6dP.js";import"./ChevronLeft-CBi5hL_n.js";import"./ChevronRight-D0iMeTJ5.js";import"./DotsVertical-BhoFPdMN.js";import"./Container-BGdfxKsK.js";import"./Eye-DcL-kKgm.js";import"./ZoomOut-CqeB-Ycx.js";import"./Globe01-BX4SSb6A.js";import"./FilterLines-DSwseOu_.js";import"./Star01-DgOBkoy7.js";import"./Palette-EMfX7hNs.js";import"./HardDrive-DcbBi9w_.js";import"./Stars02-AWskXgtc.js";import"./Key01-R_z_EgAZ.js";import"./LayoutLeft-hGFocSnW.js";import"./LinkExternal01-DQiI5oxv.js";import"./Monitor01-CRf7BSF8.js";import"./Sun-Ddl5HYpL.js";import"./Play-mcRrv0lp.js";import"./Plus-_ThoLvvV.js";import"./SearchMd-D6F8AHrW.js";import"./Settings02-B100KruV.js";import"./Shield01-DxJYzxVh.js";import"./Stars01-CF50N3iu.js";import"./Trash01-4Tg-x6Q1.js";import"./Upload01-CBpPl05N.js";import"./User01-CChZgMNn.js";import"./Users01-CxX1e6cq.js";import"./XClose-BFJ573RS.js";import"./Zap-ZgVQTmT-.js";import"./calendar-DTQK53My.js";import"./input-DVih3Sjm.js";import"./popover-CydIugVg.js";import"./textarea-RmWXPTvx.js";import"./dropdown-menu-D2SV-kWF.js";import"./image-field-FQeZHP_K.js";import"./dialog-B2mbqsst.js";import"./skeleton-vEwazeas.js";import"./tabs-DkUWsc-a.js";import"./use-file-configs-B9X5drJT.js";import"./studio-tools-C7SlPTsZ.js";import"./useInfiniteQuery-mF7h7Kib.js";import"./use-infinite-scroll--_mmqYnT.js";import"./agent-capabilities-CFJ9p-mV.js";import"./chat-context-D-8AD0J7.js";import"./tab-id-rjh-jKlB.js";import"./use-mcp-client-CLwLq9Vl.js";import"./auth-DOEa4Xg-.js";import"./watch-sse-pool-ymdzZonG.js";import"./decopilot-sse-pool-Bs8CtAgZ.js";import"./use-virtual-mcp-BgfAZ5Jr.js";import"./use-collections-BENY1kCP.js";import"./use-ai-providers-suUCAMGx.js";import"./use-organization-settings-25l1s_BF.js";import"./pair-vWhfM9EW.js";import"./use-clock-tick-DervAiLh.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CeVxNpud.js";import"./file-type-icon-C6U2veNU.js";import"./content-blocks-o63cs2vh.js";import"./types-n2YDSxA4.js";import"./shell-layout-B0RfVT3C.js";import"./avatar-BqZJEvBP.js";import"./required-auth-layout-1KnSml1h.js";import"./useRouterState-CcHttnTA.js";import"./use-org-sso-C1kwoIRD.js";import"./integration-icon-BRZNp1S0.js";import"./use-navigate-to-agent-B002vpC6.js";import"./use-connection-DYg5H00C.js";import"./use-mcp-prompts-B267X-_C.js";import"./form-CU3vQdRi.js";import"./spinner-2N-kj7x0.js";import"./drawer-iJV16qgy.js";import"./collection-search-DTKnEcQS.js";import"./toggle-group-CBraKNJ7.js";import"./sortable.esm-CH8RPvw-.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BjkWUX4T.js";import"./use-registry-connections-CMrhWNW5.js";import"./extract-connection-data-bssph-WQ.js";import"./generate-id-yj5Hc06j.js";import"./collections-DFjqouMx.js";import"./card-C0ZJxFoq.js";import"./collection-tabs-BDWQ17XJ.js";import"./badge-B2khBz0-.js";import"./connection-form-helpers-DTy5Iwrw.js";import"./useSuspenseInfiniteQuery-D6t37oXN.js";import"./mcp-oauth-BQWbsE1s.js";import"./connect-desktop-dialog-C4HCeyrm.js";import"./decopilot-D05Xyy-k.js";import"./checkbox-DxApZ9yh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-7sN_1nHI.js";import"./command-DYklD3Up.js";import"./index--7JSPThb.js";import"./index-B3hxsYs6.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-BdonEPNR.js";import"./sidebar-CeOOq5ye.js";import"./toolbar-CE9gJtYo.js";import"./use-create-virtual-mcp-izJw-zXR.js";import"./github-repo-picker-Bp_Rai-x.js";import"./use-mcp-tools-D4ZIO9iv.js";import"./alert-dialog-DU_hTH_e.js";import"./index-COSo4xcs.js";import"./use-org-auth-client-bsfac5xt.js";import"./hover-card-BUcaRmlM.js";import"./task-status-DczQDaYF.js";import"./use-status-sounds-C7cE6rna.js";import"./empty-state-C_DVBzcU.js";import"./resizable-DUax5XQL.js";import"./use-capability-CVFP3WhT.js";import"./header-tab-button-D3vC9cXp.js";import"./index-BZhcIh0y.js";import"./user-D2mv81pj.js";import"./tools-list-yuhbQkhw.js";import"./use-debounced-autosave-DSCKWvQF.js";import"./index-B0th8sGF.js";import"./search-input-DZtcJZGI.js";import"./use-secrets-B00xpt4M.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-QuD2RrzW.js";import"./view-mode-toggle-dEyORvRn.js";import"./select-model-CJrkcp8L.js";import"./use-automations-F8sxpovP.js";import"./monaco-editor-D-Xn_h_i.js";import"./automation-runs-CHOhgiKg.js";import"./table-CXgtsUd4.js";import"./use-members-CPWF2UIp.js";import"./automation-list-row-BmMbzVcz.js";function fi(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{fi as SeoSheet};
@@ -1,4 +1,4 @@
1
- import{e as $,r as H,P as ct,H as Kt,G as Xt,j as n,B as ke,R as et,c as q,t as Jt,p as he,F as Qt,a as Yt,K as me,n as De,m as Ve,f as je,E as Zt,z as es,by as qe}from"./index-DElySjov.js";import{$ as ts,G as ss,B as ns,ad as ls,O as os,N as as,M as rs,a9 as ut,ae as is,af as cs,A as dt,ag as ie,ah as us,ai as ds,aj as fs,b as ms}from"./agent-icon-DWieO6vE.js";import{t as Ae}from"./Stars01-BAVDvS6u.js";import{a as ft,t as ps,b as Ce,d as xs}from"./XCircle-RMZbZptd.js";import{i as Ge}from"./Check-eedT9M4f.js";import{i as tt}from"./ChevronRight-CBibu88R.js";import{a as mt,s as gs}from"./Eye-BMnHz-k1.js";import{a as de,u as pt,t as xt,c as st}from"./use-clock-tick-BsB0gkiC.js";import{N as gt,R as ht,e as bt,C as hs,f as bs,g as ys,u as js,i as vs,d as Ns}from"./scroll-area-C_pJDhCx.js";import{u as yt}from"./use-copy-B92V5YyR.js";import{T as pe,a as xe,b as ge}from"./tooltip-BJIwJ20V.js";import{M as jt,I as vt,F as Ss}from"./file-type-icon-BQHeWto0.js";import{c as ks}from"./content-blocks-o63cs2vh.js";import{g as Nt,M as _s}from"./types-DkSHL0JO.js";import{g as ve,i as ws,d as Ke,a as Ts}from"./chat-context-DqZ1Ibm0.js";import{l as Cs,f as $s,m as Is,n as Ms,R as As}from"./tab-id-CidWBQZm.js";import{u as Rs}from"./studio-tools-BniDnWv9.js";import{c as Ls,u as St,b as zs}from"./use-mcp-client-4hZRsKeH.js";import{i as kt}from"./AlertCircle-sZfVKKIU.js";import{s as Ie,t as _t}from"./Star01-5MkCH9IF.js";import{s as Es}from"./XClose-WgHqvoCp.js";import{n as wt}from"./ZapSquare-B5l4FlG5.js";import{n as Tt,i as Ps}from"./Globe01-KlLmxZ2g.js";import{b as Fs,i as Ds,a as Ee}from"./Tool01-CiezpOWI.js";import{a as nt,i as Os}from"./ZoomOut-rJJ-xaWS.js";import{i as Se}from"./Monitor01-Bn333I91.js";import{i as Bs}from"./SearchMd-DuNbf8h_.js";import{i as Hs}from"./Upload01-CXSIztYx.js";import{u as Ws,c as Us}from"./shell-layout-CTILiI6W.js";import{n as Ct}from"./LinkExternal01-N2hkztS6.js";import{I as Re}from"./integration-icon-hz4amrfY.js";import{u as Vs}from"./use-virtual-mcp-Csq3tX42.js";import{a as $t}from"./Users03--pS_AKxh.js";import{a as ce}from"./Palette-CcCpCoEe.js";import{l as It}from"./use-navigate-to-agent-CG5oz4s3.js";import{a as qs}from"./use-connection-DWiJ60zQ.js";import{s as Gs}from"./Stars02-DHgD3n9i.js";import{g as Ks}from"./use-mcp-prompts-DW6p58bx.js";import{c as Xs,b as Js,d as Qs,a as Ys,D as Zs}from"./dialog-DK12sdoJ.js";import{a as en,F as tn,b as sn,c as nn,d as ln,f as on}from"./form-FCvC7hbQ.js";import{I as an}from"./input-Cdm1NEie.js";import{S as rn}from"./spinner-Ct4FnHpR.js";import{t as cn}from"./ChevronDown-D6-hnD5Z.js";const un={openrouter:s=>{const e=s?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function Mt(s){if(!s?.providerMetadata)return 0;for(const e of Object.values(un)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function At(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Rt(s,e){if(!e)return s;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,l=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:s.inputTokens+(e.inputTokens??0),outputTokens:s.outputTokens+(e.outputTokens??0),reasoningTokens:s.reasoningTokens+(e.reasoningTokens??0),totalTokens:s.totalTokens+(e.totalTokens??0),cost:s.cost+Mt(e),cacheReadTokens:s.cacheReadTokens+t,cacheWriteTokens:s.cacheWriteTokens+l}}function Ma(s){return s.reduce((e,t)=>Rt(e,t.metadata?.usage),At())}function dn(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Xe(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Je(s,e){if(!e)return s;const t=`${dn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function fn(s,e){return Je(s,e).replace(/[_-]/g," ").toLowerCase()}function mn(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?et().min(1,"Required"):et();return ct(e)}function pn(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function xn(s){const e=$.c(66),{prompt:t,setPrompt:l,onSubmit:a,defaultValues:r}=s,o=H.useId();let i;if(e[0]!==t){const L=t?mn(t):ct({});i=Kt(L),e[0]=t,e[1]=i}else i=e[1];const c=i;let m;e[2]!==r||e[3]!==t?(m=t?pn(t,r):{},e[2]=r,e[3]=t,e[4]=m):m=e[4];let p;e[5]!==c||e[6]!==m?(p={resolver:c,defaultValues:m,mode:"onChange"},e[5]=c,e[6]=m,e[7]=p):p=e[7];const u=Xt(p);let f;e[8]!==t?.arguments?(f=t?.arguments??[],e[8]=t?.arguments,e[9]=f):f=e[9];const x=f;let g;e[10]!==u||e[11]!==a||e[12]!==l?(g=async L=>{await a(L),l(null),u.reset()},e[10]=u,e[11]=a,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==u||e[15]!==l?(h=L=>{L||(u.reset(),l(null))},e[14]=u,e[15]=l,e[16]=h):h=e[16];const S=h;if(!t)return null;let y;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(y=t.title||fn(t.name,Xe(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=y):y=e[20];let v;e[21]!==y?(v=n.jsx(Xs,{children:n.jsx("span",{className:"capitalize",children:y})}),e[21]=y,e[22]=v):v=e[22];let j;e[23]!==t.description?(j=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=j):j=e[24];let N;e[25]!==j||e[26]!==v?(N=n.jsxs(Js,{children:[v,j]}),e[25]=j,e[26]=v,e[27]=N):N=e[27];let k;e[28]!==u||e[29]!==b?(k=L=>{L.stopPropagation(),u.handleSubmit(b)(L)},e[28]=u,e[29]=b,e[30]=k):k=e[30];let _;if(e[31]!==x||e[32]!==u.control||e[33]!==u.formState.isSubmitting){let L;e[35]!==u.control||e[36]!==u.formState.isSubmitting?(L=z=>n.jsx(tn,{control:u.control,name:z.name,render:D=>{const{field:W}=D;return n.jsxs(sn,{children:[n.jsxs(nn,{className:"text-xs",children:[z.name,z.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(ln,{children:n.jsx(an,{...W,value:W.value??"",required:z.required,placeholder:z.description??"",className:"h-9",disabled:u.formState.isSubmitting})}),n.jsx(on,{})]})}},z.name),e[35]=u.control,e[36]=u.formState.isSubmitting,e[37]=L):L=e[37],_=x.map(L),e[31]=x,e[32]=u.control,e[33]=u.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==S?(w=()=>S(!1),e[38]=S,e[39]=w):w=e[39];let T;e[40]!==u.formState.isSubmitting||e[41]!==w?(T=n.jsx(ke,{type:"button",variant:"ghost",onClick:w,disabled:u.formState.isSubmitting,children:"Cancel"}),e[40]=u.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==u.formState.isSubmitting?(I=u.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(rn,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=u.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==u.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(ke,{type:"submit",form:o,disabled:u.formState.isSubmitting,children:I}),e[45]=u.formState.isSubmitting,e[46]=o,e[47]=I,e[48]=M):M=e[48];let C;e[49]!==T||e[50]!==M?(C=n.jsxs(Qs,{children:[T,M]}),e[49]=T,e[50]=M,e[51]=C):C=e[51];let A;e[52]!==o||e[53]!==k||e[54]!==_||e[55]!==C?(A=n.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:k,children:[_,C]}),e[52]=o,e[53]=k,e[54]=_,e[55]=C,e[56]=A):A=e[56];let R;e[57]!==u||e[58]!==A?(R=n.jsx(en,{...u,children:A}),e[57]=u,e[58]=A,e[59]=R):R=e[59];let F;e[60]!==N||e[61]!==R?(F=n.jsxs(Ys,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[N,R]}),e[60]=N,e[61]=R,e[62]=F):F=e[62];let E;return e[63]!==S||e[64]!==F?(E=n.jsx(Zs,{open:!0,onOpenChange:S,children:F}),e[63]=S,e[64]=F,e[65]=E):E=e[65],E}function Lt(s){return s?s.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function re(s,e){return s==="output-error"||s==="output-denied"?"error":s==="approval-requested"?"approval":s==="input-streaming"||s==="input-available"||s==="output-available"&&e===!0?"loading":"idle"}function Ne(s){if(s==null||typeof s!="object")return;const e=s;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return s}function gn(s){return s.storage.mention}function Aa(s,e,t){s.chain().focus().insertContentAt(e,[zt(t),{type:"text",text:" "}]).run()}function zt(s){return{type:"mention",attrs:s}}function hn(s){const e=$.c(19),{node:t,selected:l,view:a,editor:r,getPos:o}=s,{name:i,char:d,kind:c,id:m,args:p}=t.attrs,u=l&&a.editable,f=d==="@",x=a.editable&&d==="/"&&c!=="resource";let g;e[0]!==p||e[1]!==r||e[2]!==o||e[3]!==m||e[4]!==x||e[5]!==i?(g=_=>{if(!x)return;const T=gn(r)?.onEditChip;if(!T||typeof o!="function")return;const I=o();typeof I=="number"&&(_.preventDefault(),_.stopPropagation(),T({promptId:m,promptName:i,args:p??{},pos:I}))},e[0]=p,e[1]=r,e[2]=o,e[3]=m,e[4]=x,e[5]=i,e[6]=g):g=e[6];const b=g,h=x?"cursor-pointer":"cursor-default",S=f?"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",y=u&&"outline-2 outline-blue-300 outline-offset-0",v=x&&"hover:brightness-95";let j;e[7]!==h||e[8]!==S||e[9]!==y||e[10]!==v?(j=q("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",S,y,v,"capitalize"),e[7]=h,e[8]=S,e[9]=y,e[10]=v,e[11]=j):j=e[11];let N;e[12]!==i?(N=i?Lt(i):"",e[12]=i,e[13]=N):N=e[13];let k;return e[14]!==d||e[15]!==b||e[16]!==j||e[17]!==N?(k=n.jsxs(bt,{onClick:b,className:j,children:[d,N]}),e[14]=d,e[15]=b,e[16]=j,e[17]=N,e[18]=k):k=e[18],k}const bn=gt.create({name:"mention",group:"inline",inline:!0,atom:!0,addStorage(){return{onEditChip:null}},addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},char:{default:"/",parseHTML:s=>s.getAttribute("data-char")||"/",renderHTML:s=>s.char?{"data-char":s.char}:{}},metadata:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-metadata")||"null")}catch{return null}},renderHTML:s=>s.metadata?{"data-metadata":JSON.stringify(s.metadata)}:{}},kind:{default:null,parseHTML:s=>s.getAttribute("data-kind")||null,renderHTML:s=>s.kind?{"data-kind":s.kind}:{}},args:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-args")||"null")}catch{return null}},renderHTML:s=>s.args?{"data-args":JSON.stringify(s.args)}:{}}}},parseHTML(){return[{tag:'span[data-type="mention"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"mention"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.char&&(t["data-char"]=s.attrs.char),s.attrs.metadata&&(t["data-metadata"]=JSON.stringify(s.attrs.metadata)),s.attrs.kind&&(t["data-kind"]=s.attrs.kind),s.attrs.args&&(t["data-args"]=JSON.stringify(s.attrs.args)),["span",{...e,...t}]},renderText({node:s}){const e=s.attrs.char??"@",t=s.attrs.name??"";return`${e}${t}`},addNodeView(){return ht(hn)}}),yn=/^mcp__[a-zA-Z0-9_-]+__/;function Et(s){return s.replace(yn,"")}function Qe(s){const e=$.c(18),{id:t,part:l,copyable:a,extraActions:r,alwaysShowActions:o,animate:i}=s,d=a===void 0?!1:a,c=o===void 0?!1:o,m=i===void 0?!1:i,{handleCopy:p}=yt(),[u,f]=H.useState(!1);let x;e[0]!==p||e[1]!==t||e[2]!==l.text?(x=async()=>{Jt("chat_message_copied",{message_id:t,chars:l.text.length}),await p(l.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=p,e[1]=t,e[2]=l.text,e[3]=x):x=e[3];const g=x,b=d&&r,h=b||r;let S;e[4]!==m||e[5]!==t||e[6]!==l.text?(S=n.jsx(jt,{id:t,text:l.text,animate:m}),e[4]=m,e[5]=t,e[6]=l.text,e[7]=S):S=e[7];let y;e[8]!==c||e[9]!==r||e[10]!==g||e[11]!==u||e[12]!==h||e[13]!==b?(y=h&&n.jsxs("div",{className:q("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",c?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[r,b&&r&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),b&&n.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:u?n.jsx(Ge,{className:"size-4"}):n.jsx(mt,{className:"size-4"})})]}),e[8]=c,e[9]=r,e[10]=g,e[11]=u,e[12]=h,e[13]=b,e[14]=y):y=e[14];let v;return e[15]!==S||e[16]!==y?(v=n.jsxs("div",{className:"group/part relative",children:[S,y]}),e[15]=S,e[16]=y,e[17]=v):v=e[17],v}function Ra(s,e,t){s.chain().focus().insertContentAt(e,[jn(t),{type:"text",text:" "}]).run()}function jn(s){return{type:"file",attrs:s}}function vn(s){const e=$.c(17),{node:t,selected:l,view:a}=s,{name:r,mimeType:o,data:i}=t.attrs,d=l&&a.editable;let c;e[0]!==o?(c=o.startsWith("image/"),e[0]=o,e[1]=c):c=e[1];const m=c,p=d&&"outline-2 outline-blue-300 outline-offset-0";let u;e[2]!==p?(u=q("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",p),e[2]=p,e[3]=u):u=e[3];let f;e[4]!==r?(f=n.jsx(pe,{asChild:!0,children:n.jsx("span",{children:r})}),e[4]=r,e[5]=f):f=e[5];let x;e[6]!==i||e[7]!==m||e[8]!==o||e[9]!==r?(x=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${o};base64,${i}`,alt:r,className:"max-w-full max-h-64 object-contain rounded"}):n.jsxs("div",{className:"text-xs",children:[n.jsx("div",{className:"font-medium",children:r}),n.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=i,e[7]=m,e[8]=o,e[9]=r,e[10]=x):x=e[10];let g;e[11]!==f||e[12]!==x?(g=n.jsxs(ge,{children:[f,x]}),e[11]=f,e[12]=x,e[13]=g):g=e[13];let b;return e[14]!==u||e[15]!==g?(b=n.jsx(bt,{className:u,children:g}),e[14]=u,e[15]=g,e[16]=b):b=e[16],b}const Nn=gt.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},mimeType:{default:null,parseHTML:s=>s.getAttribute("data-mime-type")||null,renderHTML:s=>s.mimeType?{"data-mime-type":s.mimeType}:{}},size:{default:0,parseHTML:s=>{const e=s.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:s=>s.size?{"data-size":String(s.size)}:{}},data:{default:null,parseHTML:s=>s.getAttribute("data-data")||null,renderHTML:s=>s.data?{"data-data":s.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"file"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.mimeType&&(t["data-mime-type"]=s.attrs.mimeType),s.attrs.size&&(t["data-size"]=String(s.attrs.size)),s.attrs.data&&(t["data-data"]=s.attrs.data),["span",{...e,...t}]},renderText({node:s}){return`[${s.attrs.name??""}]`},addNodeView(){return ht(vn)}}),fe=16,Oe=2.5,Be=(fe-Oe)/2,Pe=2*Math.PI*Be;function Sn(s){const e=$.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:a,outputTokens:r,cost:o}=t;if(!l&&!a&&!r)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ts,{size:12}),e[0]=i):i=e[0];let d;e[1]!==o||e[2]!==l?(d=o>0?`$${o.toFixed(4)}`:l.toLocaleString(),e[1]=o,e[2]=l,e[3]=d):d=e[3];let c;e[4]!==d?(c=n.jsx(pe,{asChild:!0,children:n.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[i,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:d})]})}),e[4]=d,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=p):p=e[7];let u;e[8]!==a?(u=a.toLocaleString(),e[8]=a,e[9]=u):u=e[9];let f;e[10]!==u?(f=n.jsx("span",{className:"text-right tabular-nums",children:u}),e[10]=u,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"text-muted",children:"out"}),e[12]=x):x=e[12];const g=r-(t.reasoningTokens??0);let b;e[13]!==g?(b=g.toLocaleString(),e[13]=g,e[14]=b):b=e[14];let h;e[15]!==b?(h=n.jsx("span",{className:"text-right tabular-nums",children:b}),e[15]=b,e[16]=h):h=e[16];let S;e[17]!==a||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(S=(t.cacheReadTokens>0||t.cacheWriteTokens>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:a>0?`${(t.cacheReadTokens/a*100).toFixed(0)}%`:"0%"})]}),e[17]=a,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=S):S=e[20];let y;e[21]!==o?(y=o>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",o.toFixed(4)]})]}),e[21]=o,e[22]=y):y=e[22];let v;e[23]!==h||e[24]!==S||e[25]!==y||e[26]!==f?(v=n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[m,n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[p,f,x,h,S,y]})]}),e[23]=h,e[24]=S,e[25]=y,e[26]=f,e[27]=v):v=e[27];let j;return e[28]!==v||e[29]!==c?(j=n.jsxs(ge,{children:[c,v]}),e[28]=v,e[29]=c,e[30]=j):j=e[30],j}function kn(s){const e=$.c(19),{usage:t,duration:l}=s,a=l!=null&&l>0,r=t!=null&&(t.cost??0)>0,o=t!=null&&(t.totalTokens??0)>0;if(!a&&!r&&!o)return null;let i;e[0]!==l||e[1]!==a?(i=a?de(l/1e3):null,e[0]=l,e[1]=a,e[2]=i):i=e[2];const d=i;let c;e[3]!==l||e[4]!==d||e[5]!==t?(c=d&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:d})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),n.jsx("span",{className:"tabular-nums",children:de(l/1e3)}),(t?.reasoningTokens??0)>0&&n.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=l,e[4]=d,e[5]=t,e[6]=c):c=e[6];let m;e[7]!==r||e[8]!==a||e[9]!==o?(m=a&&(r||o)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=r,e[8]=a,e[9]=o,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==o||e[13]!==t?(p=(r||o)&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:r?`$${t.cost.toFixed(4)}`:`${t.totalTokens.toLocaleString()} tok`})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[n.jsx("span",{className:"opacity-60",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:(t.inputTokens??0).toLocaleString()}),n.jsx("span",{className:"opacity-60",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:((t.outputTokens??0)-(t?.reasoningTokens??0)).toLocaleString()}),(t?.reasoningTokens??0)>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"think"}),n.jsx("span",{className:"text-right tabular-nums",children:t.reasoningTokens.toLocaleString()})]}),((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:(t?.inputTokens??0)>0?`${((t?.cacheReadTokens??0)/t.inputTokens*100).toFixed(0)}%`:"0%"})]})]})]})]}),e[11]=r,e[12]=o,e[13]=t,e[14]=p):p=e[14];let u;return e[15]!==c||e[16]!==m||e[17]!==p?(u=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c,m,p]}),e[15]=c,e[16]=m,e[17]=p,e[18]=u):u=e[18],u}function La(s){const e=$.c(51),{usage:t,totalTokens:l,contextWindow:a,onOpenContextPanel:r}=s,o=Math.min(l/a*100,100),i=Pe-o/100*Pe,d=t?.cost??0,c=t?.inputTokens??0,m=t?.outputTokens??0;let p;e[0]!==o?(p=o.toFixed(0),e[0]=o,e[1]=p):p=e[1];let u;e[2]!==d?(u=d>0?`, $${d.toFixed(2)}`:"",e[2]=d,e[3]=u):u=e[3];const f=`Context usage: ${p}%${u}`,x=r?"cursor-pointer":"cursor-default";let g;e[4]!==x?(g=q("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",x),e[4]=x,e[5]=g):g=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("circle",{cx:fe/2,cy:fe/2,r:Be,fill:"none",stroke:"currentColor",strokeWidth:Oe,className:"opacity-15"}),e[6]=b):b=e[6];const h=o>90?"text-destructive":o>70?"text-warning":"text-muted-foreground";let S;e[7]!==h?(S=q(h),e[7]=h,e[8]=S):S=e[8];let y;e[9]!==i||e[10]!==S?(y=n.jsxs("svg",{width:fe,height:fe,className:"-rotate-90",children:[b,n.jsx("circle",{cx:fe/2,cy:fe/2,r:Be,fill:"none",stroke:"currentColor",strokeWidth:Oe,strokeDasharray:Pe,strokeDashoffset:i,strokeLinecap:"round",className:S})]}),e[9]=i,e[10]=S,e[11]=y):y=e[11];let v;e[12]!==o?(v=o.toFixed(0),e[12]=o,e[13]=v):v=e[13];let j;e[14]!==d?(j=d>0?` · $${d.toFixed(2)}`:"",e[14]=d,e[15]=j):j=e[15];let N;e[16]!==v||e[17]!==j?(N=n.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[v,"%",j]}),e[16]=v,e[17]=j,e[18]=N):N=e[18];let k;e[19]!==r||e[20]!==N||e[21]!==f||e[22]!==g||e[23]!==y?(k=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:r,"aria-label":f,className:g,children:[y,N]})}),e[19]=r,e[20]=N,e[21]=f,e[22]=g,e[23]=y,e[24]=k):k=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("span",{className:"text-muted",children:"context"}),e[25]=_):_=e[25];let w;e[26]!==l?(w=l.toLocaleString(),e[26]=l,e[27]=w):w=e[27];let T;e[28]!==a?(T=a.toLocaleString(),e[28]=a,e[29]=T):T=e[29];let I;e[30]!==o?(I=o.toFixed(1),e[30]=o,e[31]=I):I=e[31];let M;e[32]!==w||e[33]!==T||e[34]!==I?(M=n.jsxs("span",{className:"text-right tabular-nums",children:[w," / ",T," (",I,"%)"]}),e[32]=w,e[33]=T,e[34]=I,e[35]=M):M=e[35];let C;e[36]!==d||e[37]!==c||e[38]!==m?(C=d>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",d.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:c.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=d,e[37]=c,e[38]=m,e[39]=C):C=e[39];let A;e[40]!==c||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(A=((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:c>0?`${((t?.cacheReadTokens??0)/c*100).toFixed(0)}%`:"0%"})]}),e[40]=c,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=A):A=e[43];let R;e[44]!==M||e[45]!==C||e[46]!==A?(R=n.jsx(xe,{side:"top",className:"font-mono text-[11px]",children:n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[_,M,C,A]})}),e[44]=M,e[45]=C,e[46]=A,e[47]=R):R=e[47];let F;return e[48]!==k||e[49]!==R?(F=n.jsxs(ge,{children:[k,R]}),e[48]=k,e[49]=R,e[50]=F):F=e[50],F}function _n(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(ys,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function wn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(hs,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function Tn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(bs,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function Pt({containerRef:s,enabled:e,contentDeps:t=[],threshold:l,intervalMs:a=500}){const[r,o]=H.useState(null),[i,d]=H.useState(!1),c=l??(s?.95:.1),m=()=>{if(s?.current){s.current.scrollTop=s.current.scrollHeight;return}if(!r)return;let p=r.parentElement;for(;p;){const u=window.getComputedStyle(p);if(u.overflowY==="auto"||u.overflowY==="scroll"||u.overflow==="auto"||u.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return H.useEffect(()=>{if(!r)return;const p=new IntersectionObserver(u=>{const f=u[0]?.isIntersecting??!1;d(f)},{root:s?.current??null,threshold:c,rootMargin:"0px"});return p.observe(r),()=>p.disconnect()},[r,c]),H.useEffect(()=>{if(!e||!i)return;const p=setInterval(m,a);return()=>clearInterval(p)},[e,i,a]),H.useEffect(()=>{!e||!i||m()},[e,i,...t]),{sentinelRef:o,isTracking:i}}function B(s){const e=$.c(53),{icon:t,title:l,usage:a,summary:r,state:o,detail:i,detailVariant:d,forceOpen:c,variant:m,trailing:p,iconDestructive:u,alwaysChevron:f,defaultOpen:x,children:g}=s,b=d===void 0?"code":d,h=m===void 0?"default":m,[S,y]=H.useState(x??!1),{handleCopy:v,copied:j}=yt(),N=o==="loading",k=o==="error";let _;e[0]!==i?(_=i&&i.trim(),e[0]=i,e[1]=_):_=e[1];const T=!!_||!!g,I=h==="subtask",M=(c??!1)||S,C=H.useRef(null),A=N&&M;let R;e[2]!==i?(R=[i],e[2]=i,e[3]=R):R=e[3];let F;e[4]!==A||e[5]!==R?(F={containerRef:C,enabled:A,contentDeps:R},e[4]=A,e[5]=R,e[6]=F):F=e[6];const{sentinelRef:E}=Pt(F),L=c?void 0:y,z=!T,D=T&&"[@media(hover:hover)]:hover:bg-accent/30",W=!T&&"cursor-default",U=N&&"shimmer";let O;e[7]!==W||e[8]!==U||e[9]!==D?(O=q("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",D,W,U),e[7]=W,e[8]=U,e[9]=D,e[10]=O):O=e[10];const K=!T;let G;e[11]!==f||e[12]!==M||e[13]!==t||e[14]!==u||e[15]!==k||e[16]!==T?(G=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:f?n.jsx(tt,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:q("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",u?"[&>svg]:text-destructive/70":k?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",T&&(M?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),T&&n.jsx("div",{className:q("absolute inset-0 flex items-center justify-center transition-opacity duration-150",M?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:n.jsx(tt,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")})})]})}),e[11]=f,e[12]=M,e[13]=t,e[14]=u,e[15]=k,e[16]=T,e[17]=G):G=e[17];const Y=k?"text-warning/80":"text-foreground";let Q;e[18]!==Y?(Q=q("shrink-0 text-[14px] font-normal",Y),e[18]=Y,e[19]=Q):Q=e[19];let te;e[20]!==Q||e[21]!==l?(te=n.jsx("span",{className:Q,children:l}),e[20]=Q,e[21]=l,e[22]=te):te=e[22];let P;e[23]!==r?(P=r?n.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:r})}):n.jsx("div",{className:"flex-1"}),e[23]=r,e[24]=P):P=e[24];let V;e[25]!==p?(V=p&&n.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:p}),e[25]=p,e[26]=V):V=e[26];let X;e[27]!==a?(X=n.jsx(Sn,{usage:a}),e[27]=a,e[28]=X):X=e[28];let J;e[29]!==O||e[30]!==K||e[31]!==G||e[32]!==te||e[33]!==P||e[34]!==V||e[35]!==X||e[36]!==z?(J=n.jsxs(wn,{disabled:z,className:O,"aria-disabled":K,children:[G,te,P,V,X]}),e[29]=O,e[30]=K,e[31]=G,e[32]=te,e[33]=P,e[34]=V,e[35]=X,e[36]=z,e[37]=J):J=e[37];let se;e[38]!==g||e[39]!==j||e[40]!==i||e[41]!==b||e[42]!==v||e[43]!==T||e[44]!==E?(se=T&&n.jsx(Tn,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:g||(b==="prose"?n.jsx("div",{className:"mt-1 mb-1",children:n.jsxs("div",{ref:C,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:[n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:i}),n.jsx("div",{ref:E,className:"h-0 shrink-0"})]})}):n.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:n.jsxs("div",{ref:C,className:"flex flex-col max-h-48 overflow-y-auto",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:i})}),n.jsx("button",{type:"button",onClick:()=>v(i),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":"Copy",children:j?n.jsx(Ge,{className:"size-3.5"}):n.jsx(mt,{className:"size-3.5"})})]}),n.jsx("div",{ref:E,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=j,e[40]=i,e[41]=b,e[42]=v,e[43]=T,e[44]=E,e[45]=se):se=e[45];let ue;e[46]!==M||e[47]!==J||e[48]!==se||e[49]!==L?(ue=n.jsxs(_n,{open:M,onOpenChange:L,className:"min-w-0",children:[J,se]}),e[46]=M,e[47]=J,e[48]=se,e[49]=L,e[50]=ue):ue=e[50];const oe=ue;if(I){let ae;return e[51]!==oe?(ae=n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:oe}),e[51]=oe,e[52]=ae):ae=e[52],ae}return oe}function le(s){const e=$.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=de(t),e[0]=t,e[1]=l):l=e[1];let a;return e[2]!==l?(a=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=a):a=e[3],a}const Ft=4;function Dt(s){const e=$.c(5),{count:t,noun:l,onClick:a}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(ft,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=r):r=e[0];let o;return e[1]!==t||e[2]!==l||e[3]!==a?(o=n.jsxs("button",{type:"button",onClick:a,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:["See all ",t," ",l,r]}),e[1]=t,e[2]=l,e[3]=a,e[4]=o):o=e[4],o}function Cn(s){const e=$.c(24),{org:t}=he(),l=Qt(),a=Cs(),r=Rs();let o;e[0]!==r||e[1]!==s?(o=async g=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=(await r.call("COLLECTION_THREADS_GET",{id:s})).item?.metadata??{},y=(h.expanded_tools??[]).filter(j=>j.toolName!==g.toolName);y.push({...g,expandedAt:new Date().toISOString()});const v={...h,expanded_tools:y};return await r.call("COLLECTION_THREADS_UPDATE",{id:s,data:{metadata:v}}),y},e[0]=r,e[1]=s,e[2]=o):o=e[2];let i,d,c;e[3]!==t||e[4]!==l||e[5]!==s?(i=async g=>{const b=me.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:b});const h=l.getQueryData(b),y=(h?.metadata?.expanded_tools??[]).filter(v=>v.toolName!==g.toolName);return y.push({...g,expandedAt:new Date().toISOString()}),l.setQueryData(b,v=>v&&{...v,metadata:{...v.metadata??{},expanded_tools:y}}),{previous:h}},d=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},c=(g,b,h)=>{const S=me.ensureTask(t.id,s??"");h?.previous===void 0?l.removeQueries({queryKey:S,exact:!0}):l.setQueryData(S,h.previous),De.error(g instanceof Error?g.message:"Failed to expand tool")},e[3]=t,e[4]=l,e[5]=s,e[6]=i,e[7]=d,e[8]=c):(i=e[6],d=e[7],c=e[8]);let m;e[9]!==o||e[10]!==i||e[11]!==d||e[12]!==c?(m={mutationFn:o,onMutate:i,onSuccess:d,onError:c},e[9]=o,e[10]=i,e[11]=d,e[12]=c,e[13]=m):m=e[13];const p=Yt(m);let u;e[14]!==a||e[15]!==p||e[16]!==t||e[17]!==l||e[18]!==s?(u=g=>{if(!s||!a)return;const b=me.ensureTask(t.id,s),h=l.getQueryData(b),y=(h?.metadata?.expanded_tools??[]).filter(j=>j.toolName!==g.toolName);y.push({...g,expandedAt:new Date().toISOString()});const v={...h?.metadata??{},expanded_tools:y};l.setQueryData(b,j=>j&&{...j,metadata:v}),a.patchThread({id:s,metadata:v}),p.mutate(g)},e[14]=a,e[15]=p,e[16]=t,e[17]=l,e[18]=s,e[19]=u):u=e[19];const f=u;let x;return e[20]!==f||e[21]!==p.isPending||e[22]!==p.mutate?(x={addOrReplace:p.mutate,addOrReplaceEager:f,isPending:p.isPending},e[20]=f,e[21]=p.isPending,e[22]=p.mutate,e[23]=x):x=e[23],x}function $n(s){if(s<1024)return`${s} B`;if(s<1024*1024){const t=s/1024;return t<10?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}const e=s/(1024*1024);return e<10?`${e.toFixed(1)} MB`:`${Math.round(e)} MB`}function In(s,e,t,l){const{data:a,isLoading:r}=Ve({queryKey:me.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const o=await Ls({connectionId:e,orgId:t,orgSlug:l});try{const{tools:i}=await o.listTools(),d=Et(s);return i.find(c=>c.name===d)??null}finally{await o.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:a??void 0,isLoading:r}}const Mn={read:{icon:nt,label:"Read File"},write:{icon:Ds,label:"Write File"},edit:{icon:rs,label:"Edit File"},grep:{icon:Bs,label:"Search Content"},glob:{icon:Os,label:"Find Files"},bash:{icon:as,label:"Run Command"},read_tool_output:{icon:nt,label:"Read Tool Output"},read_resource:{icon:os,label:"Read Resource"},read_prompt:{icon:wt,label:"Read Prompt"},enable_tool:{icon:Fs,label:"Enable Tool"},open_in_agent:{icon:ls,label:"Open in Agent"},sandbox:{icon:ns,label:"Run Code"},copy_to_sandbox:{icon:Tt,label:"Load File"},share_with_user:{icon:Hs,label:"Share with User"},take_screenshot:{icon:Se,label:"Take Screenshot"},scrape_url:{icon:Ie,label:"Scrape URL"},inspect_page:{icon:ss,label:"Inspect Page"}},An="bash-sleep-start:";function Rn(s){const e=An+s;try{const t=sessionStorage.getItem(e);if(t!==null){const a=Number.parseInt(t,10);if(Number.isFinite(a))return a}const l=Date.now();return sessionStorage.setItem(e,String(l)),l}catch{return Date.now()}}function Ln(s,e){const t=$.c(2);let l;t[0]!==s?(l=()=>Rn(s),t[0]=s,t[1]=l):l=t[1];const a=H.useState(l)[0];return e??a}function zn(s){const e=Math.ceil(s/1e3);if(e<60)return`${e}s`;const t=Math.floor(e/60),l=e%60;return l?`${t}m ${l}s`:`${t}m`}function En(s){const e=$.c(4),{toolCallId:t,durationMs:l,anchorMs:a}=s;pt(1e3);const o=Ln(t,a)+l-Date.now();let i;e[0]!==o?(i=o>0?`Waiting ${zn(o)}`:"Wrapping up…",e[0]=o,e[1]=i):i=e[1];let d;return e[2]!==i?(d=n.jsx("span",{className:"tabular-nums",children:i}),e[2]=i,e[3]=d):d=e[3],d}const Pn={s:1e3,m:6e4,h:36e5,d:864e5};function Fn(s){const e=/(?:^|[\s;&|(])sleep((?:\s+[\d.]+[smhd]?)+)/g;let t=0,l=!1;for(const a of s.matchAll(e))for(const r of a[1].trim().split(/\s+/)){const o=/^([\d.]+)([smhd]?)$/.exec(r);if(!o)continue;const i=Number.parseFloat(o[1]);Number.isFinite(i)&&(t+=i*(Pn[o[2]||"s"]??1e3),l=!0)}return l?t:null}function Le(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function ye(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}function Me(s){const e=ye(s);if(e===""||e==="[Non-serializable value]")return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const Dn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function On(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const l of e.parts)if(l.type==="text"&&typeof l.text=="string")t.push(l.text);else if(l.type==="reasoning")t.push(`## Reasoning
1
+ import{e as $,r as H,P as ct,H as Kt,G as Xt,j as n,B as ke,R as et,c as q,t as Jt,p as he,F as Qt,a as Yt,K as me,n as De,m as Ve,f as je,E as Zt,z as es,by as qe}from"./index-3ttoiVWU.js";import{$ as ts,G as ss,B as ns,ad as ls,O as os,N as as,M as rs,a9 as ut,ae as is,af as cs,A as dt,ag as ie,ah as us,ai as ds,aj as fs,b as ms}from"./agent-icon-rbRaklR8.js";import{t as Ae}from"./Stars01-CF50N3iu.js";import{a as ft,t as ps,b as Ce,d as xs}from"./XCircle-CShXLucc.js";import{i as Ge}from"./Check-Cb8huOHH.js";import{i as tt}from"./ChevronRight-D0iMeTJ5.js";import{a as mt,s as gs}from"./Eye-DcL-kKgm.js";import{a as de,u as pt,t as xt,c as st}from"./use-clock-tick-DervAiLh.js";import{N as gt,R as ht,e as bt,C as hs,f as bs,g as ys,u as js,i as vs,d as Ns}from"./scroll-area-G2D-rhCe.js";import{u as yt}from"./use-copy-CeVxNpud.js";import{T as pe,a as xe,b as ge}from"./tooltip-FBNw4nVO.js";import{M as jt,I as vt,F as Ss}from"./file-type-icon-C6U2veNU.js";import{c as ks}from"./content-blocks-o63cs2vh.js";import{g as Nt,M as _s}from"./types-n2YDSxA4.js";import{g as ve,i as ws,d as Ke,a as Ts}from"./chat-context-D-8AD0J7.js";import{l as Cs,f as $s,m as Is,n as Ms,R as As}from"./tab-id-rjh-jKlB.js";import{u as Rs}from"./studio-tools-C7SlPTsZ.js";import{c as Ls,u as St,b as zs}from"./use-mcp-client-CLwLq9Vl.js";import{i as kt}from"./AlertCircle-Bdl8L7il.js";import{s as Ie,t as _t}from"./Star01-DgOBkoy7.js";import{s as Es}from"./XClose-BFJ573RS.js";import{n as wt}from"./ZapSquare-Cz0n89qc.js";import{n as Tt,i as Ps}from"./Globe01-BX4SSb6A.js";import{b as Fs,i as Ds,a as Ee}from"./Tool01-BLdHAOru.js";import{a as nt,i as Os}from"./ZoomOut-CqeB-Ycx.js";import{i as Se}from"./Monitor01-CRf7BSF8.js";import{i as Bs}from"./SearchMd-D6F8AHrW.js";import{i as Hs}from"./Upload01-CBpPl05N.js";import{u as Ws,c as Us}from"./shell-layout-B0RfVT3C.js";import{n as Ct}from"./LinkExternal01-DQiI5oxv.js";import{I as Re}from"./integration-icon-BRZNp1S0.js";import{u as Vs}from"./use-virtual-mcp-BgfAZ5Jr.js";import{a as $t}from"./Users03-DE6tDcyz.js";import{a as ce}from"./Palette-EMfX7hNs.js";import{l as It}from"./use-navigate-to-agent-B002vpC6.js";import{a as qs}from"./use-connection-DYg5H00C.js";import{s as Gs}from"./Stars02-AWskXgtc.js";import{g as Ks}from"./use-mcp-prompts-B267X-_C.js";import{c as Xs,b as Js,d as Qs,a as Ys,D as Zs}from"./dialog-B2mbqsst.js";import{a as en,F as tn,b as sn,c as nn,d as ln,f as on}from"./form-CU3vQdRi.js";import{I as an}from"./input-DVih3Sjm.js";import{S as rn}from"./spinner-2N-kj7x0.js";import{t as cn}from"./ChevronDown-D_ybfzhh.js";const un={openrouter:s=>{const e=s?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function Mt(s){if(!s?.providerMetadata)return 0;for(const e of Object.values(un)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function At(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Rt(s,e){if(!e)return s;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,l=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:s.inputTokens+(e.inputTokens??0),outputTokens:s.outputTokens+(e.outputTokens??0),reasoningTokens:s.reasoningTokens+(e.reasoningTokens??0),totalTokens:s.totalTokens+(e.totalTokens??0),cost:s.cost+Mt(e),cacheReadTokens:s.cacheReadTokens+t,cacheWriteTokens:s.cacheWriteTokens+l}}function Ma(s){return s.reduce((e,t)=>Rt(e,t.metadata?.usage),At())}function dn(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Xe(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Je(s,e){if(!e)return s;const t=`${dn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function fn(s,e){return Je(s,e).replace(/[_-]/g," ").toLowerCase()}function mn(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?et().min(1,"Required"):et();return ct(e)}function pn(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function xn(s){const e=$.c(66),{prompt:t,setPrompt:l,onSubmit:a,defaultValues:r}=s,o=H.useId();let i;if(e[0]!==t){const L=t?mn(t):ct({});i=Kt(L),e[0]=t,e[1]=i}else i=e[1];const c=i;let m;e[2]!==r||e[3]!==t?(m=t?pn(t,r):{},e[2]=r,e[3]=t,e[4]=m):m=e[4];let p;e[5]!==c||e[6]!==m?(p={resolver:c,defaultValues:m,mode:"onChange"},e[5]=c,e[6]=m,e[7]=p):p=e[7];const u=Xt(p);let f;e[8]!==t?.arguments?(f=t?.arguments??[],e[8]=t?.arguments,e[9]=f):f=e[9];const x=f;let g;e[10]!==u||e[11]!==a||e[12]!==l?(g=async L=>{await a(L),l(null),u.reset()},e[10]=u,e[11]=a,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==u||e[15]!==l?(h=L=>{L||(u.reset(),l(null))},e[14]=u,e[15]=l,e[16]=h):h=e[16];const S=h;if(!t)return null;let y;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(y=t.title||fn(t.name,Xe(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=y):y=e[20];let v;e[21]!==y?(v=n.jsx(Xs,{children:n.jsx("span",{className:"capitalize",children:y})}),e[21]=y,e[22]=v):v=e[22];let j;e[23]!==t.description?(j=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=j):j=e[24];let N;e[25]!==j||e[26]!==v?(N=n.jsxs(Js,{children:[v,j]}),e[25]=j,e[26]=v,e[27]=N):N=e[27];let k;e[28]!==u||e[29]!==b?(k=L=>{L.stopPropagation(),u.handleSubmit(b)(L)},e[28]=u,e[29]=b,e[30]=k):k=e[30];let _;if(e[31]!==x||e[32]!==u.control||e[33]!==u.formState.isSubmitting){let L;e[35]!==u.control||e[36]!==u.formState.isSubmitting?(L=z=>n.jsx(tn,{control:u.control,name:z.name,render:D=>{const{field:W}=D;return n.jsxs(sn,{children:[n.jsxs(nn,{className:"text-xs",children:[z.name,z.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(ln,{children:n.jsx(an,{...W,value:W.value??"",required:z.required,placeholder:z.description??"",className:"h-9",disabled:u.formState.isSubmitting})}),n.jsx(on,{})]})}},z.name),e[35]=u.control,e[36]=u.formState.isSubmitting,e[37]=L):L=e[37],_=x.map(L),e[31]=x,e[32]=u.control,e[33]=u.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==S?(w=()=>S(!1),e[38]=S,e[39]=w):w=e[39];let T;e[40]!==u.formState.isSubmitting||e[41]!==w?(T=n.jsx(ke,{type:"button",variant:"ghost",onClick:w,disabled:u.formState.isSubmitting,children:"Cancel"}),e[40]=u.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==u.formState.isSubmitting?(I=u.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(rn,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=u.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==u.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(ke,{type:"submit",form:o,disabled:u.formState.isSubmitting,children:I}),e[45]=u.formState.isSubmitting,e[46]=o,e[47]=I,e[48]=M):M=e[48];let C;e[49]!==T||e[50]!==M?(C=n.jsxs(Qs,{children:[T,M]}),e[49]=T,e[50]=M,e[51]=C):C=e[51];let A;e[52]!==o||e[53]!==k||e[54]!==_||e[55]!==C?(A=n.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:k,children:[_,C]}),e[52]=o,e[53]=k,e[54]=_,e[55]=C,e[56]=A):A=e[56];let R;e[57]!==u||e[58]!==A?(R=n.jsx(en,{...u,children:A}),e[57]=u,e[58]=A,e[59]=R):R=e[59];let F;e[60]!==N||e[61]!==R?(F=n.jsxs(Ys,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[N,R]}),e[60]=N,e[61]=R,e[62]=F):F=e[62];let E;return e[63]!==S||e[64]!==F?(E=n.jsx(Zs,{open:!0,onOpenChange:S,children:F}),e[63]=S,e[64]=F,e[65]=E):E=e[65],E}function Lt(s){return s?s.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function re(s,e){return s==="output-error"||s==="output-denied"?"error":s==="approval-requested"?"approval":s==="input-streaming"||s==="input-available"||s==="output-available"&&e===!0?"loading":"idle"}function Ne(s){if(s==null||typeof s!="object")return;const e=s;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return s}function gn(s){return s.storage.mention}function Aa(s,e,t){s.chain().focus().insertContentAt(e,[zt(t),{type:"text",text:" "}]).run()}function zt(s){return{type:"mention",attrs:s}}function hn(s){const e=$.c(19),{node:t,selected:l,view:a,editor:r,getPos:o}=s,{name:i,char:d,kind:c,id:m,args:p}=t.attrs,u=l&&a.editable,f=d==="@",x=a.editable&&d==="/"&&c!=="resource";let g;e[0]!==p||e[1]!==r||e[2]!==o||e[3]!==m||e[4]!==x||e[5]!==i?(g=_=>{if(!x)return;const T=gn(r)?.onEditChip;if(!T||typeof o!="function")return;const I=o();typeof I=="number"&&(_.preventDefault(),_.stopPropagation(),T({promptId:m,promptName:i,args:p??{},pos:I}))},e[0]=p,e[1]=r,e[2]=o,e[3]=m,e[4]=x,e[5]=i,e[6]=g):g=e[6];const b=g,h=x?"cursor-pointer":"cursor-default",S=f?"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",y=u&&"outline-2 outline-blue-300 outline-offset-0",v=x&&"hover:brightness-95";let j;e[7]!==h||e[8]!==S||e[9]!==y||e[10]!==v?(j=q("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",S,y,v,"capitalize"),e[7]=h,e[8]=S,e[9]=y,e[10]=v,e[11]=j):j=e[11];let N;e[12]!==i?(N=i?Lt(i):"",e[12]=i,e[13]=N):N=e[13];let k;return e[14]!==d||e[15]!==b||e[16]!==j||e[17]!==N?(k=n.jsxs(bt,{onClick:b,className:j,children:[d,N]}),e[14]=d,e[15]=b,e[16]=j,e[17]=N,e[18]=k):k=e[18],k}const bn=gt.create({name:"mention",group:"inline",inline:!0,atom:!0,addStorage(){return{onEditChip:null}},addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},char:{default:"/",parseHTML:s=>s.getAttribute("data-char")||"/",renderHTML:s=>s.char?{"data-char":s.char}:{}},metadata:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-metadata")||"null")}catch{return null}},renderHTML:s=>s.metadata?{"data-metadata":JSON.stringify(s.metadata)}:{}},kind:{default:null,parseHTML:s=>s.getAttribute("data-kind")||null,renderHTML:s=>s.kind?{"data-kind":s.kind}:{}},args:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-args")||"null")}catch{return null}},renderHTML:s=>s.args?{"data-args":JSON.stringify(s.args)}:{}}}},parseHTML(){return[{tag:'span[data-type="mention"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"mention"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.char&&(t["data-char"]=s.attrs.char),s.attrs.metadata&&(t["data-metadata"]=JSON.stringify(s.attrs.metadata)),s.attrs.kind&&(t["data-kind"]=s.attrs.kind),s.attrs.args&&(t["data-args"]=JSON.stringify(s.attrs.args)),["span",{...e,...t}]},renderText({node:s}){const e=s.attrs.char??"@",t=s.attrs.name??"";return`${e}${t}`},addNodeView(){return ht(hn)}}),yn=/^mcp__[a-zA-Z0-9_-]+__/;function Et(s){return s.replace(yn,"")}function Qe(s){const e=$.c(18),{id:t,part:l,copyable:a,extraActions:r,alwaysShowActions:o,animate:i}=s,d=a===void 0?!1:a,c=o===void 0?!1:o,m=i===void 0?!1:i,{handleCopy:p}=yt(),[u,f]=H.useState(!1);let x;e[0]!==p||e[1]!==t||e[2]!==l.text?(x=async()=>{Jt("chat_message_copied",{message_id:t,chars:l.text.length}),await p(l.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=p,e[1]=t,e[2]=l.text,e[3]=x):x=e[3];const g=x,b=d&&r,h=b||r;let S;e[4]!==m||e[5]!==t||e[6]!==l.text?(S=n.jsx(jt,{id:t,text:l.text,animate:m}),e[4]=m,e[5]=t,e[6]=l.text,e[7]=S):S=e[7];let y;e[8]!==c||e[9]!==r||e[10]!==g||e[11]!==u||e[12]!==h||e[13]!==b?(y=h&&n.jsxs("div",{className:q("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",c?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[r,b&&r&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),b&&n.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:u?n.jsx(Ge,{className:"size-4"}):n.jsx(mt,{className:"size-4"})})]}),e[8]=c,e[9]=r,e[10]=g,e[11]=u,e[12]=h,e[13]=b,e[14]=y):y=e[14];let v;return e[15]!==S||e[16]!==y?(v=n.jsxs("div",{className:"group/part relative",children:[S,y]}),e[15]=S,e[16]=y,e[17]=v):v=e[17],v}function Ra(s,e,t){s.chain().focus().insertContentAt(e,[jn(t),{type:"text",text:" "}]).run()}function jn(s){return{type:"file",attrs:s}}function vn(s){const e=$.c(17),{node:t,selected:l,view:a}=s,{name:r,mimeType:o,data:i}=t.attrs,d=l&&a.editable;let c;e[0]!==o?(c=o.startsWith("image/"),e[0]=o,e[1]=c):c=e[1];const m=c,p=d&&"outline-2 outline-blue-300 outline-offset-0";let u;e[2]!==p?(u=q("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",p),e[2]=p,e[3]=u):u=e[3];let f;e[4]!==r?(f=n.jsx(pe,{asChild:!0,children:n.jsx("span",{children:r})}),e[4]=r,e[5]=f):f=e[5];let x;e[6]!==i||e[7]!==m||e[8]!==o||e[9]!==r?(x=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${o};base64,${i}`,alt:r,className:"max-w-full max-h-64 object-contain rounded"}):n.jsxs("div",{className:"text-xs",children:[n.jsx("div",{className:"font-medium",children:r}),n.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=i,e[7]=m,e[8]=o,e[9]=r,e[10]=x):x=e[10];let g;e[11]!==f||e[12]!==x?(g=n.jsxs(ge,{children:[f,x]}),e[11]=f,e[12]=x,e[13]=g):g=e[13];let b;return e[14]!==u||e[15]!==g?(b=n.jsx(bt,{className:u,children:g}),e[14]=u,e[15]=g,e[16]=b):b=e[16],b}const Nn=gt.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},mimeType:{default:null,parseHTML:s=>s.getAttribute("data-mime-type")||null,renderHTML:s=>s.mimeType?{"data-mime-type":s.mimeType}:{}},size:{default:0,parseHTML:s=>{const e=s.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:s=>s.size?{"data-size":String(s.size)}:{}},data:{default:null,parseHTML:s=>s.getAttribute("data-data")||null,renderHTML:s=>s.data?{"data-data":s.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"file"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.mimeType&&(t["data-mime-type"]=s.attrs.mimeType),s.attrs.size&&(t["data-size"]=String(s.attrs.size)),s.attrs.data&&(t["data-data"]=s.attrs.data),["span",{...e,...t}]},renderText({node:s}){return`[${s.attrs.name??""}]`},addNodeView(){return ht(vn)}}),fe=16,Oe=2.5,Be=(fe-Oe)/2,Pe=2*Math.PI*Be;function Sn(s){const e=$.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:a,outputTokens:r,cost:o}=t;if(!l&&!a&&!r)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ts,{size:12}),e[0]=i):i=e[0];let d;e[1]!==o||e[2]!==l?(d=o>0?`$${o.toFixed(4)}`:l.toLocaleString(),e[1]=o,e[2]=l,e[3]=d):d=e[3];let c;e[4]!==d?(c=n.jsx(pe,{asChild:!0,children:n.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[i,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:d})]})}),e[4]=d,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=p):p=e[7];let u;e[8]!==a?(u=a.toLocaleString(),e[8]=a,e[9]=u):u=e[9];let f;e[10]!==u?(f=n.jsx("span",{className:"text-right tabular-nums",children:u}),e[10]=u,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"text-muted",children:"out"}),e[12]=x):x=e[12];const g=r-(t.reasoningTokens??0);let b;e[13]!==g?(b=g.toLocaleString(),e[13]=g,e[14]=b):b=e[14];let h;e[15]!==b?(h=n.jsx("span",{className:"text-right tabular-nums",children:b}),e[15]=b,e[16]=h):h=e[16];let S;e[17]!==a||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(S=(t.cacheReadTokens>0||t.cacheWriteTokens>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:a>0?`${(t.cacheReadTokens/a*100).toFixed(0)}%`:"0%"})]}),e[17]=a,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=S):S=e[20];let y;e[21]!==o?(y=o>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",o.toFixed(4)]})]}),e[21]=o,e[22]=y):y=e[22];let v;e[23]!==h||e[24]!==S||e[25]!==y||e[26]!==f?(v=n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[m,n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[p,f,x,h,S,y]})]}),e[23]=h,e[24]=S,e[25]=y,e[26]=f,e[27]=v):v=e[27];let j;return e[28]!==v||e[29]!==c?(j=n.jsxs(ge,{children:[c,v]}),e[28]=v,e[29]=c,e[30]=j):j=e[30],j}function kn(s){const e=$.c(19),{usage:t,duration:l}=s,a=l!=null&&l>0,r=t!=null&&(t.cost??0)>0,o=t!=null&&(t.totalTokens??0)>0;if(!a&&!r&&!o)return null;let i;e[0]!==l||e[1]!==a?(i=a?de(l/1e3):null,e[0]=l,e[1]=a,e[2]=i):i=e[2];const d=i;let c;e[3]!==l||e[4]!==d||e[5]!==t?(c=d&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:d})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),n.jsx("span",{className:"tabular-nums",children:de(l/1e3)}),(t?.reasoningTokens??0)>0&&n.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=l,e[4]=d,e[5]=t,e[6]=c):c=e[6];let m;e[7]!==r||e[8]!==a||e[9]!==o?(m=a&&(r||o)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=r,e[8]=a,e[9]=o,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==o||e[13]!==t?(p=(r||o)&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:r?`$${t.cost.toFixed(4)}`:`${t.totalTokens.toLocaleString()} tok`})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[n.jsx("span",{className:"opacity-60",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:(t.inputTokens??0).toLocaleString()}),n.jsx("span",{className:"opacity-60",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:((t.outputTokens??0)-(t?.reasoningTokens??0)).toLocaleString()}),(t?.reasoningTokens??0)>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"think"}),n.jsx("span",{className:"text-right tabular-nums",children:t.reasoningTokens.toLocaleString()})]}),((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:(t?.inputTokens??0)>0?`${((t?.cacheReadTokens??0)/t.inputTokens*100).toFixed(0)}%`:"0%"})]})]})]})]}),e[11]=r,e[12]=o,e[13]=t,e[14]=p):p=e[14];let u;return e[15]!==c||e[16]!==m||e[17]!==p?(u=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c,m,p]}),e[15]=c,e[16]=m,e[17]=p,e[18]=u):u=e[18],u}function La(s){const e=$.c(51),{usage:t,totalTokens:l,contextWindow:a,onOpenContextPanel:r}=s,o=Math.min(l/a*100,100),i=Pe-o/100*Pe,d=t?.cost??0,c=t?.inputTokens??0,m=t?.outputTokens??0;let p;e[0]!==o?(p=o.toFixed(0),e[0]=o,e[1]=p):p=e[1];let u;e[2]!==d?(u=d>0?`, $${d.toFixed(2)}`:"",e[2]=d,e[3]=u):u=e[3];const f=`Context usage: ${p}%${u}`,x=r?"cursor-pointer":"cursor-default";let g;e[4]!==x?(g=q("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",x),e[4]=x,e[5]=g):g=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("circle",{cx:fe/2,cy:fe/2,r:Be,fill:"none",stroke:"currentColor",strokeWidth:Oe,className:"opacity-15"}),e[6]=b):b=e[6];const h=o>90?"text-destructive":o>70?"text-warning":"text-muted-foreground";let S;e[7]!==h?(S=q(h),e[7]=h,e[8]=S):S=e[8];let y;e[9]!==i||e[10]!==S?(y=n.jsxs("svg",{width:fe,height:fe,className:"-rotate-90",children:[b,n.jsx("circle",{cx:fe/2,cy:fe/2,r:Be,fill:"none",stroke:"currentColor",strokeWidth:Oe,strokeDasharray:Pe,strokeDashoffset:i,strokeLinecap:"round",className:S})]}),e[9]=i,e[10]=S,e[11]=y):y=e[11];let v;e[12]!==o?(v=o.toFixed(0),e[12]=o,e[13]=v):v=e[13];let j;e[14]!==d?(j=d>0?` · $${d.toFixed(2)}`:"",e[14]=d,e[15]=j):j=e[15];let N;e[16]!==v||e[17]!==j?(N=n.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[v,"%",j]}),e[16]=v,e[17]=j,e[18]=N):N=e[18];let k;e[19]!==r||e[20]!==N||e[21]!==f||e[22]!==g||e[23]!==y?(k=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:r,"aria-label":f,className:g,children:[y,N]})}),e[19]=r,e[20]=N,e[21]=f,e[22]=g,e[23]=y,e[24]=k):k=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("span",{className:"text-muted",children:"context"}),e[25]=_):_=e[25];let w;e[26]!==l?(w=l.toLocaleString(),e[26]=l,e[27]=w):w=e[27];let T;e[28]!==a?(T=a.toLocaleString(),e[28]=a,e[29]=T):T=e[29];let I;e[30]!==o?(I=o.toFixed(1),e[30]=o,e[31]=I):I=e[31];let M;e[32]!==w||e[33]!==T||e[34]!==I?(M=n.jsxs("span",{className:"text-right tabular-nums",children:[w," / ",T," (",I,"%)"]}),e[32]=w,e[33]=T,e[34]=I,e[35]=M):M=e[35];let C;e[36]!==d||e[37]!==c||e[38]!==m?(C=d>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",d.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:c.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=d,e[37]=c,e[38]=m,e[39]=C):C=e[39];let A;e[40]!==c||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(A=((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:c>0?`${((t?.cacheReadTokens??0)/c*100).toFixed(0)}%`:"0%"})]}),e[40]=c,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=A):A=e[43];let R;e[44]!==M||e[45]!==C||e[46]!==A?(R=n.jsx(xe,{side:"top",className:"font-mono text-[11px]",children:n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[_,M,C,A]})}),e[44]=M,e[45]=C,e[46]=A,e[47]=R):R=e[47];let F;return e[48]!==k||e[49]!==R?(F=n.jsxs(ge,{children:[k,R]}),e[48]=k,e[49]=R,e[50]=F):F=e[50],F}function _n(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(ys,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function wn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(hs,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function Tn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(bs,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function Pt({containerRef:s,enabled:e,contentDeps:t=[],threshold:l,intervalMs:a=500}){const[r,o]=H.useState(null),[i,d]=H.useState(!1),c=l??(s?.95:.1),m=()=>{if(s?.current){s.current.scrollTop=s.current.scrollHeight;return}if(!r)return;let p=r.parentElement;for(;p;){const u=window.getComputedStyle(p);if(u.overflowY==="auto"||u.overflowY==="scroll"||u.overflow==="auto"||u.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return H.useEffect(()=>{if(!r)return;const p=new IntersectionObserver(u=>{const f=u[0]?.isIntersecting??!1;d(f)},{root:s?.current??null,threshold:c,rootMargin:"0px"});return p.observe(r),()=>p.disconnect()},[r,c]),H.useEffect(()=>{if(!e||!i)return;const p=setInterval(m,a);return()=>clearInterval(p)},[e,i,a]),H.useEffect(()=>{!e||!i||m()},[e,i,...t]),{sentinelRef:o,isTracking:i}}function B(s){const e=$.c(53),{icon:t,title:l,usage:a,summary:r,state:o,detail:i,detailVariant:d,forceOpen:c,variant:m,trailing:p,iconDestructive:u,alwaysChevron:f,defaultOpen:x,children:g}=s,b=d===void 0?"code":d,h=m===void 0?"default":m,[S,y]=H.useState(x??!1),{handleCopy:v,copied:j}=yt(),N=o==="loading",k=o==="error";let _;e[0]!==i?(_=i&&i.trim(),e[0]=i,e[1]=_):_=e[1];const T=!!_||!!g,I=h==="subtask",M=(c??!1)||S,C=H.useRef(null),A=N&&M;let R;e[2]!==i?(R=[i],e[2]=i,e[3]=R):R=e[3];let F;e[4]!==A||e[5]!==R?(F={containerRef:C,enabled:A,contentDeps:R},e[4]=A,e[5]=R,e[6]=F):F=e[6];const{sentinelRef:E}=Pt(F),L=c?void 0:y,z=!T,D=T&&"[@media(hover:hover)]:hover:bg-accent/30",W=!T&&"cursor-default",U=N&&"shimmer";let O;e[7]!==W||e[8]!==U||e[9]!==D?(O=q("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",D,W,U),e[7]=W,e[8]=U,e[9]=D,e[10]=O):O=e[10];const K=!T;let G;e[11]!==f||e[12]!==M||e[13]!==t||e[14]!==u||e[15]!==k||e[16]!==T?(G=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:f?n.jsx(tt,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:q("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",u?"[&>svg]:text-destructive/70":k?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",T&&(M?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),T&&n.jsx("div",{className:q("absolute inset-0 flex items-center justify-center transition-opacity duration-150",M?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:n.jsx(tt,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")})})]})}),e[11]=f,e[12]=M,e[13]=t,e[14]=u,e[15]=k,e[16]=T,e[17]=G):G=e[17];const Y=k?"text-warning/80":"text-foreground";let Q;e[18]!==Y?(Q=q("shrink-0 text-[14px] font-normal",Y),e[18]=Y,e[19]=Q):Q=e[19];let te;e[20]!==Q||e[21]!==l?(te=n.jsx("span",{className:Q,children:l}),e[20]=Q,e[21]=l,e[22]=te):te=e[22];let P;e[23]!==r?(P=r?n.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:r})}):n.jsx("div",{className:"flex-1"}),e[23]=r,e[24]=P):P=e[24];let V;e[25]!==p?(V=p&&n.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:p}),e[25]=p,e[26]=V):V=e[26];let X;e[27]!==a?(X=n.jsx(Sn,{usage:a}),e[27]=a,e[28]=X):X=e[28];let J;e[29]!==O||e[30]!==K||e[31]!==G||e[32]!==te||e[33]!==P||e[34]!==V||e[35]!==X||e[36]!==z?(J=n.jsxs(wn,{disabled:z,className:O,"aria-disabled":K,children:[G,te,P,V,X]}),e[29]=O,e[30]=K,e[31]=G,e[32]=te,e[33]=P,e[34]=V,e[35]=X,e[36]=z,e[37]=J):J=e[37];let se;e[38]!==g||e[39]!==j||e[40]!==i||e[41]!==b||e[42]!==v||e[43]!==T||e[44]!==E?(se=T&&n.jsx(Tn,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:g||(b==="prose"?n.jsx("div",{className:"mt-1 mb-1",children:n.jsxs("div",{ref:C,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:[n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:i}),n.jsx("div",{ref:E,className:"h-0 shrink-0"})]})}):n.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:n.jsxs("div",{ref:C,className:"flex flex-col max-h-48 overflow-y-auto",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:i})}),n.jsx("button",{type:"button",onClick:()=>v(i),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":"Copy",children:j?n.jsx(Ge,{className:"size-3.5"}):n.jsx(mt,{className:"size-3.5"})})]}),n.jsx("div",{ref:E,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=j,e[40]=i,e[41]=b,e[42]=v,e[43]=T,e[44]=E,e[45]=se):se=e[45];let ue;e[46]!==M||e[47]!==J||e[48]!==se||e[49]!==L?(ue=n.jsxs(_n,{open:M,onOpenChange:L,className:"min-w-0",children:[J,se]}),e[46]=M,e[47]=J,e[48]=se,e[49]=L,e[50]=ue):ue=e[50];const oe=ue;if(I){let ae;return e[51]!==oe?(ae=n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:oe}),e[51]=oe,e[52]=ae):ae=e[52],ae}return oe}function le(s){const e=$.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=de(t),e[0]=t,e[1]=l):l=e[1];let a;return e[2]!==l?(a=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=a):a=e[3],a}const Ft=4;function Dt(s){const e=$.c(5),{count:t,noun:l,onClick:a}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(ft,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=r):r=e[0];let o;return e[1]!==t||e[2]!==l||e[3]!==a?(o=n.jsxs("button",{type:"button",onClick:a,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:["See all ",t," ",l,r]}),e[1]=t,e[2]=l,e[3]=a,e[4]=o):o=e[4],o}function Cn(s){const e=$.c(24),{org:t}=he(),l=Qt(),a=Cs(),r=Rs();let o;e[0]!==r||e[1]!==s?(o=async g=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=(await r.call("COLLECTION_THREADS_GET",{id:s})).item?.metadata??{},y=(h.expanded_tools??[]).filter(j=>j.toolName!==g.toolName);y.push({...g,expandedAt:new Date().toISOString()});const v={...h,expanded_tools:y};return await r.call("COLLECTION_THREADS_UPDATE",{id:s,data:{metadata:v}}),y},e[0]=r,e[1]=s,e[2]=o):o=e[2];let i,d,c;e[3]!==t||e[4]!==l||e[5]!==s?(i=async g=>{const b=me.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:b});const h=l.getQueryData(b),y=(h?.metadata?.expanded_tools??[]).filter(v=>v.toolName!==g.toolName);return y.push({...g,expandedAt:new Date().toISOString()}),l.setQueryData(b,v=>v&&{...v,metadata:{...v.metadata??{},expanded_tools:y}}),{previous:h}},d=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},c=(g,b,h)=>{const S=me.ensureTask(t.id,s??"");h?.previous===void 0?l.removeQueries({queryKey:S,exact:!0}):l.setQueryData(S,h.previous),De.error(g instanceof Error?g.message:"Failed to expand tool")},e[3]=t,e[4]=l,e[5]=s,e[6]=i,e[7]=d,e[8]=c):(i=e[6],d=e[7],c=e[8]);let m;e[9]!==o||e[10]!==i||e[11]!==d||e[12]!==c?(m={mutationFn:o,onMutate:i,onSuccess:d,onError:c},e[9]=o,e[10]=i,e[11]=d,e[12]=c,e[13]=m):m=e[13];const p=Yt(m);let u;e[14]!==a||e[15]!==p||e[16]!==t||e[17]!==l||e[18]!==s?(u=g=>{if(!s||!a)return;const b=me.ensureTask(t.id,s),h=l.getQueryData(b),y=(h?.metadata?.expanded_tools??[]).filter(j=>j.toolName!==g.toolName);y.push({...g,expandedAt:new Date().toISOString()});const v={...h?.metadata??{},expanded_tools:y};l.setQueryData(b,j=>j&&{...j,metadata:v}),a.patchThread({id:s,metadata:v}),p.mutate(g)},e[14]=a,e[15]=p,e[16]=t,e[17]=l,e[18]=s,e[19]=u):u=e[19];const f=u;let x;return e[20]!==f||e[21]!==p.isPending||e[22]!==p.mutate?(x={addOrReplace:p.mutate,addOrReplaceEager:f,isPending:p.isPending},e[20]=f,e[21]=p.isPending,e[22]=p.mutate,e[23]=x):x=e[23],x}function $n(s){if(s<1024)return`${s} B`;if(s<1024*1024){const t=s/1024;return t<10?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}const e=s/(1024*1024);return e<10?`${e.toFixed(1)} MB`:`${Math.round(e)} MB`}function In(s,e,t,l){const{data:a,isLoading:r}=Ve({queryKey:me.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const o=await Ls({connectionId:e,orgId:t,orgSlug:l});try{const{tools:i}=await o.listTools(),d=Et(s);return i.find(c=>c.name===d)??null}finally{await o.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:a??void 0,isLoading:r}}const Mn={read:{icon:nt,label:"Read File"},write:{icon:Ds,label:"Write File"},edit:{icon:rs,label:"Edit File"},grep:{icon:Bs,label:"Search Content"},glob:{icon:Os,label:"Find Files"},bash:{icon:as,label:"Run Command"},read_tool_output:{icon:nt,label:"Read Tool Output"},read_resource:{icon:os,label:"Read Resource"},read_prompt:{icon:wt,label:"Read Prompt"},enable_tool:{icon:Fs,label:"Enable Tool"},open_in_agent:{icon:ls,label:"Open in Agent"},sandbox:{icon:ns,label:"Run Code"},copy_to_sandbox:{icon:Tt,label:"Load File"},share_with_user:{icon:Hs,label:"Share with User"},take_screenshot:{icon:Se,label:"Take Screenshot"},scrape_url:{icon:Ie,label:"Scrape URL"},inspect_page:{icon:ss,label:"Inspect Page"}},An="bash-sleep-start:";function Rn(s){const e=An+s;try{const t=sessionStorage.getItem(e);if(t!==null){const a=Number.parseInt(t,10);if(Number.isFinite(a))return a}const l=Date.now();return sessionStorage.setItem(e,String(l)),l}catch{return Date.now()}}function Ln(s,e){const t=$.c(2);let l;t[0]!==s?(l=()=>Rn(s),t[0]=s,t[1]=l):l=t[1];const a=H.useState(l)[0];return e??a}function zn(s){const e=Math.ceil(s/1e3);if(e<60)return`${e}s`;const t=Math.floor(e/60),l=e%60;return l?`${t}m ${l}s`:`${t}m`}function En(s){const e=$.c(4),{toolCallId:t,durationMs:l,anchorMs:a}=s;pt(1e3);const o=Ln(t,a)+l-Date.now();let i;e[0]!==o?(i=o>0?`Waiting ${zn(o)}`:"Wrapping up…",e[0]=o,e[1]=i):i=e[1];let d;return e[2]!==i?(d=n.jsx("span",{className:"tabular-nums",children:i}),e[2]=i,e[3]=d):d=e[3],d}const Pn={s:1e3,m:6e4,h:36e5,d:864e5};function Fn(s){const e=/(?:^|[\s;&|(])sleep((?:\s+[\d.]+[smhd]?)+)/g;let t=0,l=!1;for(const a of s.matchAll(e))for(const r of a[1].trim().split(/\s+/)){const o=/^([\d.]+)([smhd]?)$/.exec(r);if(!o)continue;const i=Number.parseFloat(o[1]);Number.isFinite(i)&&(t+=i*(Pn[o[2]||"s"]??1e3),l=!0)}return l?t:null}function Le(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function ye(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}function Me(s){const e=ye(s);if(e===""||e==="[Non-serializable value]")return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const Dn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function On(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const l of e.parts)if(l.type==="text"&&typeof l.text=="string")t.push(l.text);else if(l.type==="reasoning")t.push(`## Reasoning
2
2
  ${l.text}`);else if(l.type==="source-url")t.push(`## Source URL
3
3
  ${l.url}`);else if(l.type==="source-document")t.push(`## Source Document
4
4
  ${l.title}`);else if(l.type==="file")t.push(`## File
@@ -1 +1 @@
1
- import{e as o,j as t,dH as n}from"./index-DElySjov.js";function a(){const s=o.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),s[0]=e):e=s[0],e}export{a as default};
1
+ import{e as o,j as t,dH as n}from"./index-3ttoiVWU.js";function a(){const s=o.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),s[0]=e):e=s[0],e}export{a as default};
@@ -1 +1 @@
1
- import{e as S,j as s,r as w,dH as y}from"./index-DElySjov.js";import{i as R}from"./Check-eedT9M4f.js";import{t as _}from"./ChevronDown-D6-hnD5Z.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
1
+ import{e as S,j as s,r as w,dH as y}from"./index-3ttoiVWU.js";import{i as R}from"./Check-Cb8huOHH.js";import{t as _}from"./ChevronDown-D_ybfzhh.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
@@ -1 +1 @@
1
- import{r as F,e as V,j as s,p as W,f as X,g as Z,d as ee,b as te,K as ne,m as se,O as ie,l as oe,B as le}from"./index-DElySjov.js";import{u as re}from"./use-connection-DWiJ60zQ.js";import{j as ae}from"./use-mcp-client-4hZRsKeH.js";import{u as ce}from"./studio-tools-BniDnWv9.js";import{a as ue}from"./Settings02-Dg39zp7t.js";import{P as B}from"./index-BD1xF-xP.js";const de=F.createContext(null);function K(i){const e=V.c(3),{value:C,children:m}=i,t=C;let o;return e[0]!==m||e[1]!==t?(o=s.jsx(de.Provider,{value:t,children:m}),e[0]=m,e[1]=t,e[2]=o):o=e[2],o}F.createContext(null);function me(i){return{id:i.id,title:i.title,icon:i.icon,description:i.description,app_name:i.app_name,app_id:i.app_id,tools:i.tools,metadata:i.metadata}}function Pe(i){const e=V.c(57),{bindingName:C,renderEmptyState:m}=i,{org:t,project:o}=W(),M=X();let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={strict:!1},e[0]=j):j=e[0];const{org:T,taskId:k,pluginId:f}=Z(j);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={strict:!1},e[1]=v):v=e[1];const w=ee(v).virtualmcpid;let P;e[2]!==C?(P={binding:C},e[2]=C,e[3]=P):P=e[3];const R=re(P),{data:g}=te.useSession(),G=ce();let x;e[4]!==f||e[5]!==o.id?(x=ne.projectPluginConfig(o.id??"",f),e[4]=f,e[5]=o.id,e[6]=x):x=e[6];let p;e[7]!==f||e[8]!==o.id||e[9]!==G?(p=async()=>await G.call("VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:o.id,pluginId:f}),e[7]=f,e[8]=o.id,e[9]=G,e[10]=p):p=e[10];const O=!!o.id&&!!f;let _;e[11]!==x||e[12]!==p||e[13]!==O?(_={queryKey:x,queryFn:p,enabled:O},e[11]=x,e[12]=p,e[13]=O,e[14]=_):_=e[14];const{data:A,isLoading:D}=se(_),z=A?.config?.connectionId,h=z?R.find(n=>n.id===z):null,I=ae({connectionId:h?.id,orgId:t.id,orgSlug:t.slug});let y;e[15]!==g?(y=g?.user?{user:{id:g.user.id,name:g.user.name,email:g.user.email,image:g.user.image}}:null,e[15]=g,e[16]=y):y=e[16];const a=y;let b;e[17]!==t.id||e[18]!==t.name||e[19]!==t.slug?(b={id:t.id,slug:t.slug,name:t.name},e[17]=t.id,e[18]=t.name,e[19]=t.slug,e[20]=b):b=e[20];const c=b;if(D){let n;return e[21]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(oe,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[21]=n):n=e[21],n}if(R.length===0){let n;e[22]!==c||e[23]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[22]=c,e[23]=a,e[24]=n):n=e[24];const u=n;let r;e[25]!==m?(r=m(),e[25]=m,e[26]=r):r=e[26];let l;e[27]!==r?(l=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r}),e[27]=r,e[28]=l):l=e[28];let d;return e[29]!==u||e[30]!==l?(d=s.jsx(K,{value:u,children:l}),e[29]=u,e[30]=l,e[31]=d):d=e[31],d}if(!h){let n;e[32]!==c||e[33]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[32]=c,e[33]=a,e[34]=n):n=e[34];const u=n;let r;e[35]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(ue,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[35]=r):r=e[35];let l;e[36]!==M||e[37]!==t.slug||e[38]!==T||e[39]!==o.id||e[40]!==k||e[41]!==w?(l=s.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[r,s.jsx(le,{onClick:()=>{const Y=T??t.slug,H=w??o.id??"",J=k??crypto.randomUUID();M({to:"/$org/$taskId",params:{org:Y,taskId:J},search:{virtualmcpid:H,main:"settings"}})},children:"Go to Project Settings"})]}),e[36]=M,e[37]=t.slug,e[38]=T,e[39]=o.id,e[40]=k,e[41]=w,e[42]=l):l=e[42];let d;return e[43]!==u||e[44]!==l?(d=s.jsx(K,{value:u,children:l}),e[43]=u,e[44]=l,e[45]=d):d=e[45],d}const Q=h.id,U=me(h);let N;e[46]!==I?(N=(n,u)=>I?I.callTool({name:n,arguments:u}).then(fe):Promise.reject(new Error("MCP client is not available")),e[46]=I,e[47]=N):N=e[47];const $=N;let S;e[48]!==h||e[49]!==c||e[50]!==a||e[51]!==U||e[52]!==$?(S={connectionId:Q,connection:U,toolCaller:$,org:c,session:a},e[48]=h,e[49]=c,e[50]=a,e[51]=U,e[52]=$,e[53]=S):S=e[53];const q=S;let E;e[54]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(B,{children:s.jsx(B.Content,{children:s.jsx(ie,{})})}),e[54]=E):E=e[54];let L;return e[55]!==q?(L=s.jsx(K,{value:q,children:E}),e[55]=q,e[56]=L):L=e[56],L}function fe(i){return i.structuredContent??i}export{Pe as P};
1
+ import{r as F,e as V,j as s,p as W,f as X,g as Z,d as ee,b as te,K as ne,m as se,O as ie,l as oe,B as le}from"./index-3ttoiVWU.js";import{u as re}from"./use-connection-DYg5H00C.js";import{j as ae}from"./use-mcp-client-CLwLq9Vl.js";import{u as ce}from"./studio-tools-C7SlPTsZ.js";import{a as ue}from"./Settings02-B100KruV.js";import{P as B}from"./index-B0th8sGF.js";const de=F.createContext(null);function K(i){const e=V.c(3),{value:C,children:m}=i,t=C;let o;return e[0]!==m||e[1]!==t?(o=s.jsx(de.Provider,{value:t,children:m}),e[0]=m,e[1]=t,e[2]=o):o=e[2],o}F.createContext(null);function me(i){return{id:i.id,title:i.title,icon:i.icon,description:i.description,app_name:i.app_name,app_id:i.app_id,tools:i.tools,metadata:i.metadata}}function Pe(i){const e=V.c(57),{bindingName:C,renderEmptyState:m}=i,{org:t,project:o}=W(),M=X();let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={strict:!1},e[0]=j):j=e[0];const{org:T,taskId:k,pluginId:f}=Z(j);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={strict:!1},e[1]=v):v=e[1];const w=ee(v).virtualmcpid;let P;e[2]!==C?(P={binding:C},e[2]=C,e[3]=P):P=e[3];const R=re(P),{data:g}=te.useSession(),G=ce();let x;e[4]!==f||e[5]!==o.id?(x=ne.projectPluginConfig(o.id??"",f),e[4]=f,e[5]=o.id,e[6]=x):x=e[6];let p;e[7]!==f||e[8]!==o.id||e[9]!==G?(p=async()=>await G.call("VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:o.id,pluginId:f}),e[7]=f,e[8]=o.id,e[9]=G,e[10]=p):p=e[10];const O=!!o.id&&!!f;let _;e[11]!==x||e[12]!==p||e[13]!==O?(_={queryKey:x,queryFn:p,enabled:O},e[11]=x,e[12]=p,e[13]=O,e[14]=_):_=e[14];const{data:A,isLoading:D}=se(_),z=A?.config?.connectionId,h=z?R.find(n=>n.id===z):null,I=ae({connectionId:h?.id,orgId:t.id,orgSlug:t.slug});let y;e[15]!==g?(y=g?.user?{user:{id:g.user.id,name:g.user.name,email:g.user.email,image:g.user.image}}:null,e[15]=g,e[16]=y):y=e[16];const a=y;let b;e[17]!==t.id||e[18]!==t.name||e[19]!==t.slug?(b={id:t.id,slug:t.slug,name:t.name},e[17]=t.id,e[18]=t.name,e[19]=t.slug,e[20]=b):b=e[20];const c=b;if(D){let n;return e[21]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(oe,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[21]=n):n=e[21],n}if(R.length===0){let n;e[22]!==c||e[23]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[22]=c,e[23]=a,e[24]=n):n=e[24];const u=n;let r;e[25]!==m?(r=m(),e[25]=m,e[26]=r):r=e[26];let l;e[27]!==r?(l=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r}),e[27]=r,e[28]=l):l=e[28];let d;return e[29]!==u||e[30]!==l?(d=s.jsx(K,{value:u,children:l}),e[29]=u,e[30]=l,e[31]=d):d=e[31],d}if(!h){let n;e[32]!==c||e[33]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[32]=c,e[33]=a,e[34]=n):n=e[34];const u=n;let r;e[35]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(ue,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[35]=r):r=e[35];let l;e[36]!==M||e[37]!==t.slug||e[38]!==T||e[39]!==o.id||e[40]!==k||e[41]!==w?(l=s.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[r,s.jsx(le,{onClick:()=>{const Y=T??t.slug,H=w??o.id??"",J=k??crypto.randomUUID();M({to:"/$org/$taskId",params:{org:Y,taskId:J},search:{virtualmcpid:H,main:"settings"}})},children:"Go to Project Settings"})]}),e[36]=M,e[37]=t.slug,e[38]=T,e[39]=o.id,e[40]=k,e[41]=w,e[42]=l):l=e[42];let d;return e[43]!==u||e[44]!==l?(d=s.jsx(K,{value:u,children:l}),e[43]=u,e[44]=l,e[45]=d):d=e[45],d}const Q=h.id,U=me(h);let N;e[46]!==I?(N=(n,u)=>I?I.callTool({name:n,arguments:u}).then(fe):Promise.reject(new Error("MCP client is not available")),e[46]=I,e[47]=N):N=e[47];const $=N;let S;e[48]!==h||e[49]!==c||e[50]!==a||e[51]!==U||e[52]!==$?(S={connectionId:Q,connection:U,toolCaller:$,org:c,session:a},e[48]=h,e[49]=c,e[50]=a,e[51]=U,e[52]=$,e[53]=S):S=e[53];const q=S;let E;e[54]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(B,{children:s.jsx(B.Content,{children:s.jsx(ie,{})})}),e[54]=E):E=e[54];let L;return e[55]!==q?(L=s.jsx(K,{value:q,children:E}),e[55]=q,e[56]=L):L=e[56],L}function fe(i){return i.structuredContent??i}export{Pe as P};
@@ -1 +1 @@
1
- import{r as i,be as $,j as c,du as z,bf as G,bu as A,a4 as _,a5 as g,dv as b,bh as w,dw as L,dx as E,dC as H,dD as K,ad as B,dE as U,dF as V,dG as W,dy as Z,dz as q,dB as J,e as R,c as Q}from"./index-DElySjov.js";var C="Popover",[j]=B(C,[E]),P=E(),[X,u]=j(C),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[d,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:C});return c.jsx(z,{...p,children:c.jsx(X,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(m=>!m),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=C;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(b,{...s,...r,ref:e})});Y.displayName=F;var y="PopoverTrigger",S=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(y,o),s=P(o),a=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(b,{asChild:!0,...s,children:p})});S.displayName=y;var O="PopoverPortal",[ee,oe]=j(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(w,{present:o||s.open,children:c.jsx(L,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(w,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=U("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return H(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,d=p.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(T,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),T=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,...x}=t,f=u(v,o),m=P(o);return V(),c.jsx(W,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(Z,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(q,{"data-state":I(f.open),role:"dialog",id:f.contentId,...m,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(k,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=k;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=S,le=D,de=M;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=Q("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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(d=c.jsx(le,{children:c.jsx(de,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=d):d=e[11],d}export{fe as P,ve as a,ge as b};
1
+ import{r as i,be as $,j as c,du as z,bf as G,bu as A,a4 as _,a5 as g,dv as b,bh as w,dw as L,dx as E,dC as H,dD as K,ad as B,dE as U,dF as V,dG as W,dy as Z,dz as q,dB as J,e as R,c as Q}from"./index-3ttoiVWU.js";var C="Popover",[j]=B(C,[E]),P=E(),[X,u]=j(C),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[d,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:C});return c.jsx(z,{...p,children:c.jsx(X,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(m=>!m),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=C;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(b,{...s,...r,ref:e})});Y.displayName=F;var y="PopoverTrigger",S=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(y,o),s=P(o),a=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(b,{asChild:!0,...s,children:p})});S.displayName=y;var O="PopoverPortal",[ee,oe]=j(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(w,{present:o||s.open,children:c.jsx(L,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(w,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=U("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return H(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,d=p.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(T,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),T=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,...x}=t,f=u(v,o),m=P(o);return V(),c.jsx(W,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(Z,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(q,{"data-state":I(f.open),role:"dialog",id:f.contentId,...m,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(k,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=k;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=S,le=D,de=M;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=Q("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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(d=c.jsx(le,{children:c.jsx(de,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=d):d=e[11],d}export{fe as P,ve as a,ge as b};