decocms 4.491.3 → 4.493.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 (510) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-CO9ka_yi.js → ActiveShapeUtils-5xWWHSL1.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-C3fpFT5I.js → AlertCircle-B5gBB9h_.js} +1 -1
  3. package/dist/client/assets/{AreaChart-BvjH9pmK.js → AreaChart-BTyzss2a.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-C1IFj0Ic.js → ArrowLeft-B7455tPl.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DR-Jhbl1.js → ArrowUp-CP6XCJnB.js} +1 -1
  6. package/dist/client/assets/{BarChart-CJ_IiQ71.js → BarChart-Ch51NWPz.js} +1 -1
  7. package/dist/client/assets/{Building02-uHT4KVtK.js → Building02-BZItaEYx.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-zte0bRec.js → CategoricalChart-DqN5Jy74.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-BKHstO_Q.js → CheckCircle-C3CiaCW4.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-DAO6R1Op.js → ChevronSelectorVertical-DIPs2sw-.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-CceLPRrE.js → ChevronUp-nynZHATg.js} +1 -1
  12. package/dist/client/assets/{Copy01-Dx3ZT0bA.js → Copy01-CdRMK9o7.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-Dko0T335.js → CreditCard01-DVQTLvKO.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-aHYBPlin.js → DotsVertical-3XBYz4yU.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-B8QqSSmC.js → ErrorBarContext-Csmpy3UX.js} +1 -1
  16. package/dist/client/assets/{Globe04-BDe-0jS0.js → Globe04-DoxNod_i.js} +1 -1
  17. package/dist/client/assets/{Image01-Cxa392ef.js → Image01-DdBetDCI.js} +1 -1
  18. package/dist/client/assets/{Key01-BHiUNW_5.js → Key01-DcSonP-G.js} +1 -1
  19. package/dist/client/assets/{Link01-BRZRc4wX.js → Link01-3BacRGrf.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-kK_na_OL.js → LinkBroken01-BZFZ6N-h.js} +1 -1
  21. package/dist/client/assets/{Monitor01-Cl4JLYVa.js → Monitor01-DU19-CHk.js} +1 -1
  22. package/dist/client/assets/{Play-CzTcIQz_.js → Play-B7i_-ibU.js} +1 -1
  23. package/dist/client/assets/{Plus-nldAzVeQ.js → Plus-XYNDZJ4s.js} +1 -1
  24. package/dist/client/assets/{SearchMd-BiZNveM1.js → SearchMd-BFitEH5z.js} +1 -1
  25. package/dist/client/assets/{Sector-DOgIwKt7.js → Sector-CYOl8Efm.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-o0DdjJD9.js → ShoppingBag01-Ci8H67G0.js} +1 -1
  27. package/dist/client/assets/{Sun-BYGxydmh.js → Sun-D1Mdg8Cq.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-Bx3d-jDI.js → SwitchHorizontal01-BHr8jCjb.js} +1 -1
  29. package/dist/client/assets/{Tool01-Blw6F5iV.js → Tool01-DQnW-zjg.js} +1 -1
  30. package/dist/client/assets/{Trash01-DAoFHSpp.js → Trash01-DZ8laRwu.js} +1 -1
  31. package/dist/client/assets/{Upload01-CtKBhqsv.js → Upload01-CrRTpeMX.js} +1 -1
  32. package/dist/client/assets/{User01-Awky2MVQ.js → User01-9bZ-cKa7.js} +1 -1
  33. package/dist/client/assets/{UserSquare-BMOlWqCu.js → UserSquare-CuRnLJZ6.js} +1 -1
  34. package/dist/client/assets/{Users01-D7ZFKC4W.js → Users01-cUGZjxDe.js} +1 -1
  35. package/dist/client/assets/{XAxis-BLZT-vtl.js → XAxis-DDG3qYHW.js} +1 -1
  36. package/dist/client/assets/{XClose-DBJ7sD1T.js → XClose-DjFCAP5F.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-CQckFmS9.js → ZoomOut-BggitXDv.js} +1 -1
  38. package/dist/client/assets/{access-gate-DEyXiK2N.js → access-gate-Cu8JZecz.js} +1 -1
  39. package/dist/client/assets/add-connection-dialog-DBnkMFp9.js +1 -0
  40. package/dist/client/assets/agent-analytics-B1wni80p.js +2 -0
  41. package/dist/client/assets/agent-app-DY95_zYY.js +1 -0
  42. package/dist/client/assets/agent-assets-B18leh3z.js +1 -0
  43. package/dist/client/assets/agent-automation-CWXHzvtY.js +20 -0
  44. package/dist/client/assets/agent-automations-C0tbQ1R9.js +1 -0
  45. package/dist/client/assets/agent-connect-sources-CKiU44XZ.js +1 -0
  46. package/dist/client/assets/agent-deck-C8T7Jj3o.js +1 -0
  47. package/dist/client/assets/agent-e2e-LdVq-drf.js +1 -0
  48. package/dist/client/assets/agent-experiments-ClDYYnWj.js +1 -0
  49. package/dist/client/assets/agent-file-CjZFekiU.js +1 -0
  50. package/dist/client/assets/agent-hosting-zrg11_-A.js +1 -0
  51. package/dist/client/assets/agent-icon-BewGjsar.js +1 -0
  52. package/dist/client/assets/agent-library-BAUPDsyD.js +1 -0
  53. package/dist/client/assets/agent-library-file-CHlnBg90.js +1 -0
  54. package/dist/client/assets/agent-monitor-CKpvG_Lm.js +1 -0
  55. package/dist/client/assets/agent-overview-Di3y0uXp.js +1 -0
  56. package/dist/client/assets/agent-settings-C-kNuurj.js +1 -0
  57. package/dist/client/assets/{agent-site-editor-Dv8qh0xB.js → agent-site-editor-16duoEZY.js} +5 -5
  58. package/dist/client/assets/agent-site-editor-code-BUJylH9_.js +2 -0
  59. package/dist/client/assets/{agent-site-editor-content-EotWUMUT.js → agent-site-editor-content-B64VGP55.js} +6 -6
  60. package/dist/client/assets/agent-site-editor-preview-DIihiuj0.js +518 -0
  61. package/dist/client/assets/agent-view-SjLiGW-o.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-Bf5Bn5K4.js → agent-view-guard-CoiTTfLB.js} +1 -1
  63. package/dist/client/assets/agents-list-CFQQdh1t.js +1 -0
  64. package/dist/client/assets/{ai-providers-VCM02Z-N.js → ai-providers-CTzk8MgQ.js} +2 -2
  65. package/dist/client/assets/{alert-CGA3Ty0D.js → alert-Dyx5I-Y3.js} +1 -1
  66. package/dist/client/assets/{alert-dialog-kjq4dW3k.js → alert-dialog-BXEG2ySJ.js} +2 -2
  67. package/dist/client/assets/{analytics-sections-Cjkr8Muu.js → analytics-sections-BeEYJnmv.js} +1 -1
  68. package/dist/client/assets/api-keys-CH5G5_Qp.js +1 -0
  69. package/dist/client/assets/api-keys-JMxYvHms.js +1 -0
  70. package/dist/client/assets/app-editor-DqEmpUhy.js +1 -0
  71. package/dist/client/assets/asset-utils-Euq8y8zU.js +1 -0
  72. package/dist/client/assets/{auth-Cps-90jQ.js → auth-Dwu4WH32.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-Batt4Wp1.js → auth-catchall-D9Xe8fii.js} +1 -1
  74. package/dist/client/assets/auth-entry-CCIy-Mhs.js +1 -0
  75. package/dist/client/assets/{auth-split-layout-lt03dL19.js → auth-split-layout-DXUbMgnq.js} +1 -1
  76. package/dist/client/assets/authenticate-and-persist-oauth-BEdNWkUl.js +1 -0
  77. package/dist/client/assets/{automation-list-row-C9YrfX3o.js → automation-list-row-Du4blVfm.js} +1 -1
  78. package/dist/client/assets/automation-runs-BsFnE3d4.js +1 -0
  79. package/dist/client/assets/automations-Cpff9O08.js +1 -0
  80. package/dist/client/assets/autosend-BaKgBZDQ.js +1 -0
  81. package/dist/client/assets/{avatar-TL9HUab0.js → avatar-BEl6nltF.js} +1 -1
  82. package/dist/client/assets/{badge-CKM84j2S.js → badge-DFdotQFQ.js} +1 -1
  83. package/dist/client/assets/{block-document-w2kAyl6z.js → block-document-BlUE8Eks.js} +3 -3
  84. package/dist/client/assets/{blocks-preview-workspace-context-PwUYRK7b.js → blocks-preview-workspace-context-DSOKao_H.js} +1 -1
  85. package/dist/client/assets/{blog-schema-Cx6xDQRb.js → blog-schema-B_yGbArL.js} +1 -1
  86. package/dist/client/assets/{board-analytics-DT3f2AVB.js → board-analytics-UmA2i-Sq.js} +1 -1
  87. package/dist/client/assets/buckets-CJ11qX_5.js +1 -0
  88. package/dist/client/assets/{build-improve-prompt-doc-R0amEUpn.js → build-improve-prompt-doc-QS7b7hRr.js} +1 -1
  89. package/dist/client/assets/{calendar-DaaBbvOH.js → calendar-CT7cVD7N.js} +1 -1
  90. package/dist/client/assets/capability-load-error-yZzl8b80.js +1 -0
  91. package/dist/client/assets/category-editor-CTdWf8oW.js +1 -0
  92. package/dist/client/assets/{chart-DZbYggl3.js → chart-C-785ZEj.js} +1 -1
  93. package/dist/client/assets/chat-context-DJGYyGlB.js +39 -0
  94. package/dist/client/assets/chat-draft-DbBgaLY_.js +1 -0
  95. package/dist/client/assets/{checkbox-B2kVXKBD.js → checkbox-DmaIcPoL.js} +1 -1
  96. package/dist/client/assets/choose-editor-CirVpDXw.js +1 -0
  97. package/dist/client/assets/claim-phase-copy-BnoHLlrM.js +1 -0
  98. package/dist/client/assets/{cli-auth-success-DtMJnqjK.js → cli-auth-success-XcMuETZQ.js} +1 -1
  99. package/dist/client/assets/{client-icons-D3ZaOjXM.js → client-icons-DLhjrwzL.js} +1 -1
  100. package/dist/client/assets/{collapsible-vN3Y9B-p.js → collapsible-CgZ4-XuF.js} +1 -1
  101. package/dist/client/assets/collection-detail-gYU6aRKx.js +1 -0
  102. package/dist/client/assets/collection-display-button-YyNX5Efp.js +1 -0
  103. package/dist/client/assets/{collection-search-BoB9COGX.js → collection-search-BC0JMMNp.js} +1 -1
  104. package/dist/client/assets/{collection-table-wrapper-CxJ6Bp-f.js → collection-table-wrapper-DFn43mg0.js} +1 -1
  105. package/dist/client/assets/{collection-tabs-Cw7XLgNG.js → collection-tabs-DeQ7zbGh.js} +1 -1
  106. package/dist/client/assets/column-rules-b8eo73o4.js +3 -0
  107. package/dist/client/assets/{combobox-PSOtDaya.js → combobox-DeXU4vSR.js} +1 -1
  108. package/dist/client/assets/command-D2QlwSrW.js +1 -0
  109. package/dist/client/assets/{companion-mcps-section-gXkjR-XD.js → companion-mcps-section-DtzaYg0J.js} +1 -1
  110. package/dist/client/assets/config-DP6xvcYW.js +1 -0
  111. package/dist/client/assets/{connect-Dn2pI97X.js → connect-ClKIaF8K.js} +3 -3
  112. package/dist/client/assets/connect-layout-CyyX0xPx.js +1 -0
  113. package/dist/client/assets/{connection-FKmTBjan.js → connection-BjzBHJVc.js} +1 -1
  114. package/dist/client/assets/connection-card-BVD8Ppl9.js +1 -0
  115. package/dist/client/assets/connection-detail-DfYF7TR9.js +1 -0
  116. package/dist/client/assets/connection-form-helpers-5EXuPZ4G.js +1 -0
  117. package/dist/client/assets/connections-D1tC1_hB.js +1 -0
  118. package/dist/client/assets/context-DzTTGbcd.js +1 -0
  119. package/dist/client/assets/{context-menu-BLhcVqO0.js → context-menu-Can7-rLt.js} +1 -1
  120. package/dist/client/assets/{core.esm-DbclD67Y.js → core.esm-Cvui6jds.js} +1 -1
  121. package/dist/client/assets/create-organization-dialog-CD66iA3E.js +1 -0
  122. package/dist/client/assets/daily-pulse-Bz92WYIP.js +1 -0
  123. package/dist/client/assets/device-hint-DZcinuip.js +1 -0
  124. package/dist/client/assets/discover-BRALl0mU.js +1 -0
  125. package/dist/client/assets/domain-settings-DiitZO4z.js +1 -0
  126. package/dist/client/assets/{drawer-CXs6iEYK.js → drawer-BPz4t5dt.js} +1 -1
  127. package/dist/client/assets/{editor-CPkkN1Zr.js → editor-2jNHgdUN.js} +3 -3
  128. package/dist/client/assets/{empty-state-D45gZaZ-.js → empty-state-D8iC8fkc.js} +1 -1
  129. package/dist/client/assets/{empty-state-DnQ_qEjI.js → empty-state-Zf0MeIMv.js} +1 -1
  130. package/dist/client/assets/{extract-connection-data-Q_j_fmQx.js → extract-connection-data-BTBLhbEe.js} +1 -1
  131. package/dist/client/assets/{feature-gate-CFL9eB8c.js → feature-gate-Dhf-LwS1.js} +1 -1
  132. package/dist/client/assets/feature-paywall-CHcwEHRJ.js +1 -0
  133. package/dist/client/assets/file-explorer-BhYSdjXu.js +2 -0
  134. package/dist/client/assets/{file-preview-DT-0IR-r.js → file-preview-DvxQuX3P.js} +1 -1
  135. package/dist/client/assets/file-share-button-C1EB3dOc.js +3 -0
  136. package/dist/client/assets/{file-type-icon-Du5QihE_.js → file-type-icon-DzYK4NqY.js} +1 -1
  137. package/dist/client/assets/flat-project-D2zrr-4_.js +1 -0
  138. package/dist/client/assets/{folder-icon-DXEgDwxo.js → folder-icon-C_Jv4E7N.js} +2 -2
  139. package/dist/client/assets/{form-BBtB5neb.js → form-BCYpCYIL.js} +1 -1
  140. package/dist/client/assets/general-D8kDc8NB.js +1 -0
  141. package/dist/client/assets/home-CiV29kW5.js +1 -0
  142. package/dist/client/assets/{icon-button-BiR7Hy07.js → icon-button-sHj7Q6Fp.js} +1 -1
  143. package/dist/client/assets/index-6UUldwCZ.js +1 -0
  144. package/dist/client/assets/index-BVmIdqXu.js +1 -0
  145. package/dist/client/assets/{index-C-3lNbMm.js → index-BhyQWjoM.js} +6 -6
  146. package/dist/client/assets/{index-D_7jfHk6.js → index-Bm9FTdjr.js} +43 -43
  147. package/dist/client/assets/{index-DWUcsrDk.js → index-CspW_Aw1.js} +2 -2
  148. package/dist/client/assets/{index-BvwJHqHQ.js → index-CuOTEpMz.js} +2 -2
  149. package/dist/client/assets/{index-D1CuHcEn.js → index-D2iZ6syL.js} +1 -1
  150. package/dist/client/assets/{index-CmC6v99h.js → index-DmfwrRER.js} +5 -5
  151. package/dist/client/assets/{index-CoDuotD7.js → index-GgiP6YIr.js} +1 -1
  152. package/dist/client/assets/{index-KqttCHw1.js → index-KCu_K9eF.js} +1 -1
  153. package/dist/client/assets/{index-CeMEs5dC.js → index-YEKHk89C.js} +2 -2
  154. package/dist/client/assets/{index-redirect-_9q4bmDQ.js → index-redirect-C_FoZNOn.js} +1 -1
  155. package/dist/client/assets/{index-DltLvtZg.js → index-s6P2p4h7.js} +1 -1
  156. package/dist/client/assets/{index-D8mID9PZ.js → index-wABYnbOM.js} +1 -1
  157. package/dist/client/assets/{infiniteQueryObserver-DG8sBe4B.js → infiniteQueryObserver-zxl9Rj5F.js} +1 -1
  158. package/dist/client/assets/infra-billing-heizZxEC.js +1 -0
  159. package/dist/client/assets/{input-DQp1LVsq.js → input-BkQDO0Ef.js} +5 -5
  160. package/dist/client/assets/input-Bvc3OT4I.js +1 -0
  161. package/dist/client/assets/{integration-icon-BM3EOzpn.js → integration-icon-DoYtKqdf.js} +1 -1
  162. package/dist/client/assets/jira-icon-BeORJXLw.js +1 -0
  163. package/dist/client/assets/{label-DxOPcXJe.js → label-BL2W0Pcn.js} +1 -1
  164. package/dist/client/assets/{layout-bHPl4zx9.js → layout-vy24lHLj.js} +1 -1
  165. package/dist/client/assets/legacy-agents-deep-B5L4MOtR.js +1 -0
  166. package/dist/client/assets/{legacy-main-redirect-z5zSFE1g.js → legacy-main-redirect-Pp-THt9D.js} +1 -1
  167. package/dist/client/assets/library-DZte0T9-.js +1 -0
  168. package/dist/client/assets/{library-tab-Z6y7ewdW.js → library-tab-2usQWRYi.js} +3 -3
  169. package/dist/client/assets/login-CwsPhEpC.js +1 -0
  170. package/dist/client/assets/{markdown-6zdu9t3J.js → markdown-B3PJYX-4.js} +3 -3
  171. package/dist/client/assets/{mcp-app-renderer-D5zA7BfR.js → mcp-app-renderer-BLT3VM-G.js} +1 -1
  172. package/dist/client/assets/mcp-oauth-4gmyTyah.js +1 -0
  173. package/dist/client/assets/mcp-oauth-BTa4N28L.js +1 -0
  174. package/dist/client/assets/members-Dba6HROK.js +1 -0
  175. package/dist/client/assets/{memory-C67vpugN.js → memory-DAV2Pmj2.js} +2 -2
  176. package/dist/client/assets/{mini-report-page-jD0aWOQw.js → mini-report-page-B9WE5YW-.js} +1 -1
  177. package/dist/client/assets/{mock-board-DX11vRZx.js → mock-board-D9i0Vi9l.js} +1 -1
  178. package/dist/client/assets/{monaco-editor-BfKI4VlA.js → monaco-editor-DANiMmsL.js} +2 -2
  179. package/dist/client/assets/{monitoring-stats-row-DB55KTTw.js → monitoring-stats-row-B1hQA0Lu.js} +1 -1
  180. package/dist/client/assets/{multi-select-DVylmGoB.js → multi-select-BJgtMlC2.js} +1 -1
  181. package/dist/client/assets/mustache-GMlXm0yl.js +4 -0
  182. package/dist/client/assets/new-project-dialog-C-thpPQ-.js +1 -0
  183. package/dist/client/assets/{oauth-callback-Cqdj0zbM.js → oauth-callback-DZwrYGu7.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-ai-provider-Cwy6YGO7.js → oauth-callback-ai-provider-B7d3QWP4.js} +1 -1
  185. package/dist/client/assets/onboarding-DK0DTXli.js +1 -0
  186. package/dist/client/assets/openai-conversation-BMdPtMrp.js +3 -0
  187. package/dist/client/assets/optimistic-project-sidebar-views-B4v48qUS.js +1 -0
  188. package/dist/client/assets/{organization-choice-CG-C6xsW.js → organization-choice-BIWVNvRP.js} +1 -1
  189. package/dist/client/assets/orgs-D5AZUxP6.js +1 -0
  190. package/dist/client/assets/{page-seo-form-C6V8K2um.js → page-seo-form-gaHyPBMV.js} +1 -1
  191. package/dist/client/assets/pair-DXTFiJNl.js +48 -0
  192. package/dist/client/assets/plan-ladder-BUDRjzbj.js +1 -0
  193. package/dist/client/assets/{popover-C2vJrXky.js → popover-jNB4XciF.js} +1 -1
  194. package/dist/client/assets/post-calendar-D8EAMZvz.js +1 -0
  195. package/dist/client/assets/post-editor-BQa57f7n.js +2 -0
  196. package/dist/client/assets/preview-content-B6K8Jkd_.js +1 -0
  197. package/dist/client/assets/preview-dialog-Dl22mWwN.js +1 -0
  198. package/dist/client/assets/{preview-panel-CaQ4Pbpr.js → preview-panel-LWLVsrdx.js} +1 -1
  199. package/dist/client/assets/product-picker-dialog-RglVwX1Q.js +1 -0
  200. package/dist/client/assets/profile-BWcfZQ7V.js +1 -0
  201. package/dist/client/assets/project-app-view-qeunpPC-.js +1 -0
  202. package/dist/client/assets/project-feed-Dm758F3_.js +1 -0
  203. package/dist/client/assets/{project-icon-DU1uywdD.js → project-icon-D2vCEWQy.js} +1 -1
  204. package/dist/client/assets/project-reports-6TMbK6-4.js +1 -0
  205. package/dist/client/assets/project-tasks-3mU9NrZf.js +1 -0
  206. package/dist/client/assets/projects-DyGysCyv.js +1 -0
  207. package/dist/client/assets/{projects-empty-state-BsW_dfGL.js → projects-empty-state-BuMMPopD.js} +1 -1
  208. package/dist/client/assets/prompts-BrbpQc3X.js +1 -0
  209. package/dist/client/assets/record-editor-hwH5zZn-.js +1 -0
  210. package/dist/client/assets/redirect-editor-Dc4HBQwl.js +1 -0
  211. package/dist/client/assets/{reports-CMClJ0_S.js → reports-D7gOlgZm.js} +2 -2
  212. package/dist/client/assets/reports-DPHZG4Rx.js +1 -0
  213. package/dist/client/assets/reports-onboarding-DGmwN9iV.js +1 -0
  214. package/dist/client/assets/reports-tab-Bb7ApLUW.js +2 -0
  215. package/dist/client/assets/repositories-GlkzQQVy.js +1 -0
  216. package/dist/client/assets/repository-binding-D2wL-4Vr.js +1 -0
  217. package/dist/client/assets/repository-import-picker-DtM7QfYh.js +1 -0
  218. package/dist/client/assets/repository-picker-28zwGBgK.js +1 -0
  219. package/dist/client/assets/require-capability-Dm4XTD9Y.js +1 -0
  220. package/dist/client/assets/{required-auth-layout-CDif9NZC.js → required-auth-layout-CbgA2xIU.js} +1 -1
  221. package/dist/client/assets/reset-password-15IQ61HR.js +1 -0
  222. package/dist/client/assets/{resizable-CIqqPf7O.js → resizable-CGWosOTw.js} +1 -1
  223. package/dist/client/assets/{resolve-tab-icon-S311kwwr.js → resolve-tab-icon-BEIojUgL.js} +1 -1
  224. package/dist/client/assets/review-settings-BAqWAPVV.js +1 -0
  225. package/dist/client/assets/{rich-text-link-control-CMeXviAY.js → rich-text-link-control-CE4nCWAz.js} +1 -1
  226. package/dist/client/assets/roles-etRZjRQM.js +1 -0
  227. package/dist/client/assets/route-BCQ2a7UE.js +1 -0
  228. package/dist/client/assets/route-CdaJ86mX.js +1 -0
  229. package/dist/client/assets/route-DCLsEeq7.js +1 -0
  230. package/dist/client/assets/{runnable-block-editor-BWSWYcJ-.js → runnable-block-editor-xVvcrNA2.js} +4 -4
  231. package/dist/client/assets/sandbox-lifecycle-context-BKjyczlw.js +1 -0
  232. package/dist/client/assets/{schema-D1veJPjJ.js → schema-C_wSANSe.js} +1 -1
  233. package/dist/client/assets/{scroll-area-Ce9NeF1s.js → scroll-area-BT00diUA.js} +1 -1
  234. package/dist/client/assets/{search-input-DpJBHwWo.js → search-input-D-uP0R3f.js} +1 -1
  235. package/dist/client/assets/search-toggle-Hgq_Klme.js +1 -0
  236. package/dist/client/assets/{secret-picker-B_ADx-sY.js → secret-picker-BitsdCaD.js} +1 -1
  237. package/dist/client/assets/secrets-C_yZKBHs.js +1 -0
  238. package/dist/client/assets/sections-editor-DrNkE-5_.js +1 -0
  239. package/dist/client/assets/{select-CZdnCwuC.js → select-BVEgIanS.js} +1 -1
  240. package/dist/client/assets/select-model-CTmCsZzT.js +1 -0
  241. package/dist/client/assets/seo-editor-Cr-VPdNi.js +1 -0
  242. package/dist/client/assets/{separator-BtrJ5AFz.js → separator-CJOPtNz-.js} +1 -1
  243. package/dist/client/assets/settings-tab-zoRR23UC.js +4 -0
  244. package/dist/client/assets/sheet-D-h-caij.js +1 -0
  245. package/dist/client/assets/shell-layout-Ckss0QqA.js +1 -0
  246. package/dist/client/assets/skills-Dx8G-x-T.js +1 -0
  247. package/dist/client/assets/{slider-BpZoep6A.js → slider-DtTzb8JT.js} +1 -1
  248. package/dist/client/assets/{sortable.esm-DyjKGVzh.js → sortable.esm-DCsYtWcb.js} +1 -1
  249. package/dist/client/assets/sso-DDpjWaoO.js +1 -0
  250. package/dist/client/assets/{suggestion-DmBBrXFD.js → suggestion-Bso4uBRF.js} +2 -2
  251. package/dist/client/assets/{switch-hSsSQMgC.js → switch-DZo6rAtc.js} +1 -1
  252. package/dist/client/assets/{symbol-CkeqKRPe.js → symbol-Co3D-iSE.js} +1 -1
  253. package/dist/client/assets/synced-repos-B1f0culo.js +1 -0
  254. package/dist/client/assets/{tab-icon-glyph-BRREqFJ3.js → tab-icon-glyph-ClCao4gx.js} +1 -1
  255. package/dist/client/assets/{table-Dfov51xE.js → table-Gm-jWCpy.js} +1 -1
  256. package/dist/client/assets/{tabs-Df848FrP.js → tabs-CXsAC8nO.js} +1 -1
  257. package/dist/client/assets/{task-board-ChFrokIN.js → task-board-Bgw_xVJW.js} +1 -1
  258. package/dist/client/assets/{task-route-4t67EvVC.js → task-route-BxRkc6kt.js} +1 -1
  259. package/dist/client/assets/{task-status-cI-KMHji.js → task-status-B92ESgef.js} +1 -1
  260. package/dist/client/assets/taskboard-analytics-BEBBYmzN.js +1 -0
  261. package/dist/client/assets/{tasks-Dcje4OJR.js → tasks-BS9sXVdl.js} +3 -3
  262. package/dist/client/assets/tasks-DckB4c8m.js +1 -0
  263. package/dist/client/assets/{textarea-DaHaRA0Z.js → textarea-bcNEcwC6.js} +1 -1
  264. package/dist/client/assets/thread-analytics-BE8EaB4a.js +1 -0
  265. package/dist/client/assets/thread-button-BdyWFdme.js +1 -0
  266. package/dist/client/assets/{thread-intent-Cxso0qKW.js → thread-intent-DzHkd78g.js} +4 -4
  267. package/dist/client/assets/thread-route-CIiqv6HG.js +1 -0
  268. package/dist/client/assets/thread-route-mhniW_q8.js +1 -0
  269. package/dist/client/assets/thread-sheet-body-C1CJm0mZ.js +1 -0
  270. package/dist/client/assets/time-range-picker-BUGifbSV.js +1 -0
  271. package/dist/client/assets/{toggle-group-BFX-9eHs.js → toggle-group-5iPAspL-.js} +1 -1
  272. package/dist/client/assets/{tool-namespace-BHB8Go32.js → tool-namespace-CYa7zzrf.js} +1 -1
  273. package/dist/client/assets/{toolbar-icon-button-D9aCXzS4.js → toolbar-icon-button-CZBCq2Ko.js} +1 -1
  274. package/dist/client/assets/{tooltip-BULKkf4A.js → tooltip-XZmQWwgB.js} +1 -1
  275. package/dist/client/assets/{tooltipContext-1NNpJuJd.js → tooltipContext-BpyR0oly.js} +1 -1
  276. package/dist/client/assets/{track-CpjpKs1v.js → track-Ba2I9E5t.js} +1 -1
  277. package/dist/client/assets/{types-Blm6OQRg.js → types-2TlDAuAc.js} +3 -3
  278. package/dist/client/assets/{url-slug-d-Er1jOR.js → url-slug-B-L2Z8me.js} +1 -1
  279. package/dist/client/assets/{usage-stats-Dqycj-p-.js → usage-stats-BihPbkIg.js} +8 -8
  280. package/dist/client/assets/use-ai-providers-BP69qr77.js +1 -0
  281. package/dist/client/assets/use-automations-Biu6cV7d.js +1 -0
  282. package/dist/client/assets/{use-autosave-DBCPQM6l.js → use-autosave-9jHQ-y1f.js} +1 -1
  283. package/dist/client/assets/use-chat-layout-state-J-94EUwt.js +1 -0
  284. package/dist/client/assets/use-chat-navigation-BXZpM5MQ.js +1 -0
  285. package/dist/client/assets/{use-clock-tick-DGTQe72H.js → use-clock-tick-rPXqIJP8.js} +1 -1
  286. package/dist/client/assets/use-connect-companion-BupOmQ7x.js +1 -0
  287. package/dist/client/assets/use-connection-DUF3XC9E.js +1 -0
  288. package/dist/client/assets/{use-copy-CRIUfo35.js → use-copy-B01v9eRq.js} +1 -1
  289. package/dist/client/assets/{use-create-virtual-mcp-DzmQH3J8.js → use-create-virtual-mcp-BxoXyDoq.js} +1 -1
  290. package/dist/client/assets/{use-date-fns-locale-DIokBBqe.js → use-date-fns-locale-CPtrEugx.js} +1 -1
  291. package/dist/client/assets/{use-debounced-autosave-BRSYFOGW.js → use-debounced-autosave-C__Xzre-.js} +1 -1
  292. package/dist/client/assets/{use-debounced-value-DCB8Le0h.js → use-debounced-value-D5_QO1dT.js} +1 -1
  293. package/dist/client/assets/use-deco-credits-DkZSWK0d.js +1 -0
  294. package/dist/client/assets/{use-decopilot-events-uItZ_pJe.js → use-decopilot-events-1iPDcTcf.js} +1 -1
  295. package/dist/client/assets/use-delete-connection-DUG0172F.js +1 -0
  296. package/dist/client/assets/{use-deployment-admin-BSf-NdBG.js → use-deployment-admin-COeWRtXj.js} +1 -1
  297. package/dist/client/assets/use-ensure-project-folder-A0But3O1.js +1 -0
  298. package/dist/client/assets/{use-fast-preview-draft-url-8LcTSnsj.js → use-fast-preview-draft-url-BRdebqFC.js} +1 -1
  299. package/dist/client/assets/use-file-configs-B8mqylSR.js +1 -0
  300. package/dist/client/assets/{use-infinite-scroll-B02yfFGd.js → use-infinite-scroll-DewChEmc.js} +1 -1
  301. package/dist/client/assets/use-join-requests-CDGwHERc.js +1 -0
  302. package/dist/client/assets/use-main-panel-tabs-D7q-AygO.js +1 -0
  303. package/dist/client/assets/use-mcp-auth-status-CUurQWMq.js +1 -0
  304. package/dist/client/assets/{use-mcp-client-MUIIizLf.js → use-mcp-client-Dh_4AZgb.js} +4 -4
  305. package/dist/client/assets/{use-mcp-prompts-C3siW74f.js → use-mcp-prompts-LJf01t7x.js} +1 -1
  306. package/dist/client/assets/{use-mcp-tools-CPLGkZB5.js → use-mcp-tools-p8MJKmfB.js} +1 -1
  307. package/dist/client/assets/use-members-DQe3FYGy.js +1 -0
  308. package/dist/client/assets/{use-mobile-DF1FX6Xv.js → use-mobile-UYmsi-dp.js} +1 -1
  309. package/dist/client/assets/use-navigate-to-agent-DDZo26Jw.js +1 -0
  310. package/dist/client/assets/use-new-blocks-editor-nCMzaJ9Q.js +1 -0
  311. package/dist/client/assets/{use-open-billing-url-CqJ0vDkP.js → use-open-billing-url-C0JU6CzN.js} +1 -1
  312. package/dist/client/assets/use-org-auth-client-CPbs0OVW.js +1 -0
  313. package/dist/client/assets/use-org-fs-gQ0RuIPK.js +1 -0
  314. package/dist/client/assets/use-org-repo-syncs-KkmagwRy.js +1 -0
  315. package/dist/client/assets/{use-org-sso-BEGhJLya.js → use-org-sso-DWtbATGD.js} +1 -1
  316. package/dist/client/assets/use-organization-roles-BKQWBZmO.js +1 -0
  317. package/dist/client/assets/use-organization-settings-xcc5-6DS.js +1 -0
  318. package/dist/client/assets/{use-panel-navigate-C4UE8Qkr.js → use-panel-navigate-A1obvdVI.js} +1 -1
  319. package/dist/client/assets/{use-project-scope-BMVXwaQ4.js → use-project-scope-BxCbtcTE.js} +1 -1
  320. package/dist/client/assets/use-releases-G79MSxhR.js +1 -0
  321. package/dist/client/assets/use-reports-diagnostic-a7ERyr_7.js +1 -0
  322. package/dist/client/assets/use-sandbox-events-CSN74_aC.js +2 -0
  323. package/dist/client/assets/use-secrets-CmTpPaF9.js +1 -0
  324. package/dist/client/assets/use-section-preview-base-DbQlCGNR.js +1 -0
  325. package/dist/client/assets/use-tags-Ch6_1it4.js +1 -0
  326. package/dist/client/assets/use-task-board-analytics-v7nFgyEB.js +1 -0
  327. package/dist/client/assets/{use-task-board-events-BDjHMnwS.js → use-task-board-events-DHjlo-9e.js} +1 -1
  328. package/dist/client/assets/use-task-board-item-prs-CoXnP9ys.js +1 -0
  329. package/dist/client/assets/use-task-board-items-erbHwxMh.js +1 -0
  330. package/dist/client/assets/use-task-metadata-DmWCG43J.js +1 -0
  331. package/dist/client/assets/{use-thread-analytics-DJQ2zz_B.js → use-thread-analytics-DJfFmK1j.js} +1 -1
  332. package/dist/client/assets/use-thread-outputs-7J4Ek_Zs.js +1 -0
  333. package/dist/client/assets/useInfiniteQuery-vZqvTY4f.js +1 -0
  334. package/dist/client/assets/{useQueries-DKVO6hGe.js → useQueries-DoURbZYb.js} +1 -1
  335. package/dist/client/assets/useSuspenseInfiniteQuery-DdGuWYX3.js +1 -0
  336. package/dist/client/assets/{users-DbpeSClG.js → users-BfQBxfCk.js} +1 -1
  337. package/dist/client/assets/{utils-Cxy1EsFU.js → utils-DAEMarMy.js} +1 -1
  338. package/dist/client/assets/variant-calendar-DNADqO99.js +1 -0
  339. package/dist/client/assets/{variant-matcher-override-BD9nzwGm.js → variant-matcher-override-BDRgB-Pq.js} +1 -1
  340. package/dist/client/assets/{view-mode-toggle-CVVPadaN.js → view-mode-toggle-DPJfZa3C.js} +1 -1
  341. package/dist/client/assets/{virtual-mcp-CYDFCAA6.js → virtual-mcp-C54PVPPw.js} +1 -1
  342. package/dist/client/assets/{watch-sse-pool-BXtoXPGx.js → watch-sse-pool-DmOqvBBq.js} +1 -1
  343. package/dist/client/index.html +1 -1
  344. package/dist/server/server.js +633 -633
  345. package/package.json +1 -1
  346. package/dist/client/assets/LinkExternal01-CILXo-bC.js +0 -1
  347. package/dist/client/assets/X-DzPShgV5.js +0 -1
  348. package/dist/client/assets/add-connection-dialog-Eph5CbUo.js +0 -1
  349. package/dist/client/assets/agent-analytics-DSdixv-f.js +0 -2
  350. package/dist/client/assets/agent-app-CT6U3s2r.js +0 -1
  351. package/dist/client/assets/agent-assets-G93-pOM9.js +0 -1
  352. package/dist/client/assets/agent-automation-DP6Bv0AB.js +0 -20
  353. package/dist/client/assets/agent-automations-YDqRnDcc.js +0 -1
  354. package/dist/client/assets/agent-connect-sources-CSrFX52j.js +0 -1
  355. package/dist/client/assets/agent-deck-D9Bphszm.js +0 -1
  356. package/dist/client/assets/agent-e2e-k9wCqssu.js +0 -1
  357. package/dist/client/assets/agent-experiments-CPSBbmYr.js +0 -1
  358. package/dist/client/assets/agent-file-BAkSJWMw.js +0 -1
  359. package/dist/client/assets/agent-hosting-B1Ag0zD8.js +0 -1
  360. package/dist/client/assets/agent-icon-CnnNyirr.js +0 -1
  361. package/dist/client/assets/agent-library-Ch3sHhuh.js +0 -1
  362. package/dist/client/assets/agent-library-file-Bq6m6SHP.js +0 -1
  363. package/dist/client/assets/agent-monitor-DyddEd79.js +0 -1
  364. package/dist/client/assets/agent-overview-BlP2a40h.js +0 -1
  365. package/dist/client/assets/agent-settings-CaxlA04S.js +0 -1
  366. package/dist/client/assets/agent-site-editor-code-D0j_GVVh.js +0 -2
  367. package/dist/client/assets/agent-site-editor-preview-DaqE_qX4.js +0 -518
  368. package/dist/client/assets/agent-view-UQmbv7nk.js +0 -1
  369. package/dist/client/assets/agents-list-CJcm3Kq8.js +0 -1
  370. package/dist/client/assets/api-keys-BjTJSB_i.js +0 -1
  371. package/dist/client/assets/api-keys-BrfzhtIS.js +0 -1
  372. package/dist/client/assets/app-editor-CJudcxBz.js +0 -1
  373. package/dist/client/assets/asset-utils-Cdgz7yau.js +0 -1
  374. package/dist/client/assets/auth-entry-BUqhj_6T.js +0 -1
  375. package/dist/client/assets/authenticate-and-persist-oauth-eDHShxj5.js +0 -1
  376. package/dist/client/assets/automation-runs-BZA4OsIt.js +0 -1
  377. package/dist/client/assets/automations-DpWIQ3oV.js +0 -1
  378. package/dist/client/assets/autosend-BQ3F90GX.js +0 -1
  379. package/dist/client/assets/buckets-AVx7AXso.js +0 -1
  380. package/dist/client/assets/capability-load-error-BVlvKXjS.js +0 -1
  381. package/dist/client/assets/category-editor-B-jccGXu.js +0 -1
  382. package/dist/client/assets/chat-context-UMp8QwjT.js +0 -39
  383. package/dist/client/assets/chat-draft-CYy-Qv-a.js +0 -1
  384. package/dist/client/assets/choose-editor-BDo9cuNm.js +0 -1
  385. package/dist/client/assets/claim-phase-copy-DG8E1-gc.js +0 -1
  386. package/dist/client/assets/collection-detail-CBqQPzi0.js +0 -1
  387. package/dist/client/assets/collection-display-button-XaptFv9u.js +0 -1
  388. package/dist/client/assets/column-rules-Bq3eiowV.js +0 -3
  389. package/dist/client/assets/command-Doiz3O29.js +0 -1
  390. package/dist/client/assets/config-B01oZvpJ.js +0 -1
  391. package/dist/client/assets/connect-layout-CoxrwG6t.js +0 -1
  392. package/dist/client/assets/connection-card-Cvk5T5vt.js +0 -1
  393. package/dist/client/assets/connection-detail-BRdQkO7d.js +0 -1
  394. package/dist/client/assets/connection-form-helpers-D4Q7rLyt.js +0 -1
  395. package/dist/client/assets/connections-C8qSBDCe.js +0 -1
  396. package/dist/client/assets/context-Bt7kDQzj.js +0 -1
  397. package/dist/client/assets/create-organization-dialog-D-t_ZE2o.js +0 -1
  398. package/dist/client/assets/daily-pulse-DYPs4tl1.js +0 -1
  399. package/dist/client/assets/device-hint-CbxzMdRC.js +0 -1
  400. package/dist/client/assets/dialog-DRpbbWU1.js +0 -1
  401. package/dist/client/assets/discover-3ATGdKP8.js +0 -1
  402. package/dist/client/assets/domain-settings-C4-yAgIW.js +0 -1
  403. package/dist/client/assets/feature-paywall-0RYA-1Op.js +0 -1
  404. package/dist/client/assets/file-explorer-Cyg7RguR.js +0 -2
  405. package/dist/client/assets/file-share-button-C8ZBUx_e.js +0 -3
  406. package/dist/client/assets/flat-project-BpQGs-gN.js +0 -1
  407. package/dist/client/assets/general-B3jgLFML.js +0 -1
  408. package/dist/client/assets/home-DYCk_i5V.js +0 -1
  409. package/dist/client/assets/index-Cx0uPPmh.js +0 -1
  410. package/dist/client/assets/index-qeM6EfxB.js +0 -1
  411. package/dist/client/assets/infra-billing-BFh6IlFL.js +0 -1
  412. package/dist/client/assets/input-B0doV0os.js +0 -1
  413. package/dist/client/assets/input-BQ74PHN6.js +0 -1
  414. package/dist/client/assets/jira-icon-C1bLqdEg.js +0 -1
  415. package/dist/client/assets/legacy-agents-deep-BBjNU_wv.js +0 -1
  416. package/dist/client/assets/library-CVuXHyjV.js +0 -1
  417. package/dist/client/assets/login-DNhk4MX6.js +0 -1
  418. package/dist/client/assets/mcp-oauth-C5T-IVs8.js +0 -1
  419. package/dist/client/assets/members-BftWOm2t.js +0 -1
  420. package/dist/client/assets/mustache-D-VzFUJG.js +0 -4
  421. package/dist/client/assets/new-project-dialog-CXEwhrv6.js +0 -1
  422. package/dist/client/assets/onboarding-BisuojYF.js +0 -1
  423. package/dist/client/assets/openai-conversation-BICNFmxp.js +0 -3
  424. package/dist/client/assets/optimistic-project-sidebar-views-BINKTU3_.js +0 -1
  425. package/dist/client/assets/orgs-DCjydoUZ.js +0 -1
  426. package/dist/client/assets/pair-knnOGTuF.js +0 -47
  427. package/dist/client/assets/plan-ladder-DlpzxobM.js +0 -1
  428. package/dist/client/assets/post-calendar-3X9xGSKe.js +0 -1
  429. package/dist/client/assets/post-editor-BS-N2LHp.js +0 -2
  430. package/dist/client/assets/preview-content-CWMTMNmp.js +0 -1
  431. package/dist/client/assets/preview-dialog-CmtjgV1o.js +0 -1
  432. package/dist/client/assets/product-picker-dialog-904WCGJu.js +0 -1
  433. package/dist/client/assets/profile-aIUaVWtC.js +0 -1
  434. package/dist/client/assets/project-app-view-ChZmhZ13.js +0 -1
  435. package/dist/client/assets/project-feed-t8IHFF-d.js +0 -1
  436. package/dist/client/assets/project-reports-BF24m5b-.js +0 -1
  437. package/dist/client/assets/project-tasks-Wmmy6hRq.js +0 -1
  438. package/dist/client/assets/projects-CxEhyr52.js +0 -1
  439. package/dist/client/assets/prompts-Cad3gM_K.js +0 -1
  440. package/dist/client/assets/record-editor-Cu0LbDVm.js +0 -1
  441. package/dist/client/assets/redirect-editor-B65ggNrM.js +0 -1
  442. package/dist/client/assets/reports-B3_ASbsZ.js +0 -1
  443. package/dist/client/assets/reports-onboarding-DzC8BMPj.js +0 -1
  444. package/dist/client/assets/reports-tab-flC8aPMq.js +0 -2
  445. package/dist/client/assets/repositories-BRVHvY5X.js +0 -1
  446. package/dist/client/assets/repository-binding-DpX8yLri.js +0 -1
  447. package/dist/client/assets/repository-import-picker-CO5nKRxA.js +0 -1
  448. package/dist/client/assets/repository-picker-C2HnHK1A.js +0 -1
  449. package/dist/client/assets/require-capability-Do1773Hs.js +0 -1
  450. package/dist/client/assets/reset-password-Dh0gWEkU.js +0 -1
  451. package/dist/client/assets/review-settings-C9jJxNAv.js +0 -1
  452. package/dist/client/assets/roles-BOnFVbcr.js +0 -1
  453. package/dist/client/assets/route-Bvv7axF1.js +0 -1
  454. package/dist/client/assets/route-DNZvy3kt.js +0 -1
  455. package/dist/client/assets/route-DdkXah7z.js +0 -1
  456. package/dist/client/assets/sandbox-lifecycle-context-BJE24h7z.js +0 -1
  457. package/dist/client/assets/search-toggle-Br3rmrbk.js +0 -1
  458. package/dist/client/assets/secrets-t0Aczfol.js +0 -1
  459. package/dist/client/assets/sections-editor-CEBB7XW8.js +0 -1
  460. package/dist/client/assets/select-model-ER05JMp8.js +0 -1
  461. package/dist/client/assets/seo-editor-DHXJaGsL.js +0 -1
  462. package/dist/client/assets/settings-tab-CTiWw7bm.js +0 -4
  463. package/dist/client/assets/sheet-Gpaizien.js +0 -1
  464. package/dist/client/assets/shell-layout-B0-NcUCt.js +0 -1
  465. package/dist/client/assets/skills-BHEjjAUu.js +0 -1
  466. package/dist/client/assets/sso-Dgg4nP6H.js +0 -1
  467. package/dist/client/assets/synced-repos-B1QJsQos.js +0 -1
  468. package/dist/client/assets/taskboard-analytics-C5y5DQZh.js +0 -1
  469. package/dist/client/assets/tasks-B6PT7ia3.js +0 -1
  470. package/dist/client/assets/thread-analytics-5o8rlytc.js +0 -1
  471. package/dist/client/assets/thread-button-DwjwmudD.js +0 -1
  472. package/dist/client/assets/thread-route-BcAw7-v0.js +0 -1
  473. package/dist/client/assets/thread-route-CW2be8Kx.js +0 -1
  474. package/dist/client/assets/thread-sheet-body-B6geJ00B.js +0 -1
  475. package/dist/client/assets/time-range-picker-Bu58tMJr.js +0 -1
  476. package/dist/client/assets/use-ai-providers-C1bb7SnA.js +0 -1
  477. package/dist/client/assets/use-automations-zlAoF9SL.js +0 -1
  478. package/dist/client/assets/use-chat-layout-state-DDDFQN6Y.js +0 -1
  479. package/dist/client/assets/use-chat-navigation-BF9opsK8.js +0 -1
  480. package/dist/client/assets/use-connect-companion-DcLSyBxl.js +0 -1
  481. package/dist/client/assets/use-connection-5LUEsGlJ.js +0 -1
  482. package/dist/client/assets/use-deco-credits-BgPf-IIH.js +0 -1
  483. package/dist/client/assets/use-delete-connection-BLZ4VLoa.js +0 -1
  484. package/dist/client/assets/use-ensure-project-folder-BUpbRP81.js +0 -1
  485. package/dist/client/assets/use-file-configs-By7UB_YZ.js +0 -1
  486. package/dist/client/assets/use-join-requests-Cb1ihQM1.js +0 -1
  487. package/dist/client/assets/use-main-panel-tabs-xXeWrfnF.js +0 -1
  488. package/dist/client/assets/use-mcp-auth-status-B-gyzfqG.js +0 -1
  489. package/dist/client/assets/use-members-vjX9lJhj.js +0 -1
  490. package/dist/client/assets/use-navigate-to-agent-p65xWFDF.js +0 -1
  491. package/dist/client/assets/use-new-blocks-editor-DZnaAqkX.js +0 -1
  492. package/dist/client/assets/use-org-auth-client-CuZ7oLTb.js +0 -1
  493. package/dist/client/assets/use-org-fs-DPxqVRhB.js +0 -1
  494. package/dist/client/assets/use-org-repo-syncs-BG16MD5Q.js +0 -1
  495. package/dist/client/assets/use-organization-roles-DOROP0yS.js +0 -1
  496. package/dist/client/assets/use-organization-settings-CB0-LYjl.js +0 -1
  497. package/dist/client/assets/use-releases-DO5M1M4y.js +0 -1
  498. package/dist/client/assets/use-reports-diagnostic-C3LmmHKo.js +0 -1
  499. package/dist/client/assets/use-sandbox-events-E2bKOQlM.js +0 -2
  500. package/dist/client/assets/use-secrets-C2sdbGJM.js +0 -1
  501. package/dist/client/assets/use-section-preview-base-26sYGS0B.js +0 -1
  502. package/dist/client/assets/use-tags-CFN9IU6i.js +0 -1
  503. package/dist/client/assets/use-task-board-analytics-BmwRnCgb.js +0 -1
  504. package/dist/client/assets/use-task-board-item-prs-DY1JtBFR.js +0 -1
  505. package/dist/client/assets/use-task-board-items-DUgOnZAe.js +0 -1
  506. package/dist/client/assets/use-task-metadata-BCqsxDXx.js +0 -1
  507. package/dist/client/assets/use-thread-outputs-DfIiLAuO.js +0 -1
  508. package/dist/client/assets/useInfiniteQuery-eYXaZ_bo.js +0 -1
  509. package/dist/client/assets/useSuspenseInfiniteQuery-i_drPWHc.js +0 -1
  510. package/dist/client/assets/variant-calendar-BR3Tvz7m.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as z,c as L,j as u,f2 as J,f3 as ee,q as te,x as ne,a as oe,l as q,h as se}from"./index-D_7jfHk6.js";import{D as ie,E as re,C as ae}from"./types-Blm6OQRg.js";const W=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function le(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${de(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,i=o.match(s);if(i){const l=(i.index??0)+i[0].length;return o.slice(0,l)+`
1
+ import{r as z,c as L,j as u,fg as J,fh as ee,y as te,F as ne,a as oe,l as q,h as se}from"./index-Bm9FTdjr.js";import{D as ie,E as re,C as ae}from"./types-2TlDAuAc.js";const W=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function le(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${de(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,i=o.match(s);if(i){const l=(i.index??0)+i[0].length;return o.slice(0,l)+`
2
2
  `+n+o.slice(l)}const r=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,a=o.match(r);if(a){const l=(a.index??0)+a[0].length;return o.slice(0,l)+`
3
3
  <head>
4
4
  `+n+`
@@ -0,0 +1 @@
1
+ import{dO as c}from"./index-Bm9FTdjr.js";import{a as e}from"./mcp-oauth-BTa4N28L.js";async function i(n,o){const t=await(await fetch(`/api/${encodeURIComponent(n)}/connections/${o}/oauth-token/status`,{credentials:"include"}).catch(()=>null))?.json().catch(()=>null);return!!t&&typeof t=="object"&&"sandboxSignIn"in t&&t.sandboxSignIn===!0}async function r(n){return n.orgSlug&&await i(n.orgSlug,n.connectionId)?c(n.orgSlug,n.connectionId):e(n)}export{r as a};
@@ -0,0 +1 @@
1
+ import{d as V,a as N,e as H,b as z}from"./auth-Dwu4WH32.js";import{b9 as M}from"./index-Bm9FTdjr.js";function D(){return window.location.origin}function C(){try{const e=window.location.hostname;return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}const R="mcp:oauth:callback:",J=1e3,K=10*6e4,v=15e3;class W{_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(t){this._redirectUrl=t.callbackUrl??`${D()}/oauth/callback`,this._windowMode=t.windowMode??"popup";const n=t.scope?Array.isArray(t.scope)?t.scope.join(" "):t.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:t.clientName??"@decocms/studio MCP client",...n&&{scope:n}}}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(t){this._clientInfo=t}tokens(){return this._tokens??void 0}saveTokens(t){this._tokens=t}redirectToAuthorization(t){if(this._windowMode==="tab"){if(!window.open(t.toString(),"_blank"))throw new Error("Tab was blocked")}else{const i=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(t.toString(),"mcp-oauth",`width=600,height=700,left=${i},top=${o},popup=yes`)&&!window.open(t.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(t){this._codeVerifier=t}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}}async function Q(e){const t=M(e,window.location.origin),n=e.orgSlug?`/api/${encodeURIComponent(e.orgSlug)}/mcp/${e.connectionId}`:`/mcp/${e.connectionId}`,r=new URL(n,t),i=new W({serverUrl:r.href,clientName:e.clientName,clientUri:e.clientUri,callbackUrl:e.callbackUrl,scope:e.scope,windowMode:e.windowMode}),o={fn:null};try{const s=new Promise((a,d)=>{const p=e.timeout||K;let _,S,f=!1;const L=i.state(),b=`${R}${L}`,w=()=>{window.removeEventListener("message",T),window.removeEventListener("storage",y),clearTimeout(_),clearInterval(S);try{localStorage.removeItem(b)}catch{}};o.fn=c=>{f||(f=!0,w(),d(c))};const I=async c=>{if(f)return;if(f=!0,!c.success){w(),d(new Error(c.error||"OAuth authentication failed"));return}const{code:g,state:$}=c;if(!g){w(),d(new Error("Missing authorization code"));return}if(i.getStoredState()!==$){w(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const U=(await V(r))?.authorization_servers?.[0]||r,A=await N(U),k=i.clientInformation();if(!k){w(),d(new Error("Client information not found"));return}const P=i.codeVerifier(),x=await H(U,{metadata:A,clientInformation:k,authorizationCode:g,codeVerifier:P,redirectUri:i.redirectUrl,resource:new URL(r)});w(),a({tokens:x,clientId:k.client_id??null,clientSecret:k.client_secret??null,tokenEndpoint:A?.token_endpoint??null,userinfoEndpoint:A?.userinfo_endpoint??null})}catch(E){w(),d(E)}},T=async c=>{!C()&&c.origin!==window.location.origin||c.data?.type==="mcp:oauth:callback"&&await I(c.data)},y=async c=>{if(!(c.key!==b||!c.newValue))try{const g=JSON.parse(c.newValue);await I(g)}catch{}};window.addEventListener("message",T),window.addEventListener("storage",y),S=setInterval(()=>{if(f)return;let c=null;try{c=localStorage.getItem(b)}catch{return}if(c)try{I(JSON.parse(c))}catch{}},J),_=setTimeout(()=>{f||(f=!0,w(),d(new Error("OAuth authentication timeout")))},p)});if(s.catch(()=>{}),await z(i,{serverUrl:r})==="REDIRECT"){const a=await s;return{token:a.tokens.access_token,tokenInfo:{accessToken:a.tokens.access_token,refreshToken:a.tokens.refresh_token??null,expiresIn:a.tokens.expires_in??null,scope:a.tokens.scope??null,clientId:a.clientId,clientSecret:a.clientSecret,tokenEndpoint:a.tokenEndpoint,userinfoEndpoint:a.userinfoEndpoint,idToken:a.tokens.id_token??null},error:null}}const l=i.tokens(),h=i.clientInformation();return{token:l?.access_token||null,tokenInfo:l?{accessToken:l.access_token,refreshToken:l.refresh_token??null,expiresIn:l.expires_in??null,scope:l.scope??null,clientId:h?.client_id??null,clientSecret:h?.client_secret??null,tokenEndpoint:null,userinfoEndpoint:null,idToken:l.id_token??null}:null,error:null}}catch(s){return o.fn&&o.fn(s instanceof Error?s:new Error(String(s))),{token:null,tokenInfo:null,error:s instanceof Error?s.message:String(s)}}}function O(e,t){if(window.opener&&!window.opener.closed){const n=C()?"*":window.location.origin;return window.opener.postMessage(e,n),!0}if(t)try{const n=`${R}${t}`;return localStorage.setItem(n,JSON.stringify(e)),!0}catch{}return!1}async function Z(){const e=new URLSearchParams(window.location.search),t=e.get("code");let n=e.get("state");const r=e.get("error"),i=e.get("error_description");let o=n;if(n)try{const u=atob(n),l=JSON.parse(u);l.clientState&&(o=l.clientState)}catch{}if(r){const u=i||r;return O({type:"mcp:oauth:callback",success:!1,error:u},o),{success:!1,error:u}}if(!t||!n){const u="Missing code or state parameter";return O({type:"mcp:oauth:callback",success:!1,error:u},o),{success:!1,error:u}}return n=o||n,O({type:"mcp:oauth:callback",success:!0,code:t,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function m(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function j(e){try{const t=m(),n=t?new URL(e,t):new URL(e),r=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return r?r[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function F(e){try{const t=m();return(t?new URL(e,t):new URL(e)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function G(e,t,n){const r={hasToken:!1,usable:!1,sandboxSignIn:!1};try{const i=`/api/${encodeURIComponent(t)}/connections/${e}/oauth-token/status`,o=n?new URL(i,n).href:i,s=m(),u=!n||new URL(n).origin===s,l=await fetch(o,{credentials:u?"include":"omit"});if(!l.ok)return r;const h=await l.json();return{hasToken:h.hasToken===!0,usable:h.hasToken===!0&&(h.isExpired!==!0||h.canRefresh===!0),sandboxSignIn:h.sandboxSignIn===!0}}catch{return r}}async function B({url:e,token:t,orgId:n,studioUrl:r,meshUrl:i}){try{const o=j(e),s=F(e),u=m(),l=M({studioUrl:r,meshUrl:i},u?new URL(e,u).origin:new URL(e).origin),h=o&&s?await G(o,s,l):null;if(h?.sandboxSignIn)return{isAuthenticated:h.usable,supportsOAuth:!0,hasOAuthToken:h.hasToken};const a=new Headers;a.set("Content-Type","application/json"),a.set("Accept","application/json, text/event-stream");const d=await fetch(e,{method:"POST",headers:a,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/studio MCP client",version:"1.0.0"}}}),signal:AbortSignal.timeout(v)});if(d.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:h?.hasToken??!1};let p;try{const f=await d.json();p=f.error||f.message}catch{}return d.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:p||`HTTP ${d.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!d.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:p||`HTTP ${d.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o instanceof Error&&o.name==="TimeoutError"?`Connection check timed out after ${v/1e3}s`:o.message}}}export{Q as a,Z as h,B as i};
@@ -0,0 +1 @@
1
+ import{c as ue,b as xe,j as s,ev as ns,B as at,eu as as,et as rs,a2 as Tt,aa as os,R as cs,o as Jt,e as xt,K as ct,t as ge,r as pe,l as rt,h as Rt,fZ as ms,n as ds,ff as At,X as Zt,T as Ht,V as Wt,as as us,aq as fs,ar as gs,U as Mt,a7 as ps,au as xs,y as nt}from"./index-Bm9FTdjr.js";import{C as hs}from"./collection-display-button-YyNX5Efp.js";import{S as bs}from"./search-input-D-uP0R3f.js";import{C as js}from"./collection-table-wrapper-DFn43mg0.js";import{E as Nt}from"./empty-state-Zf0MeIMv.js";import{u as vs,a as Cs,I as Ss}from"./use-join-requests-CDGwHERc.js";import{A as ot}from"./avatar-BEl6nltF.js";import{f as Ns}from"./format-time-CjIPQhCN.js";import{g as gt}from"./get-initials-D-f_fDFw.js";import{a as ys}from"./use-members-DQe3FYGy.js";import{u as Xt}from"./use-org-auth-client-CPbs0OVW.js";import{u as ws}from"./use-organization-roles-BKQWBZmO.js";import{g as Ms,a as Ts}from"./role-color-Dn2tXDDF.js";import{T as Is,a as Rs,c as As,b as zs}from"./tooltip-XZmQWwgB.js";import{A as zt,a as Pt,b as kt,c as _t,g as Dt,d as Et,e as Ot,f as Lt}from"./alert-dialog-BXEG2ySJ.js";import{B as ht}from"./badge-DFdotQFQ.js";import{i as Yt}from"./DotsVertical-3XBYz4yU.js";import{i as Ps}from"./Key01-DcSonP-G.js";import{b as ks}from"./SwitchHorizontal01-BHr8jCjb.js";import{s as _s}from"./Trash01-DZ8laRwu.js";import{s as es}from"./XClose-DjFCAP5F.js";import{a as $t,b as qt,c as Ft,d as Ut,S as Bt}from"./select-BVEgIanS.js";import{C as Kt}from"./checkbox-DmaIcPoL.js";import{e as yt,b as wt,h as Vt,a as Ds,c as Es,f as Os,C as Ls}from"./command-D2QlwSrW.js";import{b as $s,P as qs,a as Fs}from"./popover-jNB4XciF.js";import{t as Us}from"./ChevronUp-nynZHATg.js";import{s as Bs}from"./Plus-XYNDZJ4s.js";import{u as Ks,c as Vs,a as Gs,d as Qs}from"./use-tags-Ch6_1it4.js";import{R as Js}from"./require-capability-Dm4XTD9Y.js";import"./ArrowUp-CP6XCJnB.js";import"./view-mode-toggle-DPJfZa3C.js";import"./SearchMd-BFitEH5z.js";import"./table-Gm-jWCpy.js";import"./form-BCYpCYIL.js";import"./label-BL2W0Pcn.js";import"./textarea-bcNEcwC6.js";import"./User01-9bZ-cKa7.js";import"./differenceInSeconds-C3x8sHUj.js";import"./index-D2iZ6syL.js";import"./index-BdQq_4o_.js";import"./index-s6P2p4h7.js";import"./access-gate-Cu8JZecz.js";import"./capability-load-error-yZzl8b80.js";function Zs(){const t=ue.c(19),e=xe(),l=vs(),{approve:c,deny:a}=Cs();if(l.length===0)return null;let n;t[0]!==e?(n=e("settings.joinRequestsSection.title"),t[0]=e,t[1]=n):n=t[1];let u;t[2]!==e?(u=e("settings.joinRequestsSection.description"),t[2]=e,t[3]=u):u=t[3];let m;if(t[4]!==c||t[5]!==a||t[6]!==l||t[7]!==e){let f;t[9]!==c||t[10]!==a||t[11]!==e?(f=o=>s.jsx(ns,{icon:s.jsx(ot,{url:o.user?.image??void 0,fallback:(o.user?.name??o.user?.email??"?").charAt(0).toUpperCase(),shape:"circle",size:"sm"}),title:o.user?.name??o.user?.email??o.userId,description:o.user?.email,action:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(at,{size:"sm",variant:"outline",onClick:()=>a.mutate(o.id),disabled:a.isPending||c.isPending,children:e("settings.joinRequestsSection.deny")}),s.jsx(at,{size:"sm",onClick:()=>c.mutate(o.id),disabled:c.isPending||a.isPending,children:e("settings.joinRequestsSection.approve")})]})},o.id),t[9]=c,t[10]=a,t[11]=e,t[12]=f):f=t[12],m=l.map(f),t[4]=c,t[5]=a,t[6]=l,t[7]=e,t[8]=m}else m=t[8];let r;t[13]!==m?(r=s.jsx(as,{children:m}),t[13]=m,t[14]=r):r=t[14];let p;return t[15]!==n||t[16]!==u||t[17]!==r?(p=s.jsx(rs,{title:n,description:u,children:r}),t[15]=n,t[16]=u,t[17]=r,t[18]=p):p=t[18],p}function Hs(){const t=ue.c(7),{locator:e}=Tt(),l=os();let c;t[0]!==e?(c=ct.invitations(e),t[0]=e,t[1]=c):c=t[1];let a;t[2]!==l?(a=async()=>(await l.call("ORGANIZATION_GET",{}))?.invitations??[],t[2]=l,t[3]=a):a=t[3];let n;return t[4]!==c||t[5]!==a?(n={queryKey:c,queryFn:a},t[4]=c,t[5]=a,t[6]=n):n=t[6],cs(n)}function Ws(){const t=ue.c(10),{locator:e}=Tt(),l=Xt(),c=Jt();let a;t[0]!==l?(a=async p=>{const f=await l.organization.cancelInvitation({invitationId:p});if(f?.error)throw new Error(f.error.message);return f.data},t[0]=l,t[1]=a):a=t[1];let n;t[2]!==e||t[3]!==c?(n=()=>{c.invalidateQueries({queryKey:ct.invitations(e)}),ge.success("Invitation cancelled")},t[2]=e,t[3]=c,t[4]=n):n=t[4];let u;t[5]!==a||t[6]!==n?(u={mutationFn:a,onSuccess:n,onError:Xs},t[5]=a,t[6]=n,t[7]=u):u=t[7];const m=xt(u);let r;return t[8]!==m?(r={cancel:m},t[8]=m,t[9]=r):r=t[9],r}function Xs(t){ge.error(t instanceof Error?t.message:"Failed to cancel invitation")}function ts(t){const e=ue.c(51),{memberId:l,className:c,disabled:a,maxDisplay:n}=t,u=a===void 0?!1:a,m=n===void 0?2:n,r=xe(),[p,f]=pe.useState(!1),[o,j]=pe.useState(""),{data:E,isLoading:z}=Ks(),P=E===void 0?[]:E,{data:v,isLoading:U}=Vs(l),x=v===void 0?[]:v,O=Gs(),T=Qs(),L=z||U,S=x.map(ei);let I;e[0]!==o?(I=C=>C.name.toLowerCase().includes(o.toLowerCase()),e[0]=o,e[1]=I):I=e[1];const k=P.filter(I);let _;e[2]!==o?(_=C=>C.name.toLowerCase()===o.toLowerCase(),e[2]=o,e[3]=_):_=e[3];const R=P.find(_),w=o.trim()&&!R,M=async C=>{const de=S.includes(C.id)?S.filter(be=>be!==C.id):[...S,C.id];await T.mutateAsync({memberId:l,tagIds:de})},B=async()=>{if(!o.trim())return;const C=await O.mutateAsync(o.trim());await T.mutateAsync({memberId:l,tagIds:[...S,C.id]}),j("")},q=async C=>{const he=S.filter(de=>de!==C);await T.mutateAsync({memberId:l,tagIds:he})},N=O.isPending||T.isPending,h=qs;let y;e[4]!==p?(y=()=>f(!p),e[4]=p,e[5]=y):y=e[5];let g;e[6]!==c?(g=rt("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",c),e[6]=c,e[7]=g):g=e[7];const b=u||L,$=L?s.jsx(Rt,{className:"size-3.5 text-muted-foreground"}):x.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[x.slice(0,m).map(Ys),x.length>m&&s.jsxs(ht,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",x.length-m]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:r("common.tagMultiSelect.addTags")});let F;e[8]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Us,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=F):F=e[8];let D;e[9]!==$||e[10]!==y||e[11]!==g||e[12]!==b?(D=s.jsx(Fs,{asChild:!0,children:s.jsxs(at,{variant:"ghost",size:"sm",onClick:y,className:g,disabled:b,children:[$,F]})}),e[9]=$,e[10]=y,e[11]=g,e[12]=b,e[13]=D):D=e[13];const G=$s,Z="w-56 p-0",K="start";let Q;e[14]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>f(!1),e[14]=Q):Q=e[14];const J=Os,H=!1;let W;e[15]!==r?(W=r("common.tagMultiSelect.searchOrCreate"),e[15]=r,e[16]=W):W=e[16];let X;e[17]!==o||e[18]!==W?(X=s.jsx(Ls,{placeholder:W,value:o,onValueChange:j,className:"h-9"}),e[17]=o,e[18]=W,e[19]=X):X=e[19];const ae=Es,re=x.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{heading:r("common.tagMultiSelect.selected"),children:x.map(C=>s.jsx(wt,{onSelect:()=>M(C),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Kt,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:C.name})]}),s.jsx("button",{type:"button",onClick:he=>{he.stopPropagation(),q(C.id)},className:"opacity-50 hover:opacity-100",disabled:N,children:s.jsx(es,{size:14})})]})},C.id))}),s.jsx(Vt,{})]}),oe=yt;let Y;e[20]!==r?(Y=r("common.tagMultiSelect.available"),e[20]=r,e[21]=Y):Y=e[21];const ce=k.length===0&&!w&&s.jsx(Ds,{children:r("common.tagMultiSelect.noTagsFound")}),me=k.filter(C=>!S.includes(C.id)).map(C=>s.jsx(wt,{onSelect:()=>M(C),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Kt,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:C.name})]})},C.id));let ee;e[22]!==oe||e[23]!==Y||e[24]!==ce||e[25]!==me?(ee=s.jsxs(oe,{heading:Y,children:[ce,me]}),e[22]=oe,e[23]=Y,e[24]=ce,e[25]=me,e[26]=ee):ee=e[26];let te;e[27]!==B||e[28]!==N||e[29]!==o||e[30]!==w||e[31]!==r?(te=w&&s.jsxs(s.Fragment,{children:[s.jsx(Vt,{}),s.jsx(yt,{children:s.jsx(wt,{onSelect:B,className:"cursor-pointer",disabled:N,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[N?s.jsx(Rt,{className:"size-3.5"}):s.jsx(Bs,{size:14}),s.jsx("span",{children:r("common.tagMultiSelect.createTag",{tagName:o.trim()})})]})})})]}),e[27]=B,e[28]=N,e[29]=o,e[30]=w,e[31]=r,e[32]=te):te=e[32];let se;e[33]!==ae||e[34]!==re||e[35]!==ee||e[36]!==te?(se=s.jsxs(ae,{children:[re,ee,te]}),e[33]=ae,e[34]=re,e[35]=ee,e[36]=te,e[37]=se):se=e[37];let ie;e[38]!==J||e[39]!==X||e[40]!==se?(ie=s.jsxs(J,{shouldFilter:H,children:[X,se]}),e[38]=J,e[39]=X,e[40]=se,e[41]=ie):ie=e[41];let le;e[42]!==G||e[43]!==Q||e[44]!==ie?(le=s.jsx(G,{className:Z,align:K,onEscapeKeyDown:Q,children:ie}),e[42]=G,e[43]=Q,e[44]=ie,e[45]=le):le=e[45];let ne;return e[46]!==h||e[47]!==p||e[48]!==D||e[49]!==le?(ne=s.jsxs(h,{open:p,onOpenChange:f,children:[D,le]}),e[46]=h,e[47]=p,e[48]=D,e[49]=le,e[50]=ne):ne=e[50],ne}function Ys(t){return s.jsx(ht,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function ei(t){return t.id}const ti=["owner","admin","user"];function si(t){const e=new Map;for(const l of ti)e.set(l,Ms(l,!0));for(const l of t)l&&!e.has(l.role)&&e.set(l.role,Ts(l.role));return e}function pt(t){const e=ue.c(84),{role:l,memberId:c,isOwner:a,roleColorMap:n,selectableRoles:u,onRoleChange:m,size:r,className:p}=t,f=r===void 0?"xs":r,o=xe();let j,E,z,P,v,U,x,O,T,L,S;if(e[0]!==p||e[1]!==a||e[2]!==c||e[3]!==m||e[4]!==l||e[5]!==n||e[6]!==u||e[7]!==f||e[8]!==o){S=Symbol.for("react.early_return_sentinel");e:{const N=n.get(l)??"bg-muted-foreground";if(a){let h;e[20]!==c||e[21]!==m?(h=J=>m(c,J),e[20]=c,e[21]=m,e[22]=h):h=e[22];let y;e[23]!==l?(y=s.jsx("span",{className:"capitalize truncate",children:l}),e[23]=l,e[24]=y):y=e[24];const g=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:rt("size-2 rounded-full shrink-0",N)}),y]});let b;e[25]!==g?(b=s.jsx($t,{children:g}),e[25]=g,e[26]=b):b=e[26];let $;e[27]!==p||e[28]!==f||e[29]!==b?($=s.jsx(qt,{size:f,className:p,children:b}),e[27]=p,e[28]=f,e[29]=b,e[30]=$):$=e[30];let F;if(e[31]!==n||e[32]!==u){let J;e[34]!==n?(J=H=>{const W=n.get(H.role)??"bg-muted-foreground";return s.jsx(Ft,{value:H.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:rt("size-3 rounded-full",W)}),s.jsx("span",{className:"capitalize",children:H.label})]})},H.role)},e[34]=n,e[35]=J):J=e[35],F=u.map(J),e[31]=n,e[32]=u,e[33]=F}else F=e[33];let D;e[36]!==F?(D=s.jsx(Ut,{children:F}),e[36]=F,e[37]=D):D=e[37];let G;e[38]!==a||e[39]!==l||e[40]!==h||e[41]!==$||e[42]!==D?(G=s.jsx(Is,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(Bt,{value:l,onValueChange:h,disabled:a,children:[$,D]})})}),e[38]=a,e[39]=l,e[40]=h,e[41]=$,e[42]=D,e[43]=G):G=e[43];let Z;e[44]!==o?(Z=o("orgs.members.ownerRoleCannotBeChanged"),e[44]=o,e[45]=Z):Z=e[45];let K;e[46]!==Z?(K=s.jsx(Rs,{children:s.jsx("p",{children:Z})}),e[46]=Z,e[47]=K):K=e[47];let Q;e[48]!==G||e[49]!==K?(Q=s.jsx(As,{children:s.jsxs(zs,{children:[G,K]})}),e[48]=G,e[49]=K,e[50]=Q):Q=e[50],S=Q;break e}z=Bt,O=l,e[51]!==c||e[52]!==m?(T=h=>m(c,h),e[51]=c,e[52]=m,e[53]=T):T=e[53],L=a,E=qt,U=f,x=p,j=$t,v="flex items-center gap-2 min-w-0",P=rt("size-2 rounded-full shrink-0",N)}e[0]=p,e[1]=a,e[2]=c,e[3]=m,e[4]=l,e[5]=n,e[6]=u,e[7]=f,e[8]=o,e[9]=j,e[10]=E,e[11]=z,e[12]=P,e[13]=v,e[14]=U,e[15]=x,e[16]=O,e[17]=T,e[18]=L,e[19]=S}else j=e[9],E=e[10],z=e[11],P=e[12],v=e[13],U=e[14],x=e[15],O=e[16],T=e[17],L=e[18],S=e[19];if(S!==Symbol.for("react.early_return_sentinel"))return S;let I;e[54]!==P?(I=s.jsx("div",{className:P}),e[54]=P,e[55]=I):I=e[55];let k;e[56]!==l?(k=s.jsx("span",{className:"capitalize truncate",children:l}),e[56]=l,e[57]=k):k=e[57];let _;e[58]!==I||e[59]!==k||e[60]!==v?(_=s.jsxs("div",{className:v,children:[I,k]}),e[58]=I,e[59]=k,e[60]=v,e[61]=_):_=e[61];let R;e[62]!==j||e[63]!==_?(R=s.jsx(j,{children:_}),e[62]=j,e[63]=_,e[64]=R):R=e[64];let w;e[65]!==E||e[66]!==R||e[67]!==U||e[68]!==x?(w=s.jsx(E,{size:U,className:x,children:R}),e[65]=E,e[66]=R,e[67]=U,e[68]=x,e[69]=w):w=e[69];let M;if(e[70]!==n||e[71]!==u){let N;e[73]!==n?(N=h=>{const y=n.get(h.role)??"bg-muted-foreground";return s.jsx(Ft,{value:h.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:rt("size-3 rounded-full",y)}),s.jsx("span",{className:"capitalize",children:h.label})]})},h.role)},e[73]=n,e[74]=N):N=e[74],M=u.map(N),e[70]=n,e[71]=u,e[72]=M}else M=e[72];let B;e[75]!==M?(B=s.jsx(Ut,{children:M}),e[75]=M,e[76]=B):B=e[76];let q;return e[77]!==z||e[78]!==w||e[79]!==B||e[80]!==O||e[81]!==T||e[82]!==L?(q=s.jsxs(z,{value:O,onValueChange:T,disabled:L,children:[w,B]}),e[77]=z,e[78]=w,e[79]=B,e[80]=O,e[81]=T,e[82]=L,e[83]=q):q=e[83],q}function Gt(t){const e=ue.c(59),{member:l,roles:c,onChangeRole:a,onRemove:n,isUpdating:u}=t,m=u===void 0?!1:u,r=xe(),p=l.role==="owner";let f,o,j,E,z,P,v,U,x;if(e[0]!==p||e[1]!==m||e[2]!==l.id||e[3]!==l.role||e[4]!==a||e[5]!==c||e[6]!==r){let M;e[16]!==l.role?(M=g=>g.role!==l.role&&g.role!=="owner",e[16]=l.role,e[17]=M):M=e[17];const B=c.filter(M);E=Zt;let q;e[18]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Yt,{size:20}),e[18]=q):q=e[18],e[19]!==p?(x=s.jsx(Ht,{asChild:!0,children:s.jsx(at,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:p,onClick:li,children:q})}),e[19]=p,e[20]=x):x=e[20],j=Wt,v="end",U=ii,o=us;let N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ks,{size:16}),e[21]=N):N=e[21];let h;e[22]!==r?(h=r("orgs.members.changeRole"),e[22]=r,e[23]=h):h=e[23],e[24]!==m||e[25]!==h?(P=s.jsxs(fs,{disabled:m,children:[N,h]}),e[24]=m,e[25]=h,e[26]=P):P=e[26],f=gs;let y;e[27]!==m||e[28]!==l.id||e[29]!==a||e[30]!==r?(y=g=>{const b=[];return g.isBuiltin||(g.allowsAllStaticPermissions?b.push(r("orgs.members.fullOrgAccess")):g.staticPermissionCount&&g.staticPermissionCount>0&&b.push(r("orgs.members.orgPermsCount",{count:g.staticPermissionCount})),g.allowsAllConnections?b.push(r("orgs.members.allConnections")):g.connectionCount&&g.connectionCount>0&&b.push(r("orgs.members.connectionCount",{count:g.connectionCount})),(g.connectionCount!==0||g.allowsAllConnections)&&(g.allowsAllTools?b.push(r("orgs.members.allTools")):g.toolCount&&g.toolCount>0&&b.push(r("orgs.members.toolCount",{count:g.toolCount})))),s.jsxs(Mt,{onClick:$=>{$.stopPropagation(),a(l.id,g.role)},disabled:m,children:[g.isBuiltin?s.jsx(ps,{size:16}):s.jsx(Ps,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:g.label}),!g.isBuiltin&&b.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:b.join(", ")})]})]},g.role)},e[27]=m,e[28]=l.id,e[29]=a,e[30]=r,e[31]=y):y=e[31],z=B.map(y),e[0]=p,e[1]=m,e[2]=l.id,e[3]=l.role,e[4]=a,e[5]=c,e[6]=r,e[7]=f,e[8]=o,e[9]=j,e[10]=E,e[11]=z,e[12]=P,e[13]=v,e[14]=U,e[15]=x}else f=e[7],o=e[8],j=e[9],E=e[10],z=e[11],P=e[12],v=e[13],U=e[14],x=e[15];let O;e[32]!==f||e[33]!==z?(O=s.jsx(f,{children:z}),e[32]=f,e[33]=z,e[34]=O):O=e[34];let T;e[35]!==o||e[36]!==P||e[37]!==O?(T=s.jsxs(o,{children:[P,O]}),e[35]=o,e[36]=P,e[37]=O,e[38]=T):T=e[38];let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(xs,{}),e[39]=L):L=e[39];let S;e[40]!==l.id||e[41]!==n?(S=M=>{M.stopPropagation(),n(l.id)},e[40]=l.id,e[41]=n,e[42]=S):S=e[42];let I;e[43]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(_s,{size:16}),e[43]=I):I=e[43];let k;e[44]!==r?(k=r("orgs.members.removeMember"),e[44]=r,e[45]=k):k=e[45];let _;e[46]!==S||e[47]!==k?(_=s.jsxs(Mt,{variant:"destructive",onClick:S,children:[I,k]}),e[46]=S,e[47]=k,e[48]=_):_=e[48];let R;e[49]!==j||e[50]!==_||e[51]!==v||e[52]!==U||e[53]!==T?(R=s.jsxs(j,{align:v,onClick:U,children:[T,L,_]}),e[49]=j,e[50]=_,e[51]=v,e[52]=U,e[53]=T,e[54]=R):R=e[54];let w;return e[55]!==E||e[56]!==R||e[57]!==x?(w=s.jsxs(E,{children:[x,R]}),e[55]=E,e[56]=R,e[57]=x,e[58]=w):w=e[58],w}function ii(t){return t.stopPropagation()}function li(t){return t.stopPropagation()}function Qt(t){const e=ue.c(11),{invitationId:l,onCancel:c,isCancelling:a}=t,n=a===void 0?!1:a,u=xe();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ht,{asChild:!0,children:s.jsx(at,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ai,children:s.jsx(Yt,{size:20})})}),e[0]=m):m=e[0];let r;e[1]!==l||e[2]!==c?(r=j=>{j.stopPropagation(),c(l)},e[1]=l,e[2]=c,e[3]=r):r=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(es,{size:16}),e[4]=p):p=e[4];let f;e[5]!==u?(f=u("orgs.members.cancelInvitation"),e[5]=u,e[6]=f):f=e[6];let o;return e[7]!==n||e[8]!==r||e[9]!==f?(o=s.jsxs(Zt,{children:[m,s.jsx(Wt,{align:"end",onClick:ni,children:s.jsxs(Mt,{variant:"destructive",onClick:r,disabled:n,children:[p,f]})})]}),e[7]=n,e[8]=r,e[9]=f,e[10]=o):o=e[10],o}function ni(t){return t.stopPropagation()}function ai(t){return t.stopPropagation()}function ri(){const t=ue.c(198),e=xe(),{data:l}=ys(),{data:c}=Hs(),a=Ws(),n=Jt(),{locator:u}=Tt(),m=Xt(),[r,p]=pe.useState(null),[f,o]=pe.useState(null),[j,E]=pe.useState(""),[z,P]=pe.useState("table"),[v,U]=pe.useState("member"),[x,O]=pe.useState("asc"),T=l?.data?.members;let L;t[0]!==v?(L=i=>{v===i?O(fi):(U(i),O("asc"))},t[0]=v,t[1]=L):L=t[1];const S=L;let I=T??[],k=c??[];if(j){const i=j.toLowerCase();I=I.filter(d=>d.user?.name?.toLowerCase().includes(i)||d.user?.email?.toLowerCase().includes(i)||d.role?.toLowerCase().includes(i)),k=k.filter(d=>d.email?.toLowerCase().includes(i)||d.role?.toLowerCase().includes(i))}if(v&&x){let i;t[2]!==x||t[3]!==v?(i=(d,A)=>{let V,fe;e:switch(v){case"member":{V=d.user?.name||"",fe=A.user?.name||"";break e}case"role":{V=d.role||"",fe=A.role||"";break e}case"joined":{V=d.createdAt?typeof d.createdAt=="string"?d.createdAt:d.createdAt.toISOString():"",fe=A.createdAt?typeof A.createdAt=="string"?A.createdAt:A.createdAt.toISOString():"";break e}default:return 0}return x==="asc"?V.localeCompare(fe):fe.localeCompare(V)},t[2]=x,t[3]=v,t[4]=i):i=t[4],I=[...I].sort(i)}const _=I;let R;t[5]!==m?(R=async i=>{const d=await m.organization.removeMember({memberIdOrEmail:i});if(d?.error)throw new Error(d.error.message)},t[5]=m,t[6]=R):R=t[6];let w;t[7]!==u||t[8]!==n||t[9]!==e?(w=()=>{nt("member_removed"),n.invalidateQueries({queryKey:ct.members(u)}),ge.success(e("orgs.members.memberRemovedSuccess")),p(null)},t[7]=u,t[8]=n,t[9]=e,t[10]=w):w=t[10];let M;t[11]!==e?(M=i=>{nt("member_remove_failed",{error:i instanceof Error?i.message:String(i)}),ge.error(i instanceof Error?i.message:e("orgs.members.failedRemoveMember"))},t[11]=e,t[12]=M):M=t[12];let B;t[13]!==R||t[14]!==w||t[15]!==M?(B={mutationFn:R,onSuccess:w,onError:M},t[13]=R,t[14]=w,t[15]=M,t[16]=B):B=t[16];const q=xt(B);let N;t[17]!==m?(N=async i=>{const{memberId:d,role:A}=i,V=await m.organization.updateMemberRole({memberId:d,role:[A]});if(V?.error)throw new Error(V.error.message)},t[17]=m,t[18]=N):N=t[18];let h;t[19]!==u||t[20]!==n||t[21]!==e?(h=(i,d)=>{nt("member_role_updated",{new_role:d.role}),n.invalidateQueries({queryKey:ct.members(u)}),ge.success(e("orgs.members.roleUpdatedSuccess"))},t[19]=u,t[20]=n,t[21]=e,t[22]=h):h=t[22];let y;t[23]!==e?(y=(i,d)=>{nt("member_role_update_failed",{new_role:d.role,error:i instanceof Error?i.message:String(i)}),ge.error(i instanceof Error?i.message:e("orgs.members.failedUpdateRole"))},t[23]=e,t[24]=y):y=t[24];let g;t[25]!==N||t[26]!==h||t[27]!==y?(g={mutationFn:N,onSuccess:h,onError:y},t[25]=N,t[26]=h,t[27]=y,t[28]=g):g=t[28];const b=xt(g);let $;t[29]!==m?($=async i=>{const{invitationId:d,role:A,email:V}=i,fe=await m.organization.cancelInvitation({invitationId:d});if(fe?.error)throw new Error(fe.error.message);const It=await m.organization.inviteMember({email:V,role:A});if(It?.error)throw new Error(It.error.message)},t[29]=m,t[30]=$):$=t[30];let F;t[31]!==u||t[32]!==n||t[33]!==e?(F=(i,d)=>{nt("invitation_role_updated",{new_role:d.role}),n.invalidateQueries({queryKey:ct.invitations(u)}),ge.success(e("orgs.members.invitationRoleUpdatedSuccess"))},t[31]=u,t[32]=n,t[33]=e,t[34]=F):F=t[34];let D;t[35]!==e?(D=(i,d)=>{nt("invitation_role_update_failed",{new_role:d.role,error:i instanceof Error?i.message:String(i)}),ge.error(i instanceof Error?i.message:e("orgs.members.failedUpdateInvitationRole"))},t[35]=e,t[36]=D):D=t[36];let G;t[37]!==F||t[38]!==D||t[39]!==$?(G={mutationFn:$,onSuccess:F,onError:D},t[37]=F,t[38]=D,t[39]=$,t[40]=G):G=t[40];const Z=xt(G),{roles:K,customRoles:Q}=ws();let J;t[41]!==Q?(J=si(Q),t[41]=Q,t[42]=J):J=t[42];const H=J;let W;t[43]!==K?(W=K.filter(ui),t[43]=K,t[44]=W):W=t[44];const X=W;let ae;t[45]!==e?(ae=e("orgs.members.columnMember"),t[45]=e,t[46]=ae):ae=t[46];let re;t[47]!==e?(re=i=>i.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ot,{url:i.data.user?.image??void 0,fallback:gt(i.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.data.user?.name||e("orgs.members.unknown")}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ot,{fallback:gt(i.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:e("orgs.members.invitationSent")})]})]}),t[47]=e,t[48]=re):re=t[48];let oe;t[49]!==ae||t[50]!==re?(oe={id:"member",header:ae,render:re,cellClassName:"flex-1 min-w-0",sortable:!0},t[49]=ae,t[50]=re,t[51]=oe):oe=t[51];let Y;t[52]!==e?(Y=e("orgs.members.columnRole"),t[52]=e,t[53]=Y):Y=t[53];let ce;t[54]!==H||t[55]!==X||t[56]!==Z||t[57]!==b?(ce=i=>i.type==="member"?s.jsx(pt,{role:i.data.role,memberId:i.data.id,isOwner:i.data.role==="owner",roleColorMap:H,selectableRoles:X,onRoleChange:(d,A)=>b.mutate({memberId:d,role:A}),className:"w-36"}):s.jsx(pt,{role:i.data.role,memberId:i.data.id,isOwner:!1,roleColorMap:H,selectableRoles:X,onRoleChange:(d,A)=>Z.mutate({invitationId:d,role:A,email:i.data.email}),className:"w-36"}),t[54]=H,t[55]=X,t[56]=Z,t[57]=b,t[58]=ce):ce=t[58];let me;t[59]!==Y||t[60]!==ce?(me={id:"role",header:Y,render:ce,cellClassName:"w-36 shrink-0",sortable:!0},t[59]=Y,t[60]=ce,t[61]=me):me=t[61];let ee;t[62]!==e?(ee=e("orgs.members.columnTags"),t[62]=e,t[63]=ee):ee=t[63];let te;t[64]!==ee?(te={id:"tags",header:ee,render:di,cellClassName:"w-40 shrink-0"},t[64]=ee,t[65]=te):te=t[65];let se;t[66]!==e?(se=e("orgs.members.columnJoined"),t[66]=e,t[67]=se):se=t[67];let ie;t[68]!==e?(ie=i=>i.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:i.data.createdAt?Ns(i.data.createdAt):e("orgs.members.na")}):s.jsx(ht,{variant:"outline",children:e("orgs.members.pending")}),t[68]=e,t[69]=ie):ie=t[69];let le;t[70]!==se||t[71]!==ie?(le={id:"joined",header:se,render:ie,cellClassName:"w-48 shrink-0",sortable:!0},t[70]=se,t[71]=ie,t[72]=le):le=t[72];let ne;t[73]!==a.cancel.isPending||t[74]!==K||t[75]!==b?(ne={id:"actions",header:"",render:i=>i.type==="member"?s.jsx(Gt,{member:i.data,roles:K,onChangeRole:(d,A)=>b.mutate({memberId:d,role:A}),onRemove:p,isUpdating:b.isPending}):s.jsx(Qt,{invitationId:i.data.id,onCancel:o,isCancelling:a.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[73]=a.cancel.isPending,t[74]=K,t[75]=b,t[76]=ne):ne=t[76];let C;t[77]!==oe||t[78]!==me||t[79]!==te||t[80]!==le||t[81]!==ne?(C=[oe,me,te,le,ne],t[77]=oe,t[78]=me,t[79]=te,t[80]=le,t[81]=ne,t[82]=C):C=t[82];const he=C;let de;t[83]!==e?(de=e("orgs.members.inviteMember"),t[83]=e,t[84]=de):de=t[84];let be;t[85]!==de?(be=s.jsx(ds.Actions,{children:s.jsx(Ss,{trigger:s.jsx(at,{size:"sm",children:de})})}),t[85]=de,t[86]=be):be=t[86];const bt=be,jt=[..._.map(mi),...k.filter(ci).map(oi)],vt=!!f;let mt;t[87]===Symbol.for("react.memo_cache_sentinel")?(mt=()=>o(null),t[87]=mt):mt=t[87];let je;t[88]!==e?(je=e("orgs.members.cancelInvitationTitle"),t[88]=e,t[89]=je):je=t[89];let ve;t[90]!==je?(ve=s.jsx(zt,{children:je}),t[90]=je,t[91]=ve):ve=t[91];let Ce;t[92]!==e?(Ce=e("orgs.members.cancelInvitationDescription"),t[92]=e,t[93]=Ce):Ce=t[93];let Se;t[94]!==Ce?(Se=s.jsx(Pt,{children:Ce}),t[94]=Ce,t[95]=Se):Se=t[95];let Ne;t[96]!==ve||t[97]!==Se?(Ne=s.jsxs(kt,{children:[ve,Se]}),t[96]=ve,t[97]=Se,t[98]=Ne):Ne=t[98];let ye;t[99]!==e?(ye=e("orgs.members.keepInvitation"),t[99]=e,t[100]=ye):ye=t[100];let we;t[101]!==ye?(we=s.jsx(_t,{children:ye}),t[101]=ye,t[102]=we):we=t[102];let Me;t[103]!==a.cancel||t[104]!==f?(Me=()=>{f&&(a.cancel.mutate(f),o(null))},t[103]=a.cancel,t[104]=f,t[105]=Me):Me=t[105];const ss=a.cancel.isPending;let Te;t[106]!==e?(Te=e("orgs.members.cancelInvitation"),t[106]=e,t[107]=Te):Te=t[107];let Ie;t[108]!==a.cancel.isPending||t[109]!==Me||t[110]!==Te?(Ie=s.jsx(Dt,{onClick:Me,disabled:ss,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Te}),t[108]=a.cancel.isPending,t[109]=Me,t[110]=Te,t[111]=Ie):Ie=t[111];let Re;t[112]!==we||t[113]!==Ie?(Re=s.jsxs(Et,{children:[we,Ie]}),t[112]=we,t[113]=Ie,t[114]=Re):Re=t[114];let Ae;t[115]!==Ne||t[116]!==Re?(Ae=s.jsxs(Ot,{children:[Ne,Re]}),t[115]=Ne,t[116]=Re,t[117]=Ae):Ae=t[117];let ze;t[118]!==vt||t[119]!==Ae?(ze=s.jsx(Lt,{open:vt,onOpenChange:mt,children:Ae}),t[118]=vt,t[119]=Ae,t[120]=ze):ze=t[120];const Ct=!!r;let dt;t[121]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>p(null),t[121]=dt):dt=t[121];let Pe;t[122]!==e?(Pe=e("orgs.members.removeMemberTitle"),t[122]=e,t[123]=Pe):Pe=t[123];let ke;t[124]!==Pe?(ke=s.jsx(zt,{children:Pe}),t[124]=Pe,t[125]=ke):ke=t[125];let _e;t[126]!==e?(_e=e("orgs.members.removeMemberDescription"),t[126]=e,t[127]=_e):_e=t[127];let De;t[128]!==_e?(De=s.jsx(Pt,{children:_e}),t[128]=_e,t[129]=De):De=t[129];let Ee;t[130]!==ke||t[131]!==De?(Ee=s.jsxs(kt,{children:[ke,De]}),t[130]=ke,t[131]=De,t[132]=Ee):Ee=t[132];let Oe;t[133]!==e?(Oe=e("orgs.members.cancel"),t[133]=e,t[134]=Oe):Oe=t[134];let Le;t[135]!==Oe?(Le=s.jsx(_t,{children:Oe}),t[135]=Oe,t[136]=Le):Le=t[136];let $e;t[137]!==r||t[138]!==q?($e=()=>r&&q.mutate(r),t[137]=r,t[138]=q,t[139]=$e):$e=t[139];const is=q.isPending;let qe;t[140]!==e?(qe=e("orgs.members.remove"),t[140]=e,t[141]=qe):qe=t[141];let Fe;t[142]!==q.isPending||t[143]!==$e||t[144]!==qe?(Fe=s.jsx(Dt,{onClick:$e,disabled:is,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:qe}),t[142]=q.isPending,t[143]=$e,t[144]=qe,t[145]=Fe):Fe=t[145];let Ue;t[146]!==Le||t[147]!==Fe?(Ue=s.jsxs(Et,{children:[Le,Fe]}),t[146]=Le,t[147]=Fe,t[148]=Ue):Ue=t[148];let Be;t[149]!==Ee||t[150]!==Ue?(Be=s.jsxs(Ot,{children:[Ee,Ue]}),t[149]=Ee,t[150]=Ue,t[151]=Be):Be=t[151];let Ke;t[152]!==Ct||t[153]!==Be?(Ke=s.jsx(Lt,{open:Ct,onOpenChange:dt,children:Be}),t[152]=Ct,t[153]=Be,t[154]=Ke):Ke=t[154];let Ve;t[155]===Symbol.for("react.memo_cache_sentinel")?(Ve=s.jsx(Zs,{}),t[155]=Ve):Ve=t[155];const ls="flex flex-col gap-6";let Ge;t[156]!==e?(Ge=e("orgs.members.searchPlaceholder"),t[156]=e,t[157]=Ge):Ge=t[157];let ut;t[158]===Symbol.for("react.memo_cache_sentinel")?(ut=i=>{i.key==="Escape"&&(E(""),i.target.blur())},t[158]=ut):ut=t[158];let Qe;t[159]!==j||t[160]!==Ge?(Qe=s.jsx(bs,{value:j,onChange:E,placeholder:Ge,className:"w-full md:w-[375px]",onKeyDown:ut}),t[159]=j,t[160]=Ge,t[161]=Qe):Qe=t[161];let Je;t[162]!==e?(Je=e("orgs.members.sortName"),t[162]=e,t[163]=Je):Je=t[163];let Ze;t[164]!==Je?(Ze={id:"member",label:Je},t[164]=Je,t[165]=Ze):Ze=t[165];let He;t[166]!==e?(He=e("orgs.members.sortRole"),t[166]=e,t[167]=He):He=t[167];let We;t[168]!==He?(We={id:"role",label:He},t[168]=He,t[169]=We):We=t[169];let Xe;t[170]!==e?(Xe=e("orgs.members.sortJoined"),t[170]=e,t[171]=Xe):Xe=t[171];let Ye;t[172]!==Xe?(Ye={id:"joined",label:Xe},t[172]=Xe,t[173]=Ye):Ye=t[173];let et;t[174]!==Ze||t[175]!==We||t[176]!==Ye?(et=[Ze,We,Ye],t[174]=Ze,t[175]=We,t[176]=Ye,t[177]=et):et=t[177];let tt;t[178]!==S||t[179]!==x||t[180]!==v||t[181]!==et||t[182]!==z?(tt=s.jsx(hs,{viewMode:z,onViewModeChange:P,sortKey:v,sortDirection:x,onSort:S,sortOptions:et}),t[178]=S,t[179]=x,t[180]=v,t[181]=et,t[182]=z,t[183]=tt):tt=t[183];let st;t[184]!==Qe||t[185]!==tt?(st=s.jsxs("div",{className:"flex items-center gap-2",children:[Qe,tt]}),t[184]=Qe,t[185]=tt,t[186]=st):st=t[186];let it;t[187]!==bt||t[188]!==st?(it=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[st,bt]}),t[187]=bt,t[188]=st,t[189]=it):it=t[189];const St=z==="cards"?s.jsx("div",{children:jt.length===0?s.jsx(Nt,{title:e("orgs.members.noMembersFound"),description:j?e("orgs.members.noMembersMatch",{search:j}):e("orgs.members.inviteMembersGetStarted")}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:jt.map(i=>{if(i.type==="invitation")return s.jsxs(At,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Qt,{invitationId:i.data.id,onCancel:o,isCancelling:a.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(ot,{fallback:gt(i.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:i.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(ht,{variant:"outline",className:"w-fit text-warning border-warning/40",children:e("orgs.members.pending")})}),s.jsx(pt,{role:i.data.role,memberId:i.data.id,isOwner:!1,roleColorMap:H,selectableRoles:X,onRoleChange:(A,V)=>Z.mutate({invitationId:A,role:V,email:i.data.email}),className:"w-fit"})]})]})]},`inv-${i.data.id}`);const d=i.data;return s.jsxs(At,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Gt,{member:d,roles:K,onChangeRole:(A,V)=>b.mutate({memberId:A,role:V}),onRemove:p,isUpdating:b.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(ot,{url:d.user?.image??void 0,fallback:gt(d.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:d.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:d.user?.email}),s.jsx(pt,{role:d.role,memberId:d.id,isOwner:d.role==="owner",roleColorMap:H,selectableRoles:X,onRoleChange:(A,V)=>b.mutate({memberId:A,role:V}),className:"w-fit"}),s.jsx(ts,{memberId:d.id,maxDisplay:3})]})]})]},d.id)})})}):s.jsx(js,{columns:he,data:jt,isLoading:!1,sortKey:v,sortDirection:x,onSort:S,emptyState:j?s.jsx(Nt,{title:e("orgs.members.noMembersFound"),description:e("orgs.members.noMembersMatch",{search:j})}):s.jsx(Nt,{title:e("orgs.members.noMembersFound"),description:e("orgs.members.inviteMembersGetStarted")})});let lt;t[190]!==it||t[191]!==St?(lt=s.jsxs("div",{className:ls,children:[it,St]}),t[190]=it,t[191]=St,t[192]=lt):lt=t[192];let ft;return t[193]!==ze||t[194]!==Ke||t[195]!==Ve||t[196]!==lt?(ft=s.jsxs(s.Fragment,{children:[ze,Ke,Ve,lt]}),t[193]=ze,t[194]=Ke,t[195]=Ve,t[196]=lt,t[197]=ft):ft=t[197],ft}function oi(t){return{type:"invitation",data:t}}function ci(t){return t.status==="pending"}function mi(t){return{type:"member",data:t}}function di(t){return t.type==="member"?s.jsx(ts,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function ui(t){return t.role!=="owner"}function fi(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function gi(){const t=ue.c(7),e=xe();let l;t[0]!==e?(l=e("orgs.members.failedLoadMembers"),t[0]=e,t[1]=l):l=t[1];let c;t[2]!==l?(c=s.jsx("div",{className:"text-sm text-muted-foreground",children:l}),t[2]=l,t[3]=c):c=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ri,{}),t[4]=a):a=t[4];let n;return t[5]!==c?(n=s.jsx(ms,{group:"members",className:"gap-6",errorFallback:c,children:a}),t[5]=c,t[6]=n):n=t[6],n}function ll(){const t=ue.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Js,{capability:"members:manage",area:"members",children:s.jsx(gi,{})}),t[0]=e):e=t[0],e}export{ll as default};
@@ -1,7 +1,7 @@
1
- import{c as me,b as he,X as pe,d as je,u as Se,a as we,j as s,n as oe,x as Ne,o as Te,K as ee,r as te,Z as ge,B as de,f1 as ye,l as ve,aS as ce,m as ze,h as Ee}from"./index-D_7jfHk6.js";import{t as ke}from"./Building02-uHT4KVtK.js";import{s as Ce}from"./User01-Awky2MVQ.js";import{a as Me,A as Oe}from"./alert-CGA3Ty0D.js";import{T as _e,a as De,b as Fe}from"./tooltip-BULKkf4A.js";import{C as Pe}from"./collection-tabs-Cw7XLgNG.js";import{E as Le}from"./empty-state-DnQ_qEjI.js";import{u as $e}from"./use-clock-tick-DGTQe72H.js";import{e as qe,u as Ae,s as Ie,w as Ke}from"./use-org-fs-DPxqVRhB.js";import"./index-D1CuHcEn.js";import"./badge-CKM84j2S.js";import"./useInfiniteQuery-eYXaZ_bo.js";import"./infiniteQueryObserver-DG8sBe4B.js";const Re=16e3;function He(t,e){return t==="organization"?"MEMORY.md":`users/${e}/MEMORY.md`}function Qe(t){return t==="organization"?`# Organization memory
1
+ import{c as me,b as he,a2 as pe,d as je,u as Se,a as we,j as s,n as oe,F as Ne,o as Te,K as ee,r as te,a4 as ge,B as de,ff as ye,l as ve,b2 as ce,m as ze,h as Ee}from"./index-Bm9FTdjr.js";import{t as ke}from"./Building02-BZItaEYx.js";import{s as Ce}from"./User01-9bZ-cKa7.js";import{a as Me,A as Oe}from"./alert-Dyx5I-Y3.js";import{T as _e,a as De,b as Fe}from"./tooltip-XZmQWwgB.js";import{C as Pe}from"./collection-tabs-DeQ7zbGh.js";import{E as Le}from"./empty-state-Zf0MeIMv.js";import{u as $e}from"./use-clock-tick-rPXqIJP8.js";import{e as qe,u as Ae,s as Ie,w as Ke}from"./use-org-fs-gQ0RuIPK.js";import"./index-D2iZ6syL.js";import"./badge-DFdotQFQ.js";import"./useInfiniteQuery-vZqvTY4f.js";import"./infiniteQueryObserver-zxl9Rj5F.js";const Re=16e3;function He(t,e){return t==="organization"?"MEMORY.md":`users/${e}/MEMORY.md`}function Qe(t){return t==="organization"?`# Organization memory
2
2
 
3
3
  Durable facts shared with everyone in this organization. Keep this a concise, curated index — not a log.
4
4
  `:`# User memory
5
5
 
6
6
  Facts and preferences specific to you. Keep this a concise, curated index — not a log.
7
- `}const Be=800,ue={marker:"absent",expect:{absent:!0}};function fe(t){return{marker:qe(t),expect:t.contentHash?{contentHash:t.contentHash}:null}}class Ye{constructor(e,i,a){this.write=e,this.onStatus=i,this.onSaved=a}write;onStatus;onSaved;draft=null;base=ue;loaded=0;held=!1;timer;queue=Promise.resolve();change(e,i){this.draft===null&&i.generation>this.loaded&&(this.base=i.version,this.loaded=i.generation),this.draft=e,!this.held&&(this.onStatus("dirty"),clearTimeout(this.timer),this.timer=setTimeout(()=>this.flush(),Be))}flush(e=!1){clearTimeout(this.timer),this.timer=void 0,!(this.held&&!e)&&(this.held=!1,this.queue=this.queue.then(()=>this.save(e)))}discard(){clearTimeout(this.timer),this.timer=void 0,this.draft=null,this.held=!1}async save(e){const i=this.draft;if(i!==null){this.onStatus("saving");try{const a=await this.write(i,e?null:this.base.expect);if(!a.ok){this.held=!0,this.onStatus(a.reason);return}this.base=fe(a.entry),this.onSaved(a.entry,i),this.draft===i&&(this.draft=null,this.onStatus("saved"))}catch{this.onStatus("error")}}}subscribe=()=>{const e=i=>{this.draft!==null&&i.preventDefault()};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e),this.timer!==void 0&&this.flush()}}}const H="home",xe=()=>0;function Ue(t,e,i){const a=Math.round((e-new Date(t).getTime())/1e3),m=new Intl.RelativeTimeFormat(i,{numeric:"auto"}),r=[["day",86400],["hour",3600],["minute",60]];for(const[n,S]of r)if(Math.abs(a)>=S)return m.format(-Math.round(a/S),n);return m.format(0,"second")}function Ve(t,e,i){switch(e){case"dirty":return"";case"saving":return t("settings.memory.saving");case"saved":return t("settings.memory.saved");case"conflict":return t("settings.memory.notSaved");case"forbidden":return t("settings.memory.readOnly");case"error":return t("settings.memory.saveError");case"idle":return i?t("settings.memory.updated",{time:i}):t("settings.memory.notStarted");default:return e}}function Je(t){const e=me.c(19),{length:i}=t,a=he(),m=i/Re;if(m<.5)return null;const r=m>1,n=r?"text-destructive":m>.8&&"text-warning";let S;e[0]!==n?(S=ve("inline-flex items-center gap-2 rounded-sm",n),e[0]=n,e[1]=S):S=e[1];const T=`${Math.min(m,1)*100}%`;let f;e[2]!==T?(f=s.jsx("span",{className:"h-1 w-16 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full bg-current transition-[width]",style:{width:T}})}),e[2]=T,e[3]=f):f=e[3];let v;e[4]!==r||e[5]!==m||e[6]!==a?(v=r?a("settings.memory.budgetOver"):a("settings.memory.budget",{percent:String(Math.round(m*100))}),e[4]=r,e[5]=m,e[6]=a,e[7]=v):v=e[7];let u;e[8]!==S||e[9]!==f||e[10]!==v?(u=s.jsx(_e,{asChild:!0,children:s.jsxs("span",{tabIndex:0,className:S,children:[f,v]})}),e[8]=S,e[9]=f,e[10]=v,e[11]=u):u=e[11];let l;e[12]!==a?(l=a("settings.memory.budgetHint"),e[12]=a,e[13]=l):l=e[13];let h;e[14]!==l?(h=s.jsx(De,{side:"top",className:"max-w-64",children:l}),e[14]=l,e[15]=h):h=e[15];let g;return e[16]!==u||e[17]!==h?(g=s.jsxs(Fe,{children:[u,h]}),e[16]=u,e[17]=h,e[18]=g):g=e[18],g}function be(){const t=me.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"gap-3 px-6 py-5",children:s.jsxs("div",{className:"flex min-h-[320px] flex-col gap-3",children:[s.jsx(ce,{className:"h-5 w-1/3"}),s.jsx(ce,{className:"h-4 w-full"}),s.jsx(ce,{className:"h-4 w-5/6"}),s.jsx(ce,{className:"h-4 w-2/3"})]})}),t[0]=e):e=t[0],e}function Xe(t){const e=me.c(109),{scope:i,userId:a,label:m}=t,r=he(),{org:n}=pe(),[S]=Ne(),{language:T}=S,f=Te(),v=$e(6e4);let u;e[0]!==i||e[1]!==a?(u=He(i,a),e[0]=i,e[1]=a,e[2]=u):u=e[2];const l=u,h=i==="organization"?"":`users/${a}`;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={staleTime:0},e[3]=g):g=e[3];const o=Ae(H,l,g);let b,w,k;e[4]!==n.id||e[5]!==l||e[6]!==o.data?(b=o.data===void 0?void 0:o.data?fe(o.data):ue,k=ze,w=ee.orgFsText(n.id,H,l,b?.marker??""),e[4]=n.id,e[5]=l,e[6]=o.data,e[7]=b,e[8]=w,e[9]=k):(b=e[7],w=e[8],k=e[9]);const M=o.data!=null;let N;e[10]!==n.slug||e[11]!==l?(N=()=>Ie(n.slug,H,l),e[10]=n.slug,e[11]=l,e[12]=N):N=e[12];let C;e[13]!==w||e[14]!==M||e[15]!==N?(C={queryKey:w,enabled:M,staleTime:1/0,queryFn:N},e[13]=w,e[14]=M,e[15]=N,e[16]=C):C=e[16];const z=k(C),P=b===ue?"":z.data,[d,O]=te.useState("idle"),[c,_]=te.useState(null),[D,$]=te.useState(null);let Q;e[17]!==h||e[18]!==n.id||e[19]!==n.slug||e[20]!==l||e[21]!==f?(Q=()=>new Ye((x,j)=>Ke(n.slug,H,l,x,j),O,(x,j)=>{const p=fe(x);f.setQueryData(ee.orgFsText(n.id,H,l,p.marker),j),f.setQueryData(ee.orgFsStat(n.id,H,l),x),f.invalidateQueries({queryKey:ee.orgFsList(n.id,H,h)}),f.invalidateQueries({queryKey:ee.orgFsRecent(n.id)}),_(y=>y&&{...y,version:p,body:j})}),e[17]=h,e[18]=n.id,e[19]=n.slug,e[20]=l,e[21]=f,e[22]=Q):Q=e[22];const[E]=te.useState(Q);te.useSyncExternalStore(E.subscribe,xe,xe),b&&P!==void 0&&(d==="idle"||d==="saved")&&b.marker!==c?.version.marker&&(_({version:b,body:P,generation:(c?.generation??0)+1}),$(null),d==="saved"&&O("idle"));let se;e[23]!==E||e[24]!==o?(se=()=>{E.discard(),O("idle"),$(null),_(Ze),o.refetch()},e[23]=E,e[24]=o,e[25]=se):se=e[25];const W=se;if(!c&&(o.isError||z.isError)){let x;e[26]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ge,{size:48,className:"text-muted-foreground"}),e[26]=x):x=e[26];let j;e[27]!==r?(j=r("settings.memory.errorTitle"),e[27]=r,e[28]=j):j=e[28];let p;e[29]!==r?(p=r("settings.memory.errorDescription"),e[29]=r,e[30]=p):p=e[30];let y;e[31]!==o||e[32]!==z?(y=()=>{o.refetch(),z.refetch()},e[31]=o,e[32]=z,e[33]=y):y=e[33];let F;e[34]!==r?(F=r("settings.memory.retry"),e[34]=r,e[35]=F):F=e[35];let L;e[36]!==y||e[37]!==F?(L=s.jsx(de,{size:"sm",variant:"outline",onClick:y,children:F}),e[36]=y,e[37]=F,e[38]=L):L=e[38];let le;return e[39]!==j||e[40]!==p||e[41]!==L?(le=s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Le,{image:x,title:j,description:p,actions:L})}),e[39]=j,e[40]=p,e[41]=L,e[42]=le):le=e[42],le}if(!c){let x;return e[43]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{}),e[43]=x):x=e[43],x}let ie;e[44]!==c.body?(ie=c.body.trim(),e[44]=c.body,e[45]=ie):ie=e[45];let ne;e[46]!==i?(ne=Qe(i).trim(),e[46]=i,e[47]=ne):ne=e[47];const re=ie===ne,q=re?"":c.body;let A,B,I,Y,U,V,K,R;if(e[48]!==m||e[49]!==T||e[50]!==W||e[51]!==v||e[52]!==E||e[53]!==i||e[54]!==c||e[55]!==o.data||e[56]!==d||e[57]!==r||e[58]!==re||e[59]!==q){const x=!re&&o.data?Ue(o.data.updatedAt,v,T):null;V="flex flex-col gap-4",e[68]!==W||e[69]!==E||e[70]!==d||e[71]!==r?(K=d==="conflict"&&s.jsxs(Me,{variant:"info",className:"border-warning",children:[s.jsx(ge,{className:"text-warning"}),s.jsxs(Oe,{className:"flex flex-1 flex-wrap items-center justify-between gap-3",children:[r("settings.memory.conflict"),s.jsxs("span",{className:"flex gap-2",children:[s.jsx(de,{size:"sm",variant:"outline",onClick:W,children:r("settings.memory.loadLatest")}),s.jsx(de,{size:"sm",onClick:()=>E.flush(!0),children:r("settings.memory.keepMine")})]})]})]}),e[68]=W,e[69]=E,e[70]=d,e[71]=r,e[72]=K):K=e[72];const j=d==="forbidden";let p;e[73]!==i||e[74]!==r?(p=r(i==="organization"?"settings.memory.orgPlaceholder":"settings.memory.userPlaceholder"),e[73]=i,e[74]=r,e[75]=p):p=e[75];let y;e[76]!==E||e[77]!==c?(y=L=>{$(L.target.value.trim().length),E.change(L.target.value,c)},e[76]=E,e[77]=c,e[78]=y):y=e[78],e[79]!==m||e[80]!==c.generation||e[81]!==j||e[82]!==p||e[83]!==y||e[84]!==q?(R=s.jsx(ye,{className:"gap-0 px-6 py-5",children:s.jsx("textarea",{defaultValue:q,readOnly:j,"aria-label":m,placeholder:p,onChange:y,className:"field-sizing-content min-h-[320px] w-full resize-none bg-transparent font-mono text-[13px] leading-6 text-foreground outline-none placeholder:text-muted-foreground"},c.generation)}),e[79]=m,e[80]=c.generation,e[81]=j,e[82]=p,e[83]=y,e[84]=q,e[85]=R):R=e[85],U="flex min-h-5 items-center justify-between gap-3 text-meta";const F=d==="error"&&"text-destructive";e[86]!==F?(A=ve("inline-flex items-center gap-1.5",F),e[86]=F,e[87]=A):A=e[87],B="polite",e[88]!==d?(I=d==="saving"&&s.jsx(Ee,{className:"size-3"}),e[88]=d,e[89]=I):I=e[89],Y=Ve(r,d,x),e[48]=m,e[49]=T,e[50]=W,e[51]=v,e[52]=E,e[53]=i,e[54]=c,e[55]=o.data,e[56]=d,e[57]=r,e[58]=re,e[59]=q,e[60]=A,e[61]=B,e[62]=I,e[63]=Y,e[64]=U,e[65]=V,e[66]=K,e[67]=R}else A=e[60],B=e[61],I=e[62],Y=e[63],U=e[64],V=e[65],K=e[66],R=e[67];let J;e[90]!==A||e[91]!==B||e[92]!==I||e[93]!==Y?(J=s.jsxs("span",{className:A,"aria-live":B,children:[I,Y]}),e[90]=A,e[91]=B,e[92]=I,e[93]=Y,e[94]=J):J=e[94];let X;e[95]!==D||e[96]!==q?(X=D??q.trim().length,e[95]=D,e[96]=q,e[97]=X):X=e[97];let Z;e[98]!==X?(Z=s.jsx(Je,{length:X}),e[98]=X,e[99]=Z):Z=e[99];let G;e[100]!==U||e[101]!==J||e[102]!==Z?(G=s.jsxs("div",{className:U,children:[J,Z]}),e[100]=U,e[101]=J,e[102]=Z,e[103]=G):G=e[103];let ae;return e[104]!==V||e[105]!==K||e[106]!==R||e[107]!==G?(ae=s.jsxs("div",{className:V,children:[K,R,G]}),e[104]=V,e[105]=K,e[106]=R,e[107]=G,e[108]=ae):ae=e[108],ae}function Ze(t){return t&&{...t,version:{marker:"",expect:null}}}function dt(){const t=me.c(53),e=he(),{org:i}=pe(),a=je();let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},t[0]=m):m=t[0];const n=Se(m).scope==="user"?"user":"organization",{data:S}=we.useSession(),T=S?.user.id,f=n==="organization"?ke:Ce;let v;t[1]!==i.name||t[2]!==n||t[3]!==e?(v=n==="organization"?e("settings.memory.orgHeading",{org:i.name}):e("settings.memory.userHeading"),t[1]=i.name,t[2]=n,t[3]=e,t[4]=v):v=t[4];const u=v;let l;t[5]!==e?(l=e("settings.memory.pageTitle"),t[5]=e,t[6]=l):l=t[6];let h;t[7]!==l?(h=s.jsx(oe.Title,{children:l}),t[7]=l,t[8]=h):h=t[8];let g;t[9]!==e?(g=e("settings.memory.tabOrg"),t[9]=e,t[10]=g):g=t[10];let o;t[11]!==g?(o={id:"organization",label:g},t[11]=g,t[12]=o):o=t[12];let b;t[13]!==e?(b=e("settings.memory.tabUser"),t[13]=e,t[14]=b):b=t[14];let w;t[15]!==b?(w={id:"user",label:b},t[15]=b,t[16]=w):w=t[16];let k;t[17]!==o||t[18]!==w?(k=[o,w],t[17]=o,t[18]=w,t[19]=k):k=t[19];let M;t[20]!==a||t[21]!==i.slug?(M=Q=>a({to:"/$org/settings/memory",params:{org:i.slug},search:Q==="user"?{scope:"user"}:{},replace:!0}),t[20]=a,t[21]=i.slug,t[22]=M):M=t[22];let N;t[23]!==n||t[24]!==k||t[25]!==M?(N=s.jsx(Pe,{placement:"page",tabs:k,activeTab:n,onTabChange:M}),t[23]=n,t[24]=k,t[25]=M,t[26]=N):N=t[26];let C;t[27]!==f?(C=s.jsx("span",{className:"surface-inset flex size-9 shrink-0 items-center justify-center rounded-full text-muted-foreground",children:s.jsx(f,{size:16})}),t[27]=f,t[28]=C):C=t[28];let z;t[29]!==u?(z=s.jsx("p",{className:"text-sm font-medium text-foreground",children:u}),t[29]=u,t[30]=z):z=t[30];let P;t[31]!==n||t[32]!==e?(P=e(n==="organization"?"settings.memory.orgDescription":"settings.memory.userDescription"),t[31]=n,t[32]=e,t[33]=P):P=t[33];let d;t[34]!==P?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:P}),t[34]=P,t[35]=d):d=t[35];let O;t[36]!==z||t[37]!==d?(O=s.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[z,d]}),t[36]=z,t[37]=d,t[38]=O):O=t[38];let c;t[39]!==C||t[40]!==O?(c=s.jsxs("div",{className:"flex items-start gap-3",children:[C,O]}),t[39]=C,t[40]=O,t[41]=c):c=t[41];let _;t[42]!==u||t[43]!==n||t[44]!==T?(_=T?s.jsx(Xe,{scope:n,userId:T,label:u},n):s.jsx(be,{}),t[42]=u,t[43]=n,t[44]=T,t[45]=_):_=t[45];let D;t[46]!==c||t[47]!==_?(D=s.jsxs("div",{className:"flex flex-col gap-4",children:[c,_]}),t[46]=c,t[47]=_,t[48]=D):D=t[48];let $;return t[49]!==N||t[50]!==D||t[51]!==h?($=s.jsx(oe,{children:s.jsx(oe.Content,{children:s.jsx(oe.Container,{width:"reading",children:s.jsxs("div",{className:"flex flex-col gap-6",children:[h,N,D]})})})}),t[49]=N,t[50]=D,t[51]=h,t[52]=$):$=t[52],$}export{dt as default};
7
+ `}const Be=800,ue={marker:"absent",expect:{absent:!0}};function fe(t){return{marker:qe(t),expect:t.contentHash?{contentHash:t.contentHash}:null}}class Ye{constructor(e,i,a){this.write=e,this.onStatus=i,this.onSaved=a}write;onStatus;onSaved;draft=null;base=ue;loaded=0;held=!1;timer;queue=Promise.resolve();change(e,i){this.draft===null&&i.generation>this.loaded&&(this.base=i.version,this.loaded=i.generation),this.draft=e,!this.held&&(this.onStatus("dirty"),clearTimeout(this.timer),this.timer=setTimeout(()=>this.flush(),Be))}flush(e=!1){clearTimeout(this.timer),this.timer=void 0,!(this.held&&!e)&&(this.held=!1,this.queue=this.queue.then(()=>this.save(e)))}discard(){clearTimeout(this.timer),this.timer=void 0,this.draft=null,this.held=!1}async save(e){const i=this.draft;if(i!==null){this.onStatus("saving");try{const a=await this.write(i,e?null:this.base.expect);if(!a.ok){this.held=!0,this.onStatus(a.reason);return}this.base=fe(a.entry),this.onSaved(a.entry,i),this.draft===i&&(this.draft=null,this.onStatus("saved"))}catch{this.onStatus("error")}}}subscribe=()=>{const e=i=>{this.draft!==null&&i.preventDefault()};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e),this.timer!==void 0&&this.flush()}}}const H="home",xe=()=>0;function Ue(t,e,i){const a=Math.round((e-new Date(t).getTime())/1e3),m=new Intl.RelativeTimeFormat(i,{numeric:"auto"}),r=[["day",86400],["hour",3600],["minute",60]];for(const[n,S]of r)if(Math.abs(a)>=S)return m.format(-Math.round(a/S),n);return m.format(0,"second")}function Ve(t,e,i){switch(e){case"dirty":return"";case"saving":return t("settings.memory.saving");case"saved":return t("settings.memory.saved");case"conflict":return t("settings.memory.notSaved");case"forbidden":return t("settings.memory.readOnly");case"error":return t("settings.memory.saveError");case"idle":return i?t("settings.memory.updated",{time:i}):t("settings.memory.notStarted");default:return e}}function Je(t){const e=me.c(19),{length:i}=t,a=he(),m=i/Re;if(m<.5)return null;const r=m>1,n=r?"text-destructive":m>.8&&"text-warning";let S;e[0]!==n?(S=ve("inline-flex items-center gap-2 rounded-sm",n),e[0]=n,e[1]=S):S=e[1];const T=`${Math.min(m,1)*100}%`;let f;e[2]!==T?(f=s.jsx("span",{className:"h-1 w-16 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full bg-current transition-[width]",style:{width:T}})}),e[2]=T,e[3]=f):f=e[3];let v;e[4]!==r||e[5]!==m||e[6]!==a?(v=r?a("settings.memory.budgetOver"):a("settings.memory.budget",{percent:String(Math.round(m*100))}),e[4]=r,e[5]=m,e[6]=a,e[7]=v):v=e[7];let u;e[8]!==S||e[9]!==f||e[10]!==v?(u=s.jsx(_e,{asChild:!0,children:s.jsxs("span",{tabIndex:0,className:S,children:[f,v]})}),e[8]=S,e[9]=f,e[10]=v,e[11]=u):u=e[11];let l;e[12]!==a?(l=a("settings.memory.budgetHint"),e[12]=a,e[13]=l):l=e[13];let h;e[14]!==l?(h=s.jsx(De,{side:"top",className:"max-w-64",children:l}),e[14]=l,e[15]=h):h=e[15];let g;return e[16]!==u||e[17]!==h?(g=s.jsxs(Fe,{children:[u,h]}),e[16]=u,e[17]=h,e[18]=g):g=e[18],g}function be(){const t=me.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"gap-3 px-6 py-5",children:s.jsxs("div",{className:"flex min-h-[320px] flex-col gap-3",children:[s.jsx(ce,{className:"h-5 w-1/3"}),s.jsx(ce,{className:"h-4 w-full"}),s.jsx(ce,{className:"h-4 w-5/6"}),s.jsx(ce,{className:"h-4 w-2/3"})]})}),t[0]=e):e=t[0],e}function Ge(t){const e=me.c(109),{scope:i,userId:a,label:m}=t,r=he(),{org:n}=pe(),[S]=Ne(),{language:T}=S,f=Te(),v=$e(6e4);let u;e[0]!==i||e[1]!==a?(u=He(i,a),e[0]=i,e[1]=a,e[2]=u):u=e[2];const l=u,h=i==="organization"?"":`users/${a}`;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={staleTime:0},e[3]=g):g=e[3];const o=Ae(H,l,g);let b,w,k;e[4]!==n.id||e[5]!==l||e[6]!==o.data?(b=o.data===void 0?void 0:o.data?fe(o.data):ue,k=ze,w=ee.orgFsText(n.id,H,l,b?.marker??""),e[4]=n.id,e[5]=l,e[6]=o.data,e[7]=b,e[8]=w,e[9]=k):(b=e[7],w=e[8],k=e[9]);const M=o.data!=null;let N;e[10]!==n.slug||e[11]!==l?(N=()=>Ie(n.slug,H,l),e[10]=n.slug,e[11]=l,e[12]=N):N=e[12];let C;e[13]!==w||e[14]!==M||e[15]!==N?(C={queryKey:w,enabled:M,staleTime:1/0,queryFn:N},e[13]=w,e[14]=M,e[15]=N,e[16]=C):C=e[16];const z=k(C),P=b===ue?"":z.data,[d,O]=te.useState("idle"),[c,_]=te.useState(null),[D,$]=te.useState(null);let Q;e[17]!==h||e[18]!==n.id||e[19]!==n.slug||e[20]!==l||e[21]!==f?(Q=()=>new Ye((x,j)=>Ke(n.slug,H,l,x,j),O,(x,j)=>{const p=fe(x);f.setQueryData(ee.orgFsText(n.id,H,l,p.marker),j),f.setQueryData(ee.orgFsStat(n.id,H,l),x),f.invalidateQueries({queryKey:ee.orgFsList(n.id,H,h)}),f.invalidateQueries({queryKey:ee.orgFsRecent(n.id)}),_(y=>y&&{...y,version:p,body:j})}),e[17]=h,e[18]=n.id,e[19]=n.slug,e[20]=l,e[21]=f,e[22]=Q):Q=e[22];const[E]=te.useState(Q);te.useSyncExternalStore(E.subscribe,xe,xe),b&&P!==void 0&&(d==="idle"||d==="saved")&&b.marker!==c?.version.marker&&(_({version:b,body:P,generation:(c?.generation??0)+1}),$(null),d==="saved"&&O("idle"));let se;e[23]!==E||e[24]!==o?(se=()=>{E.discard(),O("idle"),$(null),_(We),o.refetch()},e[23]=E,e[24]=o,e[25]=se):se=e[25];const Z=se;if(!c&&(o.isError||z.isError)){let x;e[26]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ge,{size:48,className:"text-muted-foreground"}),e[26]=x):x=e[26];let j;e[27]!==r?(j=r("settings.memory.errorTitle"),e[27]=r,e[28]=j):j=e[28];let p;e[29]!==r?(p=r("settings.memory.errorDescription"),e[29]=r,e[30]=p):p=e[30];let y;e[31]!==o||e[32]!==z?(y=()=>{o.refetch(),z.refetch()},e[31]=o,e[32]=z,e[33]=y):y=e[33];let F;e[34]!==r?(F=r("settings.memory.retry"),e[34]=r,e[35]=F):F=e[35];let L;e[36]!==y||e[37]!==F?(L=s.jsx(de,{size:"sm",variant:"outline",onClick:y,children:F}),e[36]=y,e[37]=F,e[38]=L):L=e[38];let le;return e[39]!==j||e[40]!==p||e[41]!==L?(le=s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Le,{image:x,title:j,description:p,actions:L})}),e[39]=j,e[40]=p,e[41]=L,e[42]=le):le=e[42],le}if(!c){let x;return e[43]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{}),e[43]=x):x=e[43],x}let ie;e[44]!==c.body?(ie=c.body.trim(),e[44]=c.body,e[45]=ie):ie=e[45];let ne;e[46]!==i?(ne=Qe(i).trim(),e[46]=i,e[47]=ne):ne=e[47];const re=ie===ne,q=re?"":c.body;let A,B,I,Y,U,V,K,R;if(e[48]!==m||e[49]!==T||e[50]!==Z||e[51]!==v||e[52]!==E||e[53]!==i||e[54]!==c||e[55]!==o.data||e[56]!==d||e[57]!==r||e[58]!==re||e[59]!==q){const x=!re&&o.data?Ue(o.data.updatedAt,v,T):null;V="flex flex-col gap-4",e[68]!==Z||e[69]!==E||e[70]!==d||e[71]!==r?(K=d==="conflict"&&s.jsxs(Me,{variant:"info",className:"border-warning",children:[s.jsx(ge,{className:"text-warning"}),s.jsxs(Oe,{className:"flex flex-1 flex-wrap items-center justify-between gap-3",children:[r("settings.memory.conflict"),s.jsxs("span",{className:"flex gap-2",children:[s.jsx(de,{size:"sm",variant:"outline",onClick:Z,children:r("settings.memory.loadLatest")}),s.jsx(de,{size:"sm",onClick:()=>E.flush(!0),children:r("settings.memory.keepMine")})]})]})]}),e[68]=Z,e[69]=E,e[70]=d,e[71]=r,e[72]=K):K=e[72];const j=d==="forbidden";let p;e[73]!==i||e[74]!==r?(p=r(i==="organization"?"settings.memory.orgPlaceholder":"settings.memory.userPlaceholder"),e[73]=i,e[74]=r,e[75]=p):p=e[75];let y;e[76]!==E||e[77]!==c?(y=L=>{$(L.target.value.trim().length),E.change(L.target.value,c)},e[76]=E,e[77]=c,e[78]=y):y=e[78],e[79]!==m||e[80]!==c.generation||e[81]!==j||e[82]!==p||e[83]!==y||e[84]!==q?(R=s.jsx(ye,{className:"gap-0 px-6 py-5",children:s.jsx("textarea",{defaultValue:q,readOnly:j,"aria-label":m,placeholder:p,onChange:y,className:"field-sizing-content min-h-[320px] w-full resize-none bg-transparent font-mono text-[13px] leading-6 text-foreground outline-none placeholder:text-muted-foreground"},c.generation)}),e[79]=m,e[80]=c.generation,e[81]=j,e[82]=p,e[83]=y,e[84]=q,e[85]=R):R=e[85],U="flex min-h-5 items-center justify-between gap-3 text-meta";const F=d==="error"&&"text-destructive";e[86]!==F?(A=ve("inline-flex items-center gap-1.5",F),e[86]=F,e[87]=A):A=e[87],B="polite",e[88]!==d?(I=d==="saving"&&s.jsx(Ee,{className:"size-3"}),e[88]=d,e[89]=I):I=e[89],Y=Ve(r,d,x),e[48]=m,e[49]=T,e[50]=Z,e[51]=v,e[52]=E,e[53]=i,e[54]=c,e[55]=o.data,e[56]=d,e[57]=r,e[58]=re,e[59]=q,e[60]=A,e[61]=B,e[62]=I,e[63]=Y,e[64]=U,e[65]=V,e[66]=K,e[67]=R}else A=e[60],B=e[61],I=e[62],Y=e[63],U=e[64],V=e[65],K=e[66],R=e[67];let J;e[90]!==A||e[91]!==B||e[92]!==I||e[93]!==Y?(J=s.jsxs("span",{className:A,"aria-live":B,children:[I,Y]}),e[90]=A,e[91]=B,e[92]=I,e[93]=Y,e[94]=J):J=e[94];let G;e[95]!==D||e[96]!==q?(G=D??q.trim().length,e[95]=D,e[96]=q,e[97]=G):G=e[97];let W;e[98]!==G?(W=s.jsx(Je,{length:G}),e[98]=G,e[99]=W):W=e[99];let X;e[100]!==U||e[101]!==J||e[102]!==W?(X=s.jsxs("div",{className:U,children:[J,W]}),e[100]=U,e[101]=J,e[102]=W,e[103]=X):X=e[103];let ae;return e[104]!==V||e[105]!==K||e[106]!==R||e[107]!==X?(ae=s.jsxs("div",{className:V,children:[K,R,X]}),e[104]=V,e[105]=K,e[106]=R,e[107]=X,e[108]=ae):ae=e[108],ae}function We(t){return t&&{...t,version:{marker:"",expect:null}}}function dt(){const t=me.c(53),e=he(),{org:i}=pe(),a=je();let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},t[0]=m):m=t[0];const n=Se(m).scope==="user"?"user":"organization",{data:S}=we.useSession(),T=S?.user.id,f=n==="organization"?ke:Ce;let v;t[1]!==i.name||t[2]!==n||t[3]!==e?(v=n==="organization"?e("settings.memory.orgHeading",{org:i.name}):e("settings.memory.userHeading"),t[1]=i.name,t[2]=n,t[3]=e,t[4]=v):v=t[4];const u=v;let l;t[5]!==e?(l=e("settings.memory.pageTitle"),t[5]=e,t[6]=l):l=t[6];let h;t[7]!==l?(h=s.jsx(oe.Title,{children:l}),t[7]=l,t[8]=h):h=t[8];let g;t[9]!==e?(g=e("settings.memory.tabOrg"),t[9]=e,t[10]=g):g=t[10];let o;t[11]!==g?(o={id:"organization",label:g},t[11]=g,t[12]=o):o=t[12];let b;t[13]!==e?(b=e("settings.memory.tabUser"),t[13]=e,t[14]=b):b=t[14];let w;t[15]!==b?(w={id:"user",label:b},t[15]=b,t[16]=w):w=t[16];let k;t[17]!==o||t[18]!==w?(k=[o,w],t[17]=o,t[18]=w,t[19]=k):k=t[19];let M;t[20]!==a||t[21]!==i.slug?(M=Q=>a({to:"/$org/settings/memory",params:{org:i.slug},search:Q==="user"?{scope:"user"}:{},replace:!0}),t[20]=a,t[21]=i.slug,t[22]=M):M=t[22];let N;t[23]!==n||t[24]!==k||t[25]!==M?(N=s.jsx(Pe,{placement:"page",tabs:k,activeTab:n,onTabChange:M}),t[23]=n,t[24]=k,t[25]=M,t[26]=N):N=t[26];let C;t[27]!==f?(C=s.jsx("span",{className:"surface-inset flex size-9 shrink-0 items-center justify-center rounded-full text-muted-foreground",children:s.jsx(f,{size:16})}),t[27]=f,t[28]=C):C=t[28];let z;t[29]!==u?(z=s.jsx("p",{className:"text-sm font-medium text-foreground",children:u}),t[29]=u,t[30]=z):z=t[30];let P;t[31]!==n||t[32]!==e?(P=e(n==="organization"?"settings.memory.orgDescription":"settings.memory.userDescription"),t[31]=n,t[32]=e,t[33]=P):P=t[33];let d;t[34]!==P?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:P}),t[34]=P,t[35]=d):d=t[35];let O;t[36]!==z||t[37]!==d?(O=s.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[z,d]}),t[36]=z,t[37]=d,t[38]=O):O=t[38];let c;t[39]!==C||t[40]!==O?(c=s.jsxs("div",{className:"flex items-start gap-3",children:[C,O]}),t[39]=C,t[40]=O,t[41]=c):c=t[41];let _;t[42]!==u||t[43]!==n||t[44]!==T?(_=T?s.jsx(Ge,{scope:n,userId:T,label:u},n):s.jsx(be,{}),t[42]=u,t[43]=n,t[44]=T,t[45]=_):_=t[45];let D;t[46]!==c||t[47]!==_?(D=s.jsxs("div",{className:"flex flex-col gap-4",children:[c,_]}),t[46]=c,t[47]=_,t[48]=D):D=t[48];let $;return t[49]!==N||t[50]!==D||t[51]!==h?($=s.jsx(oe,{children:s.jsx(oe.Content,{children:s.jsx(oe.Container,{width:"reading",children:s.jsxs("div",{className:"flex flex-col gap-6",children:[h,N,D]})})})}),t[49]=N,t[50]=D,t[51]=h,t[52]=$):$=t[52],$}export{dt as default};
@@ -1 +1 @@
1
- import{c as R,l as h,j as s}from"./index-D_7jfHk6.js";function E($){const e=R.c(34),{generating:l,className:N}=$;let t;e[0]!==N?(t=h("pointer-events-none rounded-xl border border-border bg-background shadow-lg",N),e[0]=N,e[1]=t):t=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",className:"stroke-muted"}),e[2]=p):p=e[2];const v=l?"75.4":"22",k=l?"stroke-muted":"stroke-success";let a;e[3]!==k?(a=h("transition-[stroke-dashoffset] duration-1000 ease-out",k),e[3]=k,e[4]=a):a=e[4];let i;e[5]!==v||e[6]!==a?(i=s.jsxs("svg",{viewBox:"0 0 32 32",className:"size-9 shrink-0 -rotate-90",children:[p,s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"75.4",strokeDashoffset:v,className:a})]}),e[5]=v,e[6]=a,e[7]=i):i=e[7];const w=l&&"animate-pulse";let c;e[8]!==w?(c=h("h-1.5 w-full rounded-full bg-muted",w),e[8]=w,e[9]=c):c=e[9];let r;e[10]!==c?(r=s.jsx("div",{className:c}),e[10]=c,e[11]=r):r=e[11];const y=l&&"animate-pulse";let n;e[12]!==y?(n=h("h-1.5 w-2/3 rounded-full bg-muted",y),e[12]=y,e[13]=n):n=e[13];let o;e[14]!==n?(o=s.jsx("div",{className:n}),e[14]=n,e[15]=o):o=e[15];let d;e[16]!==o||e[17]!==r?(d=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[r,o]}),e[16]=o,e[17]=r,e[18]=d):d=e[18];let f;e[19]!==d||e[20]!==i?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[19]=d,e[20]=i,e[21]=f):f=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=[7,10,5,9,6,8],e[22]=g):g=e[22];let m;e[23]!==l?(m=s.jsx("div",{className:"flex h-10 items-end gap-1.5",children:g.map((_,b)=>s.jsx("div",{style:{height:`${_*4}px`},className:h("flex-1 rounded-sm",l?"animate-pulse bg-muted":b%2===0?"bg-success/70":"bg-success/30")},`bar-${b}`))}),e[23]=l,e[24]=m):m=e[24];let u;e[25]!==l?(u=s.jsx("div",{className:"flex flex-col gap-1.5",children:["w-full","w-5/6","w-full","w-2/3","w-full"].map((_,b)=>s.jsx("div",{className:h("h-1.5 rounded-full bg-muted",_,l&&"animate-pulse")},`line-${b}`))}),e[25]=l,e[26]=u):u=e[26];let x;e[27]!==f||e[28]!==m||e[29]!==u?(x=s.jsxs("div",{className:"flex h-full flex-col gap-3 p-4",children:[f,m,u]}),e[27]=f,e[28]=m,e[29]=u,e[30]=x):x=e[30];let j;return e[31]!==t||e[32]!==x?(j=s.jsx("div",{"aria-hidden":!0,className:t,children:x}),e[31]=t,e[32]=x,e[33]=j):j=e[33],j}export{E as M};
1
+ import{c as R,l as h,j as s}from"./index-Bm9FTdjr.js";function E($){const e=R.c(34),{generating:l,className:N}=$;let t;e[0]!==N?(t=h("pointer-events-none rounded-xl border border-border bg-background shadow-lg",N),e[0]=N,e[1]=t):t=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",className:"stroke-muted"}),e[2]=p):p=e[2];const v=l?"75.4":"22",k=l?"stroke-muted":"stroke-success";let a;e[3]!==k?(a=h("transition-[stroke-dashoffset] duration-1000 ease-out",k),e[3]=k,e[4]=a):a=e[4];let i;e[5]!==v||e[6]!==a?(i=s.jsxs("svg",{viewBox:"0 0 32 32",className:"size-9 shrink-0 -rotate-90",children:[p,s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"75.4",strokeDashoffset:v,className:a})]}),e[5]=v,e[6]=a,e[7]=i):i=e[7];const w=l&&"animate-pulse";let c;e[8]!==w?(c=h("h-1.5 w-full rounded-full bg-muted",w),e[8]=w,e[9]=c):c=e[9];let r;e[10]!==c?(r=s.jsx("div",{className:c}),e[10]=c,e[11]=r):r=e[11];const y=l&&"animate-pulse";let n;e[12]!==y?(n=h("h-1.5 w-2/3 rounded-full bg-muted",y),e[12]=y,e[13]=n):n=e[13];let o;e[14]!==n?(o=s.jsx("div",{className:n}),e[14]=n,e[15]=o):o=e[15];let d;e[16]!==o||e[17]!==r?(d=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[r,o]}),e[16]=o,e[17]=r,e[18]=d):d=e[18];let f;e[19]!==d||e[20]!==i?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[19]=d,e[20]=i,e[21]=f):f=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=[7,10,5,9,6,8],e[22]=g):g=e[22];let m;e[23]!==l?(m=s.jsx("div",{className:"flex h-10 items-end gap-1.5",children:g.map((_,b)=>s.jsx("div",{style:{height:`${_*4}px`},className:h("flex-1 rounded-sm",l?"animate-pulse bg-muted":b%2===0?"bg-success/70":"bg-success/30")},`bar-${b}`))}),e[23]=l,e[24]=m):m=e[24];let u;e[25]!==l?(u=s.jsx("div",{className:"flex flex-col gap-1.5",children:["w-full","w-5/6","w-full","w-2/3","w-full"].map((_,b)=>s.jsx("div",{className:h("h-1.5 rounded-full bg-muted",_,l&&"animate-pulse")},`line-${b}`))}),e[25]=l,e[26]=u):u=e[26];let x;e[27]!==f||e[28]!==m||e[29]!==u?(x=s.jsxs("div",{className:"flex h-full flex-col gap-3 p-4",children:[f,m,u]}),e[27]=f,e[28]=m,e[29]=u,e[30]=x):x=e[30];let j;return e[31]!==t||e[32]!==x?(j=s.jsx("div",{"aria-hidden":!0,className:t,children:x}),e[31]=t,e[32]=x,e[33]=j):j=e[33],j}export{E as M};
@@ -1 +1 @@
1
- import{c as p,r as c,fh as f,j as l,E as h,fi as g}from"./index-D_7jfHk6.js";function w(u){const e=p.c(5),{seed:i,children:s}=u;let t;e[0]!==i?(t=()=>{const o=new f({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0,retry:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchInterval:!1}}});return i(o),o},e[0]=i,e[1]=t):t=e[1];const[n]=c.useState(t);let a;return e[2]!==s||e[3]!==n?(a=l.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none absolute inset-0 select-none overflow-hidden",children:l.jsx(h,{fallback:null,children:l.jsx(c.Suspense,{fallback:null,children:l.jsx(g,{client:n,children:s})})})}),e[2]=s,e[3]=n,e[4]=a):a=e[4],a}const d=new Date().toISOString();function r(u,e,i,s,t,n){return{id:u,organizationId:"preview",title:e,description:null,repositoryId:null,virtualMcpId:null,sprintId:null,status:i,priority:t,type:s,assigneeId:null,assignedBy:null,repo:null,dueDate:null,sortOrder:n,keySeq:n,externalUrl:null,previewRoutes:[],source:null,retryAttempts:0,reviewCycleStartedAt:null,threads:[],tags:[],reviewVerdicts:[],statusSince:null,createdBy:"preview",createdAt:d,updatedBy:"preview",updatedAt:d}}function y(){return{items:[r("p1","Fix checkout shipping estimate","triage","bug","high",1),r("p2","Add size guide to product page","triage","feature","medium",2),r("p3","Compress hero images","triage","chore","low",3),r("p4","Rewrite category descriptions","in_progress","feature","medium",4),r("p5","Audit broken redirects","in_progress","chore","high",5),r("p6","New arrivals landing page","in_review","feature","high",6),r("p7","Speed up search results","qa","chore","medium",7),r("p8","Black Friday banner","done","feature","urgent",8)],repos:[],columns:[]}}export{w as P,y as m};
1
+ import{c as p,r as c,fw as f,j as l,H as h,fx as g}from"./index-Bm9FTdjr.js";function w(u){const e=p.c(5),{seed:i,children:s}=u;let t;e[0]!==i?(t=()=>{const o=new f({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0,retry:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchInterval:!1}}});return i(o),o},e[0]=i,e[1]=t):t=e[1];const[n]=c.useState(t);let a;return e[2]!==s||e[3]!==n?(a=l.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none absolute inset-0 select-none overflow-hidden",children:l.jsx(h,{fallback:null,children:l.jsx(c.Suspense,{fallback:null,children:l.jsx(g,{client:n,children:s})})})}),e[2]=s,e[3]=n,e[4]=a):a=e[4],a}const d=new Date().toISOString();function r(u,e,i,s,t,n){return{id:u,organizationId:"preview",title:e,description:null,repositoryId:null,virtualMcpId:null,sprintId:null,status:i,priority:t,type:s,assigneeId:null,assignedBy:null,repo:null,dueDate:null,sortOrder:n,keySeq:n,externalUrl:null,previewRoutes:[],source:null,retryAttempts:0,reviewCycleStartedAt:null,threads:[],tags:[],reviewVerdicts:[],statusSince:null,createdBy:"preview",createdAt:d,updatedBy:"preview",updatedAt:d}}function y(){return{items:[r("p1","Fix checkout shipping estimate","triage","bug","high",1),r("p2","Add size guide to product page","triage","feature","medium",2),r("p3","Compress hero images","triage","chore","low",3),r("p4","Rewrite category descriptions","in_progress","feature","medium",4),r("p5","Audit broken redirects","in_progress","chore","high",5),r("p6","New arrivals landing page","in_review","feature","high",6),r("p7","Speed up search results","qa","chore","medium",7),r("p8","Black Friday banner","done","feature","urgent",8)],repos:[],columns:[]}}export{w as P,y as m};
@@ -1,4 +1,4 @@
1
- import{r as m,j as c,h as I,c as k,aL as v}from"./index-D_7jfHk6.js";import{l as L,c as S,F as $}from"./editor-CPkkN1Zr.js";import{d as K}from"./delay-CnY5UFtP.js";S();async function D(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
1
+ import{r as m,j as c,h as I,c as k,aX as v}from"./index-Bm9FTdjr.js";import{l as S,c as L,F as $}from"./editor-2jNHgdUN.js";import{d as K}from"./delay-CnY5UFtP.js";L();async function D(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
2
2
  type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
3
3
  ? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
4
4
  : T extends object
@@ -6,4 +6,4 @@ type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
6
6
  : T;
7
7
  type __InferredOutput = __ExpandRecursively<Awaited<ReturnType<typeof __default>>>;
8
8
  declare const __outputValue: __InferredOutput;
9
- `;t.setValue(i);const r=t.findMatches("__outputValue",!1,!1,!1,null,!1);if(!r||r.length===0)return t.setValue(n),null;const l=r[0];if(!l)return t.setValue(n),null;const f={lineNumber:l.range.startLineNumber,column:l.range.startColumn+1};try{const y=await(await L.init()).languages.typescript.getTypeScriptWorker();if(!y)return t.setValue(n),null;const _=await y(t.uri);await K(100);const x=t.getOffsetAt(f),h=await _.getQuickInfoAtPosition(t.uri.toString(),x);if(t.setValue(n),h){const T=h.displayParts.map(O=>O.text).join("").replace(/^const __outputValue:\s*/,"");return g(T)}else return null}catch(o){return t.setValue(n),console.error("Error getting return type:",o),null}}function g(e){if(e=e.trim(),e==="string")return{type:"string"};if(e==="number")return{type:"number"};if(e==="boolean")return{type:"boolean"};if(e==="null")return{type:"null"};if(e==="undefined")return{type:"null"};if(e==="unknown"||e==="any")return{};if(e==="never")return{not:{}};if(e.endsWith("[]")){const s=e.slice(0,-2);return{type:"array",items:g(s)}}const t=e.match(/^Array<(.+)>$/);if(t&&t[1])return{type:"array",items:g(t[1])};const n=e.match(/^Record<(.+),\s*(.+)>$/);if(n&&n[2])return{type:"object",additionalProperties:g(n[2].trim())};if(e.includes("|")){const s=A(e);if(s.length>1)return s.every(r=>/^["']/.test(r.trim()))?{type:"string",enum:s.map(r=>r.trim().replace(/^["']|["']$/g,""))}:{anyOf:s.map(r=>g(r.trim()))}}return/^["'].*["']$/.test(e)?{type:"string",const:e.slice(1,-1)}:/^-?\d+(\.\d+)?$/.test(e)?{type:"number",const:parseFloat(e)}:e.startsWith("{")&&e.endsWith("}")?z(e):{description:`TypeScript type: ${e}`}}function A(e){const t=[];let n=0,s="";for(let i=0;i<e.length;i++){const r=e[i];if(r==="{"||r==="<"||r==="("||r==="[")n++;else if(r==="}"||r===">"||r===")"||r==="]")n--;else if(r==="|"&&n===0){t.push(s.trim()),s="";continue}s+=r}return s.trim()&&t.push(s.trim()),t}function z(e){const t=e.slice(1,-1).trim();if(!t)return{type:"object",properties:{}};const n={},s=[];let i=0,r="";for(let f=0;f<t.length;f++){const o=t[f];if(o==="{"||o==="<"||o==="("||o==="[")i++;else if(o==="}"||o===">"||o===")"||o==="]")i--;else if(o===";"&&i===0){r.trim()&&M(r.trim(),n,s),r="";continue}r+=o}r.trim()&&M(r.trim(),n,s);const l={type:"object",properties:n};return s.length>0&&(l.required=s),l}function M(e,t,n){const s=e.match(/^(\w+)(\?)?:\s*(.+)$/s);if(s){const i=s[1],r=s[2],l=s[3];i&&l&&(t[i]=g(l.trim()),r||n.push(i))}}class W extends m.Component{constructor(t){super(t),this.state={hasError:!1,mountKey:0}}static getDerivedStateFromError(t){if(t.message?.includes("InstantiationService has been disposed"))return{hasError:!0};throw t}componentDidCatch(t){t.message?.includes("InstantiationService has been disposed")&&this.setState(n=>({hasError:!1,mountKey:n.mountKey+1}))}render(){return this.state.hasError?c.jsx("div",{className:"flex items-center justify-center h-full w-full bg-white dark:bg-[#1e1e1e] text-muted-foreground",children:c.jsx(I,{size:"sm"})}):m.cloneElement(this.props.children,{mountKey:this.state.mountKey})}}let b=null;const J=async()=>{if(b)return b;const[e,t,n]=await Promise.all([v(()=>import("./standalone-BioU5qLH.js"),[]),v(()=>import("./typescript-Ca_eWjgL.js"),[]),v(()=>import("./estree-CRgMSIiv.js"),[])]);return b={format:e.format,plugins:[t.default,n.default]},b},F={parser:"typescript",semi:!0,singleQuote:!1,tabWidth:2,trailingComma:"es5",printWidth:80},P={fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,stickyScroll:{enabled:!1},wordWrap:"on",folding:!0,bracketPairColorization:{enabled:!0},suggestOnTriggerCharacters:!0,quickSuggestions:{other:!0,comments:!1,strings:!0},minimap:{enabled:!1},parameterHints:{enabled:!0},inlineSuggest:{enabled:!0},autoClosingBrackets:"always",autoClosingQuotes:"always",autoSurround:"languageDefined",padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}},q=c.jsx("div",{className:"flex items-center justify-center h-full w-full text-muted-foreground",children:c.jsx(I,{size:"sm"})});function B({code:e,onChange:t,onSave:n,readOnly:s=!1,height:i=300,language:r="typescript",disableDiagnostics:l=!1,autoFocus:f=!1,mountKey:o=0}){const y=m.useRef(null),_=m.useRef(n);_.current=n;const x=m.useRef(r);x.current=r;const h=m.useId(),j=`${h}-${o}`,T=r==="typescript"?`file:///workflow-${h.replace(/:/g,"-")}-${o}.tsx`:void 0,C=s?{...P,readOnly:!0}:P,O=async u=>{const a=u.getModel();if(!a){console.warn("No model found");return}const p=a.getValue(),E=x.current;if(E==="json"){try{const d=JSON.parse(p),R=JSON.stringify(d,null,2);if(R!==p){const w=a.getFullModelRange();u.executeEdits("json-format",[{range:w,text:R}])}}catch(d){console.error("JSON formatting failed:",d)}return}if(E==="typescript")try{const{format:d,plugins:R}=await J(),w=await d(p,{...F,plugins:R});if(w!==p){const V=a.getFullModelRange();u.executeEdits("prettier",[{range:V,text:w}])}}catch(d){console.error("Prettier formatting failed:",d)}},N=async(u,a)=>{y.current=u,f&&u.focus(),r==="typescript"&&(a.languages.typescript.typescriptDefaults.setCompilerOptions({target:a.languages.typescript.ScriptTarget.ESNext,module:a.languages.typescript.ModuleKind.ESNext,moduleResolution:a.languages.typescript.ModuleResolutionKind.NodeJs,allowNonTsExtensions:!0,allowJs:!0,strict:!1,noEmit:!0,esModuleInterop:!0,jsx:a.languages.typescript.JsxEmit.React,allowSyntheticDefaultImports:!0}),a.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:l,noSyntaxValidation:l})),u.addCommand(a.KeyMod.CtrlCmd|a.KeyCode.KeyS,async()=>{await O(u);const p=await D(u),E=u.getValue();_.current?.(E,p)})};return c.jsx("div",{className:"h-full",children:c.jsx($,{height:i,language:r,theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:e,path:T,onChange:t,onMount:N,loading:q,options:C},j)})}function G(e){const t=k.c(2);let n;return t[0]!==e?(n=c.jsx(W,{children:c.jsx(B,{...e})}),t[0]=e,t[1]=n):n=t[1],n}export{G as M};
9
+ `;t.setValue(i);const r=t.findMatches("__outputValue",!1,!1,!1,null,!1);if(!r||r.length===0)return t.setValue(n),null;const l=r[0];if(!l)return t.setValue(n),null;const f={lineNumber:l.range.startLineNumber,column:l.range.startColumn+1};try{const y=await(await S.init()).languages.typescript.getTypeScriptWorker();if(!y)return t.setValue(n),null;const _=await y(t.uri);await K(100);const x=t.getOffsetAt(f),h=await _.getQuickInfoAtPosition(t.uri.toString(),x);if(t.setValue(n),h){const T=h.displayParts.map(O=>O.text).join("").replace(/^const __outputValue:\s*/,"");return g(T)}else return null}catch(o){return t.setValue(n),console.error("Error getting return type:",o),null}}function g(e){if(e=e.trim(),e==="string")return{type:"string"};if(e==="number")return{type:"number"};if(e==="boolean")return{type:"boolean"};if(e==="null")return{type:"null"};if(e==="undefined")return{type:"null"};if(e==="unknown"||e==="any")return{};if(e==="never")return{not:{}};if(e.endsWith("[]")){const s=e.slice(0,-2);return{type:"array",items:g(s)}}const t=e.match(/^Array<(.+)>$/);if(t&&t[1])return{type:"array",items:g(t[1])};const n=e.match(/^Record<(.+),\s*(.+)>$/);if(n&&n[2])return{type:"object",additionalProperties:g(n[2].trim())};if(e.includes("|")){const s=A(e);if(s.length>1)return s.every(r=>/^["']/.test(r.trim()))?{type:"string",enum:s.map(r=>r.trim().replace(/^["']|["']$/g,""))}:{anyOf:s.map(r=>g(r.trim()))}}return/^["'].*["']$/.test(e)?{type:"string",const:e.slice(1,-1)}:/^-?\d+(\.\d+)?$/.test(e)?{type:"number",const:parseFloat(e)}:e.startsWith("{")&&e.endsWith("}")?z(e):{description:`TypeScript type: ${e}`}}function A(e){const t=[];let n=0,s="";for(let i=0;i<e.length;i++){const r=e[i];if(r==="{"||r==="<"||r==="("||r==="[")n++;else if(r==="}"||r===">"||r===")"||r==="]")n--;else if(r==="|"&&n===0){t.push(s.trim()),s="";continue}s+=r}return s.trim()&&t.push(s.trim()),t}function z(e){const t=e.slice(1,-1).trim();if(!t)return{type:"object",properties:{}};const n={},s=[];let i=0,r="";for(let f=0;f<t.length;f++){const o=t[f];if(o==="{"||o==="<"||o==="("||o==="[")i++;else if(o==="}"||o===">"||o===")"||o==="]")i--;else if(o===";"&&i===0){r.trim()&&M(r.trim(),n,s),r="";continue}r+=o}r.trim()&&M(r.trim(),n,s);const l={type:"object",properties:n};return s.length>0&&(l.required=s),l}function M(e,t,n){const s=e.match(/^(\w+)(\?)?:\s*(.+)$/s);if(s){const i=s[1],r=s[2],l=s[3];i&&l&&(t[i]=g(l.trim()),r||n.push(i))}}class W extends m.Component{constructor(t){super(t),this.state={hasError:!1,mountKey:0}}static getDerivedStateFromError(t){if(t.message?.includes("InstantiationService has been disposed"))return{hasError:!0};throw t}componentDidCatch(t){t.message?.includes("InstantiationService has been disposed")&&this.setState(n=>({hasError:!1,mountKey:n.mountKey+1}))}render(){return this.state.hasError?c.jsx("div",{className:"flex items-center justify-center h-full w-full bg-white dark:bg-[#1e1e1e] text-muted-foreground",children:c.jsx(I,{size:"sm"})}):m.cloneElement(this.props.children,{mountKey:this.state.mountKey})}}let b=null;const J=async()=>{if(b)return b;const[e,t,n]=await Promise.all([v(()=>import("./standalone-BioU5qLH.js"),[]),v(()=>import("./typescript-Ca_eWjgL.js"),[]),v(()=>import("./estree-CRgMSIiv.js"),[])]);return b={format:e.format,plugins:[t.default,n.default]},b},F={parser:"typescript",semi:!0,singleQuote:!1,tabWidth:2,trailingComma:"es5",printWidth:80},P={fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,stickyScroll:{enabled:!1},wordWrap:"on",folding:!0,bracketPairColorization:{enabled:!0},suggestOnTriggerCharacters:!0,quickSuggestions:{other:!0,comments:!1,strings:!0},minimap:{enabled:!1},parameterHints:{enabled:!0},inlineSuggest:{enabled:!0},autoClosingBrackets:"always",autoClosingQuotes:"always",autoSurround:"languageDefined",padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}},q=c.jsx("div",{className:"flex items-center justify-center h-full w-full text-muted-foreground",children:c.jsx(I,{size:"sm"})});function B({code:e,onChange:t,onSave:n,readOnly:s=!1,height:i=300,language:r="typescript",disableDiagnostics:l=!1,autoFocus:f=!1,mountKey:o=0}){const y=m.useRef(null),_=m.useRef(n);_.current=n;const x=m.useRef(r);x.current=r;const h=m.useId(),j=`${h}-${o}`,T=r==="typescript"?`file:///workflow-${h.replace(/:/g,"-")}-${o}.tsx`:void 0,C=s?{...P,readOnly:!0}:P,O=async u=>{const a=u.getModel();if(!a){console.warn("No model found");return}const p=a.getValue(),E=x.current;if(E==="json"){try{const d=JSON.parse(p),R=JSON.stringify(d,null,2);if(R!==p){const w=a.getFullModelRange();u.executeEdits("json-format",[{range:w,text:R}])}}catch(d){console.error("JSON formatting failed:",d)}return}if(E==="typescript")try{const{format:d,plugins:R}=await J(),w=await d(p,{...F,plugins:R});if(w!==p){const V=a.getFullModelRange();u.executeEdits("prettier",[{range:V,text:w}])}}catch(d){console.error("Prettier formatting failed:",d)}},N=async(u,a)=>{y.current=u,f&&u.focus(),r==="typescript"&&(a.languages.typescript.typescriptDefaults.setCompilerOptions({target:a.languages.typescript.ScriptTarget.ESNext,module:a.languages.typescript.ModuleKind.ESNext,moduleResolution:a.languages.typescript.ModuleResolutionKind.NodeJs,allowNonTsExtensions:!0,allowJs:!0,strict:!1,noEmit:!0,esModuleInterop:!0,jsx:a.languages.typescript.JsxEmit.React,allowSyntheticDefaultImports:!0}),a.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:l,noSyntaxValidation:l})),u.addCommand(a.KeyMod.CtrlCmd|a.KeyCode.KeyS,async()=>{await O(u);const p=await D(u),E=u.getValue();_.current?.(E,p)})};return c.jsx("div",{className:"h-full",children:c.jsx($,{height:i,language:r,theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:e,path:T,onChange:t,onMount:N,loading:q,options:C},j)})}function X(e){const t=k.c(2);let n;return t[0]!==e?(n=c.jsx(W,{children:c.jsx(B,{...e})}),t[0]=e,t[1]=n):n=t[1],n}export{X as M};
@@ -1 +1 @@
1
- import{c as lt,l as J,j as l}from"./index-D_7jfHk6.js";import{C as Q,d as Z}from"./chart-DZbYggl3.js";import{C as tt,Y as et,A as mt,a as dt}from"./AreaChart-BvjH9pmK.js";import{X as at}from"./XAxis-BLZT-vtl.js";import{C as ut}from"./tooltipContext-1NNpJuJd.js";import{a as ht,B as pt}from"./BarChart-CJ_IiQ71.js";const it=60*1e3,P=60*it,xt=24*P,st=25*P;function q(s,t){if(s.length===0)return 0;const r=[...s].sort((f,c)=>f-c),e=Math.max(0,Math.min(r.length-1,Math.ceil(t*r.length)-1));return r[e]??0}function gt(s,t){return t<=st?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})}function yt(s,t){const r=t-s;return r<=P?Math.max(1,Math.min(60,Math.ceil(r/it))):r<=st?Math.max(1,Math.min(25,Math.ceil(r/P))):Math.max(1,Math.min(31,Math.ceil(r/xt)))}function kt(s,t,r,e){const f=t.getTime(),c=r.getTime(),h=Math.max(1,c-f),n=yt(f,c),g=Math.max(1,Math.floor(h/n)),a=[];for(let o=0;o<n;o++){const i=new Date(f+o*g);a.push({t:i.toISOString(),ts:i.getTime(),label:gt(i,h),calls:0,errors:0,durations:[]})}for(const o of s){const i=new Date(o.timestamp).getTime(),m=Math.floor((i-f)/g),x=Math.max(0,Math.min(n-1,m)),d=a[x];d&&(d.calls+=1,o.isError&&(d.errors+=1),Number.isFinite(o.durationMs)&&d.durations.push(o.durationMs))}return a.map(o=>({t:o.t,ts:o.ts,label:o.label,calls:o.calls,errors:o.errors,errorRate:o.calls>0?o.errors/o.calls*100:0,avg:Math.round(o.durations.length>0?o.durations.reduce((i,m)=>i+m,0)/o.durations.length:0),p50:Math.round(q(o.durations,.5)),p95:Math.round(q(o.durations,.95))}))}function Ct(s,t,r,e,f){const c=e??s.length,h=f??s.filter(i=>i.isError).length,n=s.map(i=>i.durationMs),g=n.length>0?n.reduce((i,m)=>i+m,0)/n.length:0,a=q(n,.95),o=kt(s,t.startDate,t.endDate);return{totalCalls:c,totalErrors:h,avgDurationMs:g,p95DurationMs:a,data:o}}function ot(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function rt(s){const t=lt.c(19),{active:r,payload:e,dataKey:f,colorVar:c}=s;if(!r||!e?.length)return null;const h=e[0],n=h?.payload?.t??"";let g;t[0]!==h?.payload?.label||t[1]!==n?(g=n?new Date(n).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):h?.payload?.label??"",t[0]=h?.payload?.label,t[1]=n,t[2]=g):g=t[2];const a=g,o=h?.value,i=typeof o=="number"?o:0,m=f==="avg"||f==="p50"||f==="p95",x=f==="costUsd";let d;t[3]!==x||t[4]!==m||t[5]!==i?(d=x?`$${i.toFixed(i<1?4:2)}`:m?i>=1e4?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`:i.toLocaleString(),t[3]=x,t[4]=m,t[5]=i,t[6]=d):d=t[6];const S=d;let y;t[7]!==a?(y=l.jsx("div",{className:"text-[11px] text-muted-foreground mb-1",children:a}),t[7]=a,t[8]=y):y=t[8];let k;t[9]!==c?(k=l.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:c}}),t[9]=c,t[10]=k):k=t[10];let b;t[11]!==S?(b=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=b):b=t[12];let p;t[13]!==k||t[14]!==b?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,b]}),t[13]=k,t[14]=b,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg border bg-background px-3 py-2 shadow-md",children:[y,p]}),t[16]=y,t[17]=p,t[18]=j):j=t[18],j}function Lt(s){const t=lt.c(85),{data:r,dataKey:e,colorNum:f,chartHeight:c,variant:h,ariaLabel:n}=s,g=h===void 0?"bar":h,a=`var(--chart-${f})`,o=`kpi-gradient-${e}-${f}`,i=Math.max(...r.map(u=>u[e]??0),0);if(g==="area"){let u;t[0]!==c?(u=J(c,"w-full"),t[0]=c,t[1]=u):u=t[1];let M;t[2]!==a||t[3]!==e?(M={label:e,color:a},t[2]=a,t[3]=e,t[4]=M):M=t[4];let v;t[5]!==e||t[6]!==M?(v={[e]:M},t[5]=e,t[6]=M,t[7]=v):v=t[7];let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I={left:0,right:-12,top:8,bottom:8},t[8]=I):I=t[8];let $,O;t[9]!==a?($=l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.2}),O=l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),t[9]=a,t[10]=$,t[11]=O):($=t[10],O=t[11]);let w;t[12]!==o||t[13]!==$||t[14]!==O?(w=l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[$,O]})}),t[12]=o,t[13]=$,t[14]=O,t[15]=w):w=t[15];let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(at,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),t[17]=V):V=t[17];let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[18]=U):U=t[18];const W=i>0?"auto":10;let E;t[19]!==W?(E=l.jsx(et,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ot,width:40,domain:[0,W],tickCount:5}),t[19]=W,t[20]=E):E=t[20];let Y;t[21]===Symbol.for("react.memo_cache_sentinel")?(Y={stroke:"var(--border)",strokeDasharray:"4 4"},t[21]=Y):Y=t[21];let T;t[22]!==a||t[23]!==e?(T=l.jsx(Q,{cursor:Y,content:nt=>{const{active:ct,payload:ft}=nt;return l.jsx(rt,{active:ct,payload:ft,dataKey:e,colorVar:a})}}),t[22]=a,t[23]=e,t[24]=T):T=t[24];const X=`url(#${o})`;let z;t[25]!==a?(z={r:4,fill:a,stroke:"var(--background)",strokeWidth:2},t[25]=a,t[26]=z):z=t[26];let A;t[27]!==a||t[28]!==e||t[29]!==X||t[30]!==z?(A=l.jsx(mt,{type:"linear",dataKey:e,stroke:a,strokeWidth:2,fill:X,animationDuration:300,dot:!1,activeDot:z}),t[27]=a,t[28]=e,t[29]=X,t[30]=z,t[31]=A):A=t[31];let B;t[32]!==r||t[33]!==E||t[34]!==T||t[35]!==A||t[36]!==w?(B=l.jsxs(dt,{data:r,margin:I,children:[w,R,V,E,T,A]}),t[32]=r,t[33]=E,t[34]=T,t[35]=A,t[36]=w,t[37]=B):B=t[37];let H;return t[38]!==n||t[39]!==B||t[40]!==u||t[41]!==v?(H=l.jsx(Z,{role:"img","aria-label":n,className:u,config:v,children:B}),t[38]=n,t[39]=B,t[40]=u,t[41]=v,t[42]=H):H=t[42],H}let m;t[43]!==c?(m=J(c,"w-full"),t[43]=c,t[44]=m):m=t[44];let x;t[45]!==a||t[46]!==e?(x={label:e,color:a},t[45]=a,t[46]=e,t[47]=x):x=t[47];let d;t[48]!==e||t[49]!==x?(d={[e]:x},t[48]=e,t[49]=x,t[50]=d):d=t[50];let S,y;t[51]===Symbol.for("react.memo_cache_sentinel")?(S={left:0,right:-12,top:8,bottom:8},y=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[51]=S,t[52]=y):(S=t[51],y=t[52]);let k;t[53]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[53]=k):k=t[53];const b=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==b?(p=l.jsx(at,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:b,tickMargin:8}),t[54]=b,t[55]=p):p=t[55];let j;t[56]===Symbol.for("react.memo_cache_sentinel")?(j={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[56]=j):j=t[56];const G=i>0?"auto":10;let _;t[57]!==G?(_=l.jsx(et,{orientation:"right",axisLine:!1,tickLine:!1,tick:j,tickFormatter:ot,width:40,domain:[0,G],tickCount:5}),t[57]=G,t[58]=_):_=t[58];let K;t[59]===Symbol.for("react.memo_cache_sentinel")?(K={fill:"var(--muted)",opacity:.3},t[59]=K):K=t[59];let C;t[60]!==a||t[61]!==e?(C=l.jsx(Q,{cursor:K,content:u=>{const{active:M,payload:v}=u;return l.jsx(rt,{active:M,payload:v,dataKey:e,colorVar:a})}}),t[60]=a,t[61]=e,t[62]=C):C=t[62];let L;if(t[63]!==a||t[64]!==r||t[65]!==e){let u;t[67]!==a||t[68]!==e?(u=(M,v)=>l.jsx(ut,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${v}`),t[67]=a,t[68]=e,t[69]=u):u=t[69],L=r.map(u),t[63]=a,t[64]=r,t[65]=e,t[66]=L}else L=t[66];let D;t[70]!==a||t[71]!==e||t[72]!==L?(D=l.jsx(ht,{dataKey:e,fill:a,radius:0,minPointSize:1,children:L}),t[70]=a,t[71]=e,t[72]=L,t[73]=D):D=t[73];let N;t[74]!==r||t[75]!==_||t[76]!==C||t[77]!==D||t[78]!==p?(N=l.jsxs(pt,{data:r,margin:S,children:[y,p,_,C,D]}),t[74]=r,t[75]=_,t[76]=C,t[77]=D,t[78]=p,t[79]=N):N=t[79];let F;return t[80]!==n||t[81]!==N||t[82]!==m||t[83]!==d?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:d,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=d,t[84]=F):F=t[84],F}export{Lt as K,Ct as c};
1
+ import{c as lt,l as J,j as l}from"./index-Bm9FTdjr.js";import{C as Q,d as Z}from"./chart-C-785ZEj.js";import{C as tt,Y as et,A as mt,a as dt}from"./AreaChart-BTyzss2a.js";import{X as at}from"./XAxis-DDG3qYHW.js";import{C as ut}from"./tooltipContext-BpyR0oly.js";import{a as ht,B as pt}from"./BarChart-Ch51NWPz.js";const it=60*1e3,P=60*it,xt=24*P,st=25*P;function q(s,t){if(s.length===0)return 0;const r=[...s].sort((f,c)=>f-c),e=Math.max(0,Math.min(r.length-1,Math.ceil(t*r.length)-1));return r[e]??0}function gt(s,t){return t<=st?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})}function yt(s,t){const r=t-s;return r<=P?Math.max(1,Math.min(60,Math.ceil(r/it))):r<=st?Math.max(1,Math.min(25,Math.ceil(r/P))):Math.max(1,Math.min(31,Math.ceil(r/xt)))}function kt(s,t,r,e){const f=t.getTime(),c=r.getTime(),h=Math.max(1,c-f),n=yt(f,c),g=Math.max(1,Math.floor(h/n)),a=[];for(let o=0;o<n;o++){const i=new Date(f+o*g);a.push({t:i.toISOString(),ts:i.getTime(),label:gt(i,h),calls:0,errors:0,durations:[]})}for(const o of s){const i=new Date(o.timestamp).getTime(),m=Math.floor((i-f)/g),x=Math.max(0,Math.min(n-1,m)),d=a[x];d&&(d.calls+=1,o.isError&&(d.errors+=1),Number.isFinite(o.durationMs)&&d.durations.push(o.durationMs))}return a.map(o=>({t:o.t,ts:o.ts,label:o.label,calls:o.calls,errors:o.errors,errorRate:o.calls>0?o.errors/o.calls*100:0,avg:Math.round(o.durations.length>0?o.durations.reduce((i,m)=>i+m,0)/o.durations.length:0),p50:Math.round(q(o.durations,.5)),p95:Math.round(q(o.durations,.95))}))}function Ct(s,t,r,e,f){const c=e??s.length,h=f??s.filter(i=>i.isError).length,n=s.map(i=>i.durationMs),g=n.length>0?n.reduce((i,m)=>i+m,0)/n.length:0,a=q(n,.95),o=kt(s,t.startDate,t.endDate);return{totalCalls:c,totalErrors:h,avgDurationMs:g,p95DurationMs:a,data:o}}function ot(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function rt(s){const t=lt.c(19),{active:r,payload:e,dataKey:f,colorVar:c}=s;if(!r||!e?.length)return null;const h=e[0],n=h?.payload?.t??"";let g;t[0]!==h?.payload?.label||t[1]!==n?(g=n?new Date(n).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):h?.payload?.label??"",t[0]=h?.payload?.label,t[1]=n,t[2]=g):g=t[2];const a=g,o=h?.value,i=typeof o=="number"?o:0,m=f==="avg"||f==="p50"||f==="p95",x=f==="costUsd";let d;t[3]!==x||t[4]!==m||t[5]!==i?(d=x?`$${i.toFixed(i<1?4:2)}`:m?i>=1e4?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`:i.toLocaleString(),t[3]=x,t[4]=m,t[5]=i,t[6]=d):d=t[6];const S=d;let y;t[7]!==a?(y=l.jsx("div",{className:"text-[11px] text-muted-foreground mb-1",children:a}),t[7]=a,t[8]=y):y=t[8];let k;t[9]!==c?(k=l.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:c}}),t[9]=c,t[10]=k):k=t[10];let b;t[11]!==S?(b=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=b):b=t[12];let p;t[13]!==k||t[14]!==b?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,b]}),t[13]=k,t[14]=b,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg border bg-background px-3 py-2 shadow-md",children:[y,p]}),t[16]=y,t[17]=p,t[18]=j):j=t[18],j}function Lt(s){const t=lt.c(85),{data:r,dataKey:e,colorNum:f,chartHeight:c,variant:h,ariaLabel:n}=s,g=h===void 0?"bar":h,a=`var(--chart-${f})`,o=`kpi-gradient-${e}-${f}`,i=Math.max(...r.map(u=>u[e]??0),0);if(g==="area"){let u;t[0]!==c?(u=J(c,"w-full"),t[0]=c,t[1]=u):u=t[1];let M;t[2]!==a||t[3]!==e?(M={label:e,color:a},t[2]=a,t[3]=e,t[4]=M):M=t[4];let v;t[5]!==e||t[6]!==M?(v={[e]:M},t[5]=e,t[6]=M,t[7]=v):v=t[7];let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I={left:0,right:-12,top:8,bottom:8},t[8]=I):I=t[8];let $,O;t[9]!==a?($=l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.2}),O=l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),t[9]=a,t[10]=$,t[11]=O):($=t[10],O=t[11]);let w;t[12]!==o||t[13]!==$||t[14]!==O?(w=l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[$,O]})}),t[12]=o,t[13]=$,t[14]=O,t[15]=w):w=t[15];let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(at,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),t[17]=V):V=t[17];let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[18]=U):U=t[18];const W=i>0?"auto":10;let E;t[19]!==W?(E=l.jsx(et,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ot,width:40,domain:[0,W],tickCount:5}),t[19]=W,t[20]=E):E=t[20];let Y;t[21]===Symbol.for("react.memo_cache_sentinel")?(Y={stroke:"var(--border)",strokeDasharray:"4 4"},t[21]=Y):Y=t[21];let T;t[22]!==a||t[23]!==e?(T=l.jsx(Q,{cursor:Y,content:nt=>{const{active:ct,payload:ft}=nt;return l.jsx(rt,{active:ct,payload:ft,dataKey:e,colorVar:a})}}),t[22]=a,t[23]=e,t[24]=T):T=t[24];const X=`url(#${o})`;let z;t[25]!==a?(z={r:4,fill:a,stroke:"var(--background)",strokeWidth:2},t[25]=a,t[26]=z):z=t[26];let A;t[27]!==a||t[28]!==e||t[29]!==X||t[30]!==z?(A=l.jsx(mt,{type:"linear",dataKey:e,stroke:a,strokeWidth:2,fill:X,animationDuration:300,dot:!1,activeDot:z}),t[27]=a,t[28]=e,t[29]=X,t[30]=z,t[31]=A):A=t[31];let B;t[32]!==r||t[33]!==E||t[34]!==T||t[35]!==A||t[36]!==w?(B=l.jsxs(dt,{data:r,margin:I,children:[w,R,V,E,T,A]}),t[32]=r,t[33]=E,t[34]=T,t[35]=A,t[36]=w,t[37]=B):B=t[37];let H;return t[38]!==n||t[39]!==B||t[40]!==u||t[41]!==v?(H=l.jsx(Z,{role:"img","aria-label":n,className:u,config:v,children:B}),t[38]=n,t[39]=B,t[40]=u,t[41]=v,t[42]=H):H=t[42],H}let m;t[43]!==c?(m=J(c,"w-full"),t[43]=c,t[44]=m):m=t[44];let x;t[45]!==a||t[46]!==e?(x={label:e,color:a},t[45]=a,t[46]=e,t[47]=x):x=t[47];let d;t[48]!==e||t[49]!==x?(d={[e]:x},t[48]=e,t[49]=x,t[50]=d):d=t[50];let S,y;t[51]===Symbol.for("react.memo_cache_sentinel")?(S={left:0,right:-12,top:8,bottom:8},y=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[51]=S,t[52]=y):(S=t[51],y=t[52]);let k;t[53]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[53]=k):k=t[53];const b=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==b?(p=l.jsx(at,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:b,tickMargin:8}),t[54]=b,t[55]=p):p=t[55];let j;t[56]===Symbol.for("react.memo_cache_sentinel")?(j={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[56]=j):j=t[56];const G=i>0?"auto":10;let _;t[57]!==G?(_=l.jsx(et,{orientation:"right",axisLine:!1,tickLine:!1,tick:j,tickFormatter:ot,width:40,domain:[0,G],tickCount:5}),t[57]=G,t[58]=_):_=t[58];let K;t[59]===Symbol.for("react.memo_cache_sentinel")?(K={fill:"var(--muted)",opacity:.3},t[59]=K):K=t[59];let C;t[60]!==a||t[61]!==e?(C=l.jsx(Q,{cursor:K,content:u=>{const{active:M,payload:v}=u;return l.jsx(rt,{active:M,payload:v,dataKey:e,colorVar:a})}}),t[60]=a,t[61]=e,t[62]=C):C=t[62];let L;if(t[63]!==a||t[64]!==r||t[65]!==e){let u;t[67]!==a||t[68]!==e?(u=(M,v)=>l.jsx(ut,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${v}`),t[67]=a,t[68]=e,t[69]=u):u=t[69],L=r.map(u),t[63]=a,t[64]=r,t[65]=e,t[66]=L}else L=t[66];let D;t[70]!==a||t[71]!==e||t[72]!==L?(D=l.jsx(ht,{dataKey:e,fill:a,radius:0,minPointSize:1,children:L}),t[70]=a,t[71]=e,t[72]=L,t[73]=D):D=t[73];let N;t[74]!==r||t[75]!==_||t[76]!==C||t[77]!==D||t[78]!==p?(N=l.jsxs(pt,{data:r,margin:S,children:[y,p,_,C,D]}),t[74]=r,t[75]=_,t[76]=C,t[77]=D,t[78]=p,t[79]=N):N=t[79];let F;return t[80]!==n||t[81]!==N||t[82]!==m||t[83]!==d?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:d,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=d,t[84]=F):F=t[84],F}export{Lt as K,Ct as c};
@@ -1 +1 @@
1
- import{c as fe,r as Z,l as he,j as t,B as pe}from"./index-D_7jfHk6.js";import{B as re}from"./badge-CKM84j2S.js";import{C as ce}from"./checkbox-B2kVXKBD.js";import{t as de}from"./ChevronUp-CceLPRrE.js";import{C as xe,a as ge,b as me,c as ve,e as je,f as Ce}from"./command-Doiz3O29.js";import{a as be,b as Ne,P as ye}from"./popover-C2vJrXky.js";const we=[];function Ae(o){const e=fe.c(72),{options:n,onValueChange:i,defaultValue:ee,placeholder:te,variant:se,animation:le,maxCount:ae,modalPopover:ne,asChild:ie,className:J,disabled:oe,onSearchChange:P}=o,d=ee===void 0?we:ee,Y=te===void 0?"Select items":te,V=se===void 0?"default":se,_=le===void 0?0:le,k=ae===void 0?3:ae,F=ne===void 0?!1:ne,G=ie===void 0?!1:ie,L=oe===void 0?!1:oe,[s,S]=Z.useState(d),[q,E]=Z.useState(!1);let O,B;e[0]!==d||e[1]!==s?(B=()=>{JSON.stringify(s)!==JSON.stringify(d)&&S(d)},O=[d,s],e[0]=d,e[1]=s,e[2]=O,e[3]=B):(O=e[2],B=e[3]),Z.useEffect(B,O);let D;e[4]!==i||e[5]!==s?(D=l=>{if(l.key==="Enter")E(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const a=[...s];a.pop(),S(a),i(a)}},e[4]=i,e[5]=s,e[6]=D):D=e[6];const H=D;let I;e[7]!==i||e[8]!==s?(I=l=>{const a=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];S(a),i(a)},e[7]=i,e[8]=s,e[9]=I):I=e[9];const c=I;let A;e[10]!==i?(A=()=>{S([]),i([])},e[10]=i,e[11]=A):A=e[11];const Q=A;let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{E(Ve)},e[12]=R):R=e[12];const ue=R;let T;e[13]!==Q||e[14]!==i||e[15]!==n||e[16]!==s.length?(T=()=>{if(s.length===n.length)Q();else{const l=n.map(Pe);S(l),i(l)}},e[13]=Q,e[14]=i,e[15]=n,e[16]=s.length,e[17]=T):T=e[17];const r=T;let m;e[18]!==G?(m=G?{}:{variant:"outline"},e[18]=G,e[19]=m):m=e[19];let u;e[20]!==J?(u=he("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",J),e[20]=J,e[21]=u):u=e[21];let f;e[22]!==_||e[23]!==k||e[24]!==n||e[25]!==Y||e[26]!==s||e[27]!==V?(f=s.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s.slice(0,k).map(l=>{const a=n.find(X=>X.value===l),w=a?.icon;return t.jsxs(re,{variant:V==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${_}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:a?.label})]},l)}),s.length>k&&t.jsxs(re,{variant:V==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${_}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(de,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:Y}),t.jsx(de,{size:20,className:"shrink-0 opacity-50"})]}),e[22]=_,e[23]=k,e[24]=n,e[25]=Y,e[26]=s,e[27]=V,e[28]=f):f=e[28];let h;e[29]!==L||e[30]!==m||e[31]!==u||e[32]!==f?(h=t.jsx(be,{asChild:!0,children:t.jsx(pe,{ref:null,...m,onClick:ue,className:u,disabled:L,children:f})}),e[29]=L,e[30]=m,e[31]=u,e[32]=f,e[33]=h):h=e[33];let K;e[34]===Symbol.for("react.memo_cache_sentinel")?(K=()=>E(!1),e[34]=K):K=e[34];const U=!P;let p;e[35]!==H||e[36]!==P?(p=t.jsx(xe,{placeholder:"Search...",onKeyDown:H,onValueChange:P,className:"rounded-t-xl"}),e[35]=H,e[36]=P,e[37]=p):p=e[37];let M;e[38]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(ge,{children:"No results found."}),e[38]=M):M=e[38];let x;e[39]!==r?(x=()=>{r()},e[39]=r,e[40]=x):x=e[40];let g;e[41]!==r?(g=l=>{l.stopPropagation(),r()},e[41]=r,e[42]=g):g=e[42];const W=s.length===n.length&&n.length>0;let v;e[43]!==W||e[44]!==r?(v=t.jsx(ce,{checked:W,onCheckedChange:r,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Se}),e[43]=W,e[44]=r,e[45]=v):v=e[45];let $;e[46]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{children:"(Select All)"}),e[46]=$):$=e[46];let j;e[47]!==g||e[48]!==v?(j=t.jsxs("div",{className:"flex items-center w-full",onClick:g,children:[v,$]}),e[47]=g,e[48]=v,e[49]=j):j=e[49];let C;e[50]!==x||e[51]!==j?(C=t.jsx(me,{onSelect:x,className:"cursor-pointer",children:j},"all"),e[50]=x,e[51]=j,e[52]=C):C=e[52];let b;if(e[53]!==n||e[54]!==s||e[55]!==c){let l;e[57]!==s||e[58]!==c?(l=a=>{const w=s.includes(a.value);return t.jsx(me,{onSelect:()=>{c(a)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:X=>{X.stopPropagation(),c(a)},children:[t.jsx(ce,{checked:w,onCheckedChange:()=>{c(a)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:ke}),a.icon&&t.jsx(a.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:a.label})]})},a.value)},e[57]=s,e[58]=c,e[59]=l):l=e[59],b=n.map(l),e[53]=n,e[54]=s,e[55]=c,e[56]=b}else b=e[56];let N;e[60]!==C||e[61]!==b?(N=t.jsxs(ve,{className:"rounded-b-xl",children:[M,t.jsxs(je,{children:[C,b]})]}),e[60]=C,e[61]=b,e[62]=N):N=e[62];let y;e[63]!==U||e[64]!==p||e[65]!==N?(y=t.jsx(Ne,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:K,children:t.jsxs(Ce,{shouldFilter:U,className:"rounded-xl",children:[p,N]})}),e[63]=U,e[64]=p,e[65]=N,e[66]=y):y=e[66];let z;return e[67]!==q||e[68]!==F||e[69]!==h||e[70]!==y?(z=t.jsxs(ye,{open:q,onOpenChange:E,modal:F,children:[h,y]}),e[67]=q,e[68]=F,e[69]=h,e[70]=y,e[71]=z):z=e[71],z}function ke(o){return o.stopPropagation()}function Se(o){return o.stopPropagation()}function Pe(o){return o.value}function Ve(o){return!o}export{Ae as M};
1
+ import{c as fe,r as Z,l as he,j as t,B as pe}from"./index-Bm9FTdjr.js";import{B as re}from"./badge-DFdotQFQ.js";import{C as ce}from"./checkbox-DmaIcPoL.js";import{t as de}from"./ChevronUp-nynZHATg.js";import{C as xe,a as ge,b as me,c as ve,e as je,f as Ce}from"./command-D2QlwSrW.js";import{a as be,b as Ne,P as ye}from"./popover-jNB4XciF.js";const we=[];function Ae(o){const e=fe.c(72),{options:n,onValueChange:i,defaultValue:ee,placeholder:te,variant:se,animation:le,maxCount:ae,modalPopover:ne,asChild:ie,className:J,disabled:oe,onSearchChange:P}=o,d=ee===void 0?we:ee,Y=te===void 0?"Select items":te,V=se===void 0?"default":se,_=le===void 0?0:le,k=ae===void 0?3:ae,F=ne===void 0?!1:ne,G=ie===void 0?!1:ie,L=oe===void 0?!1:oe,[s,S]=Z.useState(d),[q,E]=Z.useState(!1);let O,B;e[0]!==d||e[1]!==s?(B=()=>{JSON.stringify(s)!==JSON.stringify(d)&&S(d)},O=[d,s],e[0]=d,e[1]=s,e[2]=O,e[3]=B):(O=e[2],B=e[3]),Z.useEffect(B,O);let D;e[4]!==i||e[5]!==s?(D=l=>{if(l.key==="Enter")E(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const a=[...s];a.pop(),S(a),i(a)}},e[4]=i,e[5]=s,e[6]=D):D=e[6];const H=D;let I;e[7]!==i||e[8]!==s?(I=l=>{const a=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];S(a),i(a)},e[7]=i,e[8]=s,e[9]=I):I=e[9];const c=I;let A;e[10]!==i?(A=()=>{S([]),i([])},e[10]=i,e[11]=A):A=e[11];const Q=A;let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{E(Ve)},e[12]=R):R=e[12];const ue=R;let T;e[13]!==Q||e[14]!==i||e[15]!==n||e[16]!==s.length?(T=()=>{if(s.length===n.length)Q();else{const l=n.map(Pe);S(l),i(l)}},e[13]=Q,e[14]=i,e[15]=n,e[16]=s.length,e[17]=T):T=e[17];const r=T;let m;e[18]!==G?(m=G?{}:{variant:"outline"},e[18]=G,e[19]=m):m=e[19];let u;e[20]!==J?(u=he("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",J),e[20]=J,e[21]=u):u=e[21];let f;e[22]!==_||e[23]!==k||e[24]!==n||e[25]!==Y||e[26]!==s||e[27]!==V?(f=s.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s.slice(0,k).map(l=>{const a=n.find(X=>X.value===l),w=a?.icon;return t.jsxs(re,{variant:V==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${_}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:a?.label})]},l)}),s.length>k&&t.jsxs(re,{variant:V==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${_}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(de,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:Y}),t.jsx(de,{size:20,className:"shrink-0 opacity-50"})]}),e[22]=_,e[23]=k,e[24]=n,e[25]=Y,e[26]=s,e[27]=V,e[28]=f):f=e[28];let h;e[29]!==L||e[30]!==m||e[31]!==u||e[32]!==f?(h=t.jsx(be,{asChild:!0,children:t.jsx(pe,{ref:null,...m,onClick:ue,className:u,disabled:L,children:f})}),e[29]=L,e[30]=m,e[31]=u,e[32]=f,e[33]=h):h=e[33];let K;e[34]===Symbol.for("react.memo_cache_sentinel")?(K=()=>E(!1),e[34]=K):K=e[34];const U=!P;let p;e[35]!==H||e[36]!==P?(p=t.jsx(xe,{placeholder:"Search...",onKeyDown:H,onValueChange:P,className:"rounded-t-xl"}),e[35]=H,e[36]=P,e[37]=p):p=e[37];let M;e[38]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(ge,{children:"No results found."}),e[38]=M):M=e[38];let x;e[39]!==r?(x=()=>{r()},e[39]=r,e[40]=x):x=e[40];let g;e[41]!==r?(g=l=>{l.stopPropagation(),r()},e[41]=r,e[42]=g):g=e[42];const W=s.length===n.length&&n.length>0;let v;e[43]!==W||e[44]!==r?(v=t.jsx(ce,{checked:W,onCheckedChange:r,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Se}),e[43]=W,e[44]=r,e[45]=v):v=e[45];let $;e[46]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{children:"(Select All)"}),e[46]=$):$=e[46];let j;e[47]!==g||e[48]!==v?(j=t.jsxs("div",{className:"flex items-center w-full",onClick:g,children:[v,$]}),e[47]=g,e[48]=v,e[49]=j):j=e[49];let C;e[50]!==x||e[51]!==j?(C=t.jsx(me,{onSelect:x,className:"cursor-pointer",children:j},"all"),e[50]=x,e[51]=j,e[52]=C):C=e[52];let b;if(e[53]!==n||e[54]!==s||e[55]!==c){let l;e[57]!==s||e[58]!==c?(l=a=>{const w=s.includes(a.value);return t.jsx(me,{onSelect:()=>{c(a)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:X=>{X.stopPropagation(),c(a)},children:[t.jsx(ce,{checked:w,onCheckedChange:()=>{c(a)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:ke}),a.icon&&t.jsx(a.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:a.label})]})},a.value)},e[57]=s,e[58]=c,e[59]=l):l=e[59],b=n.map(l),e[53]=n,e[54]=s,e[55]=c,e[56]=b}else b=e[56];let N;e[60]!==C||e[61]!==b?(N=t.jsxs(ve,{className:"rounded-b-xl",children:[M,t.jsxs(je,{children:[C,b]})]}),e[60]=C,e[61]=b,e[62]=N):N=e[62];let y;e[63]!==U||e[64]!==p||e[65]!==N?(y=t.jsx(Ne,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:K,children:t.jsxs(Ce,{shouldFilter:U,className:"rounded-xl",children:[p,N]})}),e[63]=U,e[64]=p,e[65]=N,e[66]=y):y=e[66];let z;return e[67]!==q||e[68]!==F||e[69]!==h||e[70]!==y?(z=t.jsxs(ye,{open:q,onOpenChange:E,modal:F,children:[h,y]}),e[67]=q,e[68]=F,e[69]=h,e[70]=y,e[71]=z):z=e[71],z}function ke(o){return o.stopPropagation()}function Se(o){return o.stopPropagation()}function Pe(o){return o.value}function Ve(o){return!o}export{Ae as M};
@@ -0,0 +1,4 @@
1
+ import{o as B,e as z,K as q,b as F,r as J,j as w,D as V,q as _,s as H,v as $,B as O,t as U}from"./index-Bm9FTdjr.js";import{a as G}from"./input-BkQDO0Ef.js";import{u as L,z as Y,A as X,B as Z,y as I,q as M}from"./claim-phase-copy-BnoHLlrM.js";import{h as ee,t as te,i as re}from"./runnable-block-editor-xVvcrNA2.js";import{t as se}from"./sandbox-git-api-C7JbVL7R.js";import{u as ne}from"./chat-context-DJGYyGlB.js";import{b as ae}from"./sandbox-url-D3mC8qhT.js";import{a as ie}from"./utils-DAEMarMy.js";import{i as oe}from"./CheckCircle-C3CiaCW4.js";import{a as ce}from"./Copy01-CdRMK9o7.js";import{M as ue}from"./monaco-editor-DANiMmsL.js";function Ae({orgSlug:s,virtualMcpId:e,branch:t}){const r=B(),a=ne()?.taskId??null,n=ee(e),i=G(e).runtime==="cms",{url:o}=L(e),c=te({orgSlug:s,virtualMcpId:e,branch:t,localPreviewUrl:o});return z({mutationKey:M(s,e,t),scope:I(s,e,t),mutationFn:async({blockKey:u})=>{if(o)return{ok:!0,existed:!0};if(i){const h=await Y({orgSlug:s,virtualMcpId:e,branch:t},{delete:[u]});return X(r,{orgSlug:s,virtualMcpId:e,branch:t},h),await r.invalidateQueries({queryKey:se({orgSlug:s,virtualMcpId:e,branch:t,threadId:a})}),{ok:!0,existed:!0}}const f=re(n,ie(u)),l=await fetch(ae({orgSlug:s,virtualMcpId:e,branch:t,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():Z(l,"Delete")},onMutate:async({blockKey:u})=>{const f=q.decofile(c);await r.cancelQueries({queryKey:f});const l=r.getQueryData(f),h=!!l&&u in l,b=l?.[u];return r.setQueryData(f,k=>{if(!k)return k;const{[u]:p,...g}=k;return g}),{queryKey:f,blockKey:u,hadKey:h,previousValue:b}},onError:(u,f,l)=>{l&&r.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h)},onSuccess:()=>{r.invalidateQueries({queryKey:q.liveMeta(s,e,t)})}})}function Qe({open:s,onOpenChange:e,pageKey:t,decofile:r,onSave:a}){const n=F(),i=r[t],o=i===void 0,c=o?"":JSON.stringify(i,null,2),[u,f]=J.useState(!1),[l,h]=J.useState(c),[b,k]=J.useState(!1),p=!a||o,g=l!==c,d=()=>{navigator.clipboard.writeText(l).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)})},v=async m=>{if(!a||b)return;let S;try{S=JSON.parse(m)}catch{U.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}k(!0);try{await a(S),U.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(E){U.error(n("sectionsEditor.pageJsonDialog.saveError",{error:E instanceof Error?E.message:String(E)}))}finally{k(!1)}};return w.jsx(V,{open:s,onOpenChange:e,children:w.jsxs(_,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[w.jsxs(H,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[w.jsx($,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),w.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[w.jsxs(O,{variant:"ghost",size:"sm",onClick:d,className:"h-7 gap-1.5 text-xs",children:[u?w.jsx(oe,{size:12}):w.jsx(ce,{size:12}),n(u?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!p&&w.jsx(O,{size:"sm",onClick:()=>v(l),disabled:!g||b,className:"h-7 text-xs",children:n(b?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),o?w.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):w.jsx("div",{className:"min-h-0 flex-1 py-2",children:w.jsx(ue,{code:c,language:"json",readOnly:p,height:"100%",onChange:m=>h(m??""),onSave:m=>{v(m)}})})]})})}var le=Object.prototype.toString,j=Array.isArray||function(e){return le.call(e)==="[object Array]"};function K(s){return typeof s=="function"}function fe(s){return j(s)?"array":typeof s}function N(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function pe(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var he=RegExp.prototype.test;function de(s,e){return he.call(s,e)}var ve=/\S/;function ye(s){return!de(ve,s)}var ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function we(s){return String(s).replace(/[&<>"'`=\/]/g,function(t){return ge[t]})}var me=/\s*/,Ee=/\s+/,Q=/\s*=/,xe=/\s*\}/,ke=/#|\^|\/|>|\{|&|=|!/;function Ce(s,e){if(!s)return[];var t=!1,r=[],a=[],n=[],i=!1,o=!1,c="",u=0;function f(){if(i&&!o)for(;n.length;)delete a[n.pop()];else n=[];i=!1,o=!1}var l,h,b;function k(C){if(typeof C=="string"&&(C=C.split(Ee,2)),!j(C)||C.length!==2)throw new Error("Invalid tags: "+C);l=new RegExp(N(C[0])+"\\s*"),h=new RegExp("\\s*"+N(C[1])),b=new RegExp("\\s*"+N("}"+C[1]))}k(e||x.tags);for(var p=new R(s),g,d,v,m,S,E;!p.eos();){if(g=p.pos,v=p.scanUntil(l),v)for(var T=0,W=v.length;T<W;++T)m=v.charAt(T),ye(m)?(n.push(a.length),c+=m):(o=!0,t=!0,c+=" "),a.push(["text",m,g,g+1]),g+=1,m===`
2
+ `&&(f(),c="",u=0,t=!1);if(!p.scan(l))break;if(i=!0,d=p.scan(ke)||"name",p.scan(me),d==="="?(v=p.scanUntil(Q),p.scan(Q),p.scanUntil(h)):d==="{"?(v=p.scanUntil(b),p.scan(xe),p.scanUntil(h),d="&"):v=p.scanUntil(h),!p.scan(h))throw new Error("Unclosed tag at "+p.pos);if(d==">"?S=[d,v,g,p.pos,c,u,t]:S=[d,v,g,p.pos],u++,a.push(S),d==="#"||d==="^")r.push(S);else if(d==="/"){if(E=r.pop(),!E)throw new Error('Unopened section "'+v+'" at '+g);if(E[1]!==v)throw new Error('Unclosed section "'+E[1]+'" at '+g)}else d==="name"||d==="{"||d==="&"?o=!0:d==="="&&k(v)}if(f(),E=r.pop(),E)throw new Error('Unclosed section "'+E[1]+'" at '+p.pos);return Se(be(a))}function be(s){for(var e=[],t,r,a=0,n=s.length;a<n;++a)t=s[a],t&&(t[0]==="text"&&r&&r[0]==="text"?(r[1]+=t[1],r[3]=t[3]):(e.push(t),r=t));return e}function Se(s){for(var e=[],t=e,r=[],a,n,i=0,o=s.length;i<o;++i)switch(a=s[i],a[0]){case"#":case"^":t.push(a),r.push(a),t=a[4]=[];break;case"/":n=r.pop(),n[5]=a[2],t=r.length>0?r[r.length-1][4]:e;break;default:t.push(a)}return e}function R(s){this.string=s,this.tail=s,this.pos=0}R.prototype.eos=function(){return this.tail===""};R.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};R.prototype.scanUntil=function(e){var t=this.tail.search(e),r;switch(t){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=r.length,r};function D(s,e){this.view=s,this.cache={".":this.view},this.parent=e}D.prototype.push=function(e){return new D(e,this)};D.prototype.lookup=function(e){var t=this.cache,r;if(t.hasOwnProperty(e))r=t[e];else{for(var a=this,n,i,o,c=!1;a;){if(e.indexOf(".")>0)for(n=a.view,i=e.split("."),o=0;n!=null&&o<i.length;)o===i.length-1&&(c=A(n,i[o])||pe(n,i[o])),n=n[i[o++]];else n=a.view[e],c=A(a.view,e);if(c){r=n;break}a=a.parent}t[e]=r}return K(r)&&(r=r.call(this.view)),r};function y(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}y.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};y.prototype.parse=function(e,t){var r=this.templateCache,a=e+":"+(t||x.tags).join(":"),n=typeof r<"u",i=n?r.get(a):void 0;return i==null&&(i=Ce(e,t),n&&r.set(a,i)),i};y.prototype.render=function(e,t,r,a){var n=this.getConfigTags(a),i=this.parse(e,n),o=t instanceof D?t:new D(t,void 0);return this.renderTokens(i,o,r,e,a)};y.prototype.renderTokens=function(e,t,r,a,n){for(var i="",o,c,u,f=0,l=e.length;f<l;++f)u=void 0,o=e[f],c=o[0],c==="#"?u=this.renderSection(o,t,r,a,n):c==="^"?u=this.renderInverted(o,t,r,a,n):c===">"?u=this.renderPartial(o,t,r,n):c==="&"?u=this.unescapedValue(o,t):c==="name"?u=this.escapedValue(o,t,n):c==="text"&&(u=this.rawValue(o)),u!==void 0&&(i+=u);return i};y.prototype.renderSection=function(e,t,r,a,n){var i=this,o="",c=t.lookup(e[1]);function u(h){return i.render(h,t,r,n)}if(c){if(j(c))for(var f=0,l=c.length;f<l;++f)o+=this.renderTokens(e[4],t.push(c[f]),r,a,n);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")o+=this.renderTokens(e[4],t.push(c),r,a,n);else if(K(c)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(t.view,a.slice(e[3],e[5]),u),c!=null&&(o+=c)}else o+=this.renderTokens(e[4],t,r,a,n);return o}};y.prototype.renderInverted=function(e,t,r,a,n){var i=t.lookup(e[1]);if(!i||j(i)&&i.length===0)return this.renderTokens(e[4],t,r,a,n)};y.prototype.indentPartial=function(e,t,r){for(var a=t.replace(/[^ \t]/g,""),n=e.split(`
3
+ `),i=0;i<n.length;i++)n[i].length&&(i>0||!r)&&(n[i]=a+n[i]);return n.join(`
4
+ `)};y.prototype.renderPartial=function(e,t,r,a){if(r){var n=this.getConfigTags(a),i=K(r)?r(e[1]):r[e[1]];if(i!=null){var o=e[6],c=e[5],u=e[4],f=i;c==0&&u&&(f=this.indentPartial(i,u,o));var l=this.parse(f,n);return this.renderTokens(l,t,r,f,a)}}};y.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(r!=null)return r};y.prototype.escapedValue=function(e,t,r){var a=this.getConfigEscape(r)||x.escape,n=t.lookup(e[1]);if(n!=null)return typeof n=="number"&&a===x.escape?String(n):a(n)};y.prototype.rawValue=function(e){return e[1]};y.prototype.getConfigTags=function(e){return j(e)?e:e&&typeof e=="object"?e.tags:void 0};y.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!j(e))return e.escape};var x={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(s){P.templateCache=s},get templateCache(){return P.templateCache}},P=new y;x.clearCache=function(){return P.clearCache()};x.parse=function(e,t){return P.parse(e,t)};x.render=function(e,t,r,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+fe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return P.render(e,t,r,a)};x.escape=we;x.Scanner=R;x.Context=D;x.Writer=y;export{Qe as P,x as m,Ae as u};
@@ -0,0 +1 @@
1
+ import{c as y,j as t,r as w,y as _,b as S,B as N,D as K,q as M,s as A,v as R,aK as E,I as T,l as V,t as $}from"./index-Bm9FTdjr.js";import{i as B}from"./ArrowLeft-B7455tPl.js";import{s as F}from"./Plus-XYNDZJ4s.js";import{L as H}from"./label-BL2W0Pcn.js";import{R as L}from"./repository-import-picker-DtM7QfYh.js";import{u as O}from"./use-navigate-to-agent-DDZo26Jw.js";import{S as z}from"./thread-intent-DzHkd78g.js";import{f as Z}from"./repository-binding-D2wL-4Vr.js";const D={viewBox:"0 0 96 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},l={stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};function q(a){const e=y.c(9),{className:n}=a;let r,o,s,c,i,u,h;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M22 46V22",...l,opacity:.7}),o=t.jsx("circle",{cx:"22",cy:"18",r:"4",...l,opacity:.8}),s=t.jsx("circle",{cx:"22",cy:"50",r:"4",...l,opacity:.8}),c=t.jsx("path",{d:"M22 32h14a6 6 0 0 1 6 6v4",...l,opacity:.6}),i=t.jsx("circle",{cx:"42",cy:"46",r:"4",...l,opacity:.7}),u=t.jsx("path",{d:"M56 22h9l3 4h14a3 3 0 0 1 3 3v20a3 3 0 0 1-3 3H56a3 3 0 0 1-3-3V25a3 3 0 0 1 3-3Z",...l,opacity:.75}),h=t.jsx("path",{d:"M53 34h32",...l,opacity:.5}),e[0]=r,e[1]=o,e[2]=s,e[3]=c,e[4]=i,e[5]=u,e[6]=h):(r=e[0],o=e[1],s=e[2],c=e[3],i=e[4],u=e[5],h=e[6]);let d;return e[7]!==n?(d=t.jsxs("svg",{...D,className:n,children:[r,o,s,c,i,u,h]}),e[7]=n,e[8]=d):d=e[8],d}function I(a){const e=y.c(4),{className:n}=a;let r,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M16 22a4 4 0 0 1 4-4h14l6 6h20a4 4 0 0 1 4 4v20a4 4 0 0 1-4 4H20a4 4 0 0 1-4-4V22Z",...l,opacity:.8}),o=t.jsx("path",{d:"M16 28h64",...l,opacity:.5}),e[0]=r,e[1]=o):(r=e[0],o=e[1]);let s;return e[2]!==n?(s=t.jsxs("svg",{...D,className:n,children:[r,o]}),e[2]=n,e[3]=s):s=e[3],s}function ie(a){const e=y.c(5),{className:n}=a;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:"46",y:"16",width:"128",height:"88",rx:"8",...l}),t.jsx("path",{d:"M46 34h128",...l,opacity:.6}),t.jsx("circle",{cx:"56",cy:"25",r:"2",fill:"currentColor",opacity:.6}),t.jsx("circle",{cx:"64",cy:"25",r:"2",fill:"currentColor",opacity:.45}),t.jsx("circle",{cx:"72",cy:"25",r:"2",fill:"currentColor",opacity:.3}),t.jsx("rect",{x:"58",y:"44",width:"104",height:"24",rx:"4",...l,opacity:.5}),t.jsx("rect",{x:"58",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.4}),t.jsx("rect",{x:"95",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.3}),t.jsx("rect",{x:"132",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.22})]}),e[0]=r):r=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("g",{transform:"rotate(-8 44 92)",children:[t.jsx("rect",{x:"22",y:"52",width:"44",height:"76",rx:"8",...l,fill:"var(--color-background)"}),t.jsx("path",{d:"M37 60h14",...l,opacity:.5}),t.jsx("rect",{x:"29",y:"68",width:"30",height:"20",rx:"3",...l,opacity:.45}),t.jsx("path",{d:"M29 96h30M29 104h20",...l,opacity:.35}),t.jsx("rect",{x:"29",y:"112",width:"30",height:"8",rx:"4",...l,opacity:.5})]}),e[1]=o):o=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("g",{transform:"rotate(10 168 104)",children:[t.jsx("path",{d:"M150 92h30a6 6 0 0 1 6 6v26a6 6 0 0 1-6 6h-30a6 6 0 0 1-6-6V98a6 6 0 0 1 6-6Z",...l,fill:"var(--color-background)"}),t.jsx("circle",{cx:"165",cy:"104",r:"3.5",...l}),t.jsx("path",{d:"M152 116h26M152 124h16",...l,opacity:.45})]}),e[2]=s):s=e[2];let c;return e[3]!==n?(c=t.jsxs("svg",{viewBox:"0 0 220 140",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:n,children:[r,o,s]}),e[3]=n,e[4]=c):c=e[4],c}const v=new z(!1);let k="unknown",P=null;function U(a,e){k=a,P=e?.onCreated??null,_("project_create_clicked",{source:a}),v.set(!0)}function le(){const a=y.c(2),e=w.useSyncExternalStore(v.subscribe,v.get);let n;return a[0]!==e?(n=[e,v.set],a[0]=e,a[1]=n):n=a[1],n}function C(a){const e=P;P=null,e?.(a)}function pe(){return k}const W={repository:{titleKey:"projects.new.path.repository",hintKey:"projects.new.path.repository.hint",art:q,plate:"bg-chart-5/10 group-hover:bg-chart-5/16",art_:"text-chart-5"},folder:{titleKey:"projects.new.path.folder",hintKey:"projects.new.path.folder.hint",art:I,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},G=["repository","folder"];function J(a){const e=y.c(25),{path:n,onSelect:r}=a,o=S(),s=W[n],c=s.art;let i;e[0]!==s.art_||e[1]!==s.plate?(i=V("flex h-28 items-center justify-center rounded-lg transition-colors",s.plate,s.art_),e[0]=s.art_,e[1]=s.plate,e[2]=i):i=e[2];let u;e[3]!==c?(u=t.jsx(c,{className:"h-20"}),e[3]=c,e[4]=u):u=e[4];let h;e[5]!==i||e[6]!==u?(h=t.jsx("span",{className:i,children:u}),e[5]=i,e[6]=u,e[7]=h):h=e[7];let d;e[8]!==s.titleKey||e[9]!==o?(d=o(s.titleKey),e[8]=s.titleKey,e[9]=o,e[10]=d):d=e[10];let x;e[11]!==d?(x=t.jsx("span",{className:"text-sm font-medium text-foreground",children:d}),e[11]=d,e[12]=x):x=e[12];let f;e[13]!==s.hintKey||e[14]!==o?(f=o(s.hintKey),e[13]=s.hintKey,e[14]=o,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[16]=f,e[17]=j):j=e[17];let m;e[18]!==x||e[19]!==j?(m=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[x,j]}),e[18]=x,e[19]=j,e[20]=m):m=e[20];let g;return e[21]!==r||e[22]!==h||e[23]!==m?(g=t.jsxs("button",{type:"button",onClick:r,className:"group flex flex-col gap-3 rounded-xl bg-card p-3 text-left card-shadow outline-none transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent/40 focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20 motion-reduce:transition-none motion-reduce:hover:translate-y-0",children:[h,m]}),e[21]=r,e[22]=h,e[23]=m,e[24]=g):g=e[24],g}function Q(a){const e=y.c(8),{label:n,children:r,hint:o}=a;let s;e[0]!==n?(s=t.jsx(H,{children:n}),e[0]=n,e[1]=s):s=e[1];let c;e[2]!==o?(c=o&&t.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=c):c=e[3];let i;return e[4]!==r||e[5]!==s||e[6]!==c?(i=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[s,r,c]}),e[4]=r,e[5]=s,e[6]=c,e[7]=i):i=e[7],i}function he({open:a,onOpenChange:e,source:n="org_home"}){const r=S(),o=Z(),s=O(),[c,i]=w.useState(null),[u,h]=w.useState(""),[d,x]=w.useState(null),f=w.useRef(null),j=()=>{i(null),h(""),x(null)},m=()=>{e(!1),j()};if(c==="repository")return t.jsx(L,{open:!0,onOpenChange:p=>{p||m()},onImportComplete:({virtualMcpId:p})=>{p&&(C(p),s(p)),m()}});const g=async()=>{if(o.create.isPending)return;const p=u.trim();if(!p){x(r("projects.new.nameRequired"));return}try{const b=(await o.create.mutateAsync({title:p,description:null,status:"active",pinned:!1,connections:[],metadata:{instructions:null,project:{storeUrl:null},ui:{pinnedViews:null,layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}}}))?.id;_("project_created",{source:n,path:c}),m(),b&&(C(b),s(b)),$.success(r("projects.new.created",{title:p}))}catch{x(r("projects.new.failed"))}};return t.jsx(K,{open:a,onOpenChange:p=>{p?e(!0):m()},children:t.jsxs(M,{className:"sm:max-w-3xl",ref:f,onOpenAutoFocus:p=>{p.preventDefault(),f.current?.focus()},children:[t.jsxs(A,{children:[t.jsx(R,{children:r("projects.new.title")}),t.jsx(E,{children:r(c?"projects.new.step.folder.title":"projects.new.subtitle")})]}),c===null?t.jsx("div",{className:"grid grid-cols-1 gap-3 animate-in fade-in-0 duration-200 sm:grid-cols-2 motion-reduce:animate-none",children:G.map(p=>t.jsx(J,{path:p,onSelect:()=>{_("project_create_path_selected",{source:n,path:p}),i(p)}},p))}):t.jsxs("form",{className:"flex flex-col gap-4 animate-in fade-in-0 slide-in-from-right-2 duration-200 motion-reduce:animate-none",onSubmit:p=>{p.preventDefault(),x(null),g()},children:[t.jsx(Q,{label:r("projects.new.nameLabel"),children:t.jsx(T,{autoFocus:!0,value:u,onChange:p=>h(p.target.value),placeholder:r("projects.new.namePlaceholder")})}),d&&t.jsx("p",{className:"text-sm text-destructive",children:d}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(N,{type:"button",variant:"ghost",onClick:()=>j(),children:[t.jsx(B,{size:14}),r("projects.new.back")]}),t.jsx(N,{type:"submit",disabled:o.create.isPending,children:o.create.isPending?r("projects.new.creating"):r("projects.new.create")})]})]})]})})}function de(a){const e=y.c(11),{source:n,variant:r,size:o,label:s}=a,c=r===void 0?"default":r,i=o===void 0?"sm":o,u=S();let h;e[0]!==n?(h=()=>U(n),e[0]=n,e[1]=h):h=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(F,{size:14}),e[2]=d):d=e[2];let x;e[3]!==s||e[4]!==u?(x=s??u("projects.home.newProject"),e[3]=s,e[4]=u,e[5]=x):x=e[5];let f;return e[6]!==i||e[7]!==h||e[8]!==x||e[9]!==c?(f=t.jsxs(N,{size:i,variant:c,onClick:h,children:[d,x]}),e[6]=i,e[7]=h,e[8]=x,e[9]=c,e[10]=f):f=e[10],f}export{ie as E,de as N,he as a,pe as n,U as o,le as u};
@@ -1 +1 @@
1
- import{b as o,r as c,j as e,h as n}from"./index-D_7jfHk6.js";import{h as u}from"./mcp-oauth-C5T-IVs8.js";import"./auth-Cps-90jQ.js";function f(){const t=o(),[a,l]=c.useState(null),[r,i]=c.useState(!1);return c.useEffect(()=>{(async()=>{try{const s=await u();if(!s.success){l(s.error||t("routes.oauthCallback.authenticationFailed")),setTimeout(()=>{window.close()},3e3);return}i(!0),setTimeout(()=>{window.close()},1500)}catch(s){l(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!a&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{className:"size-8 text-primary"})}),a&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t(a?"routes.oauthCallback.authenticationFailedTitle":r?"routes.oauthCallback.authenticationSuccessfulTitle":"routes.oauthCallback.authenticationInProgressTitle")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:t("routes.oauthCallback.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:a}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]})]}):r?e.jsxs("p",{children:[t("routes.oauthCallback.authenticationComplete"),e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]}):e.jsx("p",{children:t("routes.oauthCallback.processingAuthentication")})})]})]})})}export{f as default};
1
+ import{b as o,r as c,j as e,h as n}from"./index-Bm9FTdjr.js";import{h as u}from"./mcp-oauth-BTa4N28L.js";import"./auth-Dwu4WH32.js";function f(){const t=o(),[a,l]=c.useState(null),[r,i]=c.useState(!1);return c.useEffect(()=>{(async()=>{try{const s=await u();if(!s.success){l(s.error||t("routes.oauthCallback.authenticationFailed")),setTimeout(()=>{window.close()},3e3);return}i(!0),setTimeout(()=>{window.close()},1500)}catch(s){l(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!a&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{className:"size-8 text-primary"})}),a&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t(a?"routes.oauthCallback.authenticationFailedTitle":r?"routes.oauthCallback.authenticationSuccessfulTitle":"routes.oauthCallback.authenticationInProgressTitle")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:t("routes.oauthCallback.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:a}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]})]}):r?e.jsxs("p",{children:[t("routes.oauthCallback.authenticationComplete"),e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]}):e.jsx("p",{children:t("routes.oauthCallback.processingAuthentication")})})]})]})})}export{f as default};
@@ -1 +1 @@
1
- import{b as d,r as a,j as e,h}from"./index-D_7jfHk6.js";function x(){const r=d(),[s,o]=a.useState("loading"),[l,u]=a.useState(null),c=a.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),i=t.get("code"),n=t.get("state");if(!i||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:i,stateToken:n},window.location.origin),o("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),u(t instanceof Error?t.message:String(t)),o("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(h,{className:"size-8 text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:r(s==="error"?"routes.oauthCallbackAiProvider.authFailed":s==="success"?"routes.oauthCallbackAiProvider.authSuccess":"routes.oauthCallbackAiProvider.authInProgress")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:r("routes.oauthCallbackAiProvider.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:l}),e.jsx("p",{className:"mt-2",children:r("routes.oauthCallbackAiProvider.windowCloseAuto")})]}):s==="success"?e.jsx("p",{children:r("routes.oauthCallbackAiProvider.authCompleteCloseAuto")}):e.jsx("p",{children:r("routes.oauthCallbackAiProvider.processingAuth")})})]})]})})}export{x as default};
1
+ import{b as d,r as a,j as e,h}from"./index-Bm9FTdjr.js";function x(){const r=d(),[s,o]=a.useState("loading"),[l,u]=a.useState(null),c=a.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),i=t.get("code"),n=t.get("state");if(!i||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:i,stateToken:n},window.location.origin),o("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),u(t instanceof Error?t.message:String(t)),o("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(h,{className:"size-8 text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:r(s==="error"?"routes.oauthCallbackAiProvider.authFailed":s==="success"?"routes.oauthCallbackAiProvider.authSuccess":"routes.oauthCallbackAiProvider.authInProgress")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:r("routes.oauthCallbackAiProvider.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:l}),e.jsx("p",{className:"mt-2",children:r("routes.oauthCallbackAiProvider.windowCloseAuto")})]}):s==="success"?e.jsx("p",{children:r("routes.oauthCallbackAiProvider.authCompleteCloseAuto")}):e.jsx("p",{children:r("routes.oauthCallbackAiProvider.processingAuth")})})]})]})})}export{x as default};
@@ -0,0 +1 @@
1
+ import{c as ie,j as t,a as ye,h as ce,b as de,m as Ce,K as Oe,r as P,B as Ne,e as pe,x as ze,I as Le,l as ae,t as he}from"./index-Bm9FTdjr.js";import{R as _e}from"./required-auth-layout-CbgA2xIU.js";import{A as se}from"./auth-split-layout-DXUbMgnq.js";import{O as Ee}from"./organization-choice-BIWVNvRP.js";import{A as ve}from"./avatar-BEl6nltF.js";import{L as Ae}from"./label-BL2W0Pcn.js";import{S as De}from"./switch-DZo6rAtc.js";import{t as Pe}from"./Building02-BZItaEYx.js";import{i as Re}from"./CheckCircle-C3CiaCW4.js";import{t as Fe}from"./Globe04-DoxNod_i.js";import{i as Me}from"./Upload01-CrRTpeMX.js";import"./Plus-XYNDZJ4s.js";import"./User01-9bZ-cKa7.js";const $e=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function xe(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function at(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_e,{children:t.jsx(Te,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:s}=i;let a;e[0]!==s||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:s??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=s,e[1]=n,e[2]=a):a=e[2];let f;e[3]!==b?(f=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:b}),e[3]=b,e[4]=f):f=e[4];let r;e[5]!==m?(r=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=r):r=e[6];let o;e[7]!==f||e[8]!==r?(o=t.jsxs("div",{className:"space-y-2",children:[f,r]}),e[7]=f,e[8]=r,e[9]=o):o=e[9];let j;return e[10]!==a||e[11]!==o?(j=t.jsxs("div",{className:"grid gap-10",children:[a,o]}),e[10]=a,e[11]=o,e[12]=j):j=e[12],j}function Te(){const i=ie.c(4),{data:e,isPending:b}=ye.useSession();if(b){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(se,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(ce,{className:"size-3.5 text-muted-foreground"})})}),i[0]=a):a=i[0],a}const m=e?.user?.email??"",n=e?.user?.name;let s;return i[1]!==n||i[2]!==m?(s=t.jsx(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=s):s=i[3],s}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),s=b.split("@")[1]?.toLowerCase()??"",a=!!s&&!$e.has(s),f=s.split(".")[0]??"",r=f.charAt(0).toUpperCase()+f.slice(1);let o;e[0]!==r||e[1]!==a||e[2]!==m?(o=a?r:m?.split(" ")[0]??"",e[0]=r,e[1]=a,e[2]=m,e[3]=o):o=e[3];const j=o,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(s),queryFn:Be,enabled:a});let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=new Set,e[4]=g):g=e[4];const[_,M]=P.useState(g),[$,y]=P.useState(!1);if(v){let l;return e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=l):l=e[5],t.jsx(se,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[l,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:s})})]})})}if(u){let l;e[6]!==w?(l=()=>w(),e[6]=w,e[7]=l):l=e[7];let d;e[8]!==n?(d=n("routes.onboarding.retry"),e[8]=n,e[9]=d):d=e[9];let h;return e[10]!==l||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:l,children:d}),e[10]=l,e[11]=d,e[12]=h):h=e[12],t.jsx(se,{children:t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checkFailed",{domain:s})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Ke),A=N.some(Ie),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let l;e[16]!==m?(l=m?.split(" ")[0]??"",e[16]=m,e[17]=l):l=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==r||e[21]!==s||e[22]!==a||e[23]!==l||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:s,domainLabel:r,defaultName:l,allowDomainClaim:!1,onBack:d}),e[20]=r,e[21]=s,e[22]=a,e[23]=l,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let l;e[26]!==p||e[27]!==N.length||e[28]!==n?(l=p?N.length===1?n("routes.onboarding.accessSingle"):n("routes.onboarding.accessMultiple"):n("routes.onboarding.requestAccess"),e[26]=p,e[27]=N.length,e[28]=n,e[29]=l):l=e[29];let d;e[30]!==p||e[31]!==n?(d=n(p?"routes.onboarding.emailMatchesOrg":"routes.onboarding.emailMatchesOrgApproval"),e[30]=p,e[31]=n,e[32]=d):d=e[32];let h;e[33]!==l||e[34]!==d?(h=t.jsx(fe,{title:l,description:d}),e[33]=l,e[34]=d,e[35]=h):h=e[35];let O;e[36]!==M?(O=R=>M(F=>new Set(F).add(R)),e[36]=M,e[37]=O):O=e[37];let C;e[38]!==N||e[39]!==s||e[40]!==_||e[41]!==O?(C=t.jsx(Ee,{organizations:N,domain:s,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),e[38]=N,e[39]=s,e[40]=_,e[41]=O,e[42]=C):C=e[42];let z;e[43]!==y?(z=()=>y(!0),e[43]=y,e[44]=z):z=e[44];let E;e[45]!==n?(E=n("routes.onboarding.createNewOrg"),e[45]=n,e[46]=E):E=e[46];let k;e[47]!==E||e[48]!==z?(k=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:z,children:E}),e[47]=E,e[48]=z,e[49]=k):k=e[49];let L;return e[50]!==k||e[51]!==h||e[52]!==C?(L=t.jsx(se,{children:t.jsxs("div",{className:"grid gap-10",children:[h,C,k]})}),e[50]=k,e[51]=h,e[52]=C,e[53]=L):L=e[53],L}let D;return e[54]!==j||e[55]!==r||e[56]!==s||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:s,domainLabel:r,defaultName:j}),e[54]=j,e[55]=r,e[56]=s,e[57]=a,e[58]=D):D=e[58],D}function Ue(i,e){window.location.href=`/${e}`}function Ie(i){return i.joinMode==="auto"}function Ke(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Be(){const i=await fetch("/api/auth/custom/domain-lookup",{credentials:"include"});if(!i.ok)throw new Error(`Failed to look up domain (${i.status})`);return i.json()}function be(i){const e=ie.c(103),{isCorporateEmail:b,emailDomain:m,domainLabel:n,defaultName:s,allowDomainClaim:a,onBack:f}=i,r=a===void 0?!0:a,o=de(),j=b&&r?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(s),[u,w]=P.useState(j),[g,_]=P.useState(!0),[M,$]=P.useState(null);let y;e[0]!==g||e[1]!==u||e[2]!==c?(y=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.trim()||void 0,logo:u??void 0,claimDomain:g})}),S=await x.json();if(!x.ok||!S.success)throw new Error(S.error||"Failed to set up organization");return S},e[0]=g,e[1]=u,e[2]=c,e[3]=y):y=e[3];let N;e[4]!==g?(N=x=>{if(!x.slug)return;const S=we.filter(ke=>g||!ke.claimOnly).length,ne=Se*(S-1)+800;$(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},ne)},e[4]=g,e[5]=N):N=e[5];let A;e[6]!==y||e[7]!==N?(A={mutationFn:y,onSuccess:N},e[6]=y,e[7]=N,e[8]=A):A=e[8];const p=pe(A);let D;e[9]!==u||e[10]!==c?(D={mutationFn:async()=>{const x=c.trim(),S=xe(x);if(!S)throw new Error("Invalid organization name");const ne=await ye.organization.create({name:x,slug:S,...u?{logo:u}:{}});if(ne?.error)throw new Error(ne.error.message||"Failed to create organization");window.location.href=`/${ne?.data?.slug??S}`}},e[9]=u,e[10]=c,e[11]=D):D=e[11];const l=pe(D);if(p.isPending||M){let x;e[12]!==n||e[13]!==c?(x=c.trim()||n,e[12]=n,e[13]=c,e[14]=x):x=e[14];let S;return e[15]!==g||e[16]!==m||e[17]!==u||e[18]!==x?(S=t.jsx(se,{children:t.jsx(Ge,{orgName:x,domain:m,claimDomain:g,logoUrl:u})}),e[15]=g,e[16]=m,e[17]=u,e[18]=x,e[19]=S):S=e[19],S}const d=l.isPending;let h;e[20]!==c?(h=xe(c.trim()),e[20]=c,e[21]=h):h=e[21];const O=!!h,C=p.error||l.error||null;let z;e[22]!==r||e[23]!==O||e[24]!==l||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&r?p.mutate():l.mutate())},e[22]=r,e[23]=O,e[24]=l,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==o?(k=o("routes.onboarding.welcomeTitle"),e[28]=o,e[29]=k):k=e[29];let L;e[30]!==o?(L=o("routes.onboarding.setupDescription"),e[30]=o,e[31]=L):L=e[31];let R;e[32]!==k||e[33]!==L?(R=t.jsx(fe,{title:k,description:L}),e[32]=k,e[33]=L,e[34]=R):R=e[34];let F;e[35]!==o?(F=o("routes.onboarding.orgAvatar"),e[35]=o,e[36]=F):F=e[36];let T;e[37]!==F?(T=t.jsx("p",{className:"text-sm font-medium",children:F}),e[37]=F,e[38]=T):T=e[38];let q;e[39]!==o?(q=o("routes.onboarding.optional"),e[39]=o,e[40]=q):q=e[40];let U;e[41]!==q?(U=t.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[41]=q,e[42]=U):U=e[42];let I;e[43]!==T||e[44]!==U?(I=t.jsxs("div",{className:"space-y-0.5",children:[T,U]}),e[43]=T,e[44]=U,e[45]=I):I=e[45];let K;e[46]!==s||e[47]!==c?(K=(c.trim()||s||"?").charAt(0).toUpperCase(),e[46]=s,e[47]=c,e[48]=K):K=e[48];const me=d||p.isPending;let B;e[49]!==u||e[50]!==K||e[51]!==me?(B=t.jsx(Je,{value:u,fallback:K,onChange:w,disabled:me}),e[49]=u,e[50]=K,e[51]=me,e[52]=B):B=e[52];let J;e[53]!==I||e[54]!==B?(J=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[I,B]}),e[53]=I,e[54]=B,e[55]=J):J=e[55];let G;e[56]!==o?(G=o("routes.onboarding.orgName"),e[56]=o,e[57]=G):G=e[57];let Y;e[58]!==G?(Y=t.jsx(Ae,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:G}),e[58]=G,e[59]=Y):Y=e[59];let re;e[60]===Symbol.for("react.memo_cache_sentinel")?(re=x=>v(x.target.value),e[60]=re):re=e[60];let H;e[61]!==s||e[62]!==o?(H=s||o("routes.onboarding.myOrganizationPlaceholder"),e[61]=s,e[62]=o,e[63]=H):H=e[63];const ue=d||p.isPending;let Q;e[64]!==c||e[65]!==H||e[66]!==ue?(Q=t.jsx(Le,{id:"org-name",value:c,onChange:re,placeholder:H,disabled:ue,className:"h-10 max-w-[220px]"}),e[64]=c,e[65]=H,e[66]=ue,e[67]=Q):Q=e[67];let W;e[68]!==Y||e[69]!==Q?(W=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[Y,Q]}),e[68]=Y,e[69]=Q,e[70]=W):W=e[70];let V;e[71]!==r||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==o?(V=b&&r&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:o("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=r,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=o,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[J,W,V]}),e[79]=J,e[80]=W,e[81]=V,e[82]=X):X=e[82];let Z;e[83]!==C||e[84]!==o?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:o("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=o,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==o?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",o("routes.onboarding.creating")]}):o("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=o,e[89]=ee):ee=e[89];let te;e[90]!==ge||e[91]!==ee?(te=t.jsx(Ne,{type:"submit",size:"xl",className:"w-full",disabled:ge,children:ee}),e[90]=ge,e[91]=ee,e[92]=te):te=e[92];let oe;e[93]!==f||e[94]!==o?(oe=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:o("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=o,e[95]=oe):oe=e[95];let le;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==oe?(le=t.jsx(se,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,oe]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=oe,e[102]=le):le=e[102],le}function Je(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:s}=i,a=de(),f=P.useRef(null);let r;e[0]!==n||e[1]!==a?(r=M=>{const $=M.target.files?.[0];if(!$)return;if($.size>2097152){he.error(a("routes.onboarding.imageTooLarge")),f.current&&(f.current.value="");return}const y=new FileReader;y.onerror=()=>he.error(a("routes.onboarding.failedReadImage")),y.onloadend=()=>{y.result&&n(y.result),f.current&&(f.current.value="")},y.readAsDataURL($)},e[0]=n,e[1]=a,e[2]=r):r=e[2];const o=r;let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f.current?.click(),e[3]=j):j=e[3];let c;e[4]!==a?(c=a("routes.onboarding.uploadOrgLogo"),e[4]=a,e[5]=c):c=e[5];let v;e[6]!==s||e[7]!==o?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:s}),e[6]=s,e[7]=o,e[8]=v):v=e[8];const u=b??void 0;let w;e[9]!==m||e[10]!==u?(w=t.jsx(ve,{url:u,fallback:m,shape:"square",size:"base"}),e[9]=m,e[10]=u,e[11]=w):w=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(Me,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==s||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:s,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":c,children:[v,w,g]}),e[13]=s,e[14]=c,e[15]=v,e[16]=w,e[17]=_):_=e[17],_}const we=[{icon:Pe,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Fe,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:ze,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0}],Se=1500,je=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Ge({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),s=we.filter(o=>b||!o.claimOnly),[a,f]=P.useState(0),r=P.useRef(!1);if(!r.current){r.current=!0;for(let o=1;o<s.length;o++)setTimeout(()=>f(o),Se*o)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(fe,{title:n("routes.onboarding.settingUp",{orgName:i}),description:n("routes.onboarding.gettingReady",{domain:e}),logoUrl:m??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:s.map((o,j)=>{const c=o.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(o.labelKey);return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:u||v?1:.4},children:[t.jsxs("span",{className:ae("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!u&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:u?{backgroundColor:w.bg,color:w.fg}:void 0,children:[t.jsx(Re,{size:16,className:ae("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",u?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(ce,{className:ae("absolute size-4","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0")}),t.jsx(c,{size:16,className:ae("absolute motion-safe:transition-opacity motion-safe:duration-200",!u&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:ae("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||u?"text-foreground":"text-muted-foreground"),children:g})]},o.labelKey)})})]})}export{at as default};
@@ -0,0 +1,3 @@
1
+ import{f as J,g as B}from"./input-BkQDO0Ef.js";import{aD as A,aE as D,c$ as C,aW as U,bT as W}from"./index-Bm9FTdjr.js";import"./usage-stats-BihPbkIg.js";import"./tool-namespace-CYa7zzrf.js";import"./form-BCYpCYIL.js";import"./label-BL2W0Pcn.js";import"./utils-CVEq3hMx.js";import"./markdown-B3PJYX-4.js";import"./use-copy-B01v9eRq.js";import"./Copy01-CdRMK9o7.js";import"./ZoomOut-BggitXDv.js";import"./location-BjlyegC2.js";import"./use-mobile-UYmsi-dp.js";import"./use-panel-navigate-A1obvdVI.js";import"./thread-route-mhniW_q8.js";import"./use-project-scope-BxCbtcTE.js";import"./repository-binding-D2wL-4Vr.js";import"./use-mcp-client-Dh_4AZgb.js";import"./auth-Dwu4WH32.js";import"./tooltip-XZmQWwgB.js";import"./index-D2iZ6syL.js";import"./agent-icon-BewGjsar.js";import"./AlertCircle-B5gBB9h_.js";import"./Tool01-DQnW-zjg.js";import"./ArrowUp-CP6XCJnB.js";import"./ArrowLeft-B7455tPl.js";import"./LinkBroken01-BZFZ6N-h.js";import"./ShoppingBag01-Ci8H67G0.js";import"./Building02-BZItaEYx.js";import"./CheckCircle-C3CiaCW4.js";import"./ChevronUp-nynZHATg.js";import"./ChevronSelectorVertical-DIPs2sw-.js";import"./UserSquare-CuRnLJZ6.js";import"./CreditCard01-DVQTLvKO.js";import"./DotsVertical-3XBYz4yU.js";import"./Image01-DdBetDCI.js";import"./Globe04-DoxNod_i.js";import"./SwitchHorizontal01-BHr8jCjb.js";import"./Key01-DcSonP-G.js";import"./Link01-3BacRGrf.js";import"./Monitor01-DU19-CHk.js";import"./Sun-D1Mdg8Cq.js";import"./Play-B7i_-ibU.js";import"./Plus-XYNDZJ4s.js";import"./SearchMd-BFitEH5z.js";import"./Trash01-DZ8laRwu.js";import"./Upload01-CrRTpeMX.js";import"./User01-9bZ-cKa7.js";import"./Users01-cUGZjxDe.js";import"./XClose-DjFCAP5F.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-decopilot-events-1iPDcTcf.js";import"./thread-intent-DzHkd78g.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DmOqvBBq.js";import"./task-board-Bgw_xVJW.js";import"./schema-C_wSANSe.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-DJGYyGlB.js";import"./autosend-BaKgBZDQ.js";import"./use-ai-providers-BP69qr77.js";import"./use-chat-navigation-BXZpM5MQ.js";import"./use-organization-settings-xcc5-6DS.js";import"./icon-button-sHj7Q6Fp.js";import"./file-type-icon-DzYK4NqY.js";import"./shell-layout-Ckss0QqA.js";import"./avatar-BEl6nltF.js";import"./use-clock-tick-rPXqIJP8.js";import"./command-D2QlwSrW.js";import"./index-s6P2p4h7.js";import"./integration-icon-DoYtKqdf.js";import"./project-icon-D2vCEWQy.js";import"./new-project-dialog-C-thpPQ-.js";import"./repository-import-picker-DtM7QfYh.js";import"./use-navigate-to-agent-DDZo26Jw.js";import"./repository-picker-28zwGBgK.js";import"./useInfiniteQuery-vZqvTY4f.js";import"./infiniteQueryObserver-zxl9Rj5F.js";import"./collection-search-BC0JMMNp.js";import"./use-debounced-value-D5_QO1dT.js";import"./required-auth-layout-CbgA2xIU.js";import"./use-org-sso-DWtbATGD.js";import"./chat-draft-DbBgaLY_.js";import"./select-BVEgIanS.js";import"./index-BdQq_4o_.js";import"./tabs-CXsAC8nO.js";import"./use-deco-credits-DkZSWK0d.js";import"./toggle-group-5iPAspL-.js";import"./use-open-billing-url-C0JU6CzN.js";import"./index-CuOTEpMz.js";import"./checkbox-DmaIcPoL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-jNB4XciF.js";import"./drawer-BPz4t5dt.js";import"./input-Bvc3OT4I.js";import"./suggestion-Bso4uBRF.js";import"./use-chat-layout-state-J-94EUwt.js";import"./use-file-configs-B8mqylSR.js";import"./site-slug-DebpOoQq.js";import"./use-mcp-prompts-LJf01t7x.js";import"./use-org-fs-gQ0RuIPK.js";import"./question-004-sINsf4GQ.js";import"./use-members-DQe3FYGy.js";import"./use-org-auth-client-CPbs0OVW.js";import"./feature-paywall-CHcwEHRJ.js";import"./plan-ladder-BUDRjzbj.js";import"./add-connection-dialog-DBnkMFp9.js";import"./extract-connection-data-BTBLhbEe.js";import"./metadata-D72DunRR.js";import"./connection-BjzBHJVc.js";import"./url-slug-B-L2Z8me.js";import"./connection-card-BVD8Ppl9.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-bcNEcwC6.js";import"./use-connection-DUF3XC9E.js";import"./connection-form-helpers-5EXuPZ4G.js";import"./authenticate-and-persist-oauth-BEdNWkUl.js";import"./mcp-oauth-4gmyTyah.js";import"./mcp-oauth-BTa4N28L.js";import"./collection-tabs-DeQ7zbGh.js";import"./badge-DFdotQFQ.js";import"./use-infinite-scroll-DewChEmc.js";import"./useSuspenseInfiniteQuery-DdGuWYX3.js";import"./use-task-board-events-DHjlo-9e.js";class X{constructor(t,n=4e3){this.onDisconnect=t,this.graceMs=n}onDisconnect;graceMs;timer;report(t){if(t==="connected"){clearTimeout(this.timer),this.timer=void 0;return}if(t==="failed"||t==="closed"){clearTimeout(this.timer),this.timer=void 0,this.onDisconnect();return}t==="disconnected"&&!this.timer&&(this.timer=setTimeout(this.onDisconnect,this.graceMs))}dispose(){clearTimeout(this.timer),this.timer=void 0}}const $=A({type:W(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:D(),delta:D(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),H=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:D(),target:C("client")})});class F{constructor(t,n){this.send=t,this.callbacks=n}send;callbacks;closed=!1;fragments=[];seen=new Set;delegated=new Set;consumed=new Set;pending=new Map;contexts=new Map;awaitingContext=new Map;receive(t,n=Date.now()){if(this.closed)return;const r=$.safeParse(t);if(r.success){const e=r.data;if(this.seen.has(e.event_id))return;this.seen.add(e.event_id);const s=e.type==="session.input_transcript.delta"?"user":"agent";if(this.fragments.push({role:s,text:e.delta,start:e.start_ms,end:e.end_ms,arrivedAt:n,id:e.event_id}),this.fragments.sort((o,i)=>o.start-i.start),this.fragments.length>4e3){this.callbacks.onError();return}this.callbacks.onMessage({role:s,message:e.delta,event_id:e.event_id});return}const a=H.safeParse(t);if(a.success){const{id:e}=a.data.delegation;if(this.delegated.has(e)||this.pending.has(e))return;if(this.delegated.size+this.pending.size>=40){this.callbacks.onError();return}this.pending.set(e,{offset:a.data.offset_ms,receivedAt:n});return}const m=A({type:C("session.thinking.appended"),client_event_id:D()}).safeParse(t);if(m.success){const e=m.data.client_event_id,s=this.awaitingContext.get(e);this.awaitingContext.delete(e),s&&(s.remaining.delete(e),s.remaining.size===0&&this.send({type:"session.commentary.append",event_id:crypto.randomUUID(),delegation_id:s.delegationId??null,content:"Studio has supplied the complete background result as context for this request. Briefly explain that result, including any failure or required approval. Acceptance or task creation alone does not mean the work completed."}));return}const p=A({type:D()}).safeParse(t);p.success&&p.data.type==="error"&&this.callbacks.onError()}tick(t=Date.now()){if(!this.closed)for(const[n,r]of this.pending){const a=this.fragments.filter(o=>o.start<r.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,r.receivedAt);if(t-m<500)continue;const p=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!p.length&&t-r.receivedAt<3e3)continue;if(this.pending.delete(n),this.delegated.add(n),!p.length){this.publishUpdate({delivery:"announce",delegationId:n,text:"No new transcribed request is available. No work was started. Ask the user to repeat the request."});continue}const e=p.map(o=>o.text).join("").trim(),s=[];for(const o of a){if(p.includes(o))continue;const i=s.at(-1);i?.role===o.role?i.text+=o.text:s.push({role:o.role,text:o.text})}if(e.length>J){this.publishUpdate({delivery:"announce",delegationId:n,text:"The spoken request is too long. No work was started. Ask the user to shorten it or continue in text."});continue}for(const o of p)this.consumed.add(o.id);this.callbacks.onDelegate({request:e,delegationId:n,transcript:B(s.map(({role:o,text:i})=>({role:o,text:i.trim()})).filter(({text:o})=>o))}).then(o=>{this.closed||this.publishUpdate({delivery:o.status==="rejected"?"announce":"context",delegationId:n,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:n,text:"Studio could not accept this request. Do not claim work started."})})}}publishUpdate(t){if(this.closed)return;if(t.contextId){if(this.contexts.get(t.contextId)===t.text)return;this.contexts.set(t.contextId,t.text)}const r=(t.contextId?`Updated ${t.contextId} data, superseding earlier values:
2
+ `:`Studio result data:
3
+ `)+t.text,a=new TextEncoder,m=t.delivery==="announce"&&a.encode(r).length>480,p={remaining:new Set,delegationId:t.delegationId};let e="",s=0;const o=()=>{if(!e)return;const i=crypto.randomUUID();m&&(p.remaining.add(i),this.awaitingContext.set(i,p)),this.send({type:t.delivery==="announce"&&!m?"session.commentary.append":"session.thinking.append",event_id:i,delegation_id:t.delegationId??null,content:e}),e="",s=0};for(const i of r){const v=a.encode(i).length;s+v>480&&o(),e+=i,s+=v}o()}close(){this.closed=!0,this.pending.clear(),this.awaitingContext.clear()}}async function ho(E,t,n){n.throwIfAborted();const r=new RTCPeerConnection,a=r.createDataChannel("oai-events"),m=document.createElement("audio");m.autoplay=!0;let p,e,s,o,i=!1,v=!1,h,O,L=0,P=0,g,w,y=!1;const I=Promise.withResolvers(),x=Promise.withResolvers();x.promise.catch(()=>{});const b=new F(d=>{!i&&a.readyState==="open"&&a.send(JSON.stringify(d))},t),q=new X(()=>{i||t.onDisconnect()}),T=async()=>{if(!i){i=!0,q.dispose(),b.close(),clearInterval(O),n.removeEventListener("abort",M),a.close(),r.close();for(const d of p?.getTracks()??[])d.stop();m.pause(),m.srcObject=null,e&&e.state!=="closed"&&await e.close().catch(()=>{})}},M=()=>{T()};n.addEventListener("abort",M,{once:!0});const u=AbortSignal.any([n,AbortSignal.timeout(3e4)]),j=x.promise,z=()=>x.reject(u.reason);u.addEventListener("abort",z,{once:!0}),j.catch(()=>{}),a.onmessage=({data:d})=>{if(!(i||typeof d!="string"))try{const l=JSON.parse(d);typeof l=="object"&&l!==null&&"type"in l&&(l.type==="session.started"&&(v=!0,x.resolve()),l.type==="session.closed"&&(I.resolve(),h||t.onDisconnect())),h||b.receive(l)}catch{t.onError()}},a.onclose=()=>{x.reject(new Error("Voice connection closed")),I.resolve(),!i&&!h&&t.onDisconnect()},r.onconnectionstatechange=()=>{i||q.report(r.connectionState)},r.ontrack=({streams:d,track:l})=>{if(i)return;const _=d[0]??new MediaStream([l]);m.srcObject=_,e??=new AudioContext,s=e.createAnalyser(),s.fftSize=256,o=new Uint8Array(s.fftSize),e.createMediaStreamSource(_).connect(s),e.resume().catch(()=>t.onError()),m.play().catch(()=>t.onError())};function N(){if(!s||!o||i)return 0;s.getByteTimeDomainData(o);let d=0;for(const l of o)d+=((l-128)/128)**2;return Math.min(1,Math.sqrt(d/o.length)*4)}try{const d=navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}).then(c=>{if(i||u.aborted){for(const f of c.getTracks())f.stop();throw new DOMException("Voice connection cancelled","AbortError")}return p=c,c}),l=await Promise.race([d,new Promise((c,f)=>u.addEventListener("abort",()=>f(u.reason),{once:!0}))]);e??=new AudioContext,g=e.createAnalyser(),g.fftSize=256,w=new Uint8Array(g.fftSize),e.createMediaStreamSource(l).connect(g),await e.resume();for(const c of l.getAudioTracks())r.addTrack(c,l);const _=await r.createOffer();await r.setLocalDescription(_),u.throwIfAborted(),r.iceGatheringState!=="complete"&&await new Promise((c,f)=>{const S=()=>{r.iceGatheringState==="complete"&&(R(),c())},k=()=>{R(),f(u.reason)},R=()=>{r.removeEventListener("icegatheringstatechange",S),u.removeEventListener("abort",k)};r.addEventListener("icegatheringstatechange",S),u.addEventListener("abort",k,{once:!0}),S(),u.aborted&&k()});const V=r.localDescription?.sdp;if(!V)throw new Error("Missing voice offer");const G=await E(V,u);return await r.setRemoteDescription({type:"answer",sdp:G.sdp}),await j,n.throwIfAborted(),u.removeEventListener("abort",z),n.removeEventListener("abort",M),t.onConnect(),O=setInterval(()=>{if(i||h)return;if(b.tick(),g&&w&&!y){g.getByteTimeDomainData(w);const f=w.reduce((S,k)=>S+((k-128)/128)**2,0)/w.length;Math.sqrt(f)>.025&&(P=Date.now())}t.onUserSpeaking(!y&&Date.now()-P<400),N()>.02&&(L=Date.now()),t.onModeChange({mode:Date.now()-L<400?"speaking":"listening"})},100),{endSession:()=>(h??=(async()=>{b.close();for(const c of p?.getTracks()??[])c.stop();if(m.pause(),v&&a.readyState==="open"){a.send(JSON.stringify({type:"session.close"}));let c;await Promise.race([I.promise,new Promise(f=>{c=setTimeout(f,3e3)})]),clearTimeout(c)}await T()})(),h),publishUpdate:c=>b.publishUpdate(c),setMicMuted:c=>{y=c;for(const f of p?.getAudioTracks()??[])f.enabled=!y;y&&t.onUserSpeaking(!1)},getOutputVolume:N}}catch(d){throw await T(),d}}export{ho as startOpenAIConversation};
@@ -0,0 +1 @@
1
+ import{c as a,a2 as f,m as S,K as y,o as v}from"./index-Bm9FTdjr.js";import{g as d}from"./use-chat-layout-state-J-94EUwt.js";function c(e,i){return y.optimisticProjectSidebarViews(e,i)}function l(e){return typeof e=="object"&&e!==null}function b(e,i){return e[1]===i&&e[3]==="collection"&&e[4]==="VIRTUAL_MCP"}function P(e,i){if(!l(e))return e;if("item"in e&&l(e.item)&&e.item.id===i.id)return{...e,item:i};if(!("structuredContent"in e)||!l(e.structuredContent))return e;const s=e.structuredContent.items;if(!Array.isArray(s))return e;let r=!1;const t=s.map(n=>!l(n)||n.id!==i.id?n:(r=!0,i));return r?{...e,structuredContent:{...e.structuredContent,items:t}}:e}function x(e,i,s){e.setQueriesData({predicate:r=>b(r.queryKey,i)},r=>P(r,s))}function A(e,i,s){const r=e.getQueriesData({predicate:t=>b(t.queryKey,i)&&t.queryKey[5]===s});for(const[,t]of r)if(t?.item?.id===s)return t.item;return null}function V(e,i,s){return e.getQueryData(c(i,s))??null}function j(e,i){if(i)return{sidebarViews:[...i.views],sidebarViewsVersion:d};const s=e?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:e?.sidebarViewsVersion}}function K(e,i,s){return i?{sidebarViews:[...i.views],sidebarViewsVersion:d}:s===void 0?{sidebarViews:e.sidebarViews===null?null:e.sidebarViews?[...e.sidebarViews]:void 0,sidebarViewsVersion:e.sidebarViewsVersion}:j(s,null)}function p(e,i,s,r,t){const n=V(e,i,s),o={revision:(n?.revision??0)+1,views:[...r],rollbackViews:n?[...n.rollbackViews]:[...t]};return e.setQueryData(c(i,s),o),{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}}function C(e,i,s){const r=V(e,i,s);return r?{revision:r.revision,views:[...r.views],persistedViews:[...r.rollbackViews]}:null}function m(e,i){const s=new Set(e),r=new Set(i);return s.size===r.size&&[...s].every(t=>r.has(t))}function R(e){return e?!m(e.views,e.persistedViews):!1}function k(e,i,s,{snapshot:r,saved:t,authoritativeViews:n}){if(!r)return{settledLatest:!1,reconciledViews:null};const o=V(e,i,s);if(!o||r.revision>o.revision)return{settledLatest:!1,reconciledViews:null};const u=n!==void 0?[...n]:t?[...r.views]:null,w={...o,rollbackViews:u??o.rollbackViews};return w.rollbackViews!==o.rollbackViews&&e.setQueryData(c(i,s),w),r.revision!==o.revision?{settledLatest:!1,reconciledViews:null}:(e.setQueryData(c(i,s),null),{settledLatest:!0,reconciledViews:t?u&&!m(u,r.views)?u:null:[...w.rollbackViews]})}function _(e){const i=a.c(5),{org:s}=f(),r=e??"";let t;i[0]!==s.id||i[1]!==r?(t=c(s.id,r),i[0]=s.id,i[1]=r,i[2]=t):t=i[2];let n;i[3]!==t?(n={queryKey:t,queryFn:O,enabled:!1,staleTime:Number.POSITIVE_INFINITY},i[3]=t,i[4]=n):n=i[4];const{data:o}=S(n);return o?.views}async function O(){return null}function L(e){const i=a.c(4),{org:s}=f(),r=v();let t;return i[0]!==s||i[1]!==r||i[2]!==e?(t={stage:(n,o)=>p(r,s.id,e,n,o),snapshot:()=>C(r,s.id,e),settle:n=>k(r,s.id,e,n)},i[0]=s,i[1]=r,i[2]=e,i[3]=t):t=i[3],t}export{L as a,b,j as i,R as o,K as p,A as r,_ as u,x as w};
@@ -1 +1 @@
1
- import{c as G,r as H,e as A,j as s,B as L,h as B}from"./index-D_7jfHk6.js";import{A as I}from"./avatar-TL9HUab0.js";import{s as K}from"./Plus-nldAzVeQ.js";async function T(i,e,p){const o=await fetch(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:e})}),l=await o.json();if(!o.ok||!l.success)throw new Error(l.error||p);return l}function Z(i){const e=G.c(45),{organizations:p,domain:o,requestedSlugs:l,onRequestedSlug:C,onSelected:h,onJoined:c,onRequestCompleted:M,selectLabel:O,onCreateNew:S,createNewLabel:P}=i,j=O===void 0?"Select":O,_=P===void 0?"Create new organization":P;let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=new Set,e[0]=N):N=e[0];const[J,U]=H.useState(N);let v;e[1]!==C?(v=r=>{U(t=>new Set(t).add(r)),C?.(r)},e[1]=C,e[2]=v):v=e[2];const E=v;let z;e[3]!==c?(z={mutationFn:V,onSuccess:r=>{const{organization:t,slug:x}=r;c?.(t,x)}},e[3]=c,e[4]=z):z=e[4];const n=A(z);let R;e[5]!==E||e[6]!==c||e[7]!==M?(R={mutationFn:Q,onSuccess:r=>{const{organization:t,slug:x,alreadyMember:F}=r;if(F&&x){c?.(t,x);return}E(t.slug),M?.(t)}},e[5]=E,e[6]=c,e[7]=M,e[8]=R):R=e[8];const a=A(R);let u;e[9]!==l?(u=l??[],e[9]=l,e[10]=u):u=e[10];let y;e[11]!==J||e[12]!==u?(y=new Set([...u,...J]),e[11]=J,e[12]=u,e[13]=y):y=e[13];const b=y,q=n.variables?.slug??null,w=a.variables?.slug??null;let d;e[14]!==_||e[15]!==S?(d=S&&s.jsxs("button",{type:"button",onClick:S,className:"rounded-xl border border-dashed border-border p-4 flex items-center justify-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground hover:border-foreground/40 transition-colors",children:[s.jsx(K,{size:16}),_]}),e[14]=_,e[15]=S,e[16]=d):d=e[16];let m;if(e[17]!==o||e[18]!==b||e[19]!==n||e[20]!==h||e[21]!==p||e[22]!==q||e[23]!==w||e[24]!==a||e[25]!==j){let r;e[27]!==o||e[28]!==b||e[29]!==n||e[30]!==h||e[31]!==q||e[32]!==w||e[33]!==a||e[34]!==j?(r=t=>{const x=n.isPending&&q===t.slug,F=a.isPending&&w===t.slug,$=b.has(t.slug),D=t.logo??(o?`https://www.google.com/s2/favicons?domain=${o}&sz=128`:null);return s.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[s.jsx(I,{url:D??void 0,fallback:t.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:t.name}),o&&s.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",o]})]}),t.joinMode==="auto"?s.jsx(L,{size:"default",onClick:()=>n.mutate(t),disabled:n.isPending,children:x?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(B,{className:"size-3.5"})," Joining..."]}):"Join"}):t.joinMode==="request"?$?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Request sent"}):s.jsx(L,{size:"default",variant:"outline",onClick:()=>a.mutate(t),disabled:a.isPending,children:F?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(B,{className:"size-3.5"})," Requesting..."]}):"Request to join"}):s.jsx(L,{size:"default",onClick:()=>h?.(t),children:j})]},t.id)},e[27]=o,e[28]=b,e[29]=n,e[30]=h,e[31]=q,e[32]=w,e[33]=a,e[34]=j,e[35]=r):r=e[35],m=p.map(r),e[17]=o,e[18]=b,e[19]=n,e[20]=h,e[21]=p,e[22]=q,e[23]=w,e[24]=a,e[25]=j,e[26]=m}else m=e[26];let g;e[36]!==n.error?(g=n.error&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n.error instanceof Error?n.error.message:"Failed to join organization"}),e[36]=n.error,e[37]=g):g=e[37];let f;e[38]!==a.error?(f=a.error&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a.error instanceof Error?a.error.message:"Failed to request access"}),e[38]=a.error,e[39]=f):f=e[39];let k;return e[40]!==m||e[41]!==g||e[42]!==f||e[43]!==d?(k=s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[d,m,g,f]}),e[40]=m,e[41]=g,e[42]=f,e[43]=d,e[44]=k):k=e[44],k}async function Q(i){const e=await T("/api/auth/custom/domain-request-join",i.slug,"Failed to request access");return{organization:i,slug:e.slug,alreadyMember:e.alreadyMember}}async function V(i){const e=await T("/api/auth/custom/domain-join",i.slug,"Failed to join organization");return{organization:i,slug:e.slug??i.slug}}export{Z as O};
1
+ import{c as G,r as H,e as A,j as s,B as L,h as B}from"./index-Bm9FTdjr.js";import{A as I}from"./avatar-BEl6nltF.js";import{s as K}from"./Plus-XYNDZJ4s.js";async function T(i,e,p){const o=await fetch(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:e})}),l=await o.json();if(!o.ok||!l.success)throw new Error(l.error||p);return l}function Z(i){const e=G.c(45),{organizations:p,domain:o,requestedSlugs:l,onRequestedSlug:C,onSelected:h,onJoined:c,onRequestCompleted:M,selectLabel:O,onCreateNew:S,createNewLabel:P}=i,j=O===void 0?"Select":O,_=P===void 0?"Create new organization":P;let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=new Set,e[0]=N):N=e[0];const[J,U]=H.useState(N);let v;e[1]!==C?(v=r=>{U(t=>new Set(t).add(r)),C?.(r)},e[1]=C,e[2]=v):v=e[2];const E=v;let z;e[3]!==c?(z={mutationFn:V,onSuccess:r=>{const{organization:t,slug:x}=r;c?.(t,x)}},e[3]=c,e[4]=z):z=e[4];const n=A(z);let R;e[5]!==E||e[6]!==c||e[7]!==M?(R={mutationFn:Q,onSuccess:r=>{const{organization:t,slug:x,alreadyMember:F}=r;if(F&&x){c?.(t,x);return}E(t.slug),M?.(t)}},e[5]=E,e[6]=c,e[7]=M,e[8]=R):R=e[8];const a=A(R);let u;e[9]!==l?(u=l??[],e[9]=l,e[10]=u):u=e[10];let y;e[11]!==J||e[12]!==u?(y=new Set([...u,...J]),e[11]=J,e[12]=u,e[13]=y):y=e[13];const b=y,q=n.variables?.slug??null,w=a.variables?.slug??null;let d;e[14]!==_||e[15]!==S?(d=S&&s.jsxs("button",{type:"button",onClick:S,className:"rounded-xl border border-dashed border-border p-4 flex items-center justify-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground hover:border-foreground/40 transition-colors",children:[s.jsx(K,{size:16}),_]}),e[14]=_,e[15]=S,e[16]=d):d=e[16];let m;if(e[17]!==o||e[18]!==b||e[19]!==n||e[20]!==h||e[21]!==p||e[22]!==q||e[23]!==w||e[24]!==a||e[25]!==j){let r;e[27]!==o||e[28]!==b||e[29]!==n||e[30]!==h||e[31]!==q||e[32]!==w||e[33]!==a||e[34]!==j?(r=t=>{const x=n.isPending&&q===t.slug,F=a.isPending&&w===t.slug,$=b.has(t.slug),D=t.logo??(o?`https://www.google.com/s2/favicons?domain=${o}&sz=128`:null);return s.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[s.jsx(I,{url:D??void 0,fallback:t.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:t.name}),o&&s.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",o]})]}),t.joinMode==="auto"?s.jsx(L,{size:"default",onClick:()=>n.mutate(t),disabled:n.isPending,children:x?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(B,{className:"size-3.5"})," Joining..."]}):"Join"}):t.joinMode==="request"?$?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Request sent"}):s.jsx(L,{size:"default",variant:"outline",onClick:()=>a.mutate(t),disabled:a.isPending,children:F?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(B,{className:"size-3.5"})," Requesting..."]}):"Request to join"}):s.jsx(L,{size:"default",onClick:()=>h?.(t),children:j})]},t.id)},e[27]=o,e[28]=b,e[29]=n,e[30]=h,e[31]=q,e[32]=w,e[33]=a,e[34]=j,e[35]=r):r=e[35],m=p.map(r),e[17]=o,e[18]=b,e[19]=n,e[20]=h,e[21]=p,e[22]=q,e[23]=w,e[24]=a,e[25]=j,e[26]=m}else m=e[26];let g;e[36]!==n.error?(g=n.error&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n.error instanceof Error?n.error.message:"Failed to join organization"}),e[36]=n.error,e[37]=g):g=e[37];let f;e[38]!==a.error?(f=a.error&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a.error instanceof Error?a.error.message:"Failed to request access"}),e[38]=a.error,e[39]=f):f=e[39];let k;return e[40]!==m||e[41]!==g||e[42]!==f||e[43]!==d?(k=s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[d,m,g,f]}),e[40]=m,e[41]=g,e[42]=f,e[43]=d,e[44]=k):k=e[44],k}async function Q(i){const e=await T("/api/auth/custom/domain-request-join",i.slug,"Failed to request access");return{organization:i,slug:e.slug,alreadyMember:e.alreadyMember}}async function V(i){const e=await T("/api/auth/custom/domain-join",i.slug,"Failed to join organization");return{organization:i,slug:e.slug??i.slug}}export{Z as O};