decocms 4.223.0 → 4.225.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/dist/client/assets/{AlertCircle-D6ElsVdV.js → AlertCircle-5AuOprU7.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CnCx8yu5.js → AreaChart-Wk8ICNqw.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DI46U0hW.js → ArrowLeft-DIhI9G2z.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DXifU2jU.js → ArrowUp-scxa_5To.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-g0eFiBAo.js → ArrowUpRight-BA9oV4xr.js} +1 -1
  6. package/dist/client/assets/{Check-DLCFFMhM.js → Check-CNtTpSWJ.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-t3clhDEY.js → CheckCircle-BKrA_F18.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-tPhI8IAo.js → ChevronDown-VKLIqYvn.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-B029h9tK.js → ChevronRight-Ib5ZfYb_.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DAtg-Gay.js → ChevronUp-CZ15FCHi.js} +1 -1
  11. package/dist/client/assets/{Copy01-Bs8ijW_K.js → Copy01-B9F7Zuvt.js} +1 -1
  12. package/dist/client/assets/{CpuChip01-BZeEEiQD.js → CpuChip01-CC_hutb3.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-B11AWLzQ.js → CreditCard01-JWNc7rZ4.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-BvDICIXQ.js → DotsVertical-Csv-ib_3.js} +1 -1
  15. package/dist/client/assets/{Eye-mCbEOvrw.js → Eye-DCS27XV-.js} +1 -1
  16. package/dist/client/assets/{FilterLines-DMe-a5cU.js → FilterLines-CaiEb8JB.js} +1 -1
  17. package/dist/client/assets/{Globe01-CAof63Y2.js → Globe01-Drqg6KUJ.js} +1 -1
  18. package/dist/client/assets/{Globe04-COb_HVGf.js → Globe04-meEdEGKy.js} +1 -1
  19. package/dist/client/assets/{HardDrive-B2TDrqfp.js → HardDrive-BKuMgSaU.js} +1 -1
  20. package/dist/client/assets/{Key01-SN67R_2K.js → Key01-bGzxjJsu.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-DdADR4a-.js → LayoutLeft-DfvgAkRL.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-TAXSoD5n.js → LinkExternal01-D1EqUtA_.js} +1 -1
  23. package/dist/client/assets/{LogOut01-p0UdQN5O.js → LogOut01-DXzte6_O.js} +1 -1
  24. package/dist/client/assets/{Monitor01-85SsH_8P.js → Monitor01-CQoDfUFU.js} +1 -1
  25. package/dist/client/assets/{Palette-CulL6Bsw.js → Palette-CtCaB4wK.js} +1 -1
  26. package/dist/client/assets/{Play-DL9N7Ipe.js → Play-CGg7hiGZ.js} +1 -1
  27. package/dist/client/assets/{Plus-ENOfz88I.js → Plus-DWqthFh2.js} +1 -1
  28. package/dist/client/assets/{SearchLg-BLO7Wadc.js → SearchLg-CGKdc4IN.js} +1 -1
  29. package/dist/client/assets/{SearchMd-BlLqg8aQ.js → SearchMd-B7y19WYM.js} +1 -1
  30. package/dist/client/assets/{Settings02-CjNjAID2.js → Settings02-eKxKQ3Po.js} +1 -1
  31. package/dist/client/assets/{Share07-BAxx8CcC.js → Share07-BEfDgBq8.js} +1 -1
  32. package/dist/client/assets/{Shield01-D0oqZU-Q.js → Shield01-DKKz-hs5.js} +1 -1
  33. package/dist/client/assets/{Star01-Cxd5haB_.js → Star01-0IOrf7-Y.js} +1 -1
  34. package/dist/client/assets/{Stars01-C-FlZhrE.js → Stars01-B8nkzQNK.js} +1 -1
  35. package/dist/client/assets/{Stars02-Dv4uoq65.js → Stars02-Bh_xyyc7.js} +1 -1
  36. package/dist/client/assets/{Sun-Lm1J2AdL.js → Sun-Cm_45XM8.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-D2iVDStv.js → SwitchHorizontal01-xPyfL_HZ.js} +1 -1
  38. package/dist/client/assets/{Tool01-Di6mnWcA.js → Tool01-BoCUU2dg.js} +1 -1
  39. package/dist/client/assets/{Tool02-CLeIEJiX.js → Tool02-Uewp-NcQ.js} +1 -1
  40. package/dist/client/assets/{Trash01-CWg-StRk.js → Trash01-UIf_VcVI.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-__2FFu4c.js → TrendUp01-Bm0kytjN.js} +1 -1
  42. package/dist/client/assets/{Upload01-Bf8n3nke.js → Upload01-B6U9bIgM.js} +1 -1
  43. package/dist/client/assets/{User01-D2gKMYdy.js → User01-CwuUyWsv.js} +1 -1
  44. package/dist/client/assets/{Users01-Dk5NhvVd.js → Users01-BqPX7MJ3.js} +1 -1
  45. package/dist/client/assets/{Users03-BxC3kQLt.js → Users03-RyOA80qQ.js} +1 -1
  46. package/dist/client/assets/{X-ppE9vwRY.js → X-CkC51HaZ.js} +1 -1
  47. package/dist/client/assets/{XCircle-BifdMVfv.js → XCircle-BA5CyIfy.js} +1 -1
  48. package/dist/client/assets/{XClose-DQy9b0YQ.js → XClose-D1vn_d4K.js} +1 -1
  49. package/dist/client/assets/{YAxis-Bo_QY44_.js → YAxis-B8lSIMfw.js} +1 -1
  50. package/dist/client/assets/{Zap-DZzsx299.js → Zap-CrKr3-54.js} +1 -1
  51. package/dist/client/assets/{ZapSquare-BvKOVqvS.js → ZapSquare-Dr5iClJn.js} +1 -1
  52. package/dist/client/assets/{access-gate-CS7NES54.js → access-gate-uaU0YsVl.js} +1 -1
  53. package/dist/client/assets/{agent-capabilities-cXfbMfjV.js → agent-capabilities-C4tLW0Za.js} +1 -1
  54. package/dist/client/assets/agent-icon-Dp75Aip8.js +1 -0
  55. package/dist/client/assets/{agents-list-Do6LN-KF.js → agents-list-7ppbx13E.js} +1 -1
  56. package/dist/client/assets/ai-providers-3A3ylJWr.js +1 -0
  57. package/dist/client/assets/{alert-D5B-cY57.js → alert-DVDFTVaN.js} +1 -1
  58. package/dist/client/assets/{alert-dialog-TE_U_kDF.js → alert-dialog-BY-JdMxs.js} +2 -2
  59. package/dist/client/assets/{api-keys-BoQnHkaq.js → api-keys-CUws3Xz1.js} +1 -1
  60. package/dist/client/assets/app-editor-BENo2A2e.js +1 -0
  61. package/dist/client/assets/{auth-C5lKsEx7.js → auth-BYSDCwQO.js} +1 -1
  62. package/dist/client/assets/{auth-catchall-CmJnpmCt.js → auth-catchall-xMpQfXCL.js} +1 -1
  63. package/dist/client/assets/{auth-entry-D30Brbet.js → auth-entry-BqmmWe8a.js} +1 -1
  64. package/dist/client/assets/{auth-split-layout-2g8Md8MJ.js → auth-split-layout-BMynArQL.js} +1 -1
  65. package/dist/client/assets/{authenticate-and-persist-oauth-DKyWYtJc.js → authenticate-and-persist-oauth-CFQCYd0Y.js} +1 -1
  66. package/dist/client/assets/{automation-list-row-D1y9WTXa.js → automation-list-row-9X-aLdwM.js} +1 -1
  67. package/dist/client/assets/{automation-runs-Dx16PB_p.js → automation-runs-m1km5UUs.js} +1 -1
  68. package/dist/client/assets/{automations-SuWj28Eo.js → automations-DrRIAHdy.js} +1 -1
  69. package/dist/client/assets/{avatar-wKP7qkNU.js → avatar-CBy9Y411.js} +1 -1
  70. package/dist/client/assets/{badge-BgbHQoe3.js → badge-BPTJs8tR.js} +1 -1
  71. package/dist/client/assets/{billing-CDs1Cv99.js → billing-Ciy8R0wF.js} +1 -1
  72. package/dist/client/assets/{block-document-BnhN5Dg1.js → block-document-B_2mnlgv.js} +1 -1
  73. package/dist/client/assets/brand-context-CCt6FCkW.js +1 -0
  74. package/dist/client/assets/{buckets-BSbg7dU-.js → buckets-Doi-4RMR.js} +1 -1
  75. package/dist/client/assets/bulk-category-panel-Cdoln1ld.js +1 -0
  76. package/dist/client/assets/{capability-load-error-l_4s8sKr.js → capability-load-error-BEe-Cycg.js} +1 -1
  77. package/dist/client/assets/{card-BYawXKTU.js → card-DZBvhYCi.js} +1 -1
  78. package/dist/client/assets/{cards-bIgHMnZP.js → cards-Dp1UPuqF.js} +1 -1
  79. package/dist/client/assets/category-editor-DvMA1zvH.js +1 -0
  80. package/dist/client/assets/{chart-BD3M1hjY.js → chart-DMTOf1UY.js} +1 -1
  81. package/dist/client/assets/{chat-context-CipINhjv.js → chat-context-BV5yYkZ7.js} +1 -1
  82. package/dist/client/assets/{checkbox-Cd2hVFLx.js → checkbox-C0Pqr57R.js} +1 -1
  83. package/dist/client/assets/{cli-auth-success-C1p0eIT_.js → cli-auth-success-BMZYPagJ.js} +1 -1
  84. package/dist/client/assets/collection-detail-cSCGqn_X.js +1 -0
  85. package/dist/client/assets/{collection-display-button-WT8rgB6d.js → collection-display-button-cRfJyYLg.js} +1 -1
  86. package/dist/client/assets/{collection-search-BFxratBR.js → collection-search-BnD64bOg.js} +1 -1
  87. package/dist/client/assets/{collection-table-wrapper-Cx0Fz1YO.js → collection-table-wrapper-C55tsWoK.js} +1 -1
  88. package/dist/client/assets/{collection-tabs-BpvLtp7H.js → collection-tabs-C4NU_x7h.js} +1 -1
  89. package/dist/client/assets/{command-BgiqGgOD.js → command-D-MKa5w0.js} +1 -1
  90. package/dist/client/assets/{commerce-onboarding-BDg7v40b.js → commerce-onboarding-BKq9fsCK.js} +1 -1
  91. package/dist/client/assets/{connect-C5wEE0az.js → connect-CdepUNYo.js} +1 -1
  92. package/dist/client/assets/{connection-card-Ng3GoeK5.js → connection-card-C2I8RNJB.js} +1 -1
  93. package/dist/client/assets/connection-detail-CuOK2Fb2.js +1 -0
  94. package/dist/client/assets/connection-form-helpers-BtZAsOVk.js +1 -0
  95. package/dist/client/assets/connection-tfujEzUI.js +1 -0
  96. package/dist/client/assets/connections-Bv4AIFQS.js +1 -0
  97. package/dist/client/assets/{decopilot-sse-pool-Blwb6N9i.js → decopilot-sse-pool-CVEldHqx.js} +1 -1
  98. package/dist/client/assets/{dialog-C8xV8nk7.js → dialog-B-v3BB31.js} +1 -1
  99. package/dist/client/assets/{domain-settings-Catnv7nK.js → domain-settings-Bs6NJ4a5.js} +1 -1
  100. package/dist/client/assets/{drawer-C9OT_34K.js → drawer-c-6aHaq_.js} +1 -1
  101. package/dist/client/assets/{dropdown-menu-Dv_KaZ_g.js → dropdown-menu-DrAjHS6Q.js} +1 -1
  102. package/dist/client/assets/{empty-state-BMjKtand.js → empty-state-Cr5XYcaP.js} +1 -1
  103. package/dist/client/assets/{extract-connection-data-C0wyUS2V.js → extract-connection-data-Dl7Bm5LW.js} +1 -1
  104. package/dist/client/assets/file-explorer-D0RiIkTG.js +2 -0
  105. package/dist/client/assets/{file-type-icon-CWDzqYTQ.js → file-type-icon-CSps8N-1.js} +1 -1
  106. package/dist/client/assets/{form-DpAMyOYq.js → form-bcyFNKFV.js} +1 -1
  107. package/dist/client/assets/general-BZZ-oENe.js +1 -0
  108. package/dist/client/assets/{github-repo-picker-B8X9ZEbe.js → github-repo-picker-CY6tqV9m.js} +1 -1
  109. package/dist/client/assets/{hooks-BeWC9MRd.js → hooks-BuIdZSnH.js} +2 -2
  110. package/dist/client/assets/{index-BX_NPzZv.js → index-B74UiVT7.js} +10 -10
  111. package/dist/client/assets/{index-DhJJRQBn.js → index-BotuzhGa.js} +1 -1
  112. package/dist/client/assets/index-BxiH41R6.css +1 -0
  113. package/dist/client/assets/{index-DJ5XYx-a.js → index-CN0AZ1sX.js} +1 -1
  114. package/dist/client/assets/{index-B717xuPl.js → index-CbwdUE29.js} +1 -1
  115. package/dist/client/assets/index-DE39gzO0.js +1 -0
  116. package/dist/client/assets/index-DkFgk-2h.js +1 -0
  117. package/dist/client/assets/{index-DAYZSdKu.js → index-DsqiSRe2.js} +50 -50
  118. package/dist/client/assets/{index-f52yIbKI.js → index-DstjG4U8.js} +1 -1
  119. package/dist/client/assets/{index-ex6UwO_d.js → index-p4clXeAp.js} +1 -1
  120. package/dist/client/assets/{index-CNHO0lLF.js → index-pIywkKbR.js} +1 -1
  121. package/dist/client/assets/{index-redirect-B8k0PaZb.js → index-redirect-DaTO-OAH.js} +1 -1
  122. package/dist/client/assets/{infra-billing-DVhv0D1L.js → infra-billing-BM5zof0a.js} +1 -1
  123. package/dist/client/assets/{input-BPEvvKG4.js → input-6EkTK3Tc.js} +1 -1
  124. package/dist/client/assets/{integration-icon-B6D6sUaT.js → integration-icon-C1_ZTKK2.js} +1 -1
  125. package/dist/client/assets/invite-member-dialog-CA4DNVyu.js +1 -0
  126. package/dist/client/assets/{label-BjOUR-vy.js → label-Bsd2B4PY.js} +1 -1
  127. package/dist/client/assets/{layout-WgM6aFY_.js → layout-B0vTn6LW.js} +1 -1
  128. package/dist/client/assets/{login-BJLy7i-5.js → login-Bqq8U3Fl.js} +1 -1
  129. package/dist/client/assets/{mcp-oauth-Dkbh2akf.js → mcp-oauth-Bdsl2jCl.js} +1 -1
  130. package/dist/client/assets/{members-BKXDQM9L.js → members-B-y6Mefp.js} +1 -1
  131. package/dist/client/assets/{monaco-editor-CLhGJq84.js → monaco-editor-DjPLulfl.js} +4 -4
  132. package/dist/client/assets/{monitoring-stats-row-B_uUk3Ss.js → monitoring-stats-row-D0_0f-Jn.js} +1 -1
  133. package/dist/client/assets/{multi-select-B9vyLIc9.js → multi-select-swcvnxii.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-ms18_LOp.js → oauth-callback-Chj4-NjA.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-CW28jqgj.js → oauth-callback-ai-provider-DbaBWvmg.js} +1 -1
  136. package/dist/client/assets/{onboarding-BAy1-o_A.js → onboarding-Dzz5Sz4p.js} +1 -1
  137. package/dist/client/assets/{org-layout-1u37Jfae.js → org-layout-DHzm5KjW.js} +1 -1
  138. package/dist/client/assets/{organization-choice-tbTUCsls.js → organization-choice-Cv6Rg16k.js} +1 -1
  139. package/dist/client/assets/{orgs-Buf9VnG7.js → orgs-9-abrRFC.js} +1 -1
  140. package/dist/client/assets/{page-seo-form-DAeXAFiZ.js → page-seo-form-olO1_wZC.js} +1 -1
  141. package/dist/client/assets/{popover-C-Z9QMGr.js → popover-Cp8O0BOf.js} +1 -1
  142. package/dist/client/assets/post-editor-C8UPswVv.js +1 -0
  143. package/dist/client/assets/{primitives-U9D0O-Gw.js → primitives-CoVe93B5.js} +1 -1
  144. package/dist/client/assets/profile-BdjX7-yt.js +1 -0
  145. package/dist/client/assets/project-app-view-Cqkt9pYy.js +1 -0
  146. package/dist/client/assets/record-editor-DiMIhczP.js +1 -0
  147. package/dist/client/assets/redirect-editor-DuC_v7pU.js +1 -0
  148. package/dist/client/assets/registry-CEpV99KC.js +2 -0
  149. package/dist/client/assets/{registry-layout-Dqr1hOdR.js → registry-layout-BFo-Jfp8.js} +1 -1
  150. package/dist/client/assets/{reports-CCCCoEGk.js → reports-DZSu76CC.js} +1 -1
  151. package/dist/client/assets/{require-capability-C994gRB1.js → require-capability-pE8FFSc1.js} +1 -1
  152. package/dist/client/assets/{required-auth-layout-CZqMkGhc.js → required-auth-layout-CUwfUQfP.js} +1 -1
  153. package/dist/client/assets/{reset-password-B7UqwqDu.js → reset-password-aabhOrwV.js} +1 -1
  154. package/dist/client/assets/roles-CIp-Mt2C.js +1 -0
  155. package/dist/client/assets/{search-input-DnZTwDy2.js → search-input-CfneSsqI.js} +1 -1
  156. package/dist/client/assets/{secrets-CH8wOY2o.js → secrets-Dj9uhFgd.js} +1 -1
  157. package/dist/client/assets/{sections-editor-BVPIe_xP.js → sections-editor-CbgLVKJM.js} +1 -1
  158. package/dist/client/assets/{select-D8HWXM7B.js → select-DPSOJbeT.js} +1 -1
  159. package/dist/client/assets/{select-model-VqEJ276W.js → select-model-K1AqyLKg.js} +2 -2
  160. package/dist/client/assets/self-tool-result-C3AISunK.js +1 -0
  161. package/dist/client/assets/seo-editor-Cvg8eGI2.js +1 -0
  162. package/dist/client/assets/{settings-layout-ByksEsxR.js → settings-layout-a-ncq85p.js} +1 -1
  163. package/dist/client/assets/{settings-section-x0hpgwBB.js → settings-section-DDdgVdbU.js} +1 -1
  164. package/dist/client/assets/{shell-controls-psuv5HUo.js → shell-controls-CAisEqeZ.js} +1 -1
  165. package/dist/client/assets/{shell-layout-ByW5qYjw.js → shell-layout-DpCXcjt8.js} +1 -1
  166. package/dist/client/assets/sidebar-L8FjXZIc.js +1 -0
  167. package/dist/client/assets/{skeleton-DOJnTHJ3.js → skeleton-BBy0A3ce.js} +1 -1
  168. package/dist/client/assets/{spinner-Cs9q3NVD.js → spinner-BIB0WEVJ.js} +1 -1
  169. package/dist/client/assets/{sso-BGCBNnYX.js → sso-axnsZkw3.js} +1 -1
  170. package/dist/client/assets/{store-DbU-kTMB.js → store-BGfSTyW6.js} +1 -1
  171. package/dist/client/assets/store-registry-me-8Jk68.js +2 -0
  172. package/dist/client/assets/{studio-tools-CpBEXDHG.js → studio-tools-BkqbGYdG.js} +1 -1
  173. package/dist/client/assets/{switch-C2crWHBg.js → switch-CyGKWatf.js} +1 -1
  174. package/dist/client/assets/{synced-repos-D4tjwADV.js → synced-repos-Caji8gl1.js} +1 -1
  175. package/dist/client/assets/{tab-id-eS-YXQX4.js → tab-id-Cxsf-OOg.js} +1 -1
  176. package/dist/client/assets/{table-BuKV0wZZ.js → table-BO_ehL6A.js} +1 -1
  177. package/dist/client/assets/{tabs-C4w_WWd8.js → tabs-49mtpBLy.js} +1 -1
  178. package/dist/client/assets/{textarea-Dfl6wKQt.js → textarea-DhnMR43g.js} +1 -1
  179. package/dist/client/assets/{toggle-group-D9wcd4e_.js → toggle-group-Bk96Uca0.js} +1 -1
  180. package/dist/client/assets/{toolbar-D17bJYuh.js → toolbar-BIqUAnt7.js} +1 -1
  181. package/dist/client/assets/{tooltip-5OAV9va2.js → tooltip-BDRXOJPI.js} +1 -1
  182. package/dist/client/assets/{track-4YqGNWXD.js → track-BLwAphOX.js} +1 -1
  183. package/dist/client/assets/{types-DGdL1O_w.js → types-BYXfM1o_.js} +1 -1
  184. package/dist/client/assets/{use-ai-providers-DCMs6qFa.js → use-ai-providers-9bbw_acr.js} +1 -1
  185. package/dist/client/assets/{use-api-keys-RqUhXHnX.js → use-api-keys-JccvZvG-.js} +1 -1
  186. package/dist/client/assets/{use-automations-C00F7rqw.js → use-automations-C1gMdSGl.js} +1 -1
  187. package/dist/client/assets/{use-autosave-B-dXfmtj.js → use-autosave-uIsoUtc_.js} +1 -1
  188. package/dist/client/assets/{use-capability-DsAvVTiL.js → use-capability-C9LvQ7JY.js} +1 -1
  189. package/dist/client/assets/{use-clock-tick-K0_e258u.js → use-clock-tick-CMxADp_K.js} +1 -1
  190. package/dist/client/assets/use-commerce-diagnostic-DzVyi8nS.js +1 -0
  191. package/dist/client/assets/{use-connection-C17rQDA_.js → use-connection-WokxLMwl.js} +1 -1
  192. package/dist/client/assets/{use-copy-BGGBRB_T.js → use-copy-B97j_jee.js} +1 -1
  193. package/dist/client/assets/{use-create-virtual-mcp-De-qs4WT.js → use-create-virtual-mcp-DVv52QFd.js} +1 -1
  194. package/dist/client/assets/{use-debounced-autosave-Cq3brqu3.js → use-debounced-autosave-yJceD8xK.js} +1 -1
  195. package/dist/client/assets/{use-debounced-value-BNZhBjaI.js → use-debounced-value-BX1Yu_M8.js} +1 -1
  196. package/dist/client/assets/{use-decopilot-events-IIr8Tmy-.js → use-decopilot-events-BZ79GmEu.js} +1 -1
  197. package/dist/client/assets/{use-delete-connection-BiGk9ORO.js → use-delete-connection-C8HhNUpT.js} +1 -1
  198. package/dist/client/assets/{use-deployment-admin-o19aq5ZJ.js → use-deployment-admin-CbmjlFHk.js} +1 -1
  199. package/dist/client/assets/{use-file-configs-CYHPyurW.js → use-file-configs-DGF6IHz5.js} +1 -1
  200. package/dist/client/assets/{use-infinite-scroll-HX67FBA9.js → use-infinite-scroll-D1A6hzS4.js} +1 -1
  201. package/dist/client/assets/{use-infra-billing-CidWp4Qz.js → use-infra-billing-BgKAIrHp.js} +1 -1
  202. package/dist/client/assets/{use-join-requests-B93smWob.js → use-join-requests-D_92-Y71.js} +1 -1
  203. package/dist/client/assets/{use-mcp-client-NnbFcsGZ.js → use-mcp-client-C8UvUf9Y.js} +1 -1
  204. package/dist/client/assets/{use-mcp-tools-hFoWFA4o.js → use-mcp-tools-DWhPtLw4.js} +1 -1
  205. package/dist/client/assets/{use-members-BSS05Lmb.js → use-members-BW7jM_g-.js} +1 -1
  206. package/dist/client/assets/{use-mobile-BzJ1qLXG.js → use-mobile-67MpdCeO.js} +1 -1
  207. package/dist/client/assets/{use-navigate-to-agent-CURQ7Iu_.js → use-navigate-to-agent-CdL5qb4F.js} +1 -1
  208. package/dist/client/assets/{use-open-billing-url-fx71xk_j.js → use-open-billing-url-OBCPp1Ht.js} +1 -1
  209. package/dist/client/assets/{use-org-auth-client-drjaSLRi.js → use-org-auth-client-Cn32f5PT.js} +1 -1
  210. package/dist/client/assets/{use-org-sso-DyfZQvaU.js → use-org-sso-DGC7R3Ds.js} +1 -1
  211. package/dist/client/assets/{use-organization-roles-CHiOSvCO.js → use-organization-roles-DigLbP-o.js} +1 -1
  212. package/dist/client/assets/use-organization-settings-BJx4sf85.js +1 -0
  213. package/dist/client/assets/{use-registry-connections-D0Eo-jz7.js → use-registry-connections-Cbc1pl9q.js} +1 -1
  214. package/dist/client/assets/{use-secrets-MxPt7LtM.js → use-secrets-B-OEN9Nk.js} +1 -1
  215. package/dist/client/assets/{use-section-preview-base-Cd7z_zSd.js → use-section-preview-base-Cj_8IHR1.js} +1 -1
  216. package/dist/client/assets/{use-status-sounds-Bd_yO8Kz.js → use-status-sounds-DQ8w2Xh3.js} +1 -1
  217. package/dist/client/assets/{use-tags-Bmge6Bng.js → use-tags-t5KU17Gl.js} +1 -1
  218. package/dist/client/assets/{use-view-mode-BSZX_Ie8.js → use-view-mode-CqDRE-KT.js} +1 -1
  219. package/dist/client/assets/{use-virtual-mcp-Da-ST5tm.js → use-virtual-mcp-B7UA8ChX.js} +1 -1
  220. package/dist/client/assets/useInfiniteQuery-DhzVnrLv.js +1 -0
  221. package/dist/client/assets/{useRouterState-DUTfl4tc.js → useRouterState-BMGmXwBQ.js} +1 -1
  222. package/dist/client/assets/useSuspenseInfiniteQuery-BtrMhual.js +1 -0
  223. package/dist/client/assets/{users-6mvyVBg5.js → users-CQ9BJ1gB.js} +1 -1
  224. package/dist/client/assets/variant-calendar-Ctpp33UY.js +1 -0
  225. package/dist/client/assets/{view-mode-toggle-JAJpC9zQ.js → view-mode-toggle-BrntiHNN.js} +1 -1
  226. package/dist/client/index.html +2 -2
  227. package/dist/server/cli.js +34 -28
  228. package/dist/server/server.js +15 -9
  229. package/package.json +1 -1
  230. package/dist/client/assets/agent-icon-kIlAB0pt.js +0 -1
  231. package/dist/client/assets/ai-providers-CmhQek_x.js +0 -1
  232. package/dist/client/assets/app-editor-DLSb9gJB.js +0 -1
  233. package/dist/client/assets/brand-context-BT6vtCu_.js +0 -1
  234. package/dist/client/assets/bulk-category-panel-CXj6atLH.js +0 -1
  235. package/dist/client/assets/category-editor-xjrnaDx5.js +0 -1
  236. package/dist/client/assets/collection-detail-DWrR4Q31.js +0 -1
  237. package/dist/client/assets/connection-BRGXktaB.js +0 -1
  238. package/dist/client/assets/connection-detail-CBTY1Zr8.js +0 -1
  239. package/dist/client/assets/connection-form-helpers-JAvwK5WO.js +0 -1
  240. package/dist/client/assets/connections-B7A-2eD4.js +0 -1
  241. package/dist/client/assets/file-explorer-COWya24e.js +0 -2
  242. package/dist/client/assets/general-BCrzp13z.js +0 -1
  243. package/dist/client/assets/index-BLGhhq2K.js +0 -1
  244. package/dist/client/assets/index-DDwXES0C.js +0 -1
  245. package/dist/client/assets/index-Dncm6IaE.css +0 -1
  246. package/dist/client/assets/invite-member-dialog-C1rrcxOu.js +0 -1
  247. package/dist/client/assets/post-editor-CaBWilo7.js +0 -1
  248. package/dist/client/assets/profile-CtoCe4yd.js +0 -1
  249. package/dist/client/assets/project-app-view-BFJEbcNF.js +0 -1
  250. package/dist/client/assets/record-editor-DWsVDbrf.js +0 -1
  251. package/dist/client/assets/redirect-editor-HInCVuB1.js +0 -1
  252. package/dist/client/assets/registry-Bh-HKqQ7.js +0 -2
  253. package/dist/client/assets/roles-JvHOHZod.js +0 -1
  254. package/dist/client/assets/self-tool-result-rQQpi3FX.js +0 -1
  255. package/dist/client/assets/seo-editor-C9IP4Q11.js +0 -1
  256. package/dist/client/assets/sidebar-DgvBsHW3.js +0 -1
  257. package/dist/client/assets/store-registry-D63oeeBi.js +0 -2
  258. package/dist/client/assets/use-deco-credits-QPAoAHyl.js +0 -1
  259. package/dist/client/assets/use-organization-settings-DSHsydxG.js +0 -1
  260. package/dist/client/assets/useInfiniteQuery-BCTaWj0n.js +0 -1
  261. package/dist/client/assets/useSuspenseInfiniteQuery-Dr3M9SY-.js +0 -1
  262. package/dist/client/assets/variant-calendar-4A7O0Mq8.js +0 -1
@@ -1 +0,0 @@
1
- import{aT as bt,Y as Ie,aU as yt,X as xt,aV as Xe,o as Oe,aW as Ct,aX as St,r as H,aY as Ot,aZ as vt,a_ as jt,a$ as _t,b0 as ze,b1 as Nt,b2 as Tt,b3 as wt,Z as be,$ as oe,c as G,b as te,a2 as ye,a1 as xe,e as ve,j as n,a as Je,B as Z,m as fe,k as Fe,K as X,n as Se,ar as Et,t as Ne,u as It,x as _e,p as ue,b4 as Me,Q as kt,E as Ft}from"./index-BX_NPzZv.js";import{A as Rt,a as Lt,b as Dt,c as At,e as Kt,f as Pt,g as Bt}from"./alert-dialog-TE_U_kDF.js";import{d as ie,F as Ce,a as se,e as pe,b as re,f as et,c as ae}from"./form-DpAMyOYq.js";import{I as ge}from"./input-BPEvvKG4.js";import{S as qt}from"./spinner-Cs9q3NVD.js";import{W as tt,g as Ut,u as Re,S as $t}from"./use-mcp-client-NnbFcsGZ.js";import{I as Le}from"./integration-icon-B6D6sUaT.js";import{c as he,b as nt,a as ot,d as it,e as st,h as zt}from"./dialog-C8xV8nk7.js";import{c as De,T as Ae,a as Ke}from"./tooltip-5OAV9va2.js";import{m as rt,e as at,Q as Mt}from"./agent-icon-kIlAB0pt.js";import{b as Qt,c as Vt,e as Ht}from"./extract-connection-data-C0wyUS2V.js";import{a as Gt,f as lt,b as Wt,p as Yt,i as Zt}from"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import{g as ct}from"./metadata-dUsYcpuu.js";import{i as dt}from"./CheckCircle-t3clhDEY.js";import{i as Xt}from"./Check-DLCFFMhM.js";import{a as ut}from"./Copy01-Bs8ijW_K.js";import{i as Jt}from"./Settings02-CjNjAID2.js";import{s as en}from"./Eye-mCbEOvrw.js";import{u as tn}from"./use-debounced-value-BNZhBjaI.js";import{n as nn}from"./LinkExternal01-TAXSoD5n.js";import{a as on}from"./authenticate-and-persist-oauth-DKyWYtJc.js";import{r as Qe}from"./track-4YqGNWXD.js";function Ve(o,e){const t=new Set(e);return o.filter(i=>!t.has(i))}function sn(o,e,t){const i=o.slice(0);return i[e]=t,i}var rn=class extends bt{#i;#e;#s;#o;#t;#n;#r;#a;#l;#c=[];constructor(o,e,t){super(),this.#i=o,this.#o=t,this.#s=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(o=>{o.subscribe(e=>{this.#f(o,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(o=>{o.destroy()})}setQueries(o,e){this.#s=o,this.#o=e,Ie.batch(()=>{const t=this.#t,i=this.#m(this.#s);i.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const a=i.map(d=>d.observer),s=a.map(d=>d.getCurrentResult()),c=t.length!==a.length,r=a.some((d,l)=>d!==t[l]),u=c||r,p=u?!0:s.some((d,l)=>{const f=this.#e[l];return!f||!yt(d,f)});!u&&!p||(u&&(this.#c=i,this.#t=a),this.#e=s,this.hasListeners()&&(u&&(Ve(t,a).forEach(d=>{d.destroy()}),Ve(a,t).forEach(d=>{d.subscribe(l=>{this.#f(d,l)})})),this.#g()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(o=>o.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(o,e){const t=this.#m(o),i=t.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions)),a=t.map(s=>s.defaultedQueryOptions.queryHash);return[i,s=>this.#u(s??i,e,a),()=>this.#d(i,t)]}#d(o,e){return e.map((t,i)=>{const a=o[i];return t.defaultedQueryOptions.notifyOnChangeProps?a:t.observer.trackResult(a,s=>{e.forEach(c=>{c.observer.trackProp(s)})})})}#u(o,e,t){if(e){const i=this.#l,a=t!==void 0&&i!==void 0&&(i.length!==t.length||t.some((s,c)=>s!==i[c]));return(!this.#n||this.#e!==this.#a||a||e!==this.#r)&&(this.#r=e,this.#a=this.#e,t!==void 0&&(this.#l=t),this.#n=xt(this.#n,e(o))),this.#n}return o}#p(){return this.#o?.combine!==void 0&&this.#t.some((o,e)=>o.options.suspense&&this.#e[e]?.data===void 0)}#m(o){const e=new Map;this.#t.forEach(i=>{const a=i.options.queryHash;if(!a)return;const s=e.get(a);s?s.push(i):e.set(a,[i])});const t=[];return o.forEach(i=>{const a=this.#i.defaultQueryOptions(i),c=e.get(a.queryHash)?.shift()??new Xe(this.#i,a);t.push({defaultedQueryOptions:a,observer:c})}),t}#f(o,e){const t=this.#t.indexOf(o);t!==-1&&(this.#e=sn(this.#e,t,e),this.#g())}#g(){if(this.hasListeners()){const o=this.#d(this.#e,this.#c),e=this.#p(),t=this.#n,i=e?t:this.#u(o,this.#o?.combine);(e||t!==i)&&Ie.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}};function an({queries:o,...e},t){const i=Oe(t),a=Ct(),s=St(),c=H.useMemo(()=>o.map(x=>{const h=i.defaultQueryOptions(x);return h._optimisticResults=a?"isRestoring":"optimistic",h}),[o,i,a]);c.forEach(x=>{Ot(x);const h=i.getQueryCache().get(x.queryHash);vt(x,s,h)}),jt(s);const[r]=H.useState(()=>new rn(i,c,e)),[u,p,d]=r.getOptimisticResult(c,e.combine),l=!a&&e.subscribed!==!1;H.useSyncExternalStore(H.useCallback(x=>l?r.subscribe(Ie.batchCalls(x)):_t,[r,l]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),H.useEffect(()=>{r.setQueries(c,e)},[c,e,r]);const m=u.some((x,h)=>ze(c[h],x))?u.flatMap((x,h)=>{const b=c[h];if(b&&ze(b,x)){const g=new Xe(i,b);return Nt(b,g,s)}return[]}):[];if(m.length>0)throw Promise.all(m);const y=u.find((x,h)=>{const b=c[h];return b&&Tt({result:x,errorResetBoundary:s,throwOnError:b.throwOnError,query:i.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(y?.error)throw y.error;return p(d())}function ln(o,e){return an({...o,queries:o.queries.map(t=>({...t,suspense:!0,throwOnError:wt,enabled:!0,placeholderData:void 0}))},e)}const cn=/^[a-zA-Z][a-zA-Z\d+.-]*:/,dn=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,un=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,mn=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Te(o){const e=o.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=cn.test(e),i=dn.test(e),a=un.test(e);if(t&&!i&&!a)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const s=i?e:`https://${e}`;let c;try{c=new URL(s)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(c.protocol!=="http:"&&c.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=c.hostname.split(".");return r.length<2||r.some(u=>!u||!mn.test(u))?{ok:!1,error:"Enter a valid website URL."}:(c.protocol="https:",{ok:!0,value:c.origin})}function Jo(o,e){if(!o.trim())return!0;const t=Te(o);if(!t.ok||!e)return!1;const i=Te(e);return i.ok&&i.value===t.value}function fn(o){if(!o)return null;const e=Te(o);return e.ok?new URL(e.value).hostname:null}function He(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const gn=be({name:oe().min(2,"Organization name is required")});function ei(o){const e=G.c(68),{open:t,onOpenChange:i,onCreated:a}=o,s=te();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={resolver:ye(gn),defaultValues:{name:""}},e[0]=c):c=e[0];const r=xe(c);let u;e[1]!==s?(u=async K=>{const R=He(K.name);if(!R)throw new Error(s("common.createOrganizationDialog.invalidSlug"));const U=await Je.organization.create({name:K.name,slug:R});if(U?.error)throw new Error(U.error.message||s("common.createOrganizationDialog.failedToCreate"));const B=U?.data?.slug??R;if(!B)throw new Error(s("common.createOrganizationDialog.failedToCreate"));return{orgSlug:B}},e[1]=s,e[2]=u):u=e[2];let p;e[3]!==a?(p=K=>{const{orgSlug:R}=K;if(a){a(R);return}window.location.href=`/${R}`},e[3]=a,e[4]=p):p=e[4];let d;e[5]!==u||e[6]!==p?(d={mutationFn:u,onSuccess:p},e[5]=u,e[6]=p,e[7]=d):d=e[7];const l=ve(d);let f;e[8]!==l.error||e[9]!==s?(f=l.error instanceof Error?l.error.message:l.error?s("common.createOrganizationDialog.failedToCreateGeneric"):null,e[8]=l.error,e[9]=s,e[10]=f):f=e[10];const m=f;let y;e[11]!==s?(y=s("common.createOrganizationDialog.title"),e[11]=s,e[12]=y):y=e[12];let x;e[13]!==y?(x=n.jsx(Rt,{children:y}),e[13]=y,e[14]=x):x=e[14];let h;e[15]!==s?(h=s("common.createOrganizationDialog.description"),e[15]=s,e[16]=h):h=e[16];let b;e[17]!==h?(b=n.jsx(Lt,{children:h}),e[17]=h,e[18]=b):b=e[18];let g;e[19]!==x||e[20]!==b?(g=n.jsxs(Dt,{children:[x,b]}),e[19]=x,e[20]=b,e[21]=g):g=e[21];let S;if(e[22]!==l||e[23]!==r){let K;e[25]!==l?(K=R=>l.mutateAsync(R),e[25]=l,e[26]=K):K=e[26],S=r.handleSubmit(K),e[22]=l,e[23]=r,e[24]=S}else S=e[24];let C;e[27]!==r.formState.isSubmitting||e[28]!==s?(C=K=>{const{field:R}=K;return n.jsxs(se,{children:[n.jsx(pe,{children:s("common.createOrganizationDialog.nameLabel")}),n.jsx(re,{children:n.jsx(ge,{...R,placeholder:s("common.createOrganizationDialog.namePlaceholder"),disabled:r.formState.isSubmitting})}),n.jsx(et,{children:s("common.createOrganizationDialog.nameDescription")}),R.value&&n.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[s("common.createOrganizationDialog.urlLabel")," ",n.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",He(R.value)]})]}),n.jsx(ae,{})]})},e[27]=r.formState.isSubmitting,e[28]=s,e[29]=C):C=e[29];let v;e[30]!==r.control||e[31]!==C?(v=n.jsx(ie,{control:r.control,name:"name",render:C}),e[30]=r.control,e[31]=C,e[32]=v):v=e[32];let j;e[33]!==m?(j=m&&n.jsx("div",{className:"text-destructive text-sm mt-2",children:m}),e[33]=m,e[34]=j):j=e[34];const _=r.formState.isSubmitting;let O;e[35]!==l||e[36]!==r?(O=()=>{l.reset(),r.reset()},e[35]=l,e[36]=r,e[37]=O):O=e[37];let E;e[38]!==s?(E=s("common.createOrganizationDialog.cancel"),e[38]=s,e[39]=E):E=e[39];let w;e[40]!==r.formState.isSubmitting||e[41]!==O||e[42]!==E?(w=n.jsx(At,{disabled:_,onClick:O,children:E}),e[40]=r.formState.isSubmitting,e[41]=O,e[42]=E,e[43]=w):w=e[43];const N=!r.formState.isValid||r.formState.isSubmitting;let k;e[44]!==r.formState.isSubmitting||e[45]!==s?(k=r.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(qt,{size:"xs"})," ",s("common.createOrganizationDialog.creating")]}):s("common.createOrganizationDialog.createButton"),e[44]=r.formState.isSubmitting,e[45]=s,e[46]=k):k=e[46];let I;e[47]!==N||e[48]!==k?(I=n.jsx(Z,{type:"submit",variant:"default",disabled:N,children:k}),e[47]=N,e[48]=k,e[49]=I):I=e[49];let F;e[50]!==w||e[51]!==I?(F=n.jsxs(Kt,{children:[w,I]}),e[50]=w,e[51]=I,e[52]=F):F=e[52];let A;e[53]!==S||e[54]!==v||e[55]!==j||e[56]!==F?(A=n.jsxs("form",{className:"space-y-6",onSubmit:S,autoComplete:"off",children:[v,j,F]}),e[53]=S,e[54]=v,e[55]=j,e[56]=F,e[57]=A):A=e[57];let T;e[58]!==r||e[59]!==A?(T=n.jsx(Ce,{...r,children:A}),e[58]=r,e[59]=A,e[60]=T):T=e[60];let L;e[61]!==g||e[62]!==T?(L=n.jsxs(Pt,{children:[g,T]}),e[61]=g,e[62]=T,e[63]=L):L=e[63];let P;return e[64]!==i||e[65]!==t||e[66]!==L?(P=n.jsx(Bt,{open:t,onOpenChange:i,children:L}),e[64]=i,e[65]=t,e[66]=L,e[67]=P):P=e[67],P}function pn(o){const e=G.c(14),{children:t,className:i,wrapperClassName:a}=o,[s,c]=H.useState(!0);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=x=>{if(!x)return;const h=()=>{const g=x.scrollHeight-x.scrollTop-x.clientHeight<8;c(g)};h(),x.addEventListener("scroll",h,{passive:!0});const b=new ResizeObserver(h);b.observe(x);for(const g of Array.from(x.children))b.observe(g);return()=>{x.removeEventListener("scroll",h),b.disconnect()}},e[0]=r):r=e[0];const u=r;let p;e[1]!==a?(p=fe("relative",a),e[1]=a,e[2]=p):p=e[2];let d;e[3]!==t||e[4]!==i?(d=n.jsx("div",{ref:u,className:i,children:t}),e[3]=t,e[4]=i,e[5]=d):d=e[5];const l=s?"opacity-0":"opacity-100";let f;e[6]!==l?(f=fe("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",l),e[6]=l,e[7]=f):f=e[7];let m;e[8]!==f?(m=n.jsx("div",{"aria-hidden":!0,className:f}),e[8]=f,e[9]=m):m=e[9];let y;return e[10]!==p||e[11]!==d||e[12]!==m?(y=n.jsxs("div",{className:p,children:[d,m]}),e[10]=p,e[11]=d,e[12]=m,e[13]=y):y=e[13],y}const hn=new Set([]);function bn(o){if(o.boundVia==="sa")return!0;const{companionConfig:e,cdConfig:t}=o;switch(o.bindingType){case"vtex":return me(e?.accountName);case"shopify":return me(e?.storeDomain);case"google-analytics":return me(e?.propertyId);case"google-search-console":return me(e?.siteUrl);case"github":return me(t?.github_repo);default:return!0}}function yn(o){const{companionConfig:e,cdConfig:t}=o;switch(o.bindingType){case"vtex":return typeof e?.accountName=="string"?e.accountName:null;case"shopify":return typeof e?.storeDomain=="string"?e.storeDomain:null;case"google-analytics":return typeof e?.propertyId=="string"?e.propertyId:null;case"google-search-console":return typeof e?.siteUrl=="string"?e.siteUrl:null;case"github":return typeof t?.github_repo=="string"?t.github_repo:null;default:return null}}function xn(o){const e=o.properties;if(!e)return[];const t=[];for(const[i,a]of Object.entries(e)){const r=a?.properties?.__type?.const;typeof r=="string"&&r.length>0&&t.push({fieldKey:i,bindingType:r})}return t}const Cn=[{fieldKey:"vtex",bindingType:"vtex"},{fieldKey:"shopify",bindingType:"shopify"},{fieldKey:"ga4",bindingType:"google-analytics"},{fieldKey:"gsc",bindingType:"google-search-console"},{fieldKey:"github",bindingType:"github"}];function Sn(o,e){const t=[];if(o.length&&t.push({field:["id"],operator:"in",value:o}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function ee(o){const e=o;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??o}function On(o,e,t,i){return{...o??{},[e]:{__type:t,value:i}}}function me(o){return o==null?!1:typeof o=="string"?o.trim().length>0:typeof o=="number"||typeof o=="boolean"?!0:Array.isArray(o)?o.some(me):typeof o=="object"?Object.entries(o).some(([e,t])=>!e.startsWith("__")&&me(t)):!1}const vn={accountName:"commerceOnboarding.companionCard.configField.accountName",appKey:"commerceOnboarding.companionCard.configField.appKey",appToken:"commerceOnboarding.companionCard.configField.appToken",propertyId:"commerceOnboarding.companionCard.configField.propertyId",siteUrl:"commerceOnboarding.companionCard.configField.siteUrl"};function jn(o,e){const t=vn[o];return t?e(t):o.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,i=>i.toUpperCase())}function _n(o){return me(o)?typeof o=="string"?o.trim():typeof o=="number"||typeof o=="boolean"?String(o):JSON.stringify(o):null}function Nn(o,e){return o?Object.entries(o).flatMap(([t,i])=>{if(t.startsWith("__"))return[];const a=_n(i);return a?[{key:t,label:jn(t,e),value:a}]:[]}):[]}function Ge({autoOpenFieldKey:o,card:e}){return o===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function Tn(o,e,t){const i=o.filter(a=>(a.app_name===e||!!t&&a.app_id===t)&&Gt(a)===null);return i.length===0?null:(i.sort((a,s)=>{const c=r=>r.status==="active"?0:1;return c(a)!==c(s)?c(a)-c(s):(s.updated_at??"").localeCompare(a.updated_at??"")}),i[0].id)}function wn(o){return o.server?.icons?.[0]?.src??Qt(o.server?.repository)??null}function En(o,e){const t=ct(o._meta);return t?.friendlyName||t?.friendly_name||o.title||o.server?.title||o.server?.name||e}function In(o){const e=[],t=new Map(o.connections.map(i=>[i.id,i]));for(const i of o.requirements){const a=o.curated[i.bindingType],s=a?o.itemsById[a.registryAppId]:o.itemsByName[i.bindingType];if(!s)continue;const c=o.configurationState?.[i.fieldKey]?.value,r=c?t.get(c):void 0,u=c&&r?c:null,p=u?o.connectionReadiness?.[u]!==!1:!1,d=!!u&&p,l=d?void 0:o.saBindings?.[i.bindingType],f=d||!!l,m=d?"oauth":l?"sa":null,y=f&&bn({bindingType:i.bindingType,boundVia:m,companionConfig:r?.configuration_state??null,cdConfig:o.configurationState??null});e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:s,title:En(s,i.bindingType),icon:wn(s),headline:a?.headline??ct(s._meta)?.short_description??null,area:a?.area??null,bullets:a?.bullets??[],satisfied:f,configured:y,required:hn.has(i.bindingType),candidateConnectionId:f?null:u||Tn(o.connections,i.bindingType,a?.registryAppId),linkedConnectionId:u,configurationState:r?.configuration_state??null,boundVia:m,boundResource:l?.resource??null,connectedDetail:f?yn({bindingType:i.bindingType,companionConfig:r?.configuration_state??null,cdConfig:o.configurationState??null}):null})}return e}function kn(o,e){if(!o)return null;const t=a=>{const s=a.startsWith("sc-domain:")?a.substring(10):(()=>{try{return new URL(a.startsWith("http")?a:`https://${a}`).hostname}catch{return null}})();return s===null?a:s.startsWith("www.")?s.substring(4):s},i=t(o);for(const a of e)if(t(a.siteUrl)===i)return a.siteUrl;return null}function Fn(o){return(o?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(a=>({value:a.property,label:`${a.displayName} (${i.displayName})`}))}))}function Rn(o){const e=G.c(25),{icon:t,title:i,headline:a,required:s,attention:c,action:r}=o,u=te(),p=c?"border-warning/50 bg-warning/[0.04]":"border-border";let d;e[0]!==p?(d=fe("relative flex items-center justify-between gap-3 rounded-lg border bg-card p-3.5 sm:gap-4 sm:p-4",p),e[0]=p,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==u?(l=s&&n.jsx("span",{className:"absolute -top-3 right-4 rounded-full border border-input bg-background px-3 py-1 text-xs font-medium text-foreground",children:u("commerceOnboarding.companionCard.required")}),e[2]=s,e[3]=u,e[4]=l):l=e[4];let f;e[5]!==t||e[6]!==i?(f=n.jsx(Le,{icon:t,name:i,size:"sm",fit:"contain",className:"shrink-0 p-1"}),e[5]=t,e[6]=i,e[7]=f):f=e[7];let m;e[8]!==i?(m=n.jsx("span",{className:"text-sm font-medium text-foreground",children:i}),e[8]=i,e[9]=m):m=e[9];let y;e[10]!==a?(y=a&&n.jsx("p",{className:"hidden text-sm leading-5 text-muted-foreground sm:block",children:a}),e[10]=a,e[11]=y):y=e[11];let x;e[12]!==m||e[13]!==y?(x=n.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[m,y]}),e[12]=m,e[13]=y,e[14]=x):x=e[14];let h;e[15]!==f||e[16]!==x?(h=n.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3 sm:items-start",children:[f,x]}),e[15]=f,e[16]=x,e[17]=h):h=e[17];let b;e[18]!==r?(b=n.jsx("div",{className:"shrink-0",children:r}),e[18]=r,e[19]=b):b=e[19];let g;return e[20]!==d||e[21]!==l||e[22]!==h||e[23]!==b?(g=n.jsxs("div",{className:d,children:[l,h,b]}),e[20]=d,e[21]=l,e[22]=h,e[23]=b,e[24]=g):g=e[24],g}function mt(o){const e=G.c(12),{connecting:t,disabled:i,title:a,primary:s,onConnect:c}=o,r=te(),u=s?"default":"outline",p=i||t;let d;e[0]!==r||e[1]!==a?(d=r("commerceOnboarding.companionCard.connectAriaLabel",{title:a}),e[0]=r,e[1]=a,e[2]=d):d=e[2];let l;e[3]!==t||e[4]!==r?(l=t?n.jsx(Fe,{size:16,className:"animate-spin"}):r("commerceOnboarding.companionCard.connect"),e[3]=t,e[4]=r,e[5]=l):l=e[5];let f;return e[6]!==c||e[7]!==u||e[8]!==p||e[9]!==d||e[10]!==l?(f=n.jsx(Z,{type:"button",variant:u,size:"sm",disabled:p,onClick:c,"aria-label":d,children:l}),e[6]=c,e[7]=u,e[8]=p,e[9]=d,e[10]=l,e[11]=f):f=e[11],f}function Ln(o){const e=G.c(11),{disabled:t,title:i,onConfigure:a}=o,s=te();let c;e[0]!==s||e[1]!==i?(c=s("commerceOnboarding.companionCard.configureAriaLabel",{title:i}),e[0]=s,e[1]=i,e[2]=c):c=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(rt,{size:16}),e[3]=r):r=e[3];let u;e[4]!==s?(u=s("commerceOnboarding.companionCard.finishSetup"),e[4]=s,e[5]=u):u=e[5];let p;return e[6]!==t||e[7]!==a||e[8]!==c||e[9]!==u?(p=n.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"border-warning/60 text-warning hover:bg-warning/10 hover:text-warning",disabled:t,onClick:a,"aria-label":c,children:[r,u]}),e[6]=t,e[7]=a,e[8]=c,e[9]=u,e[10]=p):p=e[10],p}function ft(o){const e=G.c(9),{detail:t,controls:i}=o,a=te();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(dt,{size:16,className:"text-success"}),e[0]=s):s=e[0];let c;e[1]!==t||e[2]!==a?(c=t?n.jsx("span",{className:"max-w-40 truncate text-foreground",children:t}):a("commerceOnboarding.companionCard.connected"),e[1]=t,e[2]=a,e[3]=c):c=e[3];let r;e[4]!==c?(r=n.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s," ",c]}),e[4]=c,e[5]=r):r=e[5];let u;return e[6]!==i||e[7]!==r?(u=n.jsxs("div",{className:"flex items-center gap-1",children:[r,i]}),e[6]=i,e[7]=r,e[8]=u):u=e[8],u}function gt(o){const e=G.c(4),{ariaLabel:t,onClick:i}=o;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(rt,{size:16}),e[0]=a):a=e[0];let s;return e[1]!==t||e[2]!==i?(s=n.jsx(Z,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:i,"aria-label":t,children:a}),e[1]=t,e[2]=i,e[3]=s):s=e[3],s}function ke(o){const e=G.c(38);let t,i,a,s,c;e[0]!==o?({value:c,onChange:i,placeholder:a,className:t,...s}=o,e[0]=o,e[1]=t,e[2]=i,e[3]=a,e[4]=s,e[5]=c):(t=e[1],i=e[2],a=e[3],s=e[4],c=e[5]);const[r,u]=H.useState(!1),[p,d]=H.useState(!1);let l;e[6]!==c?(l=async()=>{if(c)try{await navigator.clipboard.writeText(c),d(!0),setTimeout(()=>d(!1),2e3)}catch(N){console.error("Failed to copy text: ",N)}},e[6]=c,e[7]=l):l=e[7];const f=l;let m;e[8]!==r?(m=()=>{u(!r)},e[8]=r,e[9]=m):m=e[9];const y=m,x=r?"text":"password";let h;e[10]!==t?(h=fe("pr-20",t),e[10]=t,e[11]=h):h=e[11];let b;e[12]!==i||e[13]!==a||e[14]!==s||e[15]!==x||e[16]!==h||e[17]!==c?(b=n.jsx(ge,{type:x,value:c,onChange:i,placeholder:a,className:h,...s}),e[12]=i,e[13]=a,e[14]=s,e[15]=x,e[16]=h,e[17]=c,e[18]=b):b=e[18];const g=r?"Hide password":"Show password";let S;e[19]!==r?(S=r?n.jsx(Jt,{size:16}):n.jsx(en,{size:16}),e[19]=r,e[20]=S):S=e[20];let C;e[21]!==g||e[22]!==S||e[23]!==y?(C=n.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:y,title:g,children:S}),e[21]=g,e[22]=S,e[23]=y,e[24]=C):C=e[24];const v=!c,j=p?"Copied!":"Copy token";let _;e[25]!==p?(_=p?n.jsx(Xt,{size:16}):n.jsx(ut,{size:16}),e[25]=p,e[26]=_):_=e[26];let O;e[27]!==f||e[28]!==j||e[29]!==_||e[30]!==v?(O=n.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:f,disabled:v,title:j,children:_}),e[27]=f,e[28]=j,e[29]=_,e[30]=v,e[31]=O):O=e[31];let E;e[32]!==O||e[33]!==C?(E=n.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[C,O]}),e[32]=O,e[33]=C,e[34]=E):E=e[34];let w;return e[35]!==E||e[36]!==b?(w=n.jsxs("div",{className:"relative",children:[b,E]}),e[35]=E,e[36]=b,e[37]=w):w=e[37],w}function we(o){const e=G.c(19),{card:t,selfClient:i,org:a,onDone:s,onError:c}=o,r=Oe();let u;e[0]!==t||e[1]!==i?(u=async h=>{const{values:b,connectionToken:g}=h,C={configuration_state:{...t.configurationState??{},...b}};g!==void 0&&(C.connection_token=g),await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:C}})},e[0]=t,e[1]=i,e[2]=u):u=e[2];let p;e[3]!==s||e[4]!==a||e[5]!==r?(p=async()=>{await r.invalidateQueries({queryKey:X.commerceDiscoveryCompanionConnectionsPrefix(a.id)}),s()},e[3]=s,e[4]=a,e[5]=r,e[6]=p):p=e[6];let d;e[7]!==c?(d=h=>{c?.(h)},e[7]=c,e[8]=d):d=e[8];let l;e[9]!==u||e[10]!==p||e[11]!==d?(l={mutationFn:u,onSuccess:p,onError:d},e[9]=u,e[10]=p,e[11]=d,e[12]=l):l=e[12];const f=ve(l);let m;e[13]!==f?(m=(h,b)=>f.mutate({values:h,connectionToken:b?.connectionToken}),e[13]=f,e[14]=m):m=e[14];const y=m;let x;return e[15]!==f.error||e[16]!==f.isPending||e[17]!==y?(x={save:y,isPending:f.isPending,error:f.error},e[15]=f.error,e[16]=f.isPending,e[17]=y,e[18]=x):x=e[18],x}const Dn=be({accountName:oe().min(1,"Informe o nome da conta"),appKey:oe().optional(),appToken:oe().optional()});function An(o){const e=G.c(73),{card:t,selfClient:i,org:a,onDone:s,onIsPendingChange:c}=o,r=te();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=ye(Dn),e[0]=u):u=e[0];const p=t.configurationState?.accountName||"",d=t.configurationState?.appKey||"",l=t.configurationState?.appToken||"";let f;e[1]!==p||e[2]!==d||e[3]!==l?(f={resolver:u,defaultValues:{accountName:p,appKey:d,appToken:l}},e[1]=p,e[2]=d,e[3]=l,e[4]=f):f=e[4];const m=xe(f);let y;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==m?(y=()=>{m.reset({accountName:t.configurationState?.accountName||"",appKey:t.configurationState?.appKey||"",appToken:t.configurationState?.appToken||""})},e[5]=t.configurationState?.accountName,e[6]=t.configurationState?.appKey,e[7]=t.configurationState?.appToken,e[8]=m,e[9]=y):y=e[9];let x;e[10]!==t.configurationState||e[11]!==m?(x=[t.configurationState,m],e[10]=t.configurationState,e[11]=m,e[12]=x):x=e[12],H.useEffect(y,x);let h;e[13]!==t||e[14]!==s||e[15]!==a||e[16]!==i?(h={card:t,selfClient:i,org:a,onDone:s},e[13]=t,e[14]=s,e[15]=a,e[16]=i,e[17]=h):h=e[17];const{save:b,isPending:g,error:S}=we(h);let C,v;e[18]!==g||e[19]!==c?(v=()=>{c?.(g)},C=[g,c],e[18]=g,e[19]=c,e[20]=C,e[21]=v):(C=e[20],v=e[21]),H.useEffect(v,C);let j;if(e[22]!==m||e[23]!==b){let B;e[25]!==b?(B=async $=>{b($)},e[25]=b,e[26]=B):B=e[26],j=m.handleSubmit(B),e[22]=m,e[23]=b,e[24]=j}else j=e[24];const _=j;let O;e[27]!==g||e[28]!==r?(O=B=>{const{field:$}=B;return n.jsxs(se,{children:[n.jsx(pe,{children:r("commerceOnboarding.vtexConfigForm.accountNameLabel")}),n.jsx(re,{children:n.jsx(ge,{placeholder:r("commerceOnboarding.vtexConfigForm.accountNamePlaceholder"),...$,disabled:g})}),n.jsx(ae,{})]})},e[27]=g,e[28]=r,e[29]=O):O=e[29];let E;e[30]!==m.control||e[31]!==O?(E=n.jsx(ie,{control:m.control,name:"accountName",render:O}),e[30]=m.control,e[31]=O,e[32]=E):E=e[32];let w;e[33]!==g||e[34]!==r?(w=B=>{const{field:$}=B;return n.jsxs(se,{children:[n.jsx(pe,{children:r("commerceOnboarding.vtexConfigForm.appKeyLabel")}),n.jsx(re,{children:n.jsx(ke,{placeholder:r("commerceOnboarding.vtexConfigForm.appKeyPlaceholder"),...$,disabled:g})}),n.jsx(ae,{})]})},e[33]=g,e[34]=r,e[35]=w):w=e[35];let N;e[36]!==m.control||e[37]!==w?(N=n.jsx(ie,{control:m.control,name:"appKey",render:w}),e[36]=m.control,e[37]=w,e[38]=N):N=e[38];let k;e[39]!==g||e[40]!==r?(k=B=>{const{field:$}=B;return n.jsxs(se,{children:[n.jsx(pe,{children:r("commerceOnboarding.vtexConfigForm.appTokenLabel")}),n.jsx(re,{children:n.jsx(ke,{placeholder:r("commerceOnboarding.vtexConfigForm.appTokenPlaceholder"),...$,disabled:g})}),n.jsx(ae,{})]})},e[39]=g,e[40]=r,e[41]=k):k=e[41];let I;e[42]!==m.control||e[43]!==k?(I=n.jsx(ie,{control:m.control,name:"appToken",render:k}),e[42]=m.control,e[43]=k,e[44]=I):I=e[44];let F;e[45]!==m||e[46]!==E||e[47]!==N||e[48]!==I?(F=n.jsxs(Ce,{...m,children:[E,N,I]}),e[45]=m,e[46]=E,e[47]=N,e[48]=I,e[49]=F):F=e[49];let A;e[50]!==S||e[51]!==r?(A=S&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S instanceof Error?S.message:r("commerceOnboarding.vtexConfigForm.savingError")}),e[50]=S,e[51]=r,e[52]=A):A=e[52];let T;e[53]!==r?(T=r("commerceOnboarding.vtexConfigForm.cancelButton"),e[53]=r,e[54]=T):T=e[54];let L;e[55]!==g||e[56]!==s||e[57]!==T?(L=n.jsx(Z,{type:"button",variant:"outline",onClick:s,disabled:g,children:T}),e[55]=g,e[56]=s,e[57]=T,e[58]=L):L=e[58];let P;e[59]!==g||e[60]!==r?(P=r(g?"commerceOnboarding.vtexConfigForm.savingButton":"commerceOnboarding.vtexConfigForm.saveButton"),e[59]=g,e[60]=r,e[61]=P):P=e[61];let K;e[62]!==g||e[63]!==P?(K=n.jsx(Z,{type:"submit",disabled:g,children:P}),e[62]=g,e[63]=P,e[64]=K):K=e[64];let R;e[65]!==L||e[66]!==K?(R=n.jsxs(he,{className:"pt-4",children:[L,K]}),e[65]=L,e[66]=K,e[67]=R):R=e[67];let U;return e[68]!==_||e[69]!==F||e[70]!==A||e[71]!==R?(U=n.jsxs("form",{onSubmit:_,className:"space-y-4",children:[F,A,R]}),e[68]=_,e[69]=F,e[70]=A,e[71]=R,e[72]=U):U=e[72],U}const Kn=(o,e)=>be({storeDomain:oe().min(1,e("commerceOnboarding.shopifyConfigForm.storeDomainRequired")),accessToken:oe().optional(),apiVersion:oe().optional()}).refine(t=>o||!!t.accessToken?.trim(),{path:["accessToken"],message:e("commerceOnboarding.shopifyConfigForm.accessTokenRequired")});function Pn(o){const e=G.c(76),{card:t,selfClient:i,org:a,onDone:s,onIsPendingChange:c}=o,r=te();let u;e[0]!==t.configured||e[1]!==r?(u=ye(Kn(t.configured,r)),e[0]=t.configured,e[1]=r,e[2]=u):u=e[2];const p=t.configurationState?.storeDomain||"",d=t.configurationState?.apiVersion||"";let l;e[3]!==p||e[4]!==d?(l={storeDomain:p,accessToken:"",apiVersion:d},e[3]=p,e[4]=d,e[5]=l):l=e[5];let f;e[6]!==u||e[7]!==l?(f={resolver:u,defaultValues:l},e[6]=u,e[7]=l,e[8]=f):f=e[8];const m=xe(f);let y;e[9]!==t.configurationState?.apiVersion||e[10]!==t.configurationState?.storeDomain||e[11]!==m?(y=()=>{m.reset({storeDomain:t.configurationState?.storeDomain||"",accessToken:"",apiVersion:t.configurationState?.apiVersion||""})},e[9]=t.configurationState?.apiVersion,e[10]=t.configurationState?.storeDomain,e[11]=m,e[12]=y):y=e[12];let x;e[13]!==t.configurationState||e[14]!==m?(x=[t.configurationState,m],e[13]=t.configurationState,e[14]=m,e[15]=x):x=e[15],H.useEffect(y,x);let h;e[16]!==t||e[17]!==s||e[18]!==a||e[19]!==i?(h={card:t,selfClient:i,org:a,onDone:s},e[16]=t,e[17]=s,e[18]=a,e[19]=i,e[20]=h):h=e[20];const{save:b,isPending:g,error:S}=we(h);let C,v;e[21]!==g||e[22]!==c?(v=()=>{c?.(g)},C=[g,c],e[21]=g,e[22]=c,e[23]=C,e[24]=v):(C=e[23],v=e[24]),H.useEffect(v,C);let j;if(e[25]!==m||e[26]!==b){let B;e[28]!==b?(B=async $=>{const q=$.apiVersion?.trim(),M=$.accessToken?.trim();b({storeDomain:$.storeDomain.trim(),...q?{apiVersion:q}:{}},M?{connectionToken:M}:void 0)},e[28]=b,e[29]=B):B=e[29],j=m.handleSubmit(B),e[25]=m,e[26]=b,e[27]=j}else j=e[27];const _=j;let O;e[30]!==g||e[31]!==r?(O=B=>{const{field:$}=B;return n.jsxs(se,{children:[n.jsx(pe,{children:r("commerceOnboarding.shopifyConfigForm.storeDomainLabel")}),n.jsx(re,{children:n.jsx(ge,{placeholder:r("commerceOnboarding.shopifyConfigForm.storeDomainPlaceholder"),...$,disabled:g})}),n.jsx(ae,{})]})},e[30]=g,e[31]=r,e[32]=O):O=e[32];let E;e[33]!==m.control||e[34]!==O?(E=n.jsx(ie,{control:m.control,name:"storeDomain",render:O}),e[33]=m.control,e[34]=O,e[35]=E):E=e[35];let w;e[36]!==g||e[37]!==r?(w=B=>{const{field:$}=B;return n.jsxs(se,{children:[n.jsx(pe,{children:r("commerceOnboarding.shopifyConfigForm.accessTokenLabel")}),n.jsx(re,{children:n.jsx(ke,{placeholder:r("commerceOnboarding.shopifyConfigForm.accessTokenPlaceholder"),...$,disabled:g})}),n.jsx(ae,{})]})},e[36]=g,e[37]=r,e[38]=w):w=e[38];let N;e[39]!==m.control||e[40]!==w?(N=n.jsx(ie,{control:m.control,name:"accessToken",render:w}),e[39]=m.control,e[40]=w,e[41]=N):N=e[41];let k;e[42]!==g||e[43]!==r?(k=B=>{const{field:$}=B;return n.jsxs(se,{children:[n.jsx(pe,{children:r("commerceOnboarding.shopifyConfigForm.apiVersionLabel")}),n.jsx(re,{children:n.jsx(ge,{placeholder:r("commerceOnboarding.shopifyConfigForm.apiVersionPlaceholder"),...$,disabled:g})}),n.jsx(ae,{})]})},e[42]=g,e[43]=r,e[44]=k):k=e[44];let I;e[45]!==m.control||e[46]!==k?(I=n.jsx(ie,{control:m.control,name:"apiVersion",render:k}),e[45]=m.control,e[46]=k,e[47]=I):I=e[47];let F;e[48]!==m||e[49]!==E||e[50]!==N||e[51]!==I?(F=n.jsxs(Ce,{...m,children:[E,N,I]}),e[48]=m,e[49]=E,e[50]=N,e[51]=I,e[52]=F):F=e[52];let A;e[53]!==S||e[54]!==r?(A=S&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S instanceof Error?S.message:r("commerceOnboarding.shopifyConfigForm.savingError")}),e[53]=S,e[54]=r,e[55]=A):A=e[55];let T;e[56]!==r?(T=r("commerceOnboarding.shopifyConfigForm.cancelButton"),e[56]=r,e[57]=T):T=e[57];let L;e[58]!==g||e[59]!==s||e[60]!==T?(L=n.jsx(Z,{type:"button",variant:"outline",onClick:s,disabled:g,children:T}),e[58]=g,e[59]=s,e[60]=T,e[61]=L):L=e[61];let P;e[62]!==g||e[63]!==r?(P=r(g?"commerceOnboarding.shopifyConfigForm.savingButton":"commerceOnboarding.shopifyConfigForm.saveButton"),e[62]=g,e[63]=r,e[64]=P):P=e[64];let K;e[65]!==g||e[66]!==P?(K=n.jsx(Z,{type:"submit",disabled:g,children:P}),e[65]=g,e[66]=P,e[67]=K):K=e[67];let R;e[68]!==L||e[69]!==K?(R=n.jsxs(he,{className:"pt-4",children:[L,K]}),e[68]=L,e[69]=K,e[70]=R):R=e[70];let U;return e[71]!==_||e[72]!==F||e[73]!==A||e[74]!==R?(U=n.jsxs("form",{onSubmit:_,className:"space-y-4",children:[F,A,R]}),e[71]=_,e[72]=F,e[73]=A,e[74]=R,e[75]=U):U=e[75],U}function Pe(o){const e=G.c(31),{options:t,value:i,onChange:a,disabled:s,ariaLabel:c,searchPlaceholder:r,hideSearch:u}=o,p=u===void 0?!1:u,d=te(),[l,f]=H.useState("");let m,y,x;if(e[0]!==t||e[1]!==l||e[2]!==i){const _=l.trim().toLowerCase();m=_?t.filter(O=>O.label.toLowerCase().includes(_)):t,y=m.map(Bn),x=y.includes(i)?i:y[0]??"",e[0]=t,e[1]=l,e[2]=i,e[3]=m,e[4]=y,e[5]=x}else m=e[3],y=e[4],x=e[5];const h=x;let b;e[6]!==s||e[7]!==y||e[8]!==a?(b=function(O){if(s||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(O.key))return;O.preventDefault();const w=O.currentTarget.dataset.value,N=y.indexOf(w),k=y.length;if(k===0)return;let I;O.key==="ArrowDown"||O.key==="ArrowRight"?I=(N+1)%k:O.key==="ArrowUp"||O.key==="ArrowLeft"?I=(N-1+k)%k:O.key==="Home"?I=0:I=k-1;const F=y[I];a(F),O.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(F)}"]`)?.focus()},e[6]=s,e[7]=y,e[8]=a,e[9]=b):b=e[9];const g=b;let S;e[10]!==c||e[11]!==s||e[12]!==p||e[13]!==l||e[14]!==r||e[15]!==d?(S=p?null:n.jsxs("div",{className:"relative",children:[n.jsx(at,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),n.jsx(ge,{type:"text",value:l,onChange:_=>f(_.target.value),disabled:s,placeholder:r??d("commerceOnboarding.selectableList.searchPlaceholder"),"aria-label":d("commerceOnboarding.selectableList.searchAriaLabel",{label:c}),className:"h-8 pl-8"})]}),e[10]=c,e[11]=s,e[12]=p,e[13]=l,e[14]=r,e[15]=d,e[16]=S):S=e[16];let C;e[17]!==s||e[18]!==m||e[19]!==g||e[20]!==a||e[21]!==d||e[22]!==h||e[23]!==i?(C=m.length===0?n.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:d("commerceOnboarding.selectableList.noResults")}):m.map(_=>{const O=_.value===i;return n.jsxs("button",{type:"button",role:"radio","aria-checked":O,disabled:s,"data-value":_.value,tabIndex:_.value===h?0:-1,onClick:()=>a(_.value),onKeyDown:g,className:fe("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",O?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[n.jsx("span",{className:"truncate",children:_.label}),O?n.jsx(dt,{size:16,className:"shrink-0 text-primary"}):null]},_.value)}),e[17]=s,e[18]=m,e[19]=g,e[20]=a,e[21]=d,e[22]=h,e[23]=i,e[24]=C):C=e[24];let v;e[25]!==c||e[26]!==C?(v=n.jsx("div",{role:"radiogroup","aria-label":c,className:"max-h-[280px] overflow-y-auto",children:C}),e[25]=c,e[26]=C,e[27]=v):v=e[27];let j;return e[28]!==S||e[29]!==v?(j=n.jsxs("div",{className:"space-y-2",children:[S,v]}),e[28]=S,e[29]=v,e[30]=j):j=e[30],j}function Bn(o){return o.value}function Be(o){const e=G.c(16),{label:t,iconSize:i,className:a,iconClassName:s,labelClassName:c}=o,r=i===void 0?14:i;let u;e[0]!==a?(u=fe("inline-flex items-center gap-2",a),e[0]=a,e[1]=u):u=e[1];let p;e[2]!==s?(p=fe("shrink-0 animate-spin",s),e[2]=s,e[3]=p):p=e[3];let d;e[4]!==r||e[5]!==p?(d=n.jsx(Fe,{size:r,className:p}),e[4]=r,e[5]=p,e[6]=d):d=e[6];let l;e[7]!==c?(l=fe("text-sm",c),e[7]=c,e[8]=l):l=e[8];let f;e[9]!==t||e[10]!==l?(f=n.jsx("span",{className:l,children:t}),e[9]=t,e[10]=l,e[11]=f):f=e[11];let m;return e[12]!==u||e[13]!==d||e[14]!==f?(m=n.jsxs("span",{className:u,children:[d,f]}),e[12]=u,e[13]=d,e[14]=f,e[15]=m):m=e[15],m}const qn=be({propertyId:oe().min(1,"Selecione uma propriedade")});function Un(o){const e=G.c(68),{card:t,connectionId:i,companionClient:a,selfClient:s,org:c,onDone:r,onDisconnect:u,onIsPendingChange:p}=o;let d;e[0]!==i||e[1]!==c.id?(d=X.commerceDiscoveryCompanionGaProperties(c.id,i),e[0]=i,e[1]=c.id,e[2]=d):d=e[2];let l;e[3]!==a?(l=async()=>{const q=await a.callTool({name:"get-account-summaries",arguments:{}}),M=ee(q);return Fn(M)},e[3]=a,e[4]=l):l=e[4];let f;e[5]!==d||e[6]!==l?(f={queryKey:d,queryFn:l},e[5]=d,e[6]=l,e[7]=f):f=e[7];const m=Se(f);let y;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=ye(qn),e[8]=y):y=e[8];const x=t.configurationState?.propertyId||"";let h;e[9]!==x?(h={resolver:y,defaultValues:{propertyId:x}},e[9]=x,e[10]=h):h=e[10];const b=xe(h);let g;e[11]!==t||e[12]!==r||e[13]!==c||e[14]!==s?(g={card:t,selfClient:s,org:c,onDone:r},e[11]=t,e[12]=r,e[13]=c,e[14]=s,e[15]=g):g=e[15];const{save:S,isPending:C,error:v}=we(g);let j,_;e[16]!==C||e[17]!==p?(j=()=>{p?.(C)},_=[C,p],e[16]=C,e[17]=p,e[18]=j,e[19]=_):(j=e[18],_=e[19]),H.useEffect(j,_);let O;if(e[20]!==b||e[21]!==S){let q;e[23]!==S?(q=async M=>{S(M)},e[23]=S,e[24]=q):q=e[24],O=b.handleSubmit(q),e[20]=b,e[21]=S,e[22]=O}else O=e[22];const E=O;if(m.isLoading){let q;return e[25]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:n.jsx(Be,{label:"Carregando propriedades..."})}),e[25]=q):q=e[25],q}if(m.isError){let q;return e[26]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=q):q=e[26],q}let w;e[27]!==m.data?(w=m.data||[],e[27]=m.data,e[28]=w):w=e[28];const N=w;if(N.flatMap(zn).length===0){let q;e[29]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."}),e[29]=q):q=e[29];let M;e[30]!==u?(M=u?n.jsx("button",{type:"button",onClick:u,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive",children:"Desconectar conta"}):n.jsx("span",{}),e[30]=u,e[31]=M):M=e[31];let z;e[32]!==r?(z=n.jsx(Z,{type:"button",variant:"outline",onClick:r,children:"Fechar"}),e[32]=r,e[33]=z):z=e[33];let Y;return e[34]!==M||e[35]!==z?(Y=n.jsxs("div",{className:"space-y-4",children:[q,n.jsxs(he,{className:"flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[M,z]})]}),e[34]=M,e[35]=z,e[36]=Y):Y=e[36],Y}let I;e[37]!==C||e[38]!==N?(I=q=>{const{field:M}=q;return n.jsxs(se,{children:[n.jsx(re,{children:n.jsx(Pe,{options:N.flatMap($n),value:M.value,onChange:M.onChange,disabled:C,ariaLabel:"Propriedade do Google Analytics"})}),n.jsx(ae,{})]})},e[37]=C,e[38]=N,e[39]=I):I=e[39];let F;e[40]!==b.control||e[41]!==I?(F=n.jsx(ie,{control:b.control,name:"propertyId",render:I}),e[40]=b.control,e[41]=I,e[42]=F):F=e[42];let A;e[43]!==b||e[44]!==F?(A=n.jsx(Ce,{...b,children:F}),e[43]=b,e[44]=F,e[45]=A):A=e[45];let T;e[46]!==v?(T=v&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v instanceof Error?v.message:"Não foi possível salvar a configuração"}),e[46]=v,e[47]=T):T=e[47];let L;e[48]!==C||e[49]!==u?(L=u?n.jsx("button",{type:"button",onClick:u,disabled:C,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive disabled:opacity-50",children:"Desconectar conta"}):n.jsx("span",{}),e[48]=C,e[49]=u,e[50]=L):L=e[50];let P;e[51]!==C||e[52]!==r?(P=n.jsx(Z,{type:"button",variant:"outline",onClick:r,disabled:C,children:"Cancelar"}),e[51]=C,e[52]=r,e[53]=P):P=e[53];const K=C?"Salvando...":"Salvar";let R;e[54]!==C||e[55]!==K?(R=n.jsx(Z,{type:"submit",disabled:C,children:K}),e[54]=C,e[55]=K,e[56]=R):R=e[56];let U;e[57]!==P||e[58]!==R?(U=n.jsxs("div",{className:"flex gap-2",children:[P,R]}),e[57]=P,e[58]=R,e[59]=U):U=e[59];let B;e[60]!==L||e[61]!==U?(B=n.jsxs(he,{className:"flex-col gap-2 pt-4 sm:flex-row sm:items-center sm:justify-between",children:[L,U]}),e[60]=L,e[61]=U,e[62]=B):B=e[62];let $;return e[63]!==E||e[64]!==A||e[65]!==T||e[66]!==B?($=n.jsxs("form",{onSubmit:E,className:"space-y-4",children:[A,T,B]}),e[63]=E,e[64]=A,e[65]=T,e[66]=B,e[67]=$):$=e[67],$}function $n(o){return o.options}function zn(o){return o.options}const Mn=o=>be({siteUrl:oe().min(1,o("commerceOnboarding.googleSearchConsoleConfigForm.siteRequired"))});function Qn(o){const e=G.c(83),{card:t,connectionId:i,companionClient:a,selfClient:s,org:c,contextSiteUrl:r,onDone:u,onIsPendingChange:p}=o,d=te();let l;e[0]!==i||e[1]!==c.id?(l=X.commerceDiscoveryCompanionGscSites(c.id,i),e[0]=i,e[1]=c.id,e[2]=l):l=e[2];let f;e[3]!==a?(f=async()=>{const D=await a.callTool({name:"list_sites",arguments:{}});return ee(D).sites||[]},e[3]=a,e[4]=f):f=e[4];let m;e[5]!==l||e[6]!==f?(m={queryKey:l,queryFn:f},e[5]=l,e[6]=f,e[7]=m):m=e[7];const y=Se(m);let x;e[8]!==d?(x=ye(Mn(d)),e[8]=d,e[9]=x):x=e[9];const h=t.configurationState?.siteUrl||"";let b;e[10]!==h?(b={siteUrl:h},e[10]=h,e[11]=b):b=e[11];let g;e[12]!==x||e[13]!==b?(g={resolver:x,defaultValues:b},e[12]=x,e[13]=b,e[14]=g):g=e[14];const S=xe(g);let C;e[15]!==t||e[16]!==u||e[17]!==c||e[18]!==s?(C={card:t,selfClient:s,org:c,onDone:u},e[15]=t,e[16]=u,e[17]=c,e[18]=s,e[19]=C):C=e[19];const{save:v,isPending:j,error:_}=we(C),O=H.useRef(!1),E=t.configurationState?.siteUrl;let w,N;e[20]!==j||e[21]!==p?(N=()=>{p?.(j)},w=[j,p],e[20]=j,e[21]=p,e[22]=w,e[23]=N):(w=e[22],N=e[23]),H.useEffect(N,w);let k,I;e[24]!==r||e[25]!==S||e[26]!==E||e[27]!==y.data||e[28]!==y.isSuccess?(k=()=>{if(!(O.current||!y.isSuccess)){if(O.current=!0,E){S.getValues("siteUrl")!==E&&S.setValue("siteUrl",E);return}if(!S.getValues("siteUrl")){const D=kn(r,y.data??[]);D&&S.setValue("siteUrl",D)}}},I=[y.isSuccess,y.data,E,r,S],e[24]=r,e[25]=S,e[26]=E,e[27]=y.data,e[28]=y.isSuccess,e[29]=k,e[30]=I):(k=e[29],I=e[30]),H.useEffect(k,I);let F;if(e[31]!==S||e[32]!==v){let D;e[34]!==v?(D=async Q=>{v(Q)},e[34]=v,e[35]=D):D=e[35],F=S.handleSubmit(D),e[31]=S,e[32]=v,e[33]=F}else F=e[33];const A=F;if(y.isLoading){let D;e[36]!==d?(D=d("commerceOnboarding.googleSearchConsoleConfigForm.loadingSites"),e[36]=d,e[37]=D):D=e[37];let Q;return e[38]!==D?(Q=n.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:n.jsx(Be,{label:D})}),e[38]=D,e[39]=Q):Q=e[39],Q}if(y.isError){let D;e[40]!==d?(D=d("commerceOnboarding.googleSearchConsoleConfigForm.loadSitesError"),e[40]=d,e[41]=D):D=e[41];let Q;return e[42]!==D?(Q=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-destructive",children:D})}),e[42]=D,e[43]=Q):Q=e[43],Q}let T;e[44]!==y.data?(T=y.data||[],e[44]=y.data,e[45]=T):T=e[45];const L=T;if(L.length===0){let D;e[46]!==d?(D=d("commerceOnboarding.googleSearchConsoleConfigForm.noSitesFound"),e[46]=d,e[47]=D):D=e[47];let Q;return e[48]!==D?(Q=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:D})}),e[48]=D,e[49]=Q):Q=e[49],Q}let P;e[50]!==j||e[51]!==L||e[52]!==d?(P=D=>{const{field:Q}=D;return n.jsxs(se,{children:[n.jsx(re,{children:n.jsx(Pe,{options:L.map(Vn),value:Q.value,onChange:Q.onChange,disabled:j,ariaLabel:d("commerceOnboarding.googleSearchConsoleConfigForm.siteAriaLabel")})}),n.jsx(ae,{})]})},e[50]=j,e[51]=L,e[52]=d,e[53]=P):P=e[53];let K;e[54]!==S.control||e[55]!==P?(K=n.jsx(ie,{control:S.control,name:"siteUrl",render:P}),e[54]=S.control,e[55]=P,e[56]=K):K=e[56];let R;e[57]!==S||e[58]!==K?(R=n.jsx(Ce,{...S,children:K}),e[57]=S,e[58]=K,e[59]=R):R=e[59];let U;e[60]!==_||e[61]!==d?(U=_&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:_ instanceof Error?_.message:d("commerceOnboarding.googleSearchConsoleConfigForm.savingError")}),e[60]=_,e[61]=d,e[62]=U):U=e[62];let B;e[63]!==d?(B=d("commerceOnboarding.googleSearchConsoleConfigForm.cancelButton"),e[63]=d,e[64]=B):B=e[64];let $;e[65]!==j||e[66]!==u||e[67]!==B?($=n.jsx(Z,{type:"button",variant:"outline",onClick:u,disabled:j,children:B}),e[65]=j,e[66]=u,e[67]=B,e[68]=$):$=e[68];let q;e[69]!==j||e[70]!==d?(q=d(j?"commerceOnboarding.googleSearchConsoleConfigForm.savingButton":"commerceOnboarding.googleSearchConsoleConfigForm.saveButton"),e[69]=j,e[70]=d,e[71]=q):q=e[71];let M;e[72]!==j||e[73]!==q?(M=n.jsx(Z,{type:"submit",disabled:j,children:q}),e[72]=j,e[73]=q,e[74]=M):M=e[74];let z;e[75]!==$||e[76]!==M?(z=n.jsxs(he,{className:"pt-4",children:[$,M]}),e[75]=$,e[76]=M,e[77]=z):z=e[77];let Y;return e[78]!==A||e[79]!==R||e[80]!==U||e[81]!==z?(Y=n.jsxs("form",{onSubmit:A,className:"space-y-4",children:[R,U,z]}),e[78]=A,e[79]=R,e[80]=U,e[81]=z,e[82]=Y):Y=e[82],Y}function Vn(o){return{value:o.siteUrl,label:o.siteUrl}}function Hn(o){const[e,t]=o.split("/");return!e||!t?null:{owner:e,name:t}}function Gn(o){const{existingRepo:e,owner:t,name:i}=o;return e?.connectionId&&e.owner.toLowerCase()===t.toLowerCase()&&e.name.toLowerCase()===i.toLowerCase()?{connectionId:e.connectionId,installationId:e.installationId}:null}function Wn(o){const{existingRepo:e,existingConnections:t,repoConnectionId:i}=o,a=e?.connectionId&&e.connectionId!==i?e.connectionId:void 0,s=[...t.filter(c=>c.connection_id!==i&&c.connection_id!==a),{connection_id:i,selected_tools:[]}];return{staleConnectionId:a,mergedConnections:s}}const Yn=be({githubRepo:oe().min(1,"commerceOnboarding.githubConfigForm.selectRepository")}),Zn=15e3,Xn=/^[\w.-]+\/[\w.-]+$/;async function Jn(o,e,t,i){const{installations:a}=await lt(o,t),s=i.trim(),c=await Promise.allSettled(a.map(async d=>{const l=d.type==="User"?"user":"org",f=s?`${l}:${d.login} ${s} in:name`:`${l}:${d.login}`,y=await e.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:50}},void 0,{signal:AbortSignal.timeout(Zn)}),x=y.content?.[0]?.text;if(y.isError)throw new Error(x??"search_repositories failed");if(!x)throw new Error("empty search_repositories response");return JSON.parse(x).items??[]})),r=new Map;let u=0;for(const d of c){if(d.status==="rejected"){u+=1;continue}for(const l of d.value)l.full_name&&!r.has(l.full_name)&&r.set(l.full_name,l)}return{repos:Array.from(r.values()).sort((d,l)=>(l.updated_at??"").localeCompare(d.updated_at??"")).map(d=>d.full_name),failed:u,total:a.length}}function eo({connectionId:o,companionClient:e,selfClient:t,org:i,onDone:a,onIsPendingChange:s}){const c=te(),r=Oe(),u=tt.COMMERCE_DISCOVERY(i.id),[p,d]=H.useState(""),l=tn(p,300),f=H.useRef(!1),m=Se({queryKey:X.commerceDiscoveryCompanionGithubSelected(i.id,o),queryFn:async()=>{const N=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:u}}),k=ee(N).item?.configuration_state??null;return typeof k?.github_repo=="string"?k.github_repo:""}}),y=Se({queryKey:X.commerceDiscoveryCompanionGithubRepos(i.id,o,l.trim()),queryFn:()=>Jn(N=>t.callTool(N),e,o,l)}),x=xe({resolver:ye(Yn),defaultValues:{githubRepo:""}}),h=ve({mutationFn:async N=>{const k=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:u}}),F={...ee(k).item?.configuration_state??null??{},github_repo:N};await t.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:u,data:{configuration_state:F}}});const A=Hn(N);if(!A)throw new Error(c("commerceOnboarding.githubConfigForm.invalidRepository",{repo:N}));const{owner:T,name:L}=A,P=Ut(i.id),K=ee(await t.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:P}})).item,R=K?.metadata?.githubRepo,U=K?.connections??[],B=Gn({existingRepo:R,owner:T,name:L});let $=B?.connectionId,q=B?.installationId,M;if(!$){const{installations:D}=await lt(J=>t.callTool(J),o),Q=Wt(D,T);if(!Q)throw new Error(c("commerceOnboarding.githubConfigForm.noGithubInstallation",{owner:T}));q=Q.installationId;const ne=ee(await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}})).item;if(!ne)throw new Error(c("commerceOnboarding.githubConfigForm.githubConnectionNotFound"));const{childConnectionId:le,reused:W}=await Yt({orgSlug:i.slug,sourceConnection:ne,installationId:q,owner:T,repo:L,githubCallTool:J=>e.callTool(J),selfCallTool:J=>t.callTool(J)});$=le,M=W?void 0:le}const{staleConnectionId:z,mergedConnections:Y}=Wn({existingRepo:R,existingConnections:U,repoConnectionId:$});try{if(await t.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:P,data:{connections:Y,metadata:{githubRepo:{owner:T,name:L,url:`https://github.com/${N}`,installationId:q,connectionId:$}}}}}),z){const D=ee(await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:z}})).item;D&&!Zt(D)&&await t.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:z,force:!0}}).catch(()=>{})}}catch(D){throw M&&await t.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}}).catch(()=>{}),D}},onSuccess:async()=>{await r.invalidateQueries({queryKey:X.commerceDiscoveryConnection(i.id,u)}),await r.invalidateQueries({queryKey:X.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),Et(r,i.id),a()}}),b=h.isPending;H.useEffect(()=>{s?.(b)},[b,s]);const g=m.data??"";H.useEffect(()=>{!m.isSuccess||f.current||(f.current=!0,m.data&&x.setValue("githubRepo",m.data))},[m.isSuccess,m.data,x]);const S=x.handleSubmit(async N=>{h.mutate(N.githubRepo)}),C=y.data?.repos??[],v=y.data?.failed??0,j=y.data?.total??0,_=l.trim(),O=[...C];_&&Xn.test(_)&&!O.includes(_)&&O.unshift(_),g&&!O.includes(g)&&O.push(g);const E=j>0&&v===j,w=y.isError||E?c("commerceOnboarding.githubConfigForm.searchFailedTotal"):v>0?c("commerceOnboarding.githubConfigForm.searchFailedPartial"):null;return n.jsxs("form",{onSubmit:S,className:"space-y-4",children:[n.jsxs("div",{className:"relative",children:[n.jsx(at,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),n.jsx(ge,{type:"text",value:p,onChange:N=>d(N.target.value),disabled:b,placeholder:c("commerceOnboarding.githubConfigForm.searchRepositoryPlaceholder"),"aria-label":c("commerceOnboarding.githubConfigForm.searchRepositoryLabel"),className:"h-8 pl-8"})]}),y.isLoading?n.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:n.jsx(Be,{label:c("commerceOnboarding.githubConfigForm.loadingRepositories")})}):n.jsxs(n.Fragment,{children:[w&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:w}),O.length===0?!w&&n.jsx("p",{className:"text-sm text-muted-foreground",children:c("commerceOnboarding.githubConfigForm.noRepositoriesFound")}):n.jsx(Ce,{...x,children:n.jsx(ie,{control:x.control,name:"githubRepo",render:({field:N})=>n.jsxs(se,{children:[n.jsx(re,{children:n.jsx(Pe,{options:O.map(k=>({value:k,label:k})),value:N.value,onChange:N.onChange,disabled:b,ariaLabel:"Repositório",hideSearch:!0})}),n.jsx(ae,{})]})})})]}),h.error&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:h.error instanceof Error?h.error.message:c("commerceOnboarding.githubConfigForm.failedToSave")}),n.jsxs(he,{className:"pt-4",children:[n.jsx(Z,{type:"button",variant:"outline",onClick:a,disabled:b,children:c("commerceOnboarding.githubConfigForm.cancel")}),n.jsx(Z,{type:"submit",disabled:b,children:c(b?"commerceOnboarding.githubConfigForm.saving":"commerceOnboarding.githubConfigForm.save")})]})]})}const pt={vtex:An,shopify:Pn,"google-analytics":Un,"google-search-console":Qn,github:eo},Ee="deco-reader@decocms.iam.gserviceaccount.com",ht={"google-analytics":"ga4","google-search-console":"gsc"},to={ga4:{label:"Google Analytics",consoleUrl:"https://analytics.google.com/analytics/web/#/admin",consoleLinkKey:"commerceOnboarding.saBinding.ga4.openConsole",steps:["commerceOnboarding.saBinding.ga4.step1","commerceOnboarding.saBinding.ga4.step2","commerceOnboarding.saBinding.ga4.step3"],resourceLabelKey:"commerceOnboarding.saBinding.ga4.resourceLabel",resourcePlaceholderKey:"commerceOnboarding.saBinding.ga4.resourcePlaceholder",resourceHintKey:"commerceOnboarding.saBinding.ga4.resourceHint"},gsc:{label:"Google Search Console",consoleUrl:"https://search.google.com/search-console",consoleLinkKey:"commerceOnboarding.saBinding.gsc.openConsole",steps:["commerceOnboarding.saBinding.gsc.step1","commerceOnboarding.saBinding.gsc.step2","commerceOnboarding.saBinding.gsc.step3"],resourceLabelKey:"commerceOnboarding.saBinding.gsc.resourceLabel",resourcePlaceholderKey:"commerceOnboarding.saBinding.gsc.resourcePlaceholder",resourceHintKey:"commerceOnboarding.saBinding.gsc.resourceHint"}};function no(o,e){switch(e){case"no-access":return{titleKey:"commerceOnboarding.saBinding.remediation.noAccess.title",stepKeys:o==="ga4"?["commerceOnboarding.saBinding.remediation.noAccess.ga4.1","commerceOnboarding.saBinding.remediation.noAccess.ga4.2","commerceOnboarding.saBinding.remediation.noAccess.ga4.3"]:["commerceOnboarding.saBinding.remediation.noAccess.gsc.1","commerceOnboarding.saBinding.remediation.noAccess.gsc.2","commerceOnboarding.saBinding.remediation.noAccess.gsc.3"]};case"no-web-stream":return{titleKey:"commerceOnboarding.saBinding.remediation.noWebStream.title",stepKeys:["commerceOnboarding.saBinding.remediation.noWebStream.1","commerceOnboarding.saBinding.remediation.noWebStream.2","commerceOnboarding.saBinding.remediation.noWebStream.3","commerceOnboarding.saBinding.remediation.noWebStream.4"]};case"no-match":return{titleKey:"commerceOnboarding.saBinding.remediation.noMatch.title",stepKeys:o==="ga4"?["commerceOnboarding.saBinding.remediation.noMatch.ga4.1","commerceOnboarding.saBinding.remediation.noMatch.ga4.2"]:["commerceOnboarding.saBinding.remediation.noMatch.gsc.1","commerceOnboarding.saBinding.remediation.noMatch.gsc.2"]};case"resource_already_bound":return{titleKey:"commerceOnboarding.saBinding.remediation.alreadyBound.title",stepKeys:["commerceOnboarding.saBinding.remediation.alreadyBound.1","commerceOnboarding.saBinding.remediation.alreadyBound.2"]};default:return{titleKey:"commerceOnboarding.saBinding.remediation.unknown.title",stepKeys:["commerceOnboarding.saBinding.remediation.unknown.1","commerceOnboarding.saBinding.remediation.unknown.2"]}}}function oo(o){const e=G.c(96),{provider:t,siteUrl:i,siteHost:a,selfClient:s,org:c,initialResourceId:r,onDone:u,onIsPendingChange:p,onOAuthInstead:d}=o,l=te(),f=to[t],m=Oe(),[y,x]=H.useState(null);let h;e[0]!==a||e[1]!==l?(h=a||l("commerceOnboarding.saBinding.sampleDomain"),e[0]=a,e[1]=l,e[2]=h):h=e[2];const b=h;let g,S;if(e[3]!==f.resourceLabelKey||e[4]!==l){const W=be({resourceId:oe().trim().min(1,l("commerceOnboarding.saBindingForm.resourceIdRequired",{resourceLabel:l(f.resourceLabelKey).toLowerCase()}))});S=xe,g=ye(W),e[3]=f.resourceLabelKey,e[4]=l,e[5]=g,e[6]=S}else g=e[5],S=e[6];const C=r??"";let v;e[7]!==C?(v={resourceId:C},e[7]=C,e[8]=v):v=e[8];let j;e[9]!==g||e[10]!==v?(j={resolver:g,defaultValues:v},e[9]=g,e[10]=v,e[11]=j):j=e[11];const _=S(j);let O;e[12]!==t||e[13]!==s||e[14]!==i||e[15]!==l?(O=async W=>{if(!i)throw new Error(l("commerceOnboarding.saBindingForm.storeUrlUnavailable"));const J=await s.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:i,provider:t,resourceId:W.resourceId}});return ee(J)},e[12]=t,e[13]=s,e[14]=i,e[15]=l,e[16]=O):O=e[16];let E,w;e[17]!==p?(E=()=>p?.(!0),w=()=>p?.(!1),e[17]=p,e[18]=E,e[19]=w):(E=e[18],w=e[19]);let N;e[20]!==f.label||e[21]!==u||e[22]!==c||e[23]!==t||e[24]!==m||e[25]!==i||e[26]!==l?(N=async W=>{if(W.ok){x(null),Ne.success(l("commerceOnboarding.saBindingForm.connectedSuccess",{label:f.label})),i&&await m.invalidateQueries({queryKey:X.commerceDiscoveryConnectionStatus(c.id,i)}),u();return}x({...no(t,W.reason??"unknown"),detail:W.detail})},e[20]=f.label,e[21]=u,e[22]=c,e[23]=t,e[24]=m,e[25]=i,e[26]=l,e[27]=N):N=e[27];let k;e[28]!==N||e[29]!==O||e[30]!==E||e[31]!==w?(k={mutationFn:O,onMutate:E,onSettled:w,onSuccess:N},e[28]=N,e[29]=O,e[30]=E,e[31]=w,e[32]=k):k=e[32];const I=ve(k);let F;if(e[33]!==_||e[34]!==I){let W;e[36]!==I?(W=J=>I.mutate(J),e[36]=I,e[37]=W):W=e[37],F=_.handleSubmit(W),e[33]=_,e[34]=I,e[35]=F}else F=e[35];const A=F,T=I.isPending;let L;e[38]!==l?(L=()=>{navigator.clipboard?.writeText(Ee),Ne.success(l("commerceOnboarding.saBindingForm.emailCopied"))},e[38]=l,e[39]=L):L=e[39];const P=L;let K;e[40]!==f.consoleLinkKey||e[41]!==f.consoleUrl||e[42]!==f.resourceHintKey||e[43]!==f.resourceLabelKey||e[44]!==f.resourcePlaceholderKey||e[45]!==P||e[46]!==_||e[47]!==b||e[48]!==T||e[49]!==l?(K=W=>W===0?n.jsxs("a",{href:f.consoleUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground underline underline-offset-2 hover:text-foreground",children:[n.jsx(nn,{size:14}),l(f.consoleLinkKey)]}):W===1?n.jsxs("div",{className:"flex w-full items-center gap-2 rounded-lg border border-input bg-muted/40 p-2",children:[n.jsx("code",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Ee}),n.jsx(Z,{type:"button",variant:"ghost",size:"icon-sm",onClick:P,"aria-label":l("commerceOnboarding.saBindingForm.copyEmailLabel"),children:n.jsx(ut,{size:16})})]}):n.jsx(Ce,{..._,children:n.jsx(ie,{control:_.control,name:"resourceId",render:J=>{const{field:de}=J;return n.jsxs(se,{className:"w-full",children:[n.jsx(re,{children:n.jsx(ge,{...de,placeholder:l(f.resourcePlaceholderKey,{host:b}),disabled:T,autoComplete:"off","aria-label":l(f.resourceLabelKey)})}),n.jsx(et,{children:l(f.resourceHintKey,{host:b})}),n.jsx(ae,{})]})}})}),e[40]=f.consoleLinkKey,e[41]=f.consoleUrl,e[42]=f.resourceHintKey,e[43]=f.resourceLabelKey,e[44]=f.resourcePlaceholderKey,e[45]=P,e[46]=_,e[47]=b,e[48]=T,e[49]=l,e[50]=K):K=e[50];const R=K;let U;if(e[51]!==R||e[52]!==f.steps||e[53]!==b||e[54]!==l){let W;e[56]!==R||e[57]!==b||e[58]!==l?(W=(J,de)=>n.jsxs("li",{className:"flex gap-3 rounded-lg border border-border p-4",children:[n.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-medium text-foreground",children:de+1}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col items-start gap-2",children:[n.jsx("p",{className:"text-sm leading-5 text-foreground",children:l(J,{host:b})}),R(de)]})]},J),e[56]=R,e[57]=b,e[58]=l,e[59]=W):W=e[59],U=f.steps.map(W),e[51]=R,e[52]=f.steps,e[53]=b,e[54]=l,e[55]=U}else U=e[55];let B;e[60]!==U?(B=n.jsx("ol",{className:"space-y-2",children:U}),e[60]=U,e[61]=B):B=e[61];let $;e[62]!==f.label||e[63]!==y||e[64]!==l?($=y&&n.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:l(y.titleKey,{label:f.label})}),n.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:y.stepKeys.map(W=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{"aria-hidden":!0,children:"•"}),n.jsx("span",{children:l(W,{email:Ee})})]},W))})]}),e[62]=f.label,e[63]=y,e[64]=l,e[65]=$):$=e[65];let q;e[66]!==I.error||e[67]!==I.isError||e[68]!==l?(q=I.isError&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:I.error instanceof Error?I.error.message:l("commerceOnboarding.saBindingForm.bindError")}),e[66]=I.error,e[67]=I.isError,e[68]=l,e[69]=q):q=e[69];let M;e[70]!==T||e[71]!==d||e[72]!==l?(M=d&&n.jsxs("p",{className:"text-sm leading-5 text-muted-foreground",children:[l("commerceOnboarding.saBinding.oauthNote")," ",n.jsx("button",{type:"button",onClick:d,disabled:T,className:"underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:l("commerceOnboarding.saBindingForm.googleLoginAlternative")})]}),e[70]=T,e[71]=d,e[72]=l,e[73]=M):M=e[73];let z;e[74]!==l?(z=l("commerceOnboarding.saBindingForm.cancel"),e[74]=l,e[75]=z):z=e[75];let Y;e[76]!==T||e[77]!==u||e[78]!==z?(Y=n.jsx(Z,{type:"button",variant:"outline",onClick:u,disabled:T,children:z}),e[76]=T,e[77]=u,e[78]=z,e[79]=Y):Y=e[79];let D;e[80]!==T||e[81]!==l?(D=l(T?"commerceOnboarding.saBindingForm.verifying":"commerceOnboarding.saBindingForm.bind"),e[80]=T,e[81]=l,e[82]=D):D=e[82];let Q;e[83]!==T||e[84]!==D?(Q=n.jsx(Z,{type:"submit",disabled:T,children:D}),e[83]=T,e[84]=D,e[85]=Q):Q=e[85];let ne;e[86]!==Y||e[87]!==Q?(ne=n.jsxs(he,{className:"gap-2",children:[Y,Q]}),e[86]=Y,e[87]=Q,e[88]=ne):ne=e[88];let le;return e[89]!==A||e[90]!==B||e[91]!==$||e[92]!==q||e[93]!==M||e[94]!==ne?(le=n.jsxs("form",{onSubmit:A,className:"space-y-5",children:[B,$,q,M,ne]}),e[89]=A,e[90]=B,e[91]=$,e[92]=q,e[93]=M,e[94]=ne,e[95]=le):le=e[95],le}function io(){const o=G.c(2);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0];let t;return o[1]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[e,n.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[n.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),n.jsx("div",{className:"hidden h-3 w-full animate-pulse rounded bg-muted/60 sm:block"})]}),n.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),o[1]=t):t=o[1],t}function We(o){const e=G.c(17),{title:t,disconnecting:i,disabled:a,onDisconnect:s}=o,c=te(),r=a||i;let u;e[0]!==c||e[1]!==t?(u=c("commerceOnboarding.companionCard.disconnectAriaLabel",{title:t}),e[0]=c,e[1]=t,e[2]=u):u=e[2];let p;e[3]!==i?(p=i?n.jsx(Fe,{size:16,className:"animate-spin"}):n.jsx(Mt,{size:16}),e[3]=i,e[4]=p):p=e[4];let d;e[5]!==s||e[6]!==r||e[7]!==u||e[8]!==p?(d=n.jsx(Ae,{asChild:!0,children:n.jsx(Z,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:r,onClick:s,"aria-label":u,children:p})}),e[5]=s,e[6]=r,e[7]=u,e[8]=p,e[9]=d):d=e[9];let l;e[10]!==c?(l=c("commerceOnboarding.companionCard.disconnect"),e[10]=c,e[11]=l):l=e[11];let f;e[12]!==l?(f=n.jsx(Ke,{children:l}),e[12]=l,e[13]=f):f=e[13];let m;return e[14]!==d||e[15]!==f?(m=n.jsxs(De,{children:[d,f]}),e[14]=d,e[15]=f,e[16]=m):m=e[16],m}function so(o){const e=G.c(23),{card:t,connecting:i,disconnecting:a,disabled:s,onConnect:c,onDisconnect:r,org:u,selfClient:p,siteUrl:d,autoOpenConfigFieldKey:l,onAutoOpenConfigHandled:f}=o,m=t.linkedConnectionId,y=ht[t.bindingType],x=!!y&&t.boundVia!=="oauth",h=t.satisfied&&!t.configured;let b;e[0]!==l||e[1]!==t||e[2]!==i||e[3]!==s||e[4]!==a||e[5]!==m||e[6]!==h||e[7]!==f||e[8]!==c||e[9]!==r||e[10]!==u||e[11]!==y||e[12]!==p||e[13]!==d||e[14]!==x?(b=x&&y?n.jsx(ro,{card:t,provider:y,org:u,selfClient:p,siteUrl:d,onOAuthInstead:c,disabled:s,connecting:i,primary:t.required}):t.satisfied&&m?h?n.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[n.jsx(H.Suspense,{fallback:n.jsx(Ye,{}),children:n.jsx(Ze,{card:t,org:u,selfClient:p,connectionId:m,contextSiteUrl:d,variant:"configure",disabled:s,autoOpen:Ge({autoOpenFieldKey:l,card:t}),onAutoOpenHandled:f})}),n.jsx(We,{title:t.title,disconnecting:a,disabled:s,onDisconnect:r})]}):n.jsx(ft,{detail:t.connectedDetail,controls:n.jsxs(n.Fragment,{children:[n.jsx(H.Suspense,{fallback:n.jsx(Ye,{}),children:n.jsx(Ze,{card:t,org:u,selfClient:p,connectionId:m,contextSiteUrl:d,variant:"gear",disabled:s,autoOpen:Ge({autoOpenFieldKey:l,card:t}),onAutoOpenHandled:f})}),n.jsx(We,{title:t.title,disconnecting:a,disabled:s,onDisconnect:r})]})}):n.jsx(mt,{connecting:i,disabled:s,title:t.title,primary:t.required,onConnect:c}),e[0]=l,e[1]=t,e[2]=i,e[3]=s,e[4]=a,e[5]=m,e[6]=h,e[7]=f,e[8]=c,e[9]=r,e[10]=u,e[11]=y,e[12]=p,e[13]=d,e[14]=x,e[15]=b):b=e[15];const g=b,S=t.required&&!t.satisfied;let C;return e[16]!==g||e[17]!==t.headline||e[18]!==t.icon||e[19]!==t.title||e[20]!==h||e[21]!==S?(C=n.jsx(n.Fragment,{children:n.jsx(Rn,{icon:t.icon,title:t.title,headline:t.headline,required:S,attention:h,action:g})}),e[16]=g,e[17]=t.headline,e[18]=t.icon,e[19]=t.title,e[20]=h,e[21]=S,e[22]=C):C=e[22],C}function ro(o){const e=G.c(22),{card:t,provider:i,org:a,selfClient:s,siteUrl:c,onOAuthInstead:r,disabled:u,connecting:p,primary:d}=o,l=te(),[f,m]=H.useState(!1);let y;e[0]!==t.connectedDetail||e[1]!==t.satisfied||e[2]!==t.title||e[3]!==p||e[4]!==u||e[5]!==d||e[6]!==l?(y=t.satisfied?n.jsx(ft,{detail:t.connectedDetail,controls:n.jsxs(De,{children:[n.jsx(Ae,{asChild:!0,children:n.jsx(gt,{ariaLabel:l("commerceOnboarding.companionCard.configureAriaLabel",{title:t.title}),onClick:()=>m(!0)})}),n.jsx(Ke,{children:l("commerceOnboarding.companionCard.editConfiguration")})]})}):n.jsx(mt,{connecting:p,disabled:u,title:t.title,primary:d,onConnect:()=>m(!0)}),e[0]=t.connectedDetail,e[1]=t.satisfied,e[2]=t.title,e[3]=p,e[4]=u,e[5]=d,e[6]=l,e[7]=y):y=e[7];let x;e[8]!==t.satisfied||e[9]!==r?(x=t.satisfied?void 0:()=>{m(!1),r()},e[8]=t.satisfied,e[9]=r,e[10]=x):x=e[10];let h;e[11]!==t||e[12]!==f||e[13]!==a||e[14]!==i||e[15]!==s||e[16]!==c||e[17]!==x?(h=n.jsx(ao,{card:t,provider:i,org:a,selfClient:s,siteUrl:c,open:f,onOpenChange:m,onOAuthInstead:x}),e[11]=t,e[12]=f,e[13]=a,e[14]=i,e[15]=s,e[16]=c,e[17]=x,e[18]=h):h=e[18];let b;return e[19]!==y||e[20]!==h?(b=n.jsxs(n.Fragment,{children:[y,h]}),e[19]=y,e[20]=h,e[21]=b):b=e[21],b}function ao(o){const e=G.c(31),{card:t,provider:i,org:a,selfClient:s,siteUrl:c,open:r,onOpenChange:u,onOAuthInstead:p}=o,[d,l]=H.useState(!1);let f;e[0]!==u||e[1]!==d?(f=_=>{!_&&d||u(_)},e[0]=u,e[1]=d,e[2]=f):f=e[2];const m=f;let y;e[3]!==t.icon||e[4]!==t.title?(y=n.jsx(Le,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"p-1"}),e[3]=t.icon,e[4]=t.title,e[5]=y):y=e[5];let x;e[6]!==t.title?(x=n.jsx(nt,{className:"min-w-0 flex-1",children:t.title}),e[6]=t.title,e[7]=x):x=e[7];let h;e[8]!==y||e[9]!==x?(h=n.jsxs(ot,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[y,x]}),e[8]=y,e[9]=x,e[10]=h):h=e[10];let b;e[11]!==c?(b=fn(c),e[11]=c,e[12]=b):b=e[12];const g=t.boundResource??void 0;let S;e[13]!==u?(S=()=>u(!1),e[13]=u,e[14]=S):S=e[14];let C;e[15]!==p||e[16]!==a||e[17]!==i||e[18]!==s||e[19]!==c||e[20]!==b||e[21]!==g||e[22]!==S?(C=n.jsx(oo,{provider:i,siteUrl:c,siteHost:b,selfClient:s,org:a,initialResourceId:g,onDone:S,onIsPendingChange:l,onOAuthInstead:p}),e[15]=p,e[16]=a,e[17]=i,e[18]=s,e[19]=c,e[20]=b,e[21]=g,e[22]=S,e[23]=C):C=e[23];let v;e[24]!==h||e[25]!==C?(v=n.jsxs(it,{"aria-describedby":void 0,className:"max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-lg",children:[h,C]}),e[24]=h,e[25]=C,e[26]=v):v=e[26];let j;return e[27]!==m||e[28]!==r||e[29]!==v?(j=n.jsx(st,{open:r,onOpenChange:m,children:v}),e[27]=m,e[28]=r,e[29]=v,e[30]=j):j=e[30],j}function Ye(){const o=G.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0],e}function Ze(o){const e=G.c(25),{card:t,org:i,selfClient:a,connectionId:s,contextSiteUrl:c,variant:r,disabled:u,autoOpen:p,onAutoOpenHandled:d}=o,l=te(),[f,m]=H.useState(p);let y;e[0]!==t.configurationState||e[1]!==l?(y=Nn(t.configurationState,l),e[0]=t.configurationState,e[1]=l,e[2]=y):y=e[2];const x=y;let h;e[3]!==p||e[4]!==d?(h=()=>{m(!1),p&&d()},e[3]=p,e[4]=d,e[5]=h):h=e[5];const b=h;if(!pt[t.bindingType])return null;let g;e[6]!==t.title||e[7]!==u||e[8]!==x||e[9]!==l||e[10]!==r?(g=r==="configure"?n.jsx(Ln,{disabled:u,title:t.title,onConfigure:()=>m(!0)}):n.jsxs(De,{children:[n.jsx(Ae,{asChild:!0,children:n.jsx(gt,{ariaLabel:l("commerceOnboarding.companionCard.configureAriaLabel",{title:t.title}),onClick:()=>m(!0)})}),n.jsx(Ke,{children:x.length>0?l("commerceOnboarding.companionCard.editConfiguration"):l("commerceOnboarding.companionCard.configure")})]}),e[6]=t.title,e[7]=u,e[8]=x,e[9]=l,e[10]=r,e[11]=g):g=e[11];const S=g;let C;e[12]!==b?(C=_=>_?m(!0):b(),e[12]=b,e[13]=C):C=e[13];let v;e[14]!==t||e[15]!==s||e[16]!==c||e[17]!==f||e[18]!==i||e[19]!==a||e[20]!==C?(v=n.jsx(lo,{card:t,org:i,selfClient:a,connectionId:s,contextSiteUrl:c,open:f,onOpenChange:C}),e[14]=t,e[15]=s,e[16]=c,e[17]=f,e[18]=i,e[19]=a,e[20]=C,e[21]=v):v=e[21];let j;return e[22]!==v||e[23]!==S?(j=n.jsxs(n.Fragment,{children:[S,v]}),e[22]=v,e[23]=S,e[24]=j):j=e[24],j}function lo(o){const e=G.c(59),{card:t,org:i,selfClient:a,connectionId:s,contextSiteUrl:c,open:r,onOpenChange:u}=o,p=te();let d;e[0]!==s||e[1]!==i.id||e[2]!==i.slug?(d={connectionId:s,orgId:i.id,orgSlug:i.slug},e[0]=s,e[1]=i.id,e[2]=i.slug,e[3]=d):d=e[3];const l=Re(d),[f,m]=H.useState(!1),y=Oe(),x=pt[t.bindingType];let h;e[4]!==s||e[5]!==a?(h=async()=>{await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:s,force:!0}})},e[4]=s,e[5]=a,e[6]=h):h=e[6];let b;e[7]!==t.title||e[8]!==u||e[9]!==i.id||e[10]!==y||e[11]!==p?(b=async()=>{await y.invalidateQueries({queryKey:X.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),Ne.success(p("commerceOnboarding.companionCard.disconnectedSuccess",{title:t.title})),u(!1)},e[7]=t.title,e[8]=u,e[9]=i.id,e[10]=y,e[11]=p,e[12]=b):b=e[12];let g;e[13]!==p?(g=()=>{Ne.error(p("commerceOnboarding.companionCard.disconnectError"))},e[13]=p,e[14]=g):g=e[14];let S;e[15]!==h||e[16]!==b||e[17]!==g?(S={mutationFn:h,onSuccess:b,onError:g},e[15]=h,e[16]=b,e[17]=g,e[18]=S):S=e[18];const C=ve(S);if(!x)return null;let v;e[19]!==f||e[20]!==u?(v=P=>{!P&&f||u(P)},e[19]=f,e[20]=u,e[21]=v):v=e[21];const j=v;let _;e[22]!==t.icon||e[23]!==t.title?(_=n.jsx(Le,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"p-1"}),e[22]=t.icon,e[23]=t.title,e[24]=_):_=e[24];let O;e[25]!==t.title?(O=n.jsx(nt,{children:t.title}),e[25]=t.title,e[26]=O):O=e[26];let E;e[27]!==t.title||e[28]!==p?(E=p("commerceOnboarding.companionCard.configureDescription",{title:t.title}),e[27]=t.title,e[28]=p,e[29]=E):E=e[29];let w;e[30]!==E?(w=n.jsx(zt,{children:E}),e[30]=E,e[31]=w):w=e[31];let N;e[32]!==w||e[33]!==O?(N=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[O,w]}),e[32]=w,e[33]=O,e[34]=N):N=e[34];let k;e[35]!==N||e[36]!==_?(k=n.jsxs(ot,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[_,N]}),e[35]=N,e[36]=_,e[37]=k):k=e[37];let I;e[38]!==u?(I=()=>u(!1),e[38]=u,e[39]=I):I=e[39];let F;e[40]!==C?(F=()=>C.mutate(),e[40]=C,e[41]=F):F=e[41];let A;e[42]!==x||e[43]!==t||e[44]!==l||e[45]!==s||e[46]!==c||e[47]!==i||e[48]!==a||e[49]!==I||e[50]!==F?(A=n.jsx(x,{card:t,connectionId:s,companionClient:l,selfClient:a,org:i,contextSiteUrl:c,onDone:I,onDisconnect:F,onIsPendingChange:m}),e[42]=x,e[43]=t,e[44]=l,e[45]=s,e[46]=c,e[47]=i,e[48]=a,e[49]=I,e[50]=F,e[51]=A):A=e[51];let T;e[52]!==k||e[53]!==A?(T=n.jsxs(it,{className:"sm:max-w-lg",children:[k,A]}),e[52]=k,e[53]=A,e[54]=T):T=e[54];let L;return e[55]!==j||e[56]!==r||e[57]!==T?(L=n.jsx(st,{open:r,onOpenChange:j,children:T}),e[55]=j,e[56]=r,e[57]=T,e[58]=L):L=e[58],L}const qe={vtex:{registryAppId:"deco/vtex",area:"Catálogo",headline:"Rupturas e PDPs que travam suas vendas."},shopify:{registryAppId:"deco/shopify",area:"Catálogo",headline:"Pedidos, estoque e catálogo direto da sua Shopify."},"google-analytics":{registryAppId:"deco/google-analytics",area:"Funil",headline:"Onde a receita vaza no seu funil."},"google-search-console":{registryAppId:"deco/google-search-console",area:"Busca",headline:"O tráfego de busca que você deixa na mesa."},github:{registryAppId:"deco/mcp-github",area:"Engenharia",headline:"A saúde da entrega de código por trás da sua loja."}};function co(o){const e=G.c(44),{selfClient:t,org:i,cdConnectionId:a,siteUrl:s}=o;let c;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const r=Re(c);let u;e[4]!==a||e[5]!==i.id?(u=X.commerceDiscoveryCompanionSchema(i.id,a),e[4]=a,e[5]=i.id,e[6]=u):u=e[6];let p;e[7]!==r?(p=async()=>{const V=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return ee(V)},e[7]=r,e[8]=p):p=e[8];let d;e[9]!==u||e[10]!==p?(d={queryKey:u,queryFn:p,retry:!1},e[9]=u,e[10]=p,e[11]=d):d=e[11];const l=Se(d),f=l.data?.stateSchema?xn(l.data.stateSchema):null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},e[12]=m):m=e[12];const{shopify:y}=It(m);let x;e[13]!==y?(x=V=>V.bindingType!=="shopify"||y!=null,e[13]=y,e[14]=x):x=e[14];const h=(f&&f.length>0?f:Cn).filter(x),b=h.map(Co),g=h.map(xo).filter(yo),S=h.filter(bo).map(ho),C=[...g,...S].sort().join(",");let v;e[15]!==a||e[16]!==i.id?(v=X.commerceDiscoveryConnection(i.id,a),e[15]=a,e[16]=i.id,e[17]=v):v=e[17];let j;e[18]!==a||e[19]!==t?(j=async()=>{const V=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:a}});return ee(V)},e[18]=a,e[19]=t,e[20]=j):j=e[20];let _;e[21]!==v||e[22]!==j?(_={queryKey:v,queryFn:j},e[21]=v,e[22]=j,e[23]=_):_=e[23];const E=_e(_).data?.item?.configuration_state??null;let w;e[24]!==E?(w=V=>E?.[V.fieldKey]?.value,e[24]=E,e[25]=w):w=e[25];const N=h.map(w).filter(po),k=[...b.map(go),...g.map(fo),...N.map(mo)].sort().join(","),F=_e({queryKey:X.commerceDiscoveryCompanionConnections(i.id,k),queryFn:async()=>{if(h.length===0)return{items:[]};const V=[{field:["app_name"],operator:"in",value:b},{field:["app_id"],operator:"in",value:g}];N.length>0&&V.push({field:["id"],operator:"in",value:N});const ce=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:V},limit:1e3}});return ee(ce)}}).data?.items??[],A=new Set(N),T=F.filter(V=>A.has(V.id)),L=T.filter(uo);let P;e[26]!==i.id||e[27]!==i.slug?(P=V=>({queryKey:X.commerceDiscoveryCompanionOAuthStatus(i.id,V.id),queryFn:async()=>{try{const ce=await fetch(`/api/${encodeURIComponent(i.slug)}/connections/${encodeURIComponent(V.id)}/oauth-token/status`,{credentials:"include"});return ce.ok?{hasToken:(await ce.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[26]=i.id,e[27]=i.slug,e[28]=P):P=e[28];const K=ln({queries:L.map(P)});let R;e[29]!==K?(R=(V,ce)=>[V.id,K[ce]?.data?.hasToken===!0],e[29]=K,e[30]=R):R=e[30];const U=new Map(L.map(R)),B={};for(const V of T)B[V.id]=!V.oauth_config||!!V.connection_token||U.get(V.id)===!0;const $=_e({queryKey:X.commerceDiscoveryCompanionRegistry(i.id,C),queryFn:async()=>{if(h.length===0)return{items:[]};const V=Sn(g,S),ce=await Vt(tt.REGISTRY(i.id),i.id,i.slug,"COLLECTION_REGISTRY_APP_LIST",{...V?{where:V}:{},limit:1e3});return ee(ce)}}),q={},M={};for(const V of $.data?.items??[])q[V.id]=V,V.server?.name&&(M[V.server.name]=V);let z;e[31]!==i.id||e[32]!==s?(z=X.commerceDiscoveryConnectionStatus(i.id,s??""),e[31]=i.id,e[32]=s,e[33]=z):z=e[33];const Y=!!s;let D;e[34]!==t||e[35]!==s?(D=async()=>{const V=await t.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:s}});return ee(V)},e[34]=t,e[35]=s,e[36]=D):D=e[36];let Q;e[37]!==z||e[38]!==Y||e[39]!==D?(Q={queryKey:z,enabled:Y,queryFn:D},e[37]=z,e[38]=Y,e[39]=D,e[40]=Q):Q=e[40];const ne=Se(Q),le={};for(const[V,ce]of Object.entries(ht)){const je=ne.data?.providers?.[ce];je?.connected&&je.via==="sa"&&(le[V]={resource:je.resource??null})}const W=!!s&&(ne.isError||ne.data?.claimed===!1),J=In({requirements:h,itemsById:q,itemsByName:M,connections:F,connectionReadiness:B,configurationState:E,curated:qe,saBindings:le});let de;return e[41]!==J||e[42]!==W?(de={cards:J,saStatusUnavailable:W},e[41]=J,e[42]=W,e[43]=de):de=e[43],de}function uo(o){return o.oauth_config&&!o.connection_token}function mo(o){return`linked:${o}`}function fo(o){return`app:${o}`}function go(o){return`binding:${o}`}function po(o){return typeof o=="string"&&o.length>0}function ho(o){return o.bindingType}function bo(o){return!qe[o.bindingType]}function yo(o){return!!o}function xo(o){return qe[o.bindingType]?.registryAppId}function Co(o){return o.bindingType}function ti(o){const e=G.c(9),{selfClient:t,org:i,cdConnectionId:a}=o;let s;e[0]!==a||e[1]!==i.id?(s=X.commerceDiscoveryConnection(i.id,a),e[0]=a,e[1]=i.id,e[2]=s):s=e[2];let c;e[3]!==a||e[4]!==t?(c=async()=>{const d=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:a}});return ee(d)},e[3]=a,e[4]=t,e[5]=c):c=e[5];let r;e[6]!==s||e[7]!==c?(r={queryKey:s,queryFn:c,retry:!1},e[6]=s,e[7]=c,e[8]=r):r=e[8];const p=_e(r).data.item?.metadata?.siteUrl;return typeof p=="string"?p:void 0}function So({selfClient:o,org:e,userId:t,cdConnectionId:i,domain:a,siteUrl:s}){const c=Oe(),[r,u]=H.useState(null),[p,d]=H.useState(null),[l,f]=H.useState(null),m=async(h,b)=>{const g=await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:h,data:b}});return ee(g)};async function y(h){u(h.fieldKey),f(null);const b={app_name:h.title,field_key:h.fieldKey,organization_id:e.id,domain:a,site_url:s,...Qe(window.location.search)};ue("commerce_onboarding_companion_connect_clicked",b);try{let g=h.candidateConnectionId;if(!g){const O=Ht(h.registryItem,e.id,t,{remoteIndex:0}),E=O.connection_type==="STDIO",w=!!O.connection_url,N=E&&O.connection_headers&&typeof O.connection_headers=="object"&&"command"in O.connection_headers;if(!w&&!N)return ue("commerce_onboarding_companion_connect_failed",{...b,error:"no_connection_method"}),f(Me("commerceOnboarding.connectSourceDialog.noConnectionMethod",{title:h.title})),!1;const k=await o.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:O}});g=ee(k).item.id}const S=g,C=await on({connectionId:S,orgId:e.id,orgSlug:e.slug,persistFallback:O=>m(S,{connection_token:O}).then(()=>{})});if(!C.ok)return ue("commerce_onboarding_companion_connect_failed",{...b,error:C.error}),f(Me("commerceOnboarding.connectSourceDialog.signInFailed",{title:h.title,error:C.error??""})),!1;const v=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),j=ee(v).item?.configuration_state??null,_=On(j,h.fieldKey,h.bindingType,S);return h.bindingType==="github"&&delete _.github_repo,await m(i,{configuration_state:_}),await c.invalidateQueries({queryKey:X.commerceDiscoveryConnection(e.id,i)}),await c.invalidateQueries({queryKey:X.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),ue("commerce_onboarding_companion_connected",b),!0}catch(g){return ue("commerce_onboarding_companion_connect_failed",{...b,error:g instanceof Error?g.message:String(g)}),f(g instanceof Error?g.message:String(g)),!1}finally{u(null)}}async function x(h){d(h.fieldKey),f(null);const b={app_name:h.title,field_key:h.fieldKey,organization_id:e.id,domain:a,site_url:s,...Qe(window.location.search)};ue("commerce_onboarding_companion_disconnect_clicked",b);try{const g=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),C={...ee(g).item?.configuration_state??null??{}};return delete C[h.fieldKey],h.bindingType==="github"&&delete C.github_repo,await m(i,{configuration_state:C}),await c.invalidateQueries({queryKey:X.commerceDiscoveryConnection(e.id,i)}),await c.invalidateQueries({queryKey:X.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),ue("commerce_onboarding_companion_disconnected",b),!0}catch(g){return ue("commerce_onboarding_companion_disconnect_failed",{...b,error:g instanceof Error?g.message:String(g)}),f(g instanceof Error?g.message:String(g)),!1}finally{d(null)}}return{connect:y,connectingFieldKey:r,disconnect:x,disconnectingFieldKey:p,error:l}}const Ue="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-6";function $e(){const o=G.c(4),e=te();let t;o[0]!==e?(t=e("routes.commerceOnboarding.companionSection.title"),o[0]=e,o[1]=t):t=o[1];let i;return o[2]!==t?(i=n.jsx("h1",{className:"text-lg font-medium leading-6 text-foreground lg:text-xl lg:leading-7",children:t}),o[2]=t,o[3]=i):i=o[3],i}function Oo(){const o=G.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2,3].map(vo)}),o[0]=e):e=o[0],e}function vo(o){return n.jsx(io,{},o)}function jo(){const o=G.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:Ue,children:[n.jsx($e,{}),n.jsx(Oo,{})]}),o[0]=e):e=o[0],e}function _o(o){const e=G.c(18),{onRetry:t}=o,i=te();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx($e,{}),e[0]=a):a=e[0];let s;e[1]!==i?(s=i("routes.commerceOnboarding.companionSection.loadError"),e[1]=i,e[2]=s):s=e[2];let c;e[3]!==s?(c=n.jsx("p",{className:"text-sm text-foreground",children:s}),e[3]=s,e[4]=c):c=e[4];let r;e[5]!==i?(r=i("routes.commerceOnboarding.companionSection.loadErrorDescription"),e[5]=i,e[6]=r):r=e[6];let u;e[7]!==r?(u=n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=u):u=e[8];let p;e[9]!==i?(p=i("routes.commerceOnboarding.companionSection.retry"),e[9]=i,e[10]=p):p=e[10];let d;e[11]!==t||e[12]!==p?(d=n.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:p}),e[11]=t,e[12]=p,e[13]=d):d=e[13];let l;return e[14]!==c||e[15]!==u||e[16]!==d?(l=n.jsxs("div",{className:Ue,children:[a,n.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[c,u,d]})]}),e[14]=c,e[15]=u,e[16]=d,e[17]=l):l=e[17],l}function ni(o){const e=G.c(2);let t;return e[0]!==o?(t=n.jsx(kt,{children:i=>{const{reset:a}=i;return n.jsx(Ft,{fallback:s=>{const{resetError:c}=s;return n.jsx(_o,{onRetry:()=>{a(),c()}})},children:n.jsx(H.Suspense,{fallback:n.jsx(jo,{}),children:n.jsx(No,{...o})})})}}),e[0]=o,e[1]=t):t=e[1],t}function No(o){const e=G.c(60),{org:t,cdConnectionId:i,siteUrl:a,onReadinessChange:s}=o,c=te(),{data:r}=Je.useSession(),u=r?.user?.id??"";let p;if(e[0]!==a){const U=a?Te(a):null;if(U?.ok)try{p=new URL(U.value).hostname}catch{p=void 0}e[0]=a,e[1]=p}else p=e[1];let d;e[2]!==t.id||e[3]!==t.slug?(d={connectionId:$t,orgId:t.id,orgSlug:t.slug},e[2]=t.id,e[3]=t.slug,e[4]=d):d=e[4];const l=Re(d);let f;e[5]!==i||e[6]!==t||e[7]!==l||e[8]!==a?(f={selfClient:l,org:t,cdConnectionId:i,siteUrl:a},e[5]=i,e[6]=t,e[7]=l,e[8]=a,e[9]=f):f=e[9];const{cards:m,saStatusUnavailable:y}=co(f);let x;e[10]!==i||e[11]!==t||e[12]!==l||e[13]!==p||e[14]!==a||e[15]!==u?(x={selfClient:l,org:t,userId:u,cdConnectionId:i,domain:p,siteUrl:a},e[10]=i,e[11]=t,e[12]=l,e[13]=p,e[14]=a,e[15]=u,e[16]=x):x=e[16];const{connect:h,connectingFieldKey:b,disconnect:g,disconnectingFieldKey:S,error:C}=So(x),[v,j]=H.useState(null),_=Eo;let O,E,w,N,k,I,F,A,T,L;if(e[17]!==v||e[18]!==m||e[19]!==h||e[20]!==C||e[21]!==b||e[22]!==g||e[23]!==S||e[24]!==s||e[25]!==t||e[26]!==y||e[27]!==l||e[28]!==a||e[29]!==c){N=Symbol.for("react.early_return_sentinel");e:{const U=m.filter(wo),B=m.filter(To),$=y||(U.length>0?U.every(_):m.length===0||m.some(_));if(s?.($),m.length===0){N=null;break e}const q=b!==null||S!==null,M=z=>{const Y=async()=>{await h(z)&&j(z.fieldKey)};return n.jsx(so,{card:z,connecting:b===z.fieldKey,disconnecting:S===z.fieldKey,disabled:q&&b!==z.fieldKey&&S!==z.fieldKey,org:t,selfClient:l,siteUrl:a,autoOpenConfigFieldKey:v,onAutoOpenConfigHandled:()=>j(D=>D===z.fieldKey?null:D),onConnect:()=>{Y()},onDisconnect:()=>{g(z)}},z.fieldKey)};E=Ue,e[40]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx($e,{}),e[40]=w):w=e[40],O=pn,F="flex min-h-0 flex-1 flex-col md:block",A="-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[min(60vh,calc(100dvh-330px))] md:flex-none",e[41]!==C?(T=C&&n.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:C}),e[41]=C,e[42]=T):T=e[42],e[43]!==y||e[44]!==c?(L=y&&n.jsx("p",{role:"status",className:"mb-3 rounded-lg border border-warning/40 bg-warning/10 p-3 text-sm text-foreground",children:c("routes.commerceOnboarding.companionSection.statusUnavailable")}),e[43]=y,e[44]=c,e[45]=L):L=e[45],k="flex flex-col gap-4 pt-3",I=[...U,...B].map(M)}e[17]=v,e[18]=m,e[19]=h,e[20]=C,e[21]=b,e[22]=g,e[23]=S,e[24]=s,e[25]=t,e[26]=y,e[27]=l,e[28]=a,e[29]=c,e[30]=O,e[31]=E,e[32]=w,e[33]=N,e[34]=k,e[35]=I,e[36]=F,e[37]=A,e[38]=T,e[39]=L}else O=e[30],E=e[31],w=e[32],N=e[33],k=e[34],I=e[35],F=e[36],A=e[37],T=e[38],L=e[39];if(N!==Symbol.for("react.early_return_sentinel"))return N;let P;e[46]!==k||e[47]!==I?(P=n.jsx("div",{className:k,children:I}),e[46]=k,e[47]=I,e[48]=P):P=e[48];let K;e[49]!==O||e[50]!==P||e[51]!==F||e[52]!==A||e[53]!==T||e[54]!==L?(K=n.jsxs(O,{wrapperClassName:F,className:A,children:[T,L,P]}),e[49]=O,e[50]=P,e[51]=F,e[52]=A,e[53]=T,e[54]=L,e[55]=K):K=e[55];let R;return e[56]!==E||e[57]!==w||e[58]!==K?(R=n.jsxs("div",{className:E,children:[w,K]}),e[56]=E,e[57]=w,e[58]=K,e[59]=R):R=e[59],R}function To(o){return!o.required}function wo(o){return o.required}function Eo(o){return o.satisfied&&o.configured}function Io(o){return o.content?.find(e=>e.text)?.text??"__configurationFailed"}function oi(o){const e=o;if(e.isError)throw new Error(Io(e));return e.structuredContent??o}export{ei as C,Be as L,ht as P,pn as S,jo as a,ni as b,an as c,ti as d,co as e,So as f,lo as g,ao as h,Jo as i,Te as n,oi as p,fn as s,ee as u};
@@ -1 +0,0 @@
1
- import{c as T,b as ve,j as o,r as ee,B as je,k as Se}from"./index-BX_NPzZv.js";import{i as ke}from"./ChevronRight-B029h9tK.js";import{ao as fe}from"./agent-icon-kIlAB0pt.js";import{B as xe}from"./automation-runs-Dx16PB_p.js";import{r as Ne,c as we,u as _e,a as Ee,i as Pe,d as Te,f as Fe,P as Re,S as Ce}from"./page-seo-form-DAeXAFiZ.js";import{ar as ue,ai as Ke}from"./index-DAYZSdKu.js";import{a as ye}from"./Tool01-Di6mnWcA.js";import"./AlertCircle-D6ElsVdV.js";import"./ArrowUp-DXifU2jU.js";import"./ArrowLeft-DI46U0hW.js";import"./Tool02-CLeIEJiX.js";import"./XCircle-BifdMVfv.js";import"./ArrowUpRight-g0eFiBAo.js";import"./TrendUp01-__2FFu4c.js";import"./ZapSquare-BvKOVqvS.js";import"./Users03-BxC3kQLt.js";import"./CheckCircle-t3clhDEY.js";import"./Check-DLCFFMhM.js";import"./ChevronDown-tPhI8IAo.js";import"./ChevronUp-DAtg-Gay.js";import"./DotsVertical-BvDICIXQ.js";import"./Stars02-Dv4uoq65.js";import"./Copy01-Bs8ijW_K.js";import"./CpuChip01-BZeEEiQD.js";import"./CreditCard01-B11AWLzQ.js";import"./Globe01-CAof63Y2.js";import"./Settings02-CjNjAID2.js";import"./Eye-mCbEOvrw.js";import"./FilterLines-DMe-a5cU.js";import"./Share07-BAxx8CcC.js";import"./Star01-Cxd5haB_.js";import"./Globe04-COb_HVGf.js";import"./SwitchHorizontal01-D2iVDStv.js";import"./HardDrive-B2TDrqfp.js";import"./Key01-SN67R_2K.js";import"./LayoutLeft-DdADR4a-.js";import"./LinkExternal01-TAXSoD5n.js";import"./LogOut01-p0UdQN5O.js";import"./Monitor01-85SsH_8P.js";import"./Sun-Lm1J2AdL.js";import"./Palette-CulL6Bsw.js";import"./Play-DL9N7Ipe.js";import"./Plus-ENOfz88I.js";import"./SearchLg-BLO7Wadc.js";import"./SearchMd-BlLqg8aQ.js";import"./Shield01-D0oqZU-Q.js";import"./Stars01-C-FlZhrE.js";import"./Trash01-CWg-StRk.js";import"./Upload01-Bf8n3nke.js";import"./User01-D2gKMYdy.js";import"./Users01-Dk5NhvVd.js";import"./XClose-DQy9b0YQ.js";import"./X-ppE9vwRY.js";import"./Zap-DZzsx299.js";import"./select-D8HWXM7B.js";import"./tooltip-5OAV9va2.js";import"./useInfiniteQuery-BCTaWj0n.js";import"./use-infinite-scroll-HX67FBA9.js";import"./use-connection-C17rQDA_.js";import"./use-mcp-client-NnbFcsGZ.js";import"./auth-C5lKsEx7.js";import"./use-virtual-mcp-Da-ST5tm.js";import"./card-BYawXKTU.js";import"./sidebar-DgvBsHW3.js";import"./use-mobile-BzJ1qLXG.js";import"./table-BuKV0wZZ.js";import"./empty-state-BMjKtand.js";import"./use-members-BSS05Lmb.js";import"./use-org-auth-client-drjaSLRi.js";import"./use-clock-tick-K0_e258u.js";import"./use-automations-C00F7rqw.js";import"./studio-tools-CpBEXDHG.js";import"./useSuspenseInfiniteQuery-Dr3M9SY-.js";import"./avatar-wKP7qkNU.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BGGBRB_T.js";import"./dialog-C8xV8nk7.js";import"./tab-id-eS-YXQX4.js";import"./hooks-BeWC9MRd.js";import"./decopilot-sse-pool-Blwb6N9i.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-CipINhjv.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-DCMs6qFa.js";import"./use-decopilot-events-IIr8Tmy-.js";import"./use-organization-settings-DSHsydxG.js";import"./monaco-editor-CLhGJq84.js";import"./spinner-Cs9q3NVD.js";import"./types-DGdL1O_w.js";import"./shell-layout-ByW5qYjw.js";import"./required-auth-layout-CZqMkGhc.js";import"./use-org-sso-DyfZQvaU.js";import"./integration-icon-B6D6sUaT.js";import"./use-navigate-to-agent-CURQ7Iu_.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-BD3M1hjY.js";import"./index-DJ5XYx-a.js";import"./form-DpAMyOYq.js";import"./label-BjOUR-vy.js";import"./input-BPEvvKG4.js";import"./file-type-icon-CWDzqYTQ.js";import"./switch-C2crWHBg.js";import"./drawer-C9OT_34K.js";import"./collection-search-BFxratBR.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-C4w_WWd8.js";import"./toggle-group-D9wcd4e_.js";import"./use-deco-credits-QPAoAHyl.js";import"./popover-C-Z9QMGr.js";import"./self-tool-result-rQQpi3FX.js";import"./alert-dialog-TE_U_kDF.js";import"./extract-connection-data-C0wyUS2V.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-BNZhBjaI.js";import"./authenticate-and-persist-oauth-DKyWYtJc.js";import"./mcp-oauth-Dkbh2akf.js";import"./track-4YqGNWXD.js";import"./toolbar-D17bJYuh.js";import"./skeleton-DOJnTHJ3.js";import"./github-repo-picker-B8X9ZEbe.js";import"./use-mcp-tools-hFoWFA4o.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-Ng3GoeK5.js";import"./use-registry-connections-D0Eo-jz7.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-Dfl6wKQt.js";import"./connection-form-helpers-JAvwK5WO.js";import"./collection-tabs-BpvLtp7H.js";import"./badge-BgbHQoe3.js";import"./use-open-billing-url-fx71xk_j.js";import"./select-model-VqEJ276W.js";import"./checkbox-Cd2hVFLx.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-x0hpgwBB.js";import"./cards-bIgHMnZP.js";import"./dropdown-menu-Dv_KaZ_g.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bd_yO8Kz.js";import"./use-capability-DsAvVTiL.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-Cq3brqu3.js";import"./index-CNHO0lLF.js";import"./search-input-DnZTwDy2.js";import"./index-ex6UwO_d.js";import"./use-secrets-MxPt7LtM.js";import"./AreaChart-CnCx8yu5.js";import"./use-tags-Bmge6Bng.js";import"./get-initials-D-f_fDFw.js";import"./command-BgiqGgOD.js";import"./index-DhJJRQBn.js";import"./use-file-configs-CYHPyurW.js";import"./automation-list-row-D1y9WTXa.js";function A(d){return typeof d=="string"&&d.trim()?d:void 0}function he(d,e){if(d){if(e)try{const t=new URL(d,e).href;return ue(t)}catch{return}return ue(d)}}function ze(d){if(!d)return{};const e=A(d.title),t=A(d.titleTemplate);return{title:e&&t?.includes("%s")?t.replace(/%s/g,e):e,description:A(d.description),image:A(d.image),favicon:A(d.favicon)}}function De(d){if(!d)return"example.com";try{return new URL(d).host}catch{return"example.com"}}const $e=[{id:"google",labelKey:"sectionsEditor.seoPreview.platformGoogle",color:"#4285F4",layout:"search"},{id:"facebook",labelKey:"sectionsEditor.seoPreview.platformFacebook",color:"#1877F2",layout:"card"},{id:"twitter",labelKey:"sectionsEditor.seoPreview.platformTwitter",color:"#0f1419",layout:"card"},{id:"linkedin",labelKey:"sectionsEditor.seoPreview.platformLinkedin",color:"#0A66C2",layout:"card"},{id:"whatsapp",labelKey:"sectionsEditor.seoPreview.platformWhatsapp",color:"#25D366",layout:"chat"},{id:"telegram",labelKey:"sectionsEditor.seoPreview.platformTelegram",color:"#229ED9",layout:"chat"},{id:"slack",labelKey:"sectionsEditor.seoPreview.platformSlack",color:"#611f69",layout:"attachment"},{id:"discord",labelKey:"sectionsEditor.seoPreview.platformDiscord",color:"#5865F2",layout:"attachment"}];function de(d){const e=T.c(10),{src:t,className:n,iconSize:v}=d,r=v===void 0?20:v;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==n||e[2]!==t?(p=o.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:n,style:m}),e[1]=n,e[2]=t,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let i;e[5]!==r?(i=o.jsx(ye,{size:r}),e[5]=r,e[6]=i):i=e[6];let a;return e[7]!==n||e[8]!==i?(a=o.jsx("div",{className:n,style:s,children:i}),e[7]=n,e[8]=i,e[9]=a):a=e[9],a}function Be(d){const e=T.c(33),{seo:t,host:n,path:v,t:r}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#fff",border:"1px solid #dadce0"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={background:"#f1f3f4"},e[1]=i):i=e[1];let a;e[2]!==t.favicon?(a=o.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:i,children:t.favicon?o.jsx("img",{src:t.favicon,alt:"",className:"size-full object-cover"}):o.jsx(ye,{size:12,color:"#9aa0a6"})}),e[2]=t.favicon,e[3]=a):a=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#202124"},e[4]=m):m=e[4];let p;e[5]!==n?(p=o.jsx("div",{className:"truncate text-[13px] leading-tight",style:m,children:n}),e[5]=n,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#4d5156"},e[7]=f):f=e[7];let l;e[8]!==n||e[9]!==v?(l=o.jsxs("div",{className:"truncate text-[12px] leading-tight",style:f,children:[n,v]}),e[8]=n,e[9]=v,e[10]=l):l=e[10];let c;e[11]!==p||e[12]!==l?(c=o.jsxs("div",{className:"min-w-0",children:[p,l]}),e[11]=p,e[12]=l,e[13]=c):c=e[13];let h;e[14]!==a||e[15]!==c?(h=o.jsxs("div",{className:"flex items-center gap-2",children:[a,c]}),e[14]=a,e[15]=c,e[16]=h):h=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x={color:"#1a0dab"},e[17]=x):x=e[17];let y;e[18]!==t.title||e[19]!==r?(y=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[18]=t.title,e[19]=r,e[20]=y):y=e[20];let u;e[21]!==y?(u=o.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:x,children:y}),e[21]=y,e[22]=u):u=e[22];let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S={color:"#4d5156"},e[23]=S):S=e[23];let g;e[24]!==t.description||e[25]!==r?(g=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[24]=t.description,e[25]=r,e[26]=g):g=e[26];let b;e[27]!==g?(b=o.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:S,children:g}),e[27]=g,e[28]=b):b=e[28];let j;return e[29]!==u||e[30]!==b||e[31]!==h?(j=o.jsxs("div",{className:"rounded-lg p-3 text-left",style:s,children:[h,u,b]}),e[29]=u,e[30]=b,e[31]=h,e[32]=j):j=e[32],j}function Ie(d){const e=T.c(26),{seo:t,host:n,t:v}=d;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"#fff",border:"1px solid #e2e8f0"},e[0]=r):r=e[0];let s;e[1]!==t.image?(s=o.jsx(de,{src:t.image,className:"h-40 w-full"}),e[1]=t.image,e[2]=s):s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={borderTop:"1px solid #e2e8f0"},e[3]=i):i=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a={color:"#8a9099"},e[4]=a):a=e[4];let m;e[5]!==n?(m=o.jsx("div",{className:"truncate text-[11px]",style:a,children:n}),e[5]=n,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[7]=p):p=e[7];let f;e[8]!==t.title||e[9]!==v?(f=t.title??v("sectionsEditor.seoPreview.fallbackTitle"),e[8]=t.title,e[9]=v,e[10]=f):f=e[10];let l;e[11]!==f?(l=o.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:p,children:f}),e[11]=f,e[12]=l):l=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[13]=c):c=e[13];let h;e[14]!==t.description||e[15]!==v?(h=t.description??v("sectionsEditor.seoPreview.fallbackDescription"),e[14]=t.description,e[15]=v,e[16]=h):h=e[16];let x;e[17]!==h?(x=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:h}),e[17]=h,e[18]=x):x=e[18];let y;e[19]!==x||e[20]!==m||e[21]!==l?(y=o.jsxs("div",{className:"px-3 py-2",style:i,children:[m,l,x]}),e[19]=x,e[20]=m,e[21]=l,e[22]=y):y=e[22];let u;return e[23]!==y||e[24]!==s?(u=o.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:r,children:[s,y]}),e[23]=y,e[24]=s,e[25]=u):u=e[25],u}function Le(d){const e=T.c(36),{seo:t,host:n,accent:v,t:r}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f0f2f5"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={color:"#3b4045"},e[1]=i):i=e[1];let a;e[2]!==r?(a=r("sectionsEditor.seoPreview.chatCardHint"),e[2]=r,e[3]=a):a=e[3];let m;e[4]!==a?(m=o.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:i,children:a}),e[4]=a,e[5]=m):m=e[5];const p=`3px solid ${v}`;let f;e[6]!==p?(f={background:"#fff",borderLeft:p},e[6]=p,e[7]=f):f=e[7];let l;e[8]!==t.image?(l=o.jsx(de,{src:t.image,className:"h-28 w-full",iconSize:18}),e[8]=t.image,e[9]=l):l=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#1c2024"},e[10]=c):c=e[10];let h;e[11]!==t.title||e[12]!==r?(h=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[11]=t.title,e[12]=r,e[13]=h):h=e[13];let x;e[14]!==h?(x=o.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:c,children:h}),e[14]=h,e[15]=x):x=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y={color:"#60666c"},e[16]=y):y=e[16];let u;e[17]!==t.description||e[18]!==r?(u=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[17]=t.description,e[18]=r,e[19]=u):u=e[19];let S;e[20]!==u?(S=o.jsx("div",{className:"line-clamp-2 text-[11px]",style:y,children:u}),e[20]=u,e[21]=S):S=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#8a9099"},e[22]=g):g=e[22];let b;e[23]!==n?(b=o.jsx("div",{className:"mt-0.5 text-[10px]",style:g,children:n}),e[23]=n,e[24]=b):b=e[24];let j;e[25]!==x||e[26]!==S||e[27]!==b?(j=o.jsxs("div",{className:"px-2.5 py-1.5",children:[x,S,b]}),e[25]=x,e[26]=S,e[27]=b,e[28]=j):j=e[28];let k;e[29]!==j||e[30]!==f||e[31]!==l?(k=o.jsxs("div",{className:"overflow-hidden rounded-md",style:f,children:[l,j]}),e[29]=j,e[30]=f,e[31]=l,e[32]=k):k=e[32];let N;return e[33]!==k||e[34]!==m?(N=o.jsxs("div",{className:"rounded-lg p-2 text-left",style:s,children:[m,k]}),e[33]=k,e[34]=m,e[35]=N):N=e[35],N}function Oe(d){const e=T.c(39),{seo:t,host:n,accent:v,dark:r,t:s}=d,i=r?"#2b2d31":"#fff",a=r?"#00a8fc":"#1264a3",m=r?"#dbdee1":"#3b4045",p=r?"#949ba4":"#8a9099",f=r?"none":"1px solid #e2e8f0";let l;e[0]!==i||e[1]!==f?(l={background:i,border:f},e[0]=i,e[1]=f,e[2]=l):l=e[2];const c=`3px solid ${v}`;let h;e[3]!==c?(h={borderLeft:c,borderRadius:2},e[3]=c,e[4]=h):h=e[4];let x;e[5]!==p?(x={color:p},e[5]=p,e[6]=x):x=e[6];let y;e[7]!==n||e[8]!==x?(y=o.jsx("div",{className:"text-[10px]",style:x,children:n}),e[7]=n,e[8]=x,e[9]=y):y=e[9];let u;e[10]!==a?(u={color:a},e[10]=a,e[11]=u):u=e[11];let S;e[12]!==t.title||e[13]!==s?(S=t.title??s("sectionsEditor.seoPreview.fallbackTitle"),e[12]=t.title,e[13]=s,e[14]=S):S=e[14];let g;e[15]!==u||e[16]!==S?(g=o.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:S}),e[15]=u,e[16]=S,e[17]=g):g=e[17];let b;e[18]!==m?(b={color:m},e[18]=m,e[19]=b):b=e[19];let j;e[20]!==t.description||e[21]!==s?(j=t.description??s("sectionsEditor.seoPreview.fallbackDescription"),e[20]=t.description,e[21]=s,e[22]=j):j=e[22];let k;e[23]!==b||e[24]!==j?(k=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:b,children:j}),e[23]=b,e[24]=j,e[25]=k):k=e[25];let N;e[26]!==k||e[27]!==y||e[28]!==g?(N=o.jsxs("div",{className:"min-w-0 flex-1",children:[y,g,k]}),e[26]=k,e[27]=y,e[28]=g,e[29]=N):N=e[29];let w;e[30]!==t.image?(w=o.jsx(de,{src:t.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[30]=t.image,e[31]=w):w=e[31];let _;e[32]!==N||e[33]!==w||e[34]!==h?(_=o.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:h,children:[N,w]}),e[32]=N,e[33]=w,e[34]=h,e[35]=_):_=e[35];let P;return e[36]!==_||e[37]!==l?(P=o.jsx("div",{className:"rounded-lg p-2.5 text-left",style:l,children:_}),e[36]=_,e[37]=l,e[38]=P):P=e[38],P}function Ue(d){const e=T.c(21),{platform:t,seo:n,host:v,path:r,t:s}=d;let i;e[0]!==v||e[1]!==r||e[2]!==t.color||e[3]!==t.id||e[4]!==t.layout||e[5]!==n||e[6]!==s?(i=t.layout==="search"?o.jsx(Be,{seo:n,host:v,path:r,t:s}):t.layout==="card"?o.jsx(Ie,{seo:n,host:v,path:r,t:s}):t.layout==="chat"?o.jsx(Le,{seo:n,host:v,path:r,accent:t.color,t:s}):o.jsx(Oe,{seo:n,host:v,path:r,accent:t.color,dark:t.id==="discord",t:s}),e[0]=v,e[1]=r,e[2]=t.color,e[3]=t.id,e[4]=t.layout,e[5]=n,e[6]=s,e[7]=i):i=e[7];const a=i;let m;e[8]!==t.color?(m=o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:t.color}}),e[8]=t.color,e[9]=m):m=e[9];let p;e[10]!==t.labelKey||e[11]!==s?(p=s(t.labelKey),e[10]=t.labelKey,e[11]=s,e[12]=p):p=e[12];let f;e[13]!==p?(f=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p}),e[13]=p,e[14]=f):f=e[14];let l;e[15]!==m||e[16]!==f?(l=o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[m,f]}),e[15]=m,e[16]=f,e[17]=l):l=e[17];let c;return e[18]!==a||e[19]!==l?(c=o.jsxs("div",{children:[l,a]}),e[18]=a,e[19]=l,e[20]=c):c=e[20],c}function Ae(d){const e=T.c(18),{seo:t,url:n,path:v}=d,r=v===void 0?"/":v,s=ve();let i,a,m;if(e[0]!==t||e[1]!==n){const u=ze(t);i=u,a=he(u.image,n),m=he(u.favicon,n),e[0]=t,e[1]=n,e[2]=i,e[3]=a,e[4]=m}else i=e[2],a=e[3],m=e[4];let p;e[5]!==i||e[6]!==a||e[7]!==m?(p={...i,image:a,favicon:m},e[5]=i,e[6]=a,e[7]=m,e[8]=p):p=e[8];const f=p;let l;e[9]!==n?(l=De(n),e[9]=n,e[10]=l):l=e[10];const c=l,h=r==="/"?"":r;let x;e[11]!==h||e[12]!==c||e[13]!==s||e[14]!==f?(x=$e.map(u=>o.jsx(Ue,{platform:u,seo:f,host:c,path:h,t:s},u.id)),e[11]=h,e[12]=c,e[13]=s,e[14]=f,e[15]=x):x=e[15];let y;return e[16]!==x?(y=o.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:x}),e[16]=x,e[17]=y):y=e[17],y}function Ai(d){const e=T.c(70),{orgSlug:t,virtualMcpId:n,branch:v,decofile:r,meta:s,target:i,previewBaseUrl:a,onSaved:m,onEditDefaultSeo:p,onBack:f}=d,l=ve(),c=Ne(r,i,s),h=c?.seoData,x=i.kind==="site"?"site":i.pageKey,[y,u]=ee.useState(x),[S,g]=ee.useState(null),[b,j]=ee.useState(0),[k,N]=ee.useState(void 0);y!==x&&(u(x),g(null),N(void 0),j(Ge));const{persistSeo:w,persistRawSeo:_,flush:P,isPending:te}=we({orgSlug:t,virtualMcpId:n,branch:v,target:i,resolved:c,onSaved:m}),M=i.kind==="page",ge=M?c?.rawSeoData:void 0,U=k!==void 0?k:ge,be=M?_e(U)??void 0:void 0,E=S??be??h??{},F=c?Ee(E,c):null,K=F&&(!M||Pe(U))?Ke(F,s):null;let G;e[0]!==s?(G=Te(s),e[0]=s,e[1]=G):G=e[1];const oe=G;let R,H;e[2]!==r||e[3]!==E||e[4]!==s||e[5]!==i.kind?(R=i.kind==="page"?Fe(r,s)?.seoData??{}:{},H=i.kind==="page"?Ve(R,E):E,e[2]=r,e[3]=E,e[4]=s,e[5]=i.kind,e[6]=R,e[7]=H):(R=e[6],H=e[7]);const ie=H;let V;e[8]!==w||e[9]!==c||e[10]!==g?(V=C=>{if(!c)return;const pe=C;g(pe),w(pe)},e[8]=w,e[9]=c,e[10]=g,e[11]=V):V=e[11];const se=V;let W;e[12]!==g?(W=()=>g(null),e[12]=g,e[13]=W):W=e[13];const le=W;let q;e[14]!==j?(q=()=>j(Me),e[14]=j,e[15]=q):q=e[15];const re=q;let J;e[16]!==P||e[17]!==f?(J=()=>{P(),f?.()},e[16]=P,e[17]=f,e[18]=J):J=e[18];const ce=J,z=i.kind==="page"?i.path:"/";let Q;e[19]!==z||e[20]!==a||e[21]!==i.kind?(Q=i.kind==="page"&&a?He(z,a):a??null,e[19]=z,e[20]=a,e[21]=i.kind,e[22]=Q):Q=e[22];const ne=Q;let X;e[23]!==c||e[24]!==l||e[25]!==i.kind?(X=i.kind==="site"?l("sectionsEditor.seoEditor.noSiteSeoBlock"):l(c?"sectionsEditor.seoEditor.noSeoSchema":"sectionsEditor.seoEditor.couldNotLoadSeo"),e[23]=c,e[24]=l,e[25]=i.kind,e[26]=X):X=e[26];const ae=X,Y=M&&c,me=i.kind==="site"&&c&&K;let D;e[27]!==ce||e[28]!==l||e[29]!==i.kind||e[30]!==i.pageName?(D=i.kind==="page"?o.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx("button",{type:"button",onClick:ce,title:i.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:i.pageName}),o.jsx(ke,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:l("sectionsEditor.seoEditor.defaultSeoLabel")}),o.jsxs("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:["· ",l("sectionsEditor.seoEditor.appliedToEveryPage")]})]}),e[27]=ce,e[28]=l,e[29]=i.kind,e[30]=i.pageName,e[31]=D):D=e[31];let $;e[32]!==te?($=te&&o.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[32]=te,e[33]=$):$=e[33];let B;e[34]!==p||e[35]!==l||e[36]!==i.kind?(B=i.kind==="page"&&p&&o.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[o.jsx(fe,{size:14}),l("sectionsEditor.seoEditor.editDefaultSeoButton")]}),e[34]=p,e[35]=l,e[36]=i.kind,e[37]=B):B=e[37];let I;e[38]!==$||e[39]!==B?(I=o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[$,B]}),e[38]=$,e[39]=B,e[40]=I):I=e[40];let L;e[41]!==I||e[42]!==D?(L=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[D,I]}),e[41]=I,e[42]=D,e[43]=L):L=e[43];let O;e[44]!==F||e[45]!==re||e[46]!==le||e[47]!==oe||e[48]!==U||e[49]!==E||e[50]!==ae||e[51]!==b||e[52]!==se||e[53]!==z||e[54]!==_||e[55]!==w||e[56]!==ie||e[57]!==ne||e[58]!==c||e[59]!==K||e[60]!==g||e[61]!==N||e[62]!==Y||e[63]!==me||e[64]!==R||e[65]!==l?(O=!c||!Y&&!me?o.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ae}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsx(xe,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-5 py-4",children:Y?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:l("sectionsEditor.seoEditor.emptyFieldsHint")}),o.jsx(Re,{rawSeo:U,innerSeo:E,defaultResolveType:oe,seoSchema:K,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:b,siteDefaultSeo:R,onPersistRaw:C=>{N(C),_(C)},onInnerChange:C=>{g(C),w(C)},onClearForm:le,onBumpFormKey:re})]}):K&&F&&o.jsx(Ce,{schema:K,resolveType:F,value:E,formResetKey:b,onChange:se})})}),o.jsx(xe,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"@container px-5 py-4",children:o.jsx(Ae,{seo:ie,url:ne,path:z})})})]}),e[44]=F,e[45]=re,e[46]=le,e[47]=oe,e[48]=U,e[49]=E,e[50]=ae,e[51]=b,e[52]=se,e[53]=z,e[54]=_,e[55]=w,e[56]=ie,e[57]=ne,e[58]=c,e[59]=K,e[60]=g,e[61]=N,e[62]=Y,e[63]=me,e[64]=R,e[65]=l,e[66]=O):O=e[66];let Z;return e[67]!==L||e[68]!==O?(Z=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[L,O]}),e[67]=L,e[68]=O,e[69]=Z):Z=e[69],Z}function Me(d){return d+1}function Ge(d){return d+1}function He(d,e){try{return new URL(d,e).href}catch{return e}}function Ve(d,e){const t=e.__resolveType,n=d.__resolveType;if(typeof t=="string"&&typeof n=="string"&&t!==n)return{...e};const v={...d};for(const[r,s]of Object.entries(e))r!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(v[r]=s));return v}export{Ai as SeoEditor};
@@ -1 +0,0 @@
1
- import{c as b,m as g,j as o,cU as P,cV as R,H,cW as A,cX as V,cY as W,cZ as q,r as T,B as G,bg as L,aR as F}from"./index-BX_NPzZv.js";import{i as U}from"./LayoutLeft-DdADR4a-.js";import{u as X}from"./use-mobile-BzJ1qLXG.js";import{i as Y}from"./X-ppE9vwRY.js";import{b as z,T as B,a as D,c as k}from"./tooltip-5OAV9va2.js";function Z(i){const e=b.c(4);let t;e[0]!==i?({...t}=i,e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx(R,{"data-slot":"sheet",...t}),e[2]=t,e[3]=s):s=e[3],s}function J(i){const e=b.c(4);let t;e[0]!==i?({...t}=i,e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx(V,{"data-slot":"sheet-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function K(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx(q,{"data-slot":"sheet-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Q(i){const e=b.c(20);let t,s,a,l,d;e[0]!==i?({className:s,children:t,side:l,hideCloseButton:d,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=d):(t=e[1],s=e[2],a=e[3],l=e[4],d=e[5]);const n=l===void 0?"right":l,r=d===void 0?!1:d;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(K,{}),e[6]=m):m=e[6];const u=n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",h=n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",f=n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",p=n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let x;e[7]!==s||e[8]!==u||e[9]!==h||e[10]!==f||e[11]!==p?(x=g("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-200 data-[state=open]:duration-200",u,h,f,p,s),e[7]=s,e[8]=u,e[9]=h,e[10]=f,e[11]=p,e[12]=x):x=e[12];let c;e[13]!==r?(c=!r&&o.jsxs(W,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[o.jsx(Y,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]}),e[13]=r,e[14]=c):c=e[14];let v;return e[15]!==t||e[16]!==a||e[17]!==x||e[18]!==c?(v=o.jsxs(J,{children:[m,o.jsxs(H,{"data-slot":"sheet-content",className:x,...a,children:[t,c]})]}),e[15]=t,e[16]=a,e[17]=x,e[18]=c,e[19]=v):v=e[19],v}function ee(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex flex-col gap-1.5 p-4",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sheet-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function te(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("text-foreground font-semibold",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx(P,{"data-slot":"sheet-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function se(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx(A,{"data-slot":"sheet-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}const ae="15rem",le="18rem",ie="4.5rem",E=T.createContext(null);function I(){const i=T.useContext(E);if(!i)throw new Error("useSidebar must be used within a SidebarProvider.");return i}function be(i){const e=b.c(19),{children:t,defaultOpen:s,open:a,onOpenChange:l}=i,d=s===void 0?!1:s,n=X(),[r,m]=T.useState(d),[u,h]=T.useState(!1),f=a!==void 0,p=f?a:r;let x;e[0]!==f||e[1]!==l?(x=$=>{f||m($),l?.($)},e[0]=f,e[1]=l,e[2]=x):x=e[2];const c=x;let v;e[3]!==n||e[4]!==p||e[5]!==c?(v=()=>{n?h(oe):c(!p)},e[3]=n,e[4]=p,e[5]=c,e[6]=v):v=e[6];const y=v,w=p?"expanded":"collapsed";let j;e[7]!==n||e[8]!==p||e[9]!==u||e[10]!==c||e[11]!==w||e[12]!==y?(j={state:w,open:p,setOpen:c,isMobile:n,openMobile:u,setOpenMobile:h,toggleSidebar:y},e[7]=n,e[8]=p,e[9]=u,e[10]=c,e[11]=w,e[12]=y,e[13]=j):j=e[13];const S=j;let N;e[14]!==t?(N=o.jsx(z,{delayDuration:0,children:t}),e[14]=t,e[15]=N):N=e[15];let C;return e[16]!==S||e[17]!==N?(C=o.jsx(E.Provider,{value:S,children:N}),e[16]=S,e[17]=N,e[18]=C):C=e[18],C}function oe(i){return!i}function me(i){const e=b.c(14);let t,s,a,l;e[0]!==i?({className:s,style:l,children:t,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l):(t=e[1],s=e[2],a=e[3],l=e[4]);let d;e[5]!==l?(d={"--sidebar-width":ae,"--sidebar-width-icon":ie,...l},e[5]=l,e[6]=d):d=e[6];const n=d;let r;e[7]!==s?(r=g("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",s),e[7]=s,e[8]=r):r=e[8];let m;return e[9]!==t||e[10]!==a||e[11]!==n||e[12]!==r?(m=o.jsx("div",{"data-slot":"sidebar-wrapper",style:n,className:r,...a,children:t}),e[9]=t,e[10]=a,e[11]=n,e[12]=r,e[13]=m):m=e[13],m}function he(i){const e=b.c(36);let t,s,a,l,d;e[0]!==i?({side:l,variant:d,className:s,children:t,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=d):(t=e[1],s=e[2],a=e[3],l=e[4],d=e[5]);const n=l===void 0?"left":l,r=d===void 0?"sidebar":d,{isMobile:m,state:u,openMobile:h,setOpenMobile:f}=I();if(m){let C;e[6]===Symbol.for("react.memo_cache_sentinel")?(C={"--sidebar-width":le},e[6]=C):C=e[6];let $;e[7]===Symbol.for("react.memo_cache_sentinel")?($=o.jsxs(ee,{className:"sr-only",children:[o.jsx(te,{children:"Sidebar"}),o.jsx(se,{children:"Displays the mobile sidebar."})]}),e[7]=$):$=e[7];let _;e[8]!==t?(_=o.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=_):_=e[9];let M;e[10]!==n||e[11]!==_?(M=o.jsxs(Q,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:C,side:n,children:[$,_]}),e[10]=n,e[11]=_,e[12]=M):M=e[12];let O;return e[13]!==h||e[14]!==a||e[15]!==f||e[16]!==M?(O=o.jsx(Z,{open:h,onOpenChange:f,...a,children:M}),e[13]=h,e[14]=a,e[15]=f,e[16]=M,e[17]=O):O=e[17],O}const p=u==="expanded",x=p?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let c;e[18]!==x?(c=g("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","transition-[width] duration-150 ease-out motion-reduce:transition-none",x),e[18]=x,e[19]=c):c=e[19];const v=p?void 0:"icon",y=p?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let w;e[20]!==s||e[21]!==y?(w=g("flex flex-col h-full transition-[width] duration-150 ease-out motion-reduce:transition-none",y,s),e[20]=s,e[21]=y,e[22]=w):w=e[22];let j;e[23]!==t?(j=o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=j):j=e[24];let S;e[25]!==a||e[26]!==w||e[27]!==j?(S=o.jsx("div",{"data-slot":"sidebar-container",className:w,...a,children:j}),e[25]=a,e[26]=w,e[27]=j,e[28]=S):S=e[28];let N;return e[29]!==n||e[30]!==u||e[31]!==c||e[32]!==v||e[33]!==S||e[34]!==r?(N=o.jsx("div",{className:c,"data-state":u,"data-collapsible":v,"data-variant":r,"data-side":n,"data-slot":"sidebar",children:S}),e[29]=n,e[30]=u,e[31]=c,e[32]=v,e[33]=S,e[34]=r,e[35]=N):N=e[35],N}function xe(i){const e=b.c(18);let t,s,a;e[0]!==i?({className:t,onClick:s,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const{toggleSidebar:l}=I();let d;e[4]!==t?(d=g("size-7",t),e[4]=t,e[5]=d):d=e[5];let n;e[6]!==s||e[7]!==l?(n=p=>{s?.(p),l()},e[6]=s,e[7]=l,e[8]=n):n=e[8];let r,m;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(U,{}),m=o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=r,e[10]=m):(r=e[9],m=e[10]);let u;e[11]!==a||e[12]!==d||e[13]!==n?(u=o.jsx(B,{asChild:!0,children:o.jsxs(G,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:d,onClick:n,...a,children:[r,m]})}),e[11]=a,e[12]=d,e[13]=n,e[14]=u):u=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsxs(D,{side:"bottom",className:"flex items-center gap-1.5",children:["Collapse sidebar",o.jsx("span",{className:"flex items-center gap-0.5",children:["⌘","B"].map(ne)})]}),e[15]=h):h=e[15];let f;return e[16]!==u?(f=o.jsx(z,{delayDuration:300,children:o.jsxs(k,{children:[u,h]})}),e[16]=u,e[17]=f):f=e[17],f}function ne(i){return o.jsx("kbd",{className:"inline-flex items-center justify-center min-w-5 h-5 px-1 rounded-sm border border-white/20 bg-white/10 text-white/70 text-xs font-mono",children:i},i)}function ge(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("main",{"data-slot":"sidebar-inset",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function ve(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function je(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function we(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("h-4 m-0! w-full",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-sidebar":"separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Ne(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Se(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function ye(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("w-full text-sm overflow-visible",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Ce(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex w-full min-w-0 list-none flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function $e(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("group/menu-item relative w-full list-none",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}const re=F("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm outline-0 outline-sidebar-ring transition-[width,height,padding] duration-150 ease-out motion-reduce:transition-none focus-visible:outline-2 focus-visible:-outline-offset-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate group-data-[state=collapsed]/sidebar:[&>span:last-child]:hidden [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:w-full! group-data-[state=collapsed]/sidebar:aspect-square! group-data-[state=collapsed]/sidebar:max-w-[calc(var(--sidebar-width-icon)-1rem)]! group-data-[state=collapsed]/sidebar:h-auto! group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:justify-center text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function _e(i){const e=b.c(28);let t,s,a,l,d,n,r;e[0]!==i?({asChild:a,isActive:l,variant:d,size:n,tooltip:r,className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=d,e[6]=n,e[7]=r):(t=e[1],s=e[2],a=e[3],l=e[4],d=e[5],n=e[6],r=e[7]);const m=a===void 0?!1:a,u=l===void 0?!1:l,h=d===void 0?"default":d,f=n===void 0?"default":n,p=m?L:"button",{isMobile:x}=I();let c;e[8]!==t||e[9]!==f||e[10]!==h?(c=g(re({variant:h,size:f}),t),e[8]=t,e[9]=f,e[10]=h,e[11]=c):c=e[11];let v;e[12]!==p||e[13]!==u||e[14]!==s||e[15]!==f||e[16]!==c?(v=o.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":f,"data-active":u,className:c,...s}),e[12]=p,e[13]=u,e[14]=s,e[15]=f,e[16]=c,e[17]=v):v=e[17];const y=v;if(!r)return y;if(typeof r=="string"){let N;e[18]!==r?(N={children:r},e[18]=r,e[19]=N):N=e[19],r=N}let w;e[20]!==y?(w=o.jsx(B,{asChild:!0,children:y}),e[20]=y,e[21]=w):w=e[21];let j;e[22]!==x||e[23]!==r?(j=o.jsx(D,{side:"right",align:"center",hidden:x,...r}),e[22]=x,e[23]=r,e[24]=j):j=e[24];let S;return e[25]!==w||e[26]!==j?(S=o.jsxs(k,{children:[w,j]}),e[25]=w,e[26]=j,e[27]=S):S=e[27],S}export{Se as S,ye as a,Ce as b,_e as c,$e as d,we as e,ve as f,Ne as g,he as h,je as i,ge as j,me as k,be as l,te as m,se as n,ee as o,Q as p,Z as q,xe as r,I as u};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-Dqr1hOdR.js","assets/index-BX_NPzZv.js","assets/index-Dncm6IaE.css","assets/Tool02-CLeIEJiX.js","assets/CheckCircle-t3clhDEY.js","assets/Settings02-CjNjAID2.js","assets/use-mcp-client-NnbFcsGZ.js","assets/auth-C5lKsEx7.js","assets/useInfiniteQuery-BCTaWj0n.js","assets/use-infinite-scroll-HX67FBA9.js","assets/studio-tools-CpBEXDHG.js","assets/badge-BgbHQoe3.js","assets/input-BPEvvKG4.js","assets/dropdown-menu-Dv_KaZ_g.js","assets/Check-DLCFFMhM.js","assets/ChevronRight-B029h9tK.js","assets/DotsVertical-BvDICIXQ.js","assets/table-BuKV0wZZ.js","assets/toggle-group-D9wcd4e_.js","assets/use-view-mode-BSZX_Ie8.js","assets/use-mobile-BzJ1qLXG.js","assets/FilterLines-DMe-a5cU.js","assets/Globe01-CAof63Y2.js","assets/SearchMd-BlLqg8aQ.js","assets/dialog-C8xV8nk7.js","assets/X-ppE9vwRY.js","assets/AlertCircle-D6ElsVdV.js","assets/Upload01-Bf8n3nke.js","assets/metadata-dUsYcpuu.js","assets/alert-dialog-TE_U_kDF.js","assets/card-BYawXKTU.js","assets/Trash01-CWg-StRk.js","assets/label-BjOUR-vy.js","assets/select-D8HWXM7B.js","assets/tooltip-5OAV9va2.js","assets/ChevronDown-tPhI8IAo.js","assets/ChevronUp-DAtg-Gay.js","assets/switch-C2crWHBg.js","assets/textarea-Dfl6wKQt.js","assets/ArrowLeft-DI46U0hW.js","assets/XCircle-BifdMVfv.js","assets/checkbox-Cd2hVFLx.js","assets/Eye-mCbEOvrw.js","assets/LinkExternal01-TAXSoD5n.js","assets/use-copy-BGGBRB_T.js","assets/Copy01-Bs8ijW_K.js","assets/Key01-SN67R_2K.js","assets/Plus-ENOfz88I.js","assets/mcp-oauth-Dkbh2akf.js","assets/Play-DL9N7Ipe.js"])))=>i.map(i=>d[i]);
2
- import{c as m,d as n,f as c,j as t,k as f,r as l,aG as p}from"./index-BX_NPzZv.js";import{R as u}from"./require-capability-C994gRB1.js";import"./use-capability-DsAvVTiL.js";import"./access-gate-CS7NES54.js";import"./capability-load-error-l_4s8sKr.js";const g=l.lazy(()=>p(()=>import("./registry-layout-Dqr1hOdR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- import{c as z,b as B,j as t,y as Vt,B as te,r as V,aS as Rt,d as nt,s as Ht,m as K,a as re,t as H,w as Ut,k as De,p as E,F as oe,f as st,u as ot,L as Kt,D as qt,a1 as Gt,a2 as Xt,I as Qt,G as Wt,K as it,o as Yt,n as Jt}from"./index-BX_NPzZv.js";import{i as Zt}from"./ChevronRight-B029h9tK.js";import{i as en}from"./X-ppE9vwRY.js";import{aF as tn,Q as nn,A as gt,g as sn,an as on}from"./agent-icon-kIlAB0pt.js";import{t as ht}from"./ChevronDown-tPhI8IAo.js";import{T as Ce,a as ye,c as Ne}from"./tooltip-5OAV9va2.js";import{u as pt,d as xt,c as jt}from"./sidebar-DgvBsHW3.js";import{a as at,i as an,f as ln,S as cn,u as rn}from"./use-mcp-client-NnbFcsGZ.js";import{a as dn,u as un}from"./use-virtual-mcp-Da-ST5tm.js";import{a as Le,b as vt,P as bt}from"./popover-C-Z9QMGr.js";import{i as Ee}from"./Check-DLCFFMhM.js";import{s as we}from"./Plus-ENOfz88I.js";import{i as Ct}from"./SearchMd-BlLqg8aQ.js";import{s as yt}from"./XClose-DQy9b0YQ.js";import{C as mn}from"./self-tool-result-rQQpi3FX.js";import{T as Nt}from"./toolbar-D17bJYuh.js";import{S as fn}from"./skeleton-DOJnTHJ3.js";import{D as wt,a as _t,b as St,c as gn,g as hn,e as pn,f as xn}from"./drawer-C9OT_34K.js";import{u as kt}from"./use-mobile-BzJ1qLXG.js";import{a as jn,G as vn}from"./github-repo-picker-B8X9ZEbe.js";import{g as bn,b as Cn,a as Dt}from"./hooks-BeWC9MRd.js";import{u as yn,g as Nn,a as wn,b as _n}from"./use-navigate-to-agent-CURQ7Iu_.js";import{a as Sn,c as It}from"./agent-capabilities-cXfbMfjV.js";import{u as At}from"./shell-layout-ByW5qYjw.js";import{f as kn}from"./reusable-new-chat-CouMjkYR.js";import{C as Dn}from"./collection-search-BFxratBR.js";import{g as In,a as An,b as Pn,e as Tn}from"./extract-connection-data-C0wyUS2V.js";import{u as Pt,a as Tt,g as zn,C as Ye}from"./connection-card-Ng3GoeK5.js";import{e as zt,d as Ot,a as Mt,b as $t,h as On,c as Mn}from"./dialog-C8xV8nk7.js";import{d as W,a as Y,e as J,b as Z,c as ee,F as dt}from"./form-DpAMyOYq.js";import{I as ce}from"./input-BPEvvKG4.js";import{S as $n,a as Fn,b as Bn,c as Ln,d as ke}from"./select-D8HWXM7B.js";import{T as En}from"./textarea-Dfl6wKQt.js";import{b as Ft}from"./use-connection-C17rQDA_.js";import{n as Be,i as Je}from"./Tool02-CLeIEJiX.js";import{s as Ze}from"./Star01-Cxd5haB_.js";import{c as Vn,i as $e,a as ut,E as Rn,p as Hn,b as Un,d as Kn}from"./connection-form-helpers-JAvwK5WO.js";import{a as et}from"./authenticate-and-persist-oauth-DKyWYtJc.js";import{g as qn}from"./connection-slug-eyAPH6o3.js";import{C as Gn}from"./collection-tabs-BpvLtp7H.js";import{u as mt}from"./use-infinite-scroll-HX67FBA9.js";import{B as Fe}from"./badge-BgbHQoe3.js";import{u as Xn}from"./useSuspenseInfiniteQuery-Dr3M9SY-.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as Qn}from"./studio-tools-CpBEXDHG.js";import{u as Wn}from"./use-ai-providers-DCMs6qFa.js";const Yn="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function Jn(){const n=z.c(13),e=B();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),n[0]=s):s=n[0];let o;n[1]!==e?(o=e("routes.commerceOnboarding.connectModal.quote"),n[1]=e,n[2]=o):o=n[2];let a;n[3]!==o?(a=t.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",o,"”"]}),n[3]=o,n[4]=a):a=n[4];let i;n[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("img",{src:Yn,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),n[5]=i):i=n[5];let c;n[6]!==e?(c=e("routes.commerceOnboarding.connectModal.quoteAuthor"),n[6]=e,n[7]=c):c=n[7];let r;n[8]!==c?(r=t.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[i,t.jsx("span",{className:"text-base font-medium",children:c})]}),n[8]=c,n[9]=r):r=n[9];let l;return n[10]!==a||n[11]!==r?(l=t.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[s,a,r]}),n[10]=a,n[11]=r,n[12]=l):l=n[12],l}function Zn(){const n=z.c(19),e=B();let s;n[0]!==e?(s=e("routes.commerceOnboarding.connectModal.trustRevoke"),n[0]=e,n[1]=s):s=n[1];let o;n[2]!==s?(o={Icon:tn,label:s},n[2]=s,n[3]=o):o=n[3];let a;n[4]!==e?(a=e("routes.commerceOnboarding.connectModal.trustEncrypted"),n[4]=e,n[5]=a):a=n[5];let i;n[6]!==a?(i={Icon:Vt,label:a},n[6]=a,n[7]=i):i=n[7];let c;n[8]!==e?(c=e("routes.commerceOnboarding.connectModal.trustNeverSold"),n[8]=e,n[9]=c):c=n[9];let r;n[10]!==c?(r={Icon:nn,label:c},n[10]=c,n[11]=r):r=n[11];let l;n[12]!==o||n[13]!==i||n[14]!==r?(l=[o,i,r],n[12]=o,n[13]=i,n[14]=r,n[15]=l):l=n[15];const u=l;let m;n[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"h-px w-full bg-white/15"}),n[16]=m):m=n[16];let f;return n[17]!==u?(f=t.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[m,t.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:u.map(es)})]}),n[17]=u,n[18]=f):f=n[18],f}function es(n){const{Icon:e,label:s}=n;return t.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[t.jsx(e,{className:"size-4 shrink-0 opacity-85"}),s]},s)}function To(n){const e=z.c(22),{siteHost:s,footer:o,onClose:a,children:i}=n,c=B(),r=s?`https://www.google.com/s2/favicons?domain=${s}&sz=128`:null;let l;e[0]!==a||e[1]!==c?(l=a&&t.jsx("button",{type:"button",onClick:a,"aria-label":c("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:t.jsx(en,{size:18})}),e[0]=a,e[1]=c,e[2]=l):l=e[2];let u,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),m=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=u,e[4]=m):(u=e[3],m=e[4]);let f;e[5]!==r||e[6]!==s?(f=s&&t.jsxs(t.Fragment,{children:[t.jsx(Zt,{size:16,className:"shrink-0 text-foreground/25"}),r&&t.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:t.jsx("img",{src:r,alt:"",className:"size-full"})}),t.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:s})]}),e[5]=r,e[6]=s,e[7]=f):f=e[7];let d;e[8]!==f?(d=t.jsxs("div",{className:"flex items-center gap-2",children:[u,m,f]}),e[8]=f,e[9]=d):d=e[9];let h;e[10]!==o?(h=t.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:o}),e[10]=o,e[11]=h):h=e[11];let C;e[12]!==i||e[13]!==d||e[14]!==h?(C=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[d,i,h]}),e[12]=i,e[13]=d,e[14]=h,e[15]=C):C=e[15];let p,g;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),g=t.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=p,e[17]=g):(p=e[16],g=e[17]);let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[p,g,t.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[t.jsx("div",{className:"flex-1"}),t.jsx(Jn,{}),t.jsx("div",{className:"flex-1"}),t.jsx(Zn,{})]})]}),e[18]=j):j=e[18];let v;return e[19]!==l||e[20]!==C?(v=t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[l,C,j]}),e[19]=l,e[20]=C,e[21]=v):v=e[21],v}function zo(n){const e=z.c(5),{ready:s,pending:o,label:a,onClick:i,children:c}=n,r=o||!s,l=s&&!o?c:null;let u;return e[0]!==a||e[1]!==i||e[2]!==r||e[3]!==l?(u=t.jsxs(te,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:i,disabled:r,children:[a,l]}),e[0]=a,e[1]=i,e[2]=r,e[3]=l,e[4]=u):u=e[4],u}function Bt(){const n=V.useContext(Rt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(a=>a.status==="pending"&&new Date(a.expiresAt)>new Date),refetch:()=>s?.()}}function ts(n){let e=0;for(let o=0;o<n.length;o++)e=n.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function lt(n){const e=z.c(13),{org:s,size:o}=n,a=o===void 0?"sm":o,i=a==="xs"?"size-5":"size-6",c=a==="xs"?"text-[9px]":"text-xs";let r;e[0]!==i?(r=K(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==s.logo||e[3]!==s.name?(l=s.logo?void 0:ts(s.name),e[2]=s.logo,e[3]=s.name,e[4]=l):l=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==c?(u=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:K("font-semibold leading-none",c),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=c,e[8]=u):u=e[8];let m;return e[9]!==r||e[10]!==l||e[11]!==u?(m=t.jsx("div",{className:r,style:l,children:u}),e[9]=r,e[10]=l,e[11]=u,e[12]=m):m=e[12],m}function ns({invitation:n,onChanged:e}){const s=B(),[o,a]=V.useState(!1),i=n.organizationName??s("header.orgSwitcher.unknownOrganization"),c=async()=>{a(!0);try{const u=await re.organization.acceptInvitation({invitationId:n.id});if(u.error){H.error(u.error.message),a(!1);return}}catch{H.error(s("header.orgSwitcher.failedToAcceptInvitation")),a(!1);return}H.success(s("header.orgSwitcher.joined",{name:i})),Ut();let l;try{l=(await re.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=l?`/${l}`:"/"},r=async()=>{a(!0);try{const l=await re.organization.rejectInvitation({invitationId:n.id});if(l.error){H.error(l.error.message),a(!1);return}H.success(s("header.orgSwitcher.invitationDeclined")),a(!1),e()}catch{H.error(s("header.orgSwitcher.failedToDeclineInvitation")),a(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(lt,{org:{name:i},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:i}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(te,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:c,disabled:o,children:s("header.orgSwitcher.accept")}),t.jsx(te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:r,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:i}),children:t.jsx(yt,{size:14})})]})]})}function ss(n){const e=z.c(32),{orgParam:s,onSelectOrg:o,onCreateOrg:a}=n,i=B(),{data:c}=Ht(),{invitations:r,refetch:l}=Bt();let u;e[0]!==s?(u=(I,A)=>I.slug===s?-1:A.slug===s?1:I.name.localeCompare(A.name),e[0]=s,e[1]=u):u=e[1];const m=[...c??[]].sort(u),[f,d]=V.useState(""),h=f.toLowerCase(),C=h?m.filter(I=>I.name.toLowerCase().includes(h)||I.slug.toLowerCase().includes(h)):m;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ct,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=p):p=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=I=>d(I.target.value),e[3]=g):g=e[3];let j;e[4]!==f?(j=I=>I.key==="Escape"&&f&&d(""),e[4]=f,e[5]=j):j=e[5];let v;e[6]!==i?(v=i("header.orgSwitcher.searchOrganizations"),e[6]=i,e[7]=v):v=e[7];let b;e[8]!==f||e[9]!==j||e[10]!==v?(b=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:f,onChange:g,onKeyDown:j,placeholder:v,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=f,e[9]=j,e[10]=v,e[11]=b):b=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(we,{size:16}),e[12]=w):w=e[12];let S;e[13]!==a?(S=t.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:w}),e[13]=a,e[14]=S):S=e[14];let D;e[15]!==b||e[16]!==S?(D=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[p,b,S]}),e[15]=b,e[16]=S,e[17]=D):D=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let x;e[18]!==r||e[19]!==f||e[20]!==l?(x=!f&&r.map(I=>t.jsx(ns,{invitation:I,onChanged:l},I.id)),e[18]=r,e[19]=f,e[20]=l,e[21]=x):x=e[21];const k=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:f?i("header.orgSwitcher.noOrganizationsMatch",{query:f}):i("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==o||e[23]!==s?(T=I=>t.jsxs("button",{type:"button",onClick:()=>o(I.slug),className:K("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",I.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(lt,{org:I,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.slug})]}),I.slug===s&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},I.id),e[22]=o,e[23]=s,e[24]=T):T=e[24];const N=C.map(T);let y;e[25]!==x||e[26]!==k||e[27]!==N?(y=t.jsxs("div",{className:O,children:[x,k,N]}),e[25]=x,e[26]=k,e[27]=N,e[28]=y):y=e[28];let P;return e[29]!==y||e[30]!==D?(P=t.jsxs(t.Fragment,{children:[D,y]}),e[29]=y,e[30]=D,e[31]=P):P=e[31],P}function os(n){const e=z.c(22),{trigger:s,orgParam:o,align:a,side:i}=n,c=a===void 0?"start":a,r=i===void 0?"bottom":i,l=nt(),[u,m]=V.useState(!1),[f,d]=V.useState(!1);let h;e[0]!==s?(h=t.jsx(Le,{asChild:!0,children:s}),e[0]=s,e[1]=h):h=e[1];const C=String(u);let p;e[2]!==l?(p=D=>{m(!1),l({to:"/$org",params:{org:D}})},e[2]=l,e[3]=p):p=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m(!1),d(!0)},e[4]=g):g=e[4];let j;e[5]!==o||e[6]!==C||e[7]!==p?(j=t.jsx(ss,{orgParam:o,onSelectOrg:p,onCreateOrg:g},C),e[5]=o,e[6]=C,e[7]=p,e[8]=j):j=e[8];let v;e[9]!==c||e[10]!==r||e[11]!==j?(v=t.jsx(vt,{side:r,align:c,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:as,onCloseAutoFocus:is,children:j}),e[9]=c,e[10]=r,e[11]=j,e[12]=v):v=e[12];let b;e[13]!==u||e[14]!==h||e[15]!==v?(b=t.jsxs(bt,{open:u,onOpenChange:m,children:[h,v]}),e[13]=u,e[14]=h,e[15]=v,e[16]=b):b=e[16];let w;e[17]!==f?(w=t.jsx(mn,{open:f,onOpenChange:d}),e[17]=f,e[18]=w):w=e[18];let S;return e[19]!==w||e[20]!==b?(S=t.jsxs(t.Fragment,{children:[b,w]}),e[19]=w,e[20]=b,e[21]=S):S=e[21],S}function is(n){return n.preventDefault()}function as(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ls(n){const e=z.c(21),{value:s,onChange:o,placeholder:a,onKeyDown:i,className:c,isSearching:r,disabled:l}=n,u=a===void 0?"Search...":a;let m;e[0]!==c?(m=K("shrink-0 w-full border-b border-border h-12",c),e[0]=c,e[1]=m):m=e[1];const f=l?"cursor-not-allowed opacity-50":"cursor-text";let d;e[2]!==f?(d=K("flex items-center gap-2.5 h-12 px-4",f),e[2]=f,e[3]=d):d=e[3];let h;e[4]!==r?(h=r?t.jsx(De,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(Ct,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=r,e[5]=h):h=e[5];let C;e[6]!==o?(C=v=>o(v.target.value),e[6]=o,e[7]=C):C=e[7];let p;e[8]!==l||e[9]!==i||e[10]!==u||e[11]!==C||e[12]!==s?(p=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:i,placeholder:u,disabled:l,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=l,e[9]=i,e[10]=u,e[11]=C,e[12]=s,e[13]=p):p=e[13];let g;e[14]!==d||e[15]!==h||e[16]!==p?(g=t.jsxs("label",{className:d,children:[h,p]}),e[14]=d,e[15]=h,e[16]=p,e[17]=g):g=e[17];let j;return e[18]!==m||e[19]!==g?(j=t.jsx("div",{className:m,children:g}),e[18]=m,e[19]=g,e[20]=j):j=e[20],j}function cs(n,e,s){if(!s)return null;const o=bn(n,e);return o?o.threads.get().find(i=>i.id===s)?.branch??null:null}function rs(n){const e=z.c(6),{value:s,onChange:o}=n,a=B();let i;e[0]!==a?(i=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=i):i=e[1];let c;return e[2]!==o||e[3]!==i||e[4]!==s?(c=t.jsx(ls,{value:s,onChange:o,placeholder:i}),e[2]=o,e[3]=i,e[4]=s,e[5]=c):c=e[5],c}function ds(){const n=z.c(4),e=B();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function us(n){const e=z.c(10),{org:s,onClose:o}=n,a=B();let i;e[0]!==s.slug?(i={org:s.slug},e[0]=s.slug,e[1]=i):i=e[1];let c;e[2]!==o?(c=()=>o(),e[2]=o,e[3]=c):c=e[3];let r;e[4]!==a?(r=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=r):r=e[5];let l;return e[6]!==i||e[7]!==c||e[8]!==r?(l=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Kt,{to:"/$org/settings/agents",params:i,onClick:c,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:r})}),e[6]=i,e[7]=c,e[8]=r,e[9]=l):l=e[9],l}function ms(){const n=z.c(4),e=B();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Lt,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function fs(n){const e=z.c(11),{onImportFromGithub:s}=n,o=B();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(vn,{className:"size-3.5"}),e[0]=a):a=e[0];let i;e[1]!==o?(i=o("sidebar.agentsSection.import"),e[1]=o,e[2]=i):i=e[2];let c;e[3]!==s||e[4]!==i?(c=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[a,i]}),e[3]=s,e[4]=i,e[5]=c):c=e[5];let r;e[6]!==o?(r=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=r):r=e[7];let l;return e[8]!==c||e[9]!==r?(l=t.jsx(Lt,{action:c,children:r}),e[8]=c,e[9]=r,e[10]=l):l=e[10],l}function gs(n){const e=z.c(11),{setOpen:s,emptyCtaClass:o}=n,a=B();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let c;e[2]!==o?(c=K(o),e[2]=o,e[3]=c):c=e[3];let r;e[4]!==s?(r=()=>{E("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=r):r=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(we,{className:"size-4"}),e[6]=l):l=e[6];let u;return e[7]!==i||e[8]!==c||e[9]!==r?(u=t.jsx(Nt,{"aria-label":i,className:c,onClick:r,children:l}),e[7]=i,e[8]=c,e[9]=r,e[10]=u):u=e[10],u}function hs(n){const e=z.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:a}=n,i=B();let c;e[0]!==o||e[1]!==i?(c=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=c):c=e[2];let r;e[3]!==a?(r=K(a),e[3]=a,e[4]=r):r=e[4];let l;e[5]!==s?(l=()=>{E("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=l):l=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(we,{}),e[7]=u):u=e[7];let m;e[8]!==i?(m=i("sidebar.agentsSection.newAgent"),e[8]=i,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx("span",{children:m}),e[10]=m,e[11]=f):f=e[11];let d;return e[12]!==c||e[13]!==r||e[14]!==l||e[15]!==f?(d=t.jsx(xt,{children:t.jsxs(jt,{tooltip:c,className:r,onClick:l,children:[u,f]})}),e[12]=c,e[13]=r,e[14]=l,e[15]=f,e[16]=d):d=e[16],d}function ps(){const n=z.c(4),e=B();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(St,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function xs(n){const e=z.c(8),{emptyCtaClass:s}=n,o=B();let a;e[0]!==o?(a=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a):a=e[1];let i;e[2]!==s?(i=K(s),e[2]=s,e[3]=i):i=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(we,{className:"size-4"}),e[4]=c):c=e[4];let r;return e[5]!==a||e[6]!==i?(r=t.jsx(Nt,{"aria-label":a,className:i,children:c}),e[5]=a,e[6]=i,e[7]=r):r=e[7],r}function js(n){const e=z.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:a}=n,i=B();let c;e[0]!==o||e[1]!==i?(c=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=c):c=e[2];let r;e[3]!==a?(r=K(a),e[3]=a,e[4]=r):r=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(we,{}),e[5]=l):l=e[5];let u;e[6]!==i?(u=i("sidebar.agentsSection.newAgent"),e[6]=i,e[7]=u):u=e[7];let m;e[8]!==u?(m=t.jsx("span",{children:u}),e[8]=u,e[9]=m):m=e[9];let f;e[10]!==c||e[11]!==r||e[12]!==m?(f=t.jsx(Le,{asChild:!0,children:t.jsxs(jt,{tooltip:c,className:r,children:[l,m]})}),e[10]=c,e[11]=r,e[12]=m,e[13]=f):f=e[13];let d;e[14]!==f||e[15]!==s?(d=s(f),e[14]=f,e[15]=s,e[16]=d):d=e[16];let h;return e[17]!==d?(h=t.jsx(xt,{children:d}),e[17]=d,e[18]=h):h=e[18],h}function vs(n){const e=z.c(9),{children:s}=n,o=B();let a;e[0]!==s?(a=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==o?(i=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==i?(c=t.jsx(ye,{side:"right",sideOffset:8,children:i}),e[4]=i,e[5]=c):c=e[5];let r;return e[6]!==a||e[7]!==c?(r=t.jsxs(Ne,{defaultOpen:!0,delayDuration:0,children:[a,c]}),e[6]=a,e[7]=c,e[8]=r):r=e[8],r}function bs(n){const e=nt(),{create:s}=Cn(),{locator:o}=oe(),a=st({strict:!1}),i=ot({strict:!1});return async c=>{const r=crypto.randomUUID(),l=c===i.virtualmcpid?cs(n,o,a.taskId??""):null;try{await s({id:r,virtual_mcp_id:c,...l?{branch:l}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:r},search:{virtualmcpid:c}})}}function tt(n){const e=z.c(20),{agent:s,selected:o,onClick:a}=n,i=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let c;e[0]!==i?(c=K("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==s.icon||e[3]!==s.title?(r=t.jsx(gt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=r):r=e[4];let l;e[5]!==s.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=l):l=e[6];let u;e[7]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=u):u=e[8];let m;e[9]!==l||e[10]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,u]}),e[9]=l,e[10]=u,e[11]=m):m=e[11];let f;e[12]!==o?(f=o&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=f):f=e[13];let d;return e[14]!==a||e[15]!==c||e[16]!==r||e[17]!==m||e[18]!==f?(d=t.jsxs("button",{type:"button",onClick:a,className:c,children:[r,m,f]}),e[14]=a,e[15]=c,e[16]=r,e[17]=m,e[18]=f,e[19]=d):d=e[19],d}function Lt(n){const e=z.c(5),{children:s,action:o}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let i;return e[2]!==o||e[3]!==a?(i=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,o]}),e[2]=o,e[3]=a,e[4]=i):i=e[4],i}function Cs(n){const e=z.c(23),{onClose:s,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:i}=n,[c,r]=V.useState(""),l=dn(),u=l??[],{org:m}=oe(),{data:f}=re.useSession(),d=f?.user?.id??"anon",h=Nn(l),C=wn(),p=bs(m.slug),g=Sn(l),j=c.toLowerCase(),v=u.filter(_s).filter(F=>!g.has(F.id)).filter(ws).filter(F=>!c||F.title.toLowerCase().includes(j)),b=v.filter(Ns),w=v.filter(ys),S=at(m.id),D=!c||S.title.toLowerCase().includes(j),O=!!(o&&D);let x;e[0]!==s||e[1]!==o?(x=()=>{o?.(null),s(),r("")},e[0]=s,e[1]=o,e[2]=x):x=e[2];const k=x,T=F=>{if(o){o(F.id),s(),r("");return}_n({orgId:m.id,userId:d},F.id,h),C(),s(),r(""),p(F.id)},N="flex flex-col max-h-[min(640px,80dvh)]";let y;e[3]!==c?(y=t.jsx(rs,{value:c,onChange:r}),e[3]=c,e[4]=y):y=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",I=o&&D&&S&&t.jsx(tt,{agent:S,selected:!a||a===S.id,onClick:k}),A=(b.length>0||!c)&&t.jsx(fs,{onImportFromGithub:i}),M=b.map(F=>t.jsx(tt,{agent:F,selected:o?a===F.id:void 0,onClick:()=>T(F)},F.id)),R=w.length>0&&t.jsx(ms,{}),X=w.map(F=>t.jsx(tt,{agent:F,selected:o?a===F.id:void 0,onClick:()=>T(F)},F.id));let L;e[5]!==O||e[6]!==c||e[7]!==v.length?(L=v.length===0&&!O&&c&&t.jsx(ds,{}),e[5]=O,e[6]=c,e[7]=v.length,e[8]=L):L=e[8];let ne;e[9]!==L||e[10]!==I||e[11]!==A||e[12]!==M||e[13]!==R||e[14]!==X?(ne=t.jsxs("div",{className:P,children:[I,A,M,R,X,L]}),e[9]=L,e[10]=I,e[11]=A,e[12]=M,e[13]=R,e[14]=X,e[15]=ne):ne=e[15];let q;e[16]!==s||e[17]!==m?(q=t.jsx(us,{org:m,onClose:s}),e[16]=s,e[17]=m,e[18]=q):q=e[18];let de;return e[19]!==ne||e[20]!==q||e[21]!==y?(de=t.jsxs("div",{className:N,children:[y,ne,q]}),e[19]=ne,e[20]=q,e[21]=y,e[22]=de):de=e[22],de}function ys(n){return!It(n.metadata)}function Ns(n){return It(n.metadata)}function ws(n){return!ln(n.id)}function _s(n){return!an(n.id)}function Ss(n){const e=z.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:o,trigger:a,onSelectAgent:i,selectedAgentId:c,side:r,align:l}=s,u=o===void 0?!1:o,m=r===void 0?"right":r,f=l===void 0?"start":l,[d,h]=V.useState(!1),[C,p]=V.useState(!1),g=kt(),{setOpenMobile:j}=pt(),v=yn(),b=v?"border border-border":void 0;let w;e[2]!==v?(w=A=>v?t.jsx(vs,{children:A}):A,e[2]=v,e[3]=w):w=e[3];const S=w;let D;e[4]!==g||e[5]!==j?(D=()=>{h(!1),g&&j(!1)},e[4]=g,e[5]=j,e[6]=D):D=e[6];const O=D;let x;e[7]!==O?(x=()=>{O(),p(!0)},e[7]=O,e[8]=x):x=e[8];const k=x;let T;e[9]!==O||e[10]!==k||e[11]!==i||e[12]!==d||e[13]!==c?(T=d&&t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(fn,{className:"h-4 w-24"})}),children:t.jsx(Cs,{onClose:O,onSelectAgent:i,selectedAgentId:c,onImportFromGithub:k})}),e[9]=O,e[10]=k,e[11]=i,e[12]=d,e[13]=c,e[14]=T):T=e[14];const N=T;let y;e[15]!==f||e[16]!==u||e[17]!==b||e[18]!==v||e[19]!==g||e[20]!==d||e[21]!==N||e[22]!==m||e[23]!==a||e[24]!==S?(y=g?t.jsxs(t.Fragment,{children:[a?t.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:a}):u?S(t.jsx(gs,{setOpen:h,emptyCtaClass:b})):t.jsx(hs,{setOpen:h,highlightEmpty:v,emptyCtaClass:b}),t.jsx(wt,{open:d,onOpenChange:h,direction:"bottom",children:t.jsxs(_t,{className:"max-h-[85dvh] p-0",children:[t.jsx(ps,{}),N]})})]}):t.jsxs(bt,{open:d,onOpenChange:A=>{A&&!d&&E("agent_browser_opened",{surface:"desktop_popover"}),h(A)},children:[a?t.jsx(Le,{asChild:!0,children:a}):u?S(t.jsx(Le,{asChild:!0,children:t.jsx(xs,{emptyCtaClass:b})})):t.jsx(js,{wrapEmptyHint:S,highlightEmpty:v,emptyCtaClass:b}),t.jsx(vt,{className:"w-[380px] p-0 overflow-hidden",side:m,align:f,children:N})]}),e[15]=f,e[16]=u,e[17]=b,e[18]=v,e[19]=g,e[20]=d,e[21]=N,e[22]=m,e[23]=a,e[24]=S,e[25]=y):y=e[25];let P;e[26]!==C?(P=t.jsx(jn,{open:C,onOpenChange:p,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let I;return e[28]!==P||e[29]!==y?(I=t.jsxs(t.Fragment,{children:[y,P]}),e[28]=P,e[29]=y,e[30]=I):I=e[30],I}const ks="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Ds(n){const e=z.c(29),{agentId:s,fallback:o,onOpenHome:a,onPick:i}=n,c=B(),r=un(s)??o??null;let l,u,m,f,d;e[0]!==r?.title||e[1]!==a||e[2]!==c?(d=r?.title??c("header.shellBreadcrumb.superAgentDefaultName"),f="flex min-w-0 items-center gap-0",l="button",u=a,m=c("header.shellBreadcrumb.openAgentHome",{name:d}),e[0]=r?.title,e[1]=a,e[2]=c,e[3]=l,e[4]=u,e[5]=m,e[6]=f,e[7]=d):(l=e[3],u=e[4],m=e[5],f=e[6],d=e[7]);const h=r?.icon??null;let C;e[8]!==h||e[9]!==d?(C=t.jsx(gt,{icon:h,name:d,size:"xs"}),e[8]=h,e[9]=d,e[10]=C):C=e[10];let p;e[11]!==l||e[12]!==u||e[13]!==m||e[14]!==C?(p=t.jsx("button",{type:l,onClick:u,"aria-label":m,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:C}),e[11]=l,e[12]=u,e[13]=m,e[14]=C,e[15]=p):p=e[15];let g;e[16]!==d?(g=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:d}),e[16]=d,e[17]=g):g=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=j):j=e[18];let v;e[19]!==g?(v=t.jsxs("button",{type:"button",className:ks,children:[g,j]}),e[19]=g,e[20]=v):v=e[20];let b;e[21]!==s||e[22]!==i||e[23]!==v?(b=t.jsx(Ss,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:i,trigger:v}),e[21]=s,e[22]=i,e[23]=v,e[24]=b):b=e[24];let w;return e[25]!==b||e[26]!==f||e[27]!==p?(w=t.jsxs("div",{className:f,children:[p,b]}),e[25]=b,e[26]=f,e[27]=p,e[28]=w):w=e[28],w}function Oo(n){const e=z.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:o}=s,a=B(),{org:i}=oe(),{state:c,isMobile:r}=pt(),l=Bt().invitations.length>0,u=c==="collapsed"||r;let m;e[2]!==l||e[3]!==i.name||e[4]!==a?(m=l?a("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:i.name}):a("header.shellBreadcrumb.switchOrganization",{name:i.name}),e[2]=l,e[3]=i.name,e[4]=a,e[5]=m):m=e[5];let f;e[6]!==i?(f=t.jsx(lt,{org:i,size:"sm"}),e[6]=i,e[7]=f):f=e[7];let d;e[8]!==l||e[9]!==u?(d=l&&t.jsx("span",{className:K("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",u?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=l,e[9]=u,e[10]=d):d=e[10];let h;e[11]!==f||e[12]!==d?(h=t.jsxs("span",{className:"relative inline-flex",children:[f,d]}),e[11]=f,e[12]=d,e[13]=h):h=e[13];let C;e[14]!==i.name||e[15]!==o?(C=o&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[14]=i.name,e[15]=o,e[16]=C):C=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=p):p=e[17];let g;e[18]!==m||e[19]!==h||e[20]!==C?(g=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[h,C,p]})}),e[18]=m,e[19]=h,e[20]=C,e[21]=g):g=e[21];let j;e[22]!==i.slug||e[23]!==g?(j=t.jsx(os,{orgParam:i.slug,trigger:g}),e[22]=i.slug,e[23]=g,e[24]=j):j=e[24];let v;e[25]!==i.name?(v=t.jsx(ye,{side:"bottom",children:i.name}),e[25]=i.name,e[26]=v):v=e[26];let b;return e[27]!==v||e[28]!==j?(b=t.jsxs(Ne,{children:[j,v]}),e[27]=v,e[28]=j,e[29]=b):b=e[29],b}function Mo(n){const e=z.c(22);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:a}=oe();let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[2]=i):i=e[2];const c=st(i);let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[3]=r):r=e[3];const l=ot(r),{threads:u}=Dt(),{data:m}=re.useSession(),{setTaskId:f,createNewTask:d}=At();let h;e[4]!==a.id?(h=at(a.id),e[4]=a.id,e[5]=h):h=e[5];const C=h,p=C.id,g=c.taskId?l.virtualmcpid??p:p;let j;e[6]!==d||e[7]!==p||e[8]!==o||e[9]!==m?.user?.id||e[10]!==f||e[11]!==u?(j=O=>{const x=O??p,k=kn(u,x,m?.user?.id);k?f(k.id,x):d(x),o?.()},e[6]=d,e[7]=p,e[8]=o,e[9]=m?.user?.id,e[10]=f,e[11]=u,e[12]=j):j=e[12];const v=j;let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=b):b=e[13];const w=g===p?C:void 0;let S;e[14]!==g||e[15]!==v?(S=()=>v(g),e[14]=g,e[15]=v,e[16]=S):S=e[16];let D;return e[17]!==g||e[18]!==v||e[19]!==w||e[20]!==S?(D=t.jsx(V.Suspense,{fallback:b,children:t.jsx(Ds,{agentId:g,fallback:w,onOpenHome:S,onPick:v})}),e[17]=g,e[18]=v,e[19]=w,e[20]=S,e[21]=D):D=e[21],D}function $o(){const n=z.c(24),e=B(),{org:s}=oe();let o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},n[0]=o):o=n[0];const a=st(o);let i;n[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[1]=i):i=n[1];const c=ot(i),{threads:r}=Dt(),{createNewTask:l}=At();let u;n[2]!==s.id?(u=at(s.id),n[2]=s.id,n[3]=u):u=n[3];const m=u.id,f=a.taskId?c.virtualmcpid??m:m;let d;n[4]!==a.taskId||n[5]!==r?(d=(a.taskId?r.find(D=>D.id===a.taskId)?.branch:null)??null,n[4]=a.taskId,n[5]=r,n[6]=d):d=n[6];const h=d;let C;n[7]!==f||n[8]!==l||n[9]!==h?(C=()=>{l(f,h)},n[7]=f,n[8]=l,n[9]=h,n[10]=C):C=n[10];const p=C;let g;n[11]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=g):g=n[12];let j;n[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(sn,{size:16}),n[13]=j):j=n[13];let v;n[14]!==p||n[15]!==g?(v=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:p,"aria-label":g,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:j})}),n[14]=p,n[15]=g,n[16]=v):v=n[16];let b;n[17]!==e?(b=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=b):b=n[18];let w;n[19]!==b?(w=t.jsx(ye,{side:"bottom",children:b}),n[19]=b,n[20]=w):w=n[20];let S;return n[21]!==v||n[22]!==w?(S=t.jsxs(Ne,{children:[v,w]}),n[21]=v,n[22]=w,n[23]=S):S=n[23],S}function Is({open:n,onOpenChange:e,onCreated:s}){const o=B(),{org:a}=oe(),{data:i}=re.useSession(),{stdioEnabled:c}=qt(),r=kt(),l=Ft(),u=Pt(),f=Tt(u,"").items,d=Gt({resolver:Xt(Vn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=d.watch("ui_type"),C=d.watch("connection_url"),p=d.watch("npx_package"),g=$e({uiType:h,connectionUrl:C??"",npxPackage:p??""})??ut({uiType:h,connectionUrl:C??"",registryItems:f}),j=x=>{const k=x.trim();if(!k)return;const T=!!d.formState.dirtyFields.title,N=!!d.formState.dirtyFields.description,y=!!d.formState.dirtyFields.env_vars,P=A=>{if(A&&(!T&&!d.getValues("title").trim()&&A.title&&d.setValue("title",A.title,{shouldDirty:!1}),!N&&!(d.getValues("description")??"").trim()&&A.description&&d.setValue("description",A.description,{shouldDirty:!1}),!y&&A.envVarKeys?.length)){const M=d.getValues("env_vars")??[],R=new Set(M.map(L=>L.key)),X=A.envVarKeys.filter(L=>!R.has(L));X.length>0&&d.setValue("env_vars",[...M,...X.map(L=>({key:L,value:""}))],{shouldDirty:!0})}},I=Hn(k);if(I&&c){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",I.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),P($e({uiType:"NPX",npxPackage:I.packageName}));return}if(k.startsWith("http://")||k.startsWith("https://")){const A=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";d.setValue("ui_type",A,{shouldDirty:!0}),d.setValue("connection_url",k,{shouldDirty:!0}),P($e({uiType:A,connectionUrl:k})??ut({uiType:A,connectionUrl:k,registryItems:f}));return}h==="NPX"&&P($e({uiType:"NPX",npxPackage:k}))},v=x=>{x||d.reset(),e(x)},b=async x=>{let k,T=null,N=null,y=null;x.ui_type==="NPX"?(k="STDIO",T="",y=Un(x.npx_package||"",x.env_vars||[])):x.ui_type==="STDIO"?(k="STDIO",T="",y=Kn(x.stdio_command||"",x.stdio_args||"",x.stdio_cwd,x.env_vars||[])):(k=x.ui_type,T=x.connection_url||"",N=x.connection_token||null);const P=In("conn");try{await l.create.mutateAsync({id:P,title:x.title,description:x.description||null,connection_type:k,connection_url:T,connection_token:N,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:i?.user?.id||"system",organization_id:a.id,icon:x.icon??null,app_name:null,app_id:null,connection_headers:y,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),s?.(P)}catch{H.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},w=o("connections.createConnectionDialog.title"),S=o("connections.createConnectionDialog.description"),D=d.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(W,{control:d.control,name:"ui_type",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs($n,{value:x.value,onValueChange:x.onChange,children:[t.jsx(Z,{children:t.jsx(Fn,{children:t.jsx(Bn,{})})}),t.jsxs(Ln,{children:[t.jsx(ke,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(ke,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(ke,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ke,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Be,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(ke,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(on,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),h==="NPX"&&t.jsx(W,{control:d.control,name:"npx_package",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...x,value:x.value??"",onPaste:k=>{const T=k.clipboardData.getData("text");T&&(k.preventDefault(),d.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:k=>{j(k.target.value),x.onBlur()}})}),t.jsx(ee,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(W,{control:d.control,name:"stdio_command",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...x,value:x.value??""})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"stdio_args",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...x,value:x.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(W,{control:d.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...x,value:x.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(W,{control:d.control,name:"env_vars",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Rn,{value:x.value??[],onChange:x.onChange})}),t.jsx(ee,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(W,{control:d.control,name:"connection_url",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...x,value:x.value??"",onPaste:k=>{const T=k.clipboardData.getData("text");T&&(k.preventDefault(),d.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:k=>{j(k.target.value),x.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"connection_token",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:g?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ce,{type:"password",placeholder:g?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...x,value:x.value??""})}),g?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.token.helperText,g.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(W,{control:d.control,name:"title",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...x})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"description",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(En,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...x,value:x.value??""})}),t.jsx(ee,{})]})})]});return r?t.jsx(wt,{open:n,onOpenChange:v,children:t.jsxs(_t,{className:"max-h-[90vh]",children:[t.jsx(gn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(St,{children:w}),t.jsx(hn,{className:"mt-1",children:S})]}),t.jsx(pn,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(yt,{size:16})})})]})}),t.jsx(dt,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(b),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(xn,{children:t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:D})})]})})]})}):t.jsx(zt,{open:n,onOpenChange:v,children:t.jsxs(Ot,{className:"sm:max-w-[525px]",children:[t.jsxs(Mt,{children:[t.jsx($t,{children:w}),t.jsx(On,{children:S})]}),t.jsx(dt,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(b),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Mn,{children:[t.jsx(te,{type:"button",variant:"outline",onClick:()=>v(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:D})]})]})})]})})}function As(n){const e=z.c(72),{mode:s,agentId:o,addedConnectionIds:a,onAdd:i,onCloneAndAdd:c,onConnectAndAdd:r,connectingItemId:l,search:u,onCreateConnection:m,onBrowseNavigate:f,defaultTab:d}=n,h=s===void 0?"add":s,C=d===void 0?"connected":d,p=B(),{org:g}=oe(),j=V.useDeferredValue(u),v=u!==j;let b;e[0]!==j?(b=j.trim().toLowerCase(),e[0]=j,e[1]=b):b=e[1];const w=b;let S;e[2]!==C?(S=_=>_??C,e[2]=C,e[3]=S):S=e[3];const[D,O]=Qt(Wt.connectionsTab(g.slug)+(C==="all"?":home-modal":":agent-modal"),S);let x;e[4]!==D||e[5]!==O?(x=_=>{_!==D&&E("connections_dialog_tab_changed",{to_tab:_}),O(_)},e[4]=D,e[5]=O,e[6]=x):x=e[6];const k=x;let T;e[7]!==g.id||e[8]!==g.slug?(T={connectionId:cn,orgId:g.id,orgSlug:g.slug},e[7]=g.id,e[8]=g.slug,e[9]=T):T=e[9];const N=rn(T),y=j?.trim().split(/\s+/).filter(Boolean)??[],P=y.length>0?{operator:"or",conditions:y.flatMap(Bs)}:void 0,I={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(I),{data:M,fetchNextPage:R,hasNextPage:X,isFetchingNextPage:L}=Xn({queryKey:it.collectionListInfinite(N,g.id,"","CONNECTIONS",A),queryFn:async _=>{const{pageParam:$}=_,se=$===void 0?0:$;return(await N.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:$s,staleTime:3e4}),ne=M?.pages.flatMap(Ms)??[],q=zn(ne),de=new Set(ne.filter(Os).map(zs)),F=Pt(),ie=Tt(F,j),Re=mt(ie.loadMore,ie.hasMore,ie.isLoadingMore),He=mt(R,X??!1,L),G=D==="all"||!!w,ct=G?ie.items.filter(_=>{const $=An(_);if($&&de.has($))return!1;if(!w)return!0;const se=Ve(_._meta),ae=[_.title,_.description,_.name,_.server?.title,_.server?.description,_.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return y.some(Q=>ae.includes(Q.toLowerCase()))}):[],_e=ct.filter(Ts),Se=ct.filter(Ps);let Ie;e[10]!==a?(Ie=_=>_.some($=>a.has($.id)),e[10]=a,e[11]=Ie):Ie=e[11];const Ue=Ie;let Ae;e[12]!==a||e[13]!==o||e[14]!==l||e[15]!==Ue||e[16]!==h||e[17]!==i||e[18]!==f||e[19]!==c||e[20]!==p?(Ae=(_,$,se,ae,Q)=>{const Me=Ue(Q),be=Q.find(le=>!a.has(le.id)),U=Q[0];if(h==="browse"){const le=qn(U);return t.jsx(Ye,{connection:{title:$,icon:se,description:Q.length>1?`${Q.length} instances`:ae??void 0},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",p("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{E("connection_browse_clicked",{app_name:U.app_name??null,connection_id:U.id,instances_count:Q.length}),f?.(le)}},_)}return t.jsx(Ye,{connection:{title:$,icon:se,description:ae},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",p("virtualMcp.connectionDialogContent.added")]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:le=>{le.stopPropagation(),be?(E("connection_add_clicked",{action:"use_existing",app_name:U.app_name??null,connection_id:be.id}),o&&E("agent_connection_attached",{agent_id:o,connection_id:be.id,app_name:U.app_name??null,mode:"existing"}),i(be.id)):(E("connection_add_clicked",{action:"clone",app_name:U.app_name??null,base_connection_id:U.id}),c(U))},children:p("virtualMcp.connectionDialogContent.add")})]})},_)},e[12]=a,e[13]=o,e[14]=l,e[15]=Ue,e[16]=h,e[17]=i,e[18]=f,e[19]=c,e[20]=p,e[21]=Ae):Ae=e[21];const Pe=Ae;let Te;e[22]!==l||e[23]!==h||e[24]!==r||e[25]!==p?(Te=_=>{const $=Ve(_._meta),se=$?.friendlyName||$?.friendly_name||_.server?.title||_.title||_.server?.name||_.name||_.id||"",ae=_.server?.description||_.description||null,Q=_.server?.icons?.[0]?.src||Pn(_.server?.repository)||null,Me=$?.official===!0,be=$?.verified===!0,U=$?.owner==="deco";return t.jsx(Ye,{connection:{title:se,description:ae,icon:Q},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[U&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:p("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.builtByDeco")})]}),!U&&Me&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Je,{})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!U&&!Me&&be&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Je,{})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:le=>{le.stopPropagation(),E("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,app_name:$?.friendlyName||_.server?.name||_.name||null}),r(_)},children:l===_.id?t.jsx(De,{size:14,className:"animate-spin"}):p(h==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${_.id}`)},e[22]=l,e[23]=h,e[24]=r,e[25]=p,e[26]=Te):Te=e[26];const rt=Te;let ue;e[27]!==D||e[28]!==k||e[29]!==m||e[30]!==w||e[31]!==p?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Gn,{tabs:[{id:"all",label:p("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:p("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:D,onTabChange:_=>k(_)}),t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{E("connections_dialog_custom_clicked"),m()},children:[t.jsx(we,{size:12}),p("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=D,e[28]=k,e[29]=m,e[30]=w,e[31]=p,e[32]=ue):ue=e[32];const Ke=v&&"opacity-50 pointer-events-none";let me;e[33]!==Ke?(me=K("flex-1 overflow-auto p-5 transition-opacity duration-150",Ke),e[33]=Ke,e[34]=me):me=e[34];const Et="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ze;e[35]!==Pe?(ze=_=>{if(_.type==="group")return Pe(_.key,_.title,_.icon,null,_.connections);const $=_.connection;return Pe($.id,$.title,$.icon,$.description??null,[$])},e[35]=Pe,e[36]=ze):ze=e[36];const qe=q.map(ze);let fe;e[37]!==He?(fe=t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[37]=He,e[38]=fe):fe=e[38];let ge;e[39]!==L?(ge=L&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(De,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=L,e[40]=ge):ge=e[40];const Ge=G&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Je,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:p("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Xe=G&&_e.map(rt),Qe=G&&Se.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:p("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=G&&Se.map(rt);let he;e[41]!==Re||e[42]!==F||e[43]!==G?(he=G&&F.length>0&&t.jsx("div",{ref:Re,className:"col-span-full h-1"}),e[41]=Re,e[42]=F,e[43]=G,e[44]=he):he=e[44];let pe;e[45]!==ie.isLoadingMore||e[46]!==G?(pe=G&&ie.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(De,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=ie.isLoadingMore,e[46]=G,e[47]=pe):pe=e[47];let xe;e[48]!==qe||e[49]!==fe||e[50]!==ge||e[51]!==Ge||e[52]!==Xe||e[53]!==Qe||e[54]!==We||e[55]!==he||e[56]!==pe?(xe=t.jsxs("div",{className:Et,children:[qe,fe,ge,Ge,Xe,Qe,We,he,pe]}),e[48]=qe,e[49]=fe,e[50]=ge,e[51]=Ge,e[52]=Xe,e[53]=Qe,e[54]=We,e[55]=he,e[56]=pe,e[57]=xe):xe=e[57];let je;e[58]!==D||e[59]!==q.length||e[60]!==Se||e[61]!==u||e[62]!==p||e[63]!==_e?(je=q.length===0&&_e.length===0&&Se.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?p("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):p(D==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=D,e[59]=q.length,e[60]=Se,e[61]=u,e[62]=p,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let Oe;return e[69]!==ue||e[70]!==ve?(Oe=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=Oe):Oe=e[71],Oe}function Ps(n){return!n.verified&&!Ve(n._meta)?.verified&&!n.meta?.verified}function Ts(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function zs(n){return n.app_name}function Os(n){return n.app_name}function Ms(n){return n?.items??[]}function $s(n,e){if(n?.hasMore)return e.reduce(Fs,0)}function Fs(n,e){return n+(e?.items?.length??0)}function Bs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Fo({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...a}){const i=B(),c=a.mode??"add",r="agentId"in a?a.agentId:void 0,l="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,u="onAdd"in a&&a.onAdd?a.onAdd:N=>{},m=(N,y,P)=>{r&&E("agent_connection_attached",{agent_id:r,connection_id:N,app_name:y,mode:P})},[f,d]=V.useState(null),[h,C]=V.useState(o),[p,g]=V.useState(!1),{org:j}=oe(),{data:v}=re.useSession(),b=Ft(),w=Yt(),S=nt(),D=N=>{e(!1),S({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:N}})},O=()=>{w.invalidateQueries({predicate:N=>{const y=N.queryKey;return y[1]===j.id&&y[3]==="collection"&&y[4]==="CONNECTIONS"}})},x=async(N,y)=>{E("connection_oauth_succeeded",{connection_id:N,flow:y});const P=new URL(`/api/${j.slug}/mcp/${N}`,window.location.origin);await w.invalidateQueries({queryKey:it.isMCPAuthenticated(P.href,null)}),O()},k=async N=>{d(N.app_name??N.id);try{const P=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await b.create.mutateAsync({title:P,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,M=await et({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:R=>b.update.mutateAsync({id:A,data:{connection_token:R}}).then(()=>{})});if(M.ran&&!M.ok){E("connection_oauth_failed",{connection_id:A,flow:"clone",error:M.error??"no_token"}),H.error(i("virtualMcp.addConnectionDialog.authenticationFailedError",{error:M.error??"no token received"})),await b.delete.mutateAsync(A);return}M.ran&&await x(A,"clone"),m(A,N.app_name??null,"clone"),u(A)}catch(y){console.error("Failed to add connection:",y),H.error(i("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{d(null)}},T=async N=>{if(!(!j||!v?.user?.id)){d(N.id);try{const y=Tn(N,j.id,v.user.id,{remoteIndex:0}),P=y.connection_type==="STDIO",I=!!y.connection_url,A=P&&y.connection_headers&&typeof y.connection_headers=="object"&&"command"in y.connection_headers;if(!I&&!A){H.error(i("virtualMcp.addConnectionDialog.mcpServerConnectionError")),d(null);return}const{id:M}=await b.create.mutateAsync(y),R=await et({connectionId:M,orgId:j.id,orgSlug:j.slug,persistFallback:X=>b.update.mutateAsync({id:M,data:{connection_token:X}}).then(()=>{})});if(R.ran&&!R.ok){E("connection_oauth_failed",{connection_id:M,flow:"connect_new",error:R.error??"no_token"}),H.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:R.error??"no token received"})}),m(M,y.app_name??null,"new"),u(M);return}R.ran?(await x(M,"connect_new"),H.success(i("virtualMcp.addConnectionDialog.connectedAuthenticated"))):H.success(i("virtualMcp.addConnectionDialog.connected")),m(M,y.app_name??null,"new"),u(M)}catch(y){console.error("Failed to connect:",y),H.error(i("virtualMcp.addConnectionDialog.failedToConnect"))}finally{d(null)}}};return t.jsxs(zt,{open:n,onOpenChange:e,children:[t.jsxs(Ot,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Mt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx($t,{className:"text-base font-semibold",children:i(c==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(Dn,{value:h,onChange:C,placeholder:i("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(De,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(As,{mode:c,agentId:r,addedConnectionIds:l,onAdd:u,onCloneAndAdd:k,onConnectAndAdd:T,connectingItemId:f,search:h,onCreateConnection:()=>g(!0),onBrowseNavigate:D,defaultTab:s})})]}),t.jsx(Is,{open:p,onOpenChange:g,onCreated:async N=>{g(!1);const y=await et({connectionId:N,orgId:j.id,orgSlug:j.slug,persistFallback:P=>b.update.mutateAsync({id:N,data:{connection_token:P}}).then(()=>{})});if(y.ran&&!y.ok){E("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:y.error??"no_token"}),H.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:y.error??"no token received"})}),m(N,null,"custom"),u(N),e(!1);return}y.ran&&await x(N,"custom_create"),m(N,null,"custom"),u(N),e(!1)}})]})}const ft=new Map;function Bo(){const{org:n}=oe(),e=Qn(),s=Wn(),o=s.find(g=>g.providerId==="deco"),{data:a,isLoading:i,refetch:c,isFetching:r}=Jt({queryKey:it.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),l=a?.balanceCents??null,u=l!=null?l/100:null,m=V.useRef(new Map);if(l!=null){const g=ft.get(n.id);m.current.get(n.id)&&g!=null&&l>g&&E("credits_topped_up_detected",{organization_id:n.id,delta_cents:l-g,previous_balance_cents:g,new_balance_cents:l}),ft.set(n.id,l),m.current.set(n.id,!0)}const f=!!o,d=l!=null&&l>0,h=l!=null&&l===0,C=l!=null&&l===200,p=s.length>0&&s.every(g=>g.providerId==="deco");return{hasDecoKey:f,decoKeyId:o?.id??null,balanceCents:l,balanceDollars:u,hasCredits:d,isZeroBalance:h,isInitialFreeCredit:C,hasOnlyDecoProvider:p,isLoading:i,isFetching:r,refetch:c}}export{Mo as A,To as C,$o as N,Oo as O,zo as a,Fo as b,os as c,lt as d,Bo as u};
@@ -1 +0,0 @@
1
- import{Z as c,$ as r,_ as I,a3 as k,a4 as m,a0 as E,ba as C,c as u,F as A,n as O,K as y,o as x,e as $,r as Q}from"./index-BX_NPzZv.js";import{W as q}from"./use-mcp-client-NnbFcsGZ.js";import{c as G,u as U}from"./studio-tools-CpBEXDHG.js";c({title:r(),url:r(),icon:r()});c({registries:k(r(),c({enabled:m()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:I(r()).describe("List of MCP app_name or app_id values to hide from the store.")});const g=c({keyId:r(),modelId:r(),title:r().optional()}).nullable();E(["fast","smart","thinking","image","web_search","deep_research"]);E(["fast","smart","thinking"]);const ne=c({tiers:c({fast:g,smart:g,thinking:g,image:g,web_search:g,deep_research:g})});c({tiers:c({fast:g.optional(),smart:g.optional(),thinking:g.optional()})});c({ids:I(r()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});c({demo_mode:m().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:m().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),qa_agent_enabled:m().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:m().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:m().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),cheap_reviewer_model:m().optional().describe("Run the QA Agent and Code Reviewer on a cheaper model than the Super Agent. A review reads a diff and reaches a verdict; it does not need the model that wrote the code. Off by default — turning it on trades some review depth for cost."),auto_assign_report_tasks_to_super_agent:m().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});const M=new Set(["qa_agent_enabled","code_reviewer_enabled"]);function L(e,t){const n=e?.[t];return M.has(t)?n!==!1:n===!0}c({id:r().describe("Brand context ID"),name:r().describe("Company name"),domain:r().describe("Company domain (e.g. example.com)"),overview:r().describe("Company overview / description"),logo:r().nullable().optional().describe("Logo URL"),favicon:r().nullable().optional().describe("Favicon URL"),ogImage:r().nullable().optional().describe("OG image URL"),fonts:c({heading:r().optional().describe("Font family for headings"),body:r().optional().describe("Font family for body text"),code:r().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:c({primary:r().optional().describe("Primary brand color (hex)"),secondary:r().optional().describe("Secondary brand color (hex)"),accent:r().optional().describe("Accent / highlight color (hex)"),background:r().optional().describe("Background color (hex)"),foreground:r().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:I(k(r(),C())).nullable().optional().describe("Brand images"),metadata:k(r(),C()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:r().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:m().optional().describe("Whether this is the default brand for the organization")});const D={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null},F={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function P(e,t){return{queryKey:y.organizationSettings(t),queryFn:async()=>{try{return await G(e,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...D,organizationId:t}}},staleTime:6e4}}function h(e){const t=u.c(6),{org:n}=A();let a;t[0]!==n.id||t[1]!==n.slug?(a=P(n.slug,n.id),t[0]=n.id,t[1]=n.slug,t[2]=a):a=t[2];const o=e;let s;return t[3]!==a||t[4]!==o?(s={...a,select:o},t[3]=a,t[4]=o,t[5]=s):s=t[5],O(s)}function ae(e,t){const n=u.c(3);let a;n[0]!==e||n[1]!==t?(a=P(t,e),n[0]=e,n[1]=t,n[2]=a):a=n[2];const{data:o}=O(a);return o??null}function p(){const e=u.c(9),{org:t}=A(),n=U(),a=x();let o;e[0]!==t||e[1]!==n?(o=async l=>{const d=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:t.id,...l});if(!d)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return d},e[0]=t,e[1]=n,e[2]=o):o=e[2];let s;e[3]!==t||e[4]!==a?(s=l=>{a.setQueryData(y.organizationSettings(t.id),d=>({...d??D,...l}))},e[3]=t,e[4]=a,e[5]=s):s=e[5];let i;return e[6]!==o||e[7]!==s?(i={mutationFn:o,onSuccess:s},e[6]=o,e[7]=s,e[8]=i):i=e[8],$(i)}function K(e){return e?.tiers?{tiers:{fast:e.tiers.fast??null,smart:e.tiers.smart??null,thinking:e.tiers.thinking??null,image:e.tiers.image??null,web_search:e.tiers.web_search??null,deep_research:e.tiers.deep_research??null}}:F}function oe(){const{data:e}=h(W);return e??F}function W(e){return K(e.simple_mode)}function se(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(s,i)=>t.mutate({simple_mode:s},i),a=(s,i)=>t.mutateAsync({simple_mode:s},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let o;return e[3]!==t||e[4]!==n||e[5]!==a?(o={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function ie(){return j("reports_only")}function j(e){const t=u.c(5);let n;t[0]!==e?(n=s=>L(s.flags,e),t[0]=e,t[1]=n):n=t[1];const{data:a}=h(n);let o;return t[2]!==a||t[3]!==e?(o=a??M.has(e),t[2]=a,t[3]=e,t[4]=o):o=t[4],o}function re(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(s,i,l)=>t.mutate({flags:{[s]:i}},l),a=(s,i,l)=>t.mutateAsync({flags:{[s]:i}},l),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let o;return e[3]!==t||e[4]!==n||e[5]!==a?(o={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function B(){const{data:e}=h(Y);return e??null}function Y(e){return e.registry_config}function le(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(s,i)=>t.mutate({registry_config:s},i),a=(s,i)=>t.mutateAsync({registry_config:s},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let o;return e[3]!==t||e[4]!==n||e[5]!==a?(o={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function ce(){const{data:e}=h(Z);return e??null}function Z(e){return e.default_home_agents}function H(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(s,i)=>t.mutate({default_home_agents:s},i),a=(s,i)=>t.mutateAsync({default_home_agents:s},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let o;return e[3]!==t||e[4]!==n||e[5]!==a?(o={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function ue(){const e=u.c(14),{org:t}=A(),n=H(),a=x();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Promise.resolve(),e[0]=o):o=e[0];const s=Q.useRef(o);let i;e[1]!==t.id?(i=y.organizationSettings(t.id),e[1]=t.id,e[2]=i):i=e[2];const l=i;let d;e[3]!==l||e[4]!==a?(d=()=>a.getQueryData(l)?.default_home_agents?.ids??[],e[3]=l,e[4]=a,e[5]=d):d=e[5];const S=d;let b;e[6]!==l||e[7]!==t.slug||e[8]!==a||e[9]!==n?(b=z=>{const R=s.current.then(async()=>{const T=a.getQueryData(l),v=z(T?.default_home_agents?.ids??[]);if(v!==null){a.setQueryData(l,f=>f&&{...f,default_home_agents:{ids:v}});try{await n.mutateAsync({ids:v}),await a.refetchQueries({queryKey:y.homeNextActions(t.slug),type:"active"})}catch(f){const N=f;throw a.setQueryData(l,T),N}}});return s.current=R.catch(J),R},e[6]=l,e[7]=t.slug,e[8]=a,e[9]=n,e[10]=b):b=e[10];const w=b;let _;return e[11]!==w||e[12]!==S?(_={currentIds:S,apply:w},e[11]=w,e[12]=S,e[13]=_):_=e[13],_}function J(){}function de(){const e=u.c(3),{data:t,isPending:n}=h(V),a=t??null;let o;return e[0]!==n||e[1]!==a?(o={mainAgentId:a,isPending:n},e[0]=n,e[1]=a,e[2]=o):o=e[2],o}function V(e){return e.main_agent_id??null}function me(){const e=u.c(7),t=p();let n,a;e[0]!==t?(n=(s,i)=>t.mutate({main_agent_id:s},i),a=(s,i)=>t.mutateAsync({main_agent_id:s},i),e[0]=t,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let o;return e[3]!==t||e[4]!==n||e[5]!==a?(o={...t,mutate:n,mutateAsync:a},e[3]=t,e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function ge(){const e=u.c(5),{org:t}=A(),n=B();let a;e[0]!==t.id?(a=q.REGISTRY(t.id),e[0]=t.id,e[1]=a):a=e[1];const o=a;let s;return e[2]!==o||e[3]!==n?(s=i=>{if(!n)return i===o;const l=n.registries[i];return l?l.enabled:i===o},e[2]=o,e[3]=n,e[4]=s):s=e[4],s}export{ne as S,ie as a,oe as b,ce as c,ue as d,de as e,ge as f,ae as g,me as h,re as i,se as j,B as k,le as l,j as u};
@@ -1 +0,0 @@
1
- import{I as u}from"./use-infinite-scroll-HX67FBA9.js";import{e6 as i}from"./index-BX_NPzZv.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./use-infinite-scroll-HX67FBA9.js";import{e6 as u,b3 as n}from"./index-BX_NPzZv.js";function a(e,r){return u({...e,enabled:!0,suspense:!0,throwOnError:n},s,r)}export{a as u};
@@ -1 +0,0 @@
1
- import{c as K,b as tt,r as et,j as s,m as ot,B as nt}from"./index-BX_NPzZv.js";import{u as vt,a7 as dt,f as yt}from"./agent-icon-kIlAB0pt.js";import{i as Tt}from"./ChevronRight-B029h9tK.js";import{L as jt}from"./label-BjOUR-vy.js";import{B as pt}from"./automation-runs-Dx16PB_p.js";import{S as Nt}from"./switch-C2crWHBg.js";import{T as wt,c as kt,a as Mt}from"./tooltip-5OAV9va2.js";import{V as _t}from"./view-mode-toggle-JAJpC9zQ.js";import"./AlertCircle-D6ElsVdV.js";import"./Tool01-Di6mnWcA.js";import"./ArrowUp-DXifU2jU.js";import"./ArrowLeft-DI46U0hW.js";import"./Tool02-CLeIEJiX.js";import"./XCircle-BifdMVfv.js";import"./ArrowUpRight-g0eFiBAo.js";import"./TrendUp01-__2FFu4c.js";import"./ZapSquare-BvKOVqvS.js";import"./Users03-BxC3kQLt.js";import"./CheckCircle-t3clhDEY.js";import"./Check-DLCFFMhM.js";import"./ChevronDown-tPhI8IAo.js";import"./ChevronUp-DAtg-Gay.js";import"./DotsVertical-BvDICIXQ.js";import"./Stars02-Dv4uoq65.js";import"./Copy01-Bs8ijW_K.js";import"./CpuChip01-BZeEEiQD.js";import"./CreditCard01-B11AWLzQ.js";import"./Globe01-CAof63Y2.js";import"./Settings02-CjNjAID2.js";import"./Eye-mCbEOvrw.js";import"./FilterLines-DMe-a5cU.js";import"./Share07-BAxx8CcC.js";import"./Star01-Cxd5haB_.js";import"./Globe04-COb_HVGf.js";import"./SwitchHorizontal01-D2iVDStv.js";import"./HardDrive-B2TDrqfp.js";import"./Key01-SN67R_2K.js";import"./LayoutLeft-DdADR4a-.js";import"./LinkExternal01-TAXSoD5n.js";import"./LogOut01-p0UdQN5O.js";import"./Monitor01-85SsH_8P.js";import"./Sun-Lm1J2AdL.js";import"./Palette-CulL6Bsw.js";import"./Play-DL9N7Ipe.js";import"./Plus-ENOfz88I.js";import"./SearchLg-BLO7Wadc.js";import"./SearchMd-BlLqg8aQ.js";import"./Shield01-D0oqZU-Q.js";import"./Stars01-C-FlZhrE.js";import"./Trash01-CWg-StRk.js";import"./Upload01-Bf8n3nke.js";import"./User01-D2gKMYdy.js";import"./Users01-Dk5NhvVd.js";import"./XClose-DQy9b0YQ.js";import"./X-ppE9vwRY.js";import"./Zap-DZzsx299.js";import"./select-D8HWXM7B.js";import"./useInfiniteQuery-BCTaWj0n.js";import"./use-infinite-scroll-HX67FBA9.js";import"./use-connection-C17rQDA_.js";import"./use-mcp-client-NnbFcsGZ.js";import"./auth-C5lKsEx7.js";import"./use-virtual-mcp-Da-ST5tm.js";import"./card-BYawXKTU.js";import"./sidebar-DgvBsHW3.js";import"./use-mobile-BzJ1qLXG.js";import"./table-BuKV0wZZ.js";import"./empty-state-BMjKtand.js";import"./use-members-BSS05Lmb.js";import"./use-org-auth-client-drjaSLRi.js";import"./use-clock-tick-K0_e258u.js";import"./use-automations-C00F7rqw.js";import"./studio-tools-CpBEXDHG.js";import"./useSuspenseInfiniteQuery-Dr3M9SY-.js";import"./avatar-wKP7qkNU.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BGGBRB_T.js";import"./dialog-C8xV8nk7.js";import"./tab-id-eS-YXQX4.js";import"./hooks-BeWC9MRd.js";import"./decopilot-sse-pool-Blwb6N9i.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-CipINhjv.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-DCMs6qFa.js";import"./use-decopilot-events-IIr8Tmy-.js";import"./use-organization-settings-DSHsydxG.js";import"./monaco-editor-CLhGJq84.js";import"./spinner-Cs9q3NVD.js";import"./types-DGdL1O_w.js";import"./shell-layout-ByW5qYjw.js";import"./required-auth-layout-CZqMkGhc.js";import"./use-org-sso-DyfZQvaU.js";import"./integration-icon-B6D6sUaT.js";import"./use-navigate-to-agent-CURQ7Iu_.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-BD3M1hjY.js";import"./index-DJ5XYx-a.js";import"./form-DpAMyOYq.js";import"./input-BPEvvKG4.js";import"./file-type-icon-CWDzqYTQ.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Dt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",i=typeof n=="string";if(!r&&!i)return null;const o=r?new Date(t):Ct,a=i?new Date(n):Dt;return Number.isNaN(o.getTime())||Number.isNaN(a.getTime())||r&&i&&a.getTime()<=o.getTime()?null:{start:o,end:a,openStart:!r,openEnd:!i}}function ft(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(Et.has(n)){const r=Rt(e);r&&t.push(r);return}if(St.has(n)){const r=e.matchers;if(Array.isArray(r))for(const i of r)ft(i,t)}}}function Ot(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const n=e.variants;return Array.isArray(n)}function It(e){if(typeof e=="string"){const m=e.trim();if(m.length===0)return null;try{const c=new URL(m).pathname.split("/").filter(Boolean),d=c[c.length-1];if(d)return decodeURIComponent(d)}catch{}return m.length>80?`${m.slice(0,77)}…`:m}if(!e||typeof e!="object")return null;const t=e,n=t.config,i=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,i?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const m of o)if(typeof m=="string"&&m.trim().length>0)return m.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function X(e,t,n,r,i){if(Ot(e)){const o=e.variants,a=e.__resolveType,m=$t.test(a)?"":Pt(r);o.forEach((l,c)=>{if(!l||typeof l!="object")return;const d=l,f=[];if(ft(d.rule,f),f.length===0)return;const x=It(d.value)??(m||n);for(const h of f)i.push({blockKey:t,blockLabel:n,innerPath:m,variantIndex:c,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:a})});for(let l=0;l<o.length;l++){const c=o[l];c&&typeof c=="object"&&X(c.value,t,n,[...r,"variants",l,"value"],i)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)X(e[o],t,n,[...r,o],i);return}if(e&&typeof e=="object")for(const[o,a]of Object.entries(e))o!=="__resolveType"&&X(a,t,n,[...r,o],i)}function Ft(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))X(r,n,Lt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,i)=>{const o=i*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),n}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function ut(e,t){return e.get(t)??Ht}const Bt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ht=["January","February","March","April","May","June","July","August","September","October","November","December"],gt=1440*60*1e3;function B(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function xt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function G(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function Z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function st(e,t){return Math.round((B(e).getTime()-B(t).getTime())/gt)}function Wt(e){const t=(e.getTime()-B(e).getTime())/gt;return Math.min(Math.max(t,0),1)}function it(e,t){return st(e,t)+Wt(e)}function zt(e){const t=Z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const i=[];for(let o=0;o<7;o++)i.push(Z(t,r*7+o));n.push(i)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Ut(e,t){const n=B(e[0]),r=Z(n,7),i=n.getTime(),o=r.getTime(),a=[];for(const c of t){const d=B(c.start),f=B(c.end);if(f.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=f.getTime()>=r.getTime()?Z(r,-1):f,h=st(u,n),g=st(x,u)+1;if(g<=0)continue;const b=Math.max(c.start.getTime(),i),j=Math.min(c.end.getTime(),o),v=it(new Date(b),n),p=Math.max(it(new Date(j),n)-v,0);p<=0||a.push({variant:c,startCol:h,span:g,leftUnits:v,widthUnits:p})}a.sort((c,d)=>c.startCol-d.startCol||d.span-c.span||c.variant.blockKey.localeCompare(d.variant.blockKey));const m=[],l=[];for(const c of a){let d=m.findIndex(f=>f<=c.startCol);d===-1&&(d=m.length,m.push(0)),m[d]=c.startCol+c.span,l.push({...c,lane:d})}return l}const at=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Yt(e,t){const n=e.openStart?t("sandbox.variantCalendar.always"):at.format(e.start),r=e.openEnd?t("sandbox.variantCalendar.ongoing"):at.format(e.end);return`${n} → ${r}`}function Gt(e){const t=K.c(18),{variant:n}=e,r=tt();let i;t[0]!==n.blockLabel?(i=s.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=i):i=t[1];let o;t[2]!==n.innerPath?(o=n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=o):o=t[3];let a;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(a=n.label!==n.blockLabel&&n.label!==n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=a):a=t[7];let m;t[8]!==r||t[9]!==n?(m=Yt(n,r),t[8]=r,t[9]=n,t[10]=m):m=t[10];let l;t[11]!==m?(l=s.jsx("div",{className:"mt-1",children:m}),t[11]=m,t[12]=l):l=t[12];let c;return t[13]!==i||t[14]!==o||t[15]!==a||t[16]!==l?(c=s.jsx(Mt,{children:s.jsxs("div",{className:"text-xs",children:[i,o,a,l]})}),t[13]=i,t[14]=o,t[15]=a,t[16]=l,t[17]=c):c=t[17],c}const lt=16;function Kt(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${lt}px, #000 calc(100% - ${lt}px), ${r})`}function bt(e){const t=K.c(26),{variant:n,color:r,style:i,children:o,fadeStart:a,fadeEnd:m}=e,l=a===void 0?!1:a,c=m===void 0?!1:m;let d;t[0]!==c||t[1]!==l?(d=Kt(l,c),t[0]=c,t[1]=l,t[2]=d):d=t[2];const f=d;let u;t[3]!==l?(u=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=u):u=t[4];let x;t[5]!==c?(x=c&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=c,t[6]=x):x=t[6];let h;t[7]!==f?(h=f&&{maskImage:f,WebkitMaskImage:f},t[7]=f,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==i||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...i},t[9]=r.bg,t[10]=r.text,t[11]=i,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==o?(b=s.jsx("span",{className:"truncate",children:o}),t[16]=o,t[17]=b):b=t[17];let j;t[18]!==g||t[19]!==b?(j=s.jsx(wt,{asChild:!0,children:s.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=j):j=t[20];let v;t[21]!==n?(v=s.jsx(Gt,{variant:n}),t[21]=n,t[22]=v):v=t[22];let p;return t[23]!==v||t[24]!==j?(p=s.jsxs(kt,{children:[j,v]}),t[23]=v,t[24]=j,t[25]=p):p=t[25],p}function or(e){const t=K.c(72),{decofile:n}=e,r=tt(),[i,o]=et.useState("calendar"),[a,m]=et.useState(Xt),[l,c]=et.useState(!1);let d,f,u;if(t[0]!==n||t[1]!==l){const P=Ft(n);d=P.filter(Qt).length,u=l?P:P.filter(qt),f=Vt(u.map(Jt)),t[0]=n,t[1]=l,t[2]=d,t[3]=f,t[4]=u}else d=t[2],f=t[3],u=t[4];const x=f;let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>m(xt(new Date)),t[5]=h):h=t[5];const g=h;let b;t[6]!==i?(b=()=>m(P=>i==="calendar"?G(P,-1):G(P,-3)),t[6]=i,t[7]=b):b=t[7];const j=b;let v;t[8]!==i?(v=()=>m(P=>i==="calendar"?G(P,1):G(P,3)),t[8]=i,t[9]=v):v=t[9];const p=v;let y;t[10]!==r?(y=r("sandbox.variantCalendar.today"),t[10]=r,t[11]=y):y=t[11];let T;t[12]!==y?(T=s.jsx(nt,{variant:"outline",size:"sm",onClick:g,children:y}),t[12]=y,t[13]=T):T=t[13];let w;t[14]!==r?(w=r("sandbox.variantCalendar.previous"),t[14]=r,t[15]=w):w=t[15];let D;t[16]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(vt,{size:16}),t[16]=D):D=t[16];let k;t[17]!==j||t[18]!==w?(k=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:j,"aria-label":w,children:D}),t[17]=j,t[18]=w,t[19]=k):k=t[19];let M;t[20]!==r?(M=r("sandbox.variantCalendar.next"),t[20]=r,t[21]=M):M=t[21];let S;t[22]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Tt,{size:16}),t[22]=S):S=t[22];let A;t[23]!==p||t[24]!==M?(A=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:p,"aria-label":M,children:S}),t[23]=p,t[24]=M,t[25]=A):A=t[25];const $=ht[a.getMonth()];let C;t[26]!==a?(C=a.getFullYear(),t[26]=a,t[27]=C):C=t[27];let _;t[28]!==$||t[29]!==C?(_=s.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[$," ",C]}),t[28]=$,t[29]=C,t[30]=_):_=t[30];let N;t[31]!==A||t[32]!==_||t[33]!==T||t[34]!==k?(N=s.jsxs("div",{className:"flex items-center gap-2",children:[T,k,A,_]}),t[31]=A,t[32]=_,t[33]=T,t[34]=k,t[35]=N):N=t[35];let L;t[36]!==d||t[37]!==l||t[38]!==r?(L=d>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Nt,{id:"show-ongoing",checked:l,onCheckedChange:c}),s.jsx(jt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:r("sandbox.variantCalendar.showOngoing",{count:d})})]}),t[36]=d,t[37]=l,t[38]=r,t[39]=L):L=t[39];let H;t[40]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(dt,{}),t[40]=H):H=t[40];let F;t[41]!==r?(F=r("sandbox.variantCalendar.calendarMode"),t[41]=r,t[42]=F):F=t[42];let E;t[43]!==F?(E={value:"calendar",icon:H,label:F},t[43]=F,t[44]=E):E=t[44];let W;t[45]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(yt,{}),t[45]=W):W=t[45];let R;t[46]!==r?(R=r("sandbox.variantCalendar.timelineMode"),t[46]=r,t[47]=R):R=t[47];let O;t[48]!==R?(O={value:"timeline",icon:W,label:R},t[48]=R,t[49]=O):O=t[49];let I;t[50]!==E||t[51]!==O?(I=[E,O],t[50]=E,t[51]=O,t[52]=I):I=t[52];let V;t[53]!==I||t[54]!==i?(V=s.jsx(_t,{value:i,onValueChange:o,options:I}),t[53]=I,t[54]=i,t[55]=V):V=t[55];let z;t[56]!==L||t[57]!==V?(z=s.jsxs("div",{className:"flex items-center gap-4",children:[L,V]}),t[56]=L,t[57]=V,t[58]=z):z=t[58];let U;t[59]!==N||t[60]!==z?(U=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[N,z]}),t[59]=N,t[60]=z,t[61]=U):U=t[61];let Y;t[62]!==x||t[63]!==a||t[64]!==d||t[65]!==l||t[66]!==u||t[67]!==i?(Y=u.length===0?s.jsx(Zt,{hiddenOngoing:l?0:d}):i==="calendar"?s.jsx(ee,{monthStart:a,variants:u,colorMap:x}):s.jsx(oe,{monthStart:a,variants:u,colorMap:x}),t[62]=x,t[63]=a,t[64]=d,t[65]=l,t[66]=u,t[67]=i,t[68]=Y):Y=t[68];let q;return t[69]!==U||t[70]!==Y?(q=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[U,Y]}),t[69]=U,t[70]=Y,t[71]=q):q=t[71],q}function Jt(e){return e.blockKey}function qt(e){return!e.openEnd}function Qt(e){return e.openEnd}function Xt(){return xt(new Date)}function Zt(e){const t=K.c(4),{hiddenOngoing:n}=e,r=n===void 0?0:n,i=tt();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(dt,{size:24,className:"text-muted-foreground/60"}),t[0]=o):o=t[0];let a;return t[1]!==r||t[2]!==i?(a=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[o,r>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noDatedVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.hiddenOngoingVariants",{count:r})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noScheduledVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=r,t[2]=i,t[3]=a):a=t[3],a}const rt=20,ct=2,mt=28,te=6;function ee(e){const t=K.c(17),{monthStart:n,variants:r,colorMap:i}=e;let o,a,m,l,c;if(t[0]!==i||t[1]!==n||t[2]!==r){const u=zt(n),x=B(new Date);o=pt,c="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:Bt.map(re)}),t[8]=m):m=t[8],l=u.map((h,g)=>{const b=Ut(h,r),j=b.reduce(ne,0),v=mt+j*(rt+ct)+8;return s.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:v},children:[h.map((p,y)=>{const T=p.getMonth()===n.getMonth(),w=p.getTime()===x.getTime();return s.jsx("div",{className:ot("border-r last:border-r-0 px-2 pt-1.5 text-xs",T?"bg-background":"bg-muted/30 text-muted-foreground"),children:s.jsx("span",{className:ot("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",w&&"bg-primary text-primary-foreground font-semibold"),children:p.getDate()})},y)}),b.map((p,y)=>{const T=ut(i,p.variant.blockKey),w=mt+p.lane*(rt+ct),D=p.leftUnits/7*100,k=p.widthUnits/7*100,M=p.variant.openStart&&g===0,S=p.variant.openEnd&&g===u.length-1;return s.jsxs(bt,{variant:p.variant,color:T,fadeStart:M,fadeEnd:S,style:{top:w,left:`calc(${D}% + 2px)`,width:`calc(${k}% - 4px)`,minWidth:te,height:rt},children:[p.variant.blockLabel,p.variant.label!==p.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",p.variant.label]})]},`${g}-${y}`)})]},g)}),t[0]=i,t[1]=n,t[2]=r,t[3]=o,t[4]=a,t[5]=m,t[6]=l,t[7]=c}else o=t[3],a=t[4],m=t[5],l=t[6],c=t[7];let d;t[9]!==a||t[10]!==m||t[11]!==l?(d=s.jsxs("div",{className:a,children:[m,l]}),t[9]=a,t[10]=m,t[11]=l,t[12]=d):d=t[12];let f;return t[13]!==o||t[14]!==c||t[15]!==d?(f=s.jsx(o,{className:c,children:d}),t[13]=o,t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function ne(e,t){return Math.max(e,t.lane+1)}function re(e){return s.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const Q=4,se=32,J=240;function oe(e){const t=K.c(23),{monthStart:n,variants:r,colorMap:i}=e,o=n,a=G(n,Q),m=new Date,l=new Map;for(const _ of r){const N=l.get(_.blockKey)??[];N.push(_),l.set(_.blockKey,N)}const c=Array.from(l.entries()).sort(le),d=a.getTime()-o.getTime(),f=_=>(Math.max(o.getTime(),Math.min(a.getTime(),_.getTime()))-o.getTime())/d*100;let u;t[0]!==o?(u=(_,N)=>G(o,N),t[0]=o,t[1]=u):u=t[1];const x=Array.from({length:Q},u),h=m.getTime()>=o.getTime()&&m.getTime()<=a.getTime()?f(m):null,g=tt(),b=pt,j="flex-1 min-h-0",v="min-w-[900px] relative";let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p={width:J},t[2]=p):p=t[2];let y;t[3]!==g?(y=g("sandbox.variantCalendar.variantBlock"),t[3]=g,t[4]=y):y=t[4];let T;t[5]!==y?(T=s.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:p,children:y}),t[5]=y,t[6]=T):T=t[6];let w;t[7]===Symbol.for("react.memo_cache_sentinel")?(w={gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},t[7]=w):w=t[7];const D=x.map(ae);let k;t[8]!==D?(k=s.jsx("div",{className:"flex-1 grid",style:w,children:D}),t[8]=D,t[9]=k):k=t[9];let M;t[10]!==T||t[11]!==k?(M=s.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[T,k]}),t[10]=T,t[11]=k,t[12]=M):M=t[12];let S;t[13]!==g||t[14]!==h?(S=h!==null&&s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${J}px + (100% - ${J}px) * ${h} / 100)`},children:s.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:g("sandbox.variantCalendar.todayLabel")})}),t[13]=g,t[14]=h,t[15]=S):S=t[15];const A=c.map(_=>{const[N,L]=_,H=ut(i,N),F=L[0]?.blockLabel??N;return s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:s.jsx("div",{className:"px-3 truncate",style:{width:J},children:F})}),L.map((E,W)=>s.jsxs("div",{className:"flex border-b items-center",style:{height:se},children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:J},children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:H.bg}}),s.jsx("span",{className:"truncate text-foreground/80",children:E.label})]}),s.jsxs("div",{className:"relative flex-1 h-full",children:[s.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},children:x.map(ie)}),(()=>{const R=Math.max(E.start.getTime(),o.getTime()),O=Math.min(E.end.getTime(),a.getTime());if(O<=R)return null;const I=f(new Date(R)),V=f(new Date(O))-I;return s.jsx(bt,{variant:E,color:H,fadeStart:E.openStart,fadeEnd:E.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${I}%`,width:`calc(${V}% - 2px)`,height:22},children:E.label})})()]})]},W))]},N)});let $;t[16]!==M||t[17]!==S||t[18]!==A?($=s.jsxs("div",{className:v,children:[M,S,A]}),t[16]=M,t[17]=S,t[18]=A,t[19]=$):$=t[19];let C;return t[20]!==b||t[21]!==$?(C=s.jsx(b,{className:j,children:$}),t[20]=b,t[21]=$,t[22]=C):C=t[22],C}function ie(e,t){return s.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function ae(e,t){return s.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ht[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function le(e,t){return e[0].localeCompare(t[0])}export{or as VariantCalendar};