decocms 4.345.0 → 4.345.1
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.
- package/dist/client/assets/{AlertCircle-piOaFPQJ.js → AlertCircle-D5wzOxIg.js} +1 -1
- package/dist/client/assets/{AreaChart-C754kxxt.js → AreaChart-B7-Obnq_.js} +1 -1
- package/dist/client/assets/{ArrowLeft-EySzpaMt.js → ArrowLeft-Beb7uT2a.js} +1 -1
- package/dist/client/assets/{ArrowRight-CN1prjjJ.js → ArrowRight-Du9XgC-I.js} +1 -1
- package/dist/client/assets/{ArrowUp-39D5k7I2.js → ArrowUp-_u4Yru0Q.js} +1 -1
- package/dist/client/assets/{Check-CmgBwUGv.js → Check-Bqh0edDs.js} +1 -1
- package/dist/client/assets/{CheckCircle-CwJqWx0e.js → CheckCircle-P3KELI_n.js} +1 -1
- package/dist/client/assets/{ChevronRight-Dk9nR_C7.js → ChevronRight-DyhM_Luf.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-X68ci9mX.js → ChevronSelectorVertical-S2WVRFJv.js} +1 -1
- package/dist/client/assets/{ChevronUp-DLLvYK07.js → ChevronUp-CGseLBwf.js} +1 -1
- package/dist/client/assets/{Copy01-DlxhdgMn.js → Copy01-CQ5n9k6R.js} +1 -1
- package/dist/client/assets/{CreditCard01-CGG5tsm6.js → CreditCard01-DQ2UyAUW.js} +1 -1
- package/dist/client/assets/{DotsVertical-Bk31Y8qH.js → DotsVertical-CXA4FBF-.js} +1 -1
- package/dist/client/assets/{Download01-CxTJDArl.js → Download01-EHABWuSq.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DAIYWYhf.js → ErrorBarContext-DtNUqfSS.js} +1 -1
- package/dist/client/assets/{Eye-UEYlbIHb.js → Eye-4ikW46Xl.js} +1 -1
- package/dist/client/assets/{GitBranch01-DRT2X7Dj.js → GitBranch01-rChCKXuD.js} +1 -1
- package/dist/client/assets/{Globe01-Z6BbST4r.js → Globe01-DQGNcxVn.js} +1 -1
- package/dist/client/assets/{HardDrive--vlQvWpi.js → HardDrive-CALvWP4_.js} +1 -1
- package/dist/client/assets/{Image01-rCxXluf6.js → Image01-BrxwhCeX.js} +1 -1
- package/dist/client/assets/{Key01-By90Yq6k.js → Key01-D_IxGQOL.js} +1 -1
- package/dist/client/assets/{Link01-CUe3c6G0.js → Link01-DvvkHs6T.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D2pSy7v4.js → LinkExternal01-B4pNNDj3.js} +1 -1
- package/dist/client/assets/{Monitor01-CY2DbFkD.js → Monitor01-Cb0G367h.js} +1 -1
- package/dist/client/assets/{Package-Bb4KYw9O.js → Package-Bfk8OrRH.js} +1 -1
- package/dist/client/assets/{Palette-o-NEtwsW.js → Palette-B6tq__pc.js} +1 -1
- package/dist/client/assets/{Play-DpmIDjD8.js → Play-BKI4FgKL.js} +1 -1
- package/dist/client/assets/{Plus-CgVmxzR4.js → Plus-BZSUkwsF.js} +1 -1
- package/dist/client/assets/{SearchMd-Cjr4mqh9.js → SearchMd-CC2qYhKq.js} +1 -1
- package/dist/client/assets/{Sector-3UpSGQVE.js → Sector-D-zqGwr9.js} +1 -1
- package/dist/client/assets/{Settings02-Dss_LnvC.js → Settings02-3O7I-4oK.js} +1 -1
- package/dist/client/assets/{Share07-CgTNZ1dk.js → Share07-B043tEsF.js} +1 -1
- package/dist/client/assets/{Shield01-CNbrlPDI.js → Shield01-DSyesTES.js} +1 -1
- package/dist/client/assets/{Stars01-Dno5l14o.js → Stars01-D0DXnyE9.js} +1 -1
- package/dist/client/assets/{Sun-DAVD-A5B.js → Sun-BUQJT4KF.js} +1 -1
- package/dist/client/assets/{Tool01-DdmZi7j_.js → Tool01-CgvePMtM.js} +1 -1
- package/dist/client/assets/{Tool02-KStnzngn.js → Tool02-_HC8oqfU.js} +1 -1
- package/dist/client/assets/{Trash01-BevWobXU.js → Trash01-DCX9ydiU.js} +1 -1
- package/dist/client/assets/{TrendUp01-NTK3Zf_M.js → TrendUp01-DhL5-hJo.js} +1 -1
- package/dist/client/assets/{Upload01-By19QANP.js → Upload01-CNkQbAmi.js} +1 -1
- package/dist/client/assets/{User01-CDRv3_oY.js → User01-cnJUdVWa.js} +1 -1
- package/dist/client/assets/{UserSquare-l4Q5fPEZ.js → UserSquare-CpUQtm07.js} +1 -1
- package/dist/client/assets/{Users01-sAr72jTU.js → Users01-CPNdhBFx.js} +1 -1
- package/dist/client/assets/{Users03-CrZajyAo.js → Users03-BZkJWCNu.js} +1 -1
- package/dist/client/assets/{XCircle-BTj4-tdv.js → XCircle-4con0UUu.js} +1 -1
- package/dist/client/assets/{XClose-C-bbcgCJ.js → XClose-C2dpX0F_.js} +1 -1
- package/dist/client/assets/{Zap-D6-O3NZl.js → Zap-Bsbv5icR.js} +1 -1
- package/dist/client/assets/{ZoomOut-DpAkOD8e.js → ZoomOut-DiztYlpQ.js} +1 -1
- package/dist/client/assets/{access-gate-DQan09qj.js → access-gate-DD56oGJy.js} +1 -1
- package/dist/client/assets/{agent-icon-BrQLA9dC.js → agent-icon-B7AXGQ6P.js} +1 -1
- package/dist/client/assets/{agents-list-BIlHhg8F.js → agents-list-CY8WmhcM.js} +1 -1
- package/dist/client/assets/{ai-providers-D9jubp2s.js → ai-providers-BiO7fRFd.js} +1 -1
- package/dist/client/assets/{alert-DI_JsgmI.js → alert-DtchnFmi.js} +1 -1
- package/dist/client/assets/{alert-dialog-DuVJ7GC7.js → alert-dialog-BxdFiiIi.js} +1 -1
- package/dist/client/assets/{analytics-tab-gxTnWc1L.js → analytics-tab-I9OgZdgL.js} +1 -1
- package/dist/client/assets/api-keys-BBBNaWWJ.js +1 -0
- package/dist/client/assets/{api-keys-BJORgq17.js → api-keys-BrduPH4d.js} +1 -1
- package/dist/client/assets/app-editor-BzjPUgJu.js +1 -0
- package/dist/client/assets/{auth-CRmM4ftp.js → auth-BTVKfAUC.js} +1 -1
- package/dist/client/assets/{auth-catchall-D9f22qVk.js → auth-catchall-BVwWvb_2.js} +1 -1
- package/dist/client/assets/{auth-entry-Z1av5utg.js → auth-entry-BVFYUVVl.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Dhyl4Mok.js → auth-split-layout-Dr2p8hD_.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DEZCdj-t.js → authenticate-and-persist-oauth-BJAzAIhG.js} +1 -1
- package/dist/client/assets/{automation-list-row-CJo0GDE_.js → automation-list-row-CtQKd-53.js} +1 -1
- package/dist/client/assets/{automation-runs-Ge9BW9cQ.js → automation-runs-B71QxQf_.js} +1 -1
- package/dist/client/assets/{automations-AOZDTTBB.js → automations-BoEYJP3m.js} +1 -1
- package/dist/client/assets/{autosend-CI7ToXd3.js → autosend-t6fUCO9u.js} +1 -1
- package/dist/client/assets/{avatar-ncVfbaUx.js → avatar-_tvfLV9T.js} +1 -1
- package/dist/client/assets/{badge-rtLQpibV.js → badge-5xoC1FJQ.js} +1 -1
- package/dist/client/assets/{block-document-WxPy4zHY.js → block-document-CvHof2aO.js} +1 -1
- package/dist/client/assets/{breadcrumb-d7wNqsyt.js → breadcrumb-BjJYdEoK.js} +1 -1
- package/dist/client/assets/{buckets-NBI_IEuj.js → buckets-DC0lhAAM.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-B8uZmKXZ.js → bulk-category-panel-B5ry5wx9.js} +1 -1
- package/dist/client/assets/{capability-load-error-BAq8tXOS.js → capability-load-error-QfuL86LE.js} +1 -1
- package/dist/client/assets/{cards-CgpdHb-U.js → cards-QMwTXs-C.js} +1 -1
- package/dist/client/assets/{category-editor-DrNCa6L7.js → category-editor-eSTt5JDo.js} +1 -1
- package/dist/client/assets/{cdn-tab-BflNT2VL.js → cdn-tab-D1sD7Ph4.js} +1 -1
- package/dist/client/assets/{chart-C7j_btUB.js → chart-9tl6Tp7O.js} +1 -1
- package/dist/client/assets/{chat-context-BcY08VKG.js → chat-context-B3FHPtyp.js} +1 -1
- package/dist/client/assets/{checkbox-D0oTwa58.js → checkbox-DdiWS6j9.js} +1 -1
- package/dist/client/assets/{choose-editor-B2cOrwQv.js → choose-editor-Brv8AsJr.js} +1 -1
- package/dist/client/assets/{cli-auth-success-G8Y4SVGK.js → cli-auth-success-DIIukxGb.js} +1 -1
- package/dist/client/assets/{client-icons-BE3evb-i.js → client-icons-cKM5ZcqP.js} +1 -1
- package/dist/client/assets/{collection-detail-DCICjiwT.js → collection-detail--i0_pJUK.js} +1 -1
- package/dist/client/assets/{collection-display-button-C4HtW9B5.js → collection-display-button-D_wt_RA1.js} +1 -1
- package/dist/client/assets/{collection-search-UW0xDxmi.js → collection-search-DRdf_GYh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-STLb6VjQ.js → collection-table-wrapper-CnvktR4-.js} +1 -1
- package/dist/client/assets/{collection-tabs-644rp01A.js → collection-tabs-BxV7MP04.js} +1 -1
- package/dist/client/assets/{command-CTH7s7Ya.js → command-BDN-a3rJ.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CxUaxjg3.js → commerce-onboarding-DSY4uJcG.js} +1 -1
- package/dist/client/assets/{connect-DEIsBWg2.js → connect-GYd0QYyw.js} +1 -1
- package/dist/client/assets/{connect-layout-CmuGJ6zd.js → connect-layout-B6hgiK5r.js} +1 -1
- package/dist/client/assets/{connection-CU1s53fy.js → connection-C75DYl44.js} +1 -1
- package/dist/client/assets/{connection-card-B-DQLE2m.js → connection-card-BaEIpCbA.js} +1 -1
- package/dist/client/assets/{connection-detail-C3OYxb5o.js → connection-detail-Cdm23aMI.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B-auMXZc.js → connection-form-helpers-aQ5B6tRy.js} +1 -1
- package/dist/client/assets/{connections-DPnFX966.js → connections-B8QOba3u.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-xnwS5290.js → create-organization-dialog-BST4Ck0w.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CnHcYfZj.js → decopilot-sse-pool-DIVelB7F.js} +1 -1
- package/dist/client/assets/{dialog-DKxWMb0-.js → dialog-wNMMbzXr.js} +1 -1
- package/dist/client/assets/{domain-settings-yEjTU5K7.js → domain-settings-CxJq_pNN.js} +1 -1
- package/dist/client/assets/{drawer-BaA_lu4x.js → drawer-Dl4KbpLj.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CC8IMYtS.js → dropdown-menu-BvPxOnm0.js} +1 -1
- package/dist/client/assets/{e2e-tab-CyxfrSC2.js → e2e-tab-BiwnewGk.js} +1 -1
- package/dist/client/assets/{editor-Cm-sI42p.js → editor-BskznDjo.js} +1 -1
- package/dist/client/assets/{empty-state-DA8cnNqW.js → empty-state-C-SubUW6.js} +1 -1
- package/dist/client/assets/{empty-state-BioEMyZp.js → empty-state-CaNGPrDs.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BdnZZmxw.js → extract-connection-data-C4TyJjoX.js} +1 -1
- package/dist/client/assets/{file-explorer-jXzlywVk.js → file-explorer-B1DsBcfy.js} +1 -1
- package/dist/client/assets/{file-type-icon-ChIQfzaN.js → file-type-icon-DKxC4oSX.js} +1 -1
- package/dist/client/assets/{folder-icon-_4CbErMC.js → folder-icon-f4yD90eP.js} +1 -1
- package/dist/client/assets/{form-CorLMse0.js → form-B76JQCy8.js} +1 -1
- package/dist/client/assets/{general-BCDanvgJ.js → general-BNu9Vb3u.js} +1 -1
- package/dist/client/assets/{github-icon-CeFWgmVz.js → github-icon-CdMLfMj7.js} +1 -1
- package/dist/client/assets/{hooks-BOHEAk9Y.js → hooks-BJtZPSVy.js} +1 -1
- package/dist/client/assets/{hosting-tab-BktIiwOH.js → hosting-tab-BLjuvgys.js} +1 -1
- package/dist/client/assets/{index-ObIlqSDZ.js → index-4snYVWB2.js} +1 -1
- package/dist/client/assets/{index-BrCtIPlH.js → index-CaU5DFED.js} +1 -1
- package/dist/client/assets/{index-B8l7Wp2b.js → index-CwUtSIZT.js} +1 -1
- package/dist/client/assets/{index-fS0pDoNW.js → index-DR-7CxUP.js} +4 -4
- package/dist/client/assets/{index-BlP07NoC.js → index-DU9sTbUZ.js} +6 -6
- package/dist/client/assets/{index-CYWX8R5H.js → index-Dj8tvdMR.js} +1 -1
- package/dist/client/assets/{index-BAPa6G_8.js → index-DlGxosdM.js} +1 -1
- package/dist/client/assets/{index-YZeWKaou.js → index-Jy48DtbD.js} +1 -1
- package/dist/client/assets/{index-w12TFwlK.js → index-RKb_9qNN.js} +1 -1
- package/dist/client/assets/{index-redirect-CfbLeyNL.js → index-redirect-DSZLimlN.js} +1 -1
- package/dist/client/assets/{index-D0wjsDWq.js → index-zyhhgc8D.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B62setNi.js → infiniteQueryObserver-DMi6D2_K.js} +1 -1
- package/dist/client/assets/{infra-billing-BtMbkXjN.js → infra-billing-92jygPAU.js} +1 -1
- package/dist/client/assets/{input-DaMV0yqT.js → input-By-Luuj6.js} +1 -1
- package/dist/client/assets/{integration-icon-BFx8Gs71.js → integration-icon-CpzKJe80.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-erQjr6Dv.js → invite-member-dialog-QBtFVQK3.js} +1 -1
- package/dist/client/assets/{label-Cznjg7Mb.js → label-CHgW_ahI.js} +1 -1
- package/dist/client/assets/{layout-CwmaRw9Y.js → layout-9YgsD1RL.js} +1 -1
- package/dist/client/assets/{login-DYTFtcpb.js → login-BjHKLMoO.js} +1 -1
- package/dist/client/assets/{markdown-BNMHtGi6.js → markdown-BbkOj7TQ.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-Df-LUzfK.js → mcp-app-renderer--rnWoHIc.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CDjOqnrq.js → mcp-oauth-Dql553Ej.js} +1 -1
- package/dist/client/assets/{members-s02j5DFH.js → members-D6h-8p_Y.js} +1 -1
- package/dist/client/assets/{monaco-editor-7CBGfDCH.js → monaco-editor-CK-YzUmW.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CO2-hLq6.js → monitoring-stats-row-D_wXsyGn.js} +1 -1
- package/dist/client/assets/{multi-select-D1MP7iDa.js → multi-select-B93qStg3.js} +1 -1
- package/dist/client/assets/{oauth-callback-t2WmO9-v.js → oauth-callback-DmICfNLf.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Ce5MHp3r.js → oauth-callback-ai-provider-BCYGio4s.js} +1 -1
- package/dist/client/assets/{onboarding-Dg8pqQh4.js → onboarding-z3GnNpO5.js} +1 -1
- package/dist/client/assets/{org-layout-dq0fDq-h.js → org-layout-C-eaDwHZ.js} +1 -1
- package/dist/client/assets/{organization-choice-Bnr-wpFe.js → organization-choice-BaFzw0ii.js} +1 -1
- package/dist/client/assets/{orgs-DJfci181.js → orgs-BumlFPGs.js} +1 -1
- package/dist/client/assets/{page-seo-form-B1ADwpo8.js → page-seo-form-DatHE4-0.js} +1 -1
- package/dist/client/assets/{popover-sPMAt4On.js → popover-zAXw_Ex4.js} +1 -1
- package/dist/client/assets/{post-calendar-B4Z9Jz7b.js → post-calendar-BnXyVANq.js} +1 -1
- package/dist/client/assets/{post-editor-CcXinFIi.js → post-editor-DMnPDsdI.js} +1 -1
- package/dist/client/assets/{primitives-CGxQwrae.js → primitives-zj67r-_6.js} +1 -1
- package/dist/client/assets/{profile-C9bBchUu.js → profile-DMvNb5vL.js} +1 -1
- package/dist/client/assets/{project-app-view-DudFJRxH.js → project-app-view-Bn6tqh-s.js} +1 -1
- package/dist/client/assets/{project-icon-DD8-TjG9.js → project-icon-DZuabjud.js} +1 -1
- package/dist/client/assets/{prompts-CAxx1TcH.js → prompts-faWYk3a_.js} +1 -1
- package/dist/client/assets/record-editor-BGEMjZVj.js +1 -0
- package/dist/client/assets/redirect-editor-BlQ9ZBG7.js +1 -0
- package/dist/client/assets/registry-Do5Holmd.js +2 -0
- package/dist/client/assets/{registry-layout-Bcal-jx7.js → registry-layout-BiksbGSO.js} +1 -1
- package/dist/client/assets/{reports-BbDmvyvn.js → reports-o3wZ4DFb.js} +1 -1
- package/dist/client/assets/repositories-4Ag5U4M3.js +1 -0
- package/dist/client/assets/{repository-import-picker-TTmQRKgM.js → repository-import-picker-Crzmlv3v.js} +1 -1
- package/dist/client/assets/{repository-picker-Be7NfZEA.js → repository-picker-Dn5CWMQu.js} +1 -1
- package/dist/client/assets/{require-capability-q7uVdBbT.js → require-capability-ry4-n_XW.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CR5eG3sF.js → required-auth-layout-C6sCfFoS.js} +1 -1
- package/dist/client/assets/{reset-password-DnIxE4MM.js → reset-password-BPvYj_d6.js} +1 -1
- package/dist/client/assets/{review-settings-Bit87Ep6.js → review-settings-CFta44Y-.js} +1 -1
- package/dist/client/assets/{roles-CYck8jTX.js → roles-D-D6RtHy.js} +1 -1
- package/dist/client/assets/{schema-CVS6b6X8.js → schema-CzaGiNXr.js} +1 -1
- package/dist/client/assets/{scroll-area-DIJ4XfEc.js → scroll-area-C4NBwqyh.js} +1 -1
- package/dist/client/assets/{search-input-BN_fecvo.js → search-input-jf5-JJb9.js} +1 -1
- package/dist/client/assets/{secrets-Dr0vdQ4d.js → secrets-DNPz1kGQ.js} +1 -1
- package/dist/client/assets/{sections-editor-BsuMEuNO.js → sections-editor-CiB_HyuR.js} +1 -1
- package/dist/client/assets/{select-BJ0Gkkka.js → select-8-nbJ0jG.js} +1 -1
- package/dist/client/assets/{select-model-D8CTPoiO.js → select-model-BN5vxFKu.js} +1 -1
- package/dist/client/assets/{self-tool-result-KOheC4HD.js → self-tool-result-Cei_02H_.js} +1 -1
- package/dist/client/assets/{seo-editor-CSFxllkC.js → seo-editor-BS-_liwN.js} +1 -1
- package/dist/client/assets/settings-layout-BWoejjac.js +1 -0
- package/dist/client/assets/{settings-sidebar-C_Tz8rbX.js → settings-sidebar-C0QwDGxU.js} +1 -1
- package/dist/client/assets/{shell-controls-5f0FnXKd.js → shell-controls-DLLmOm3e.js} +1 -1
- package/dist/client/assets/{shell-layout-D-M6_Jkf.js → shell-layout-UiGWQtHh.js} +1 -1
- package/dist/client/assets/{skill-preview-5YIvamOb.js → skill-preview-OK-E70YW.js} +1 -1
- package/dist/client/assets/{skills-DMmhWXLy.js → skills-REtufkzf.js} +1 -1
- package/dist/client/assets/{sso-nVCDDH4k.js → sso-Bl2RYEhH.js} +1 -1
- package/dist/client/assets/{store-LfRhnjNM.js → store-BUZ3BxYI.js} +1 -1
- package/dist/client/assets/store-registry-DemSgqBf.js +2 -0
- package/dist/client/assets/{switch-C0tiHttS.js → switch-B_09jY5-.js} +1 -1
- package/dist/client/assets/{synced-repos-D5wTALWx.js → synced-repos-BNk3uyi6.js} +1 -1
- package/dist/client/assets/{table-D4dLAB1m.js → table-C9B_yGws.js} +1 -1
- package/dist/client/assets/{tabs-CDFENeRa.js → tabs-yz5p2eqD.js} +1 -1
- package/dist/client/assets/{task-board-B4aUIKJI.js → task-board-DX0mX_sm.js} +1 -1
- package/dist/client/assets/{task-route-BUYfM-Mq.js → task-route-DTA1f0w5.js} +1 -1
- package/dist/client/assets/{tasks-COtpdI-R.js → tasks-CCt0uT1A.js} +1 -1
- package/dist/client/assets/{textarea-DIJRp6Ds.js → textarea-DD_XQc8b.js} +1 -1
- package/dist/client/assets/{thread-intent-DK53ivxy.js → thread-intent-BKZp36M-.js} +1 -1
- package/dist/client/assets/{thread-route-m3qiCJQP.js → thread-route-g3bFZsDA.js} +1 -1
- package/dist/client/assets/{toggle-group-BSxkMDRS.js → toggle-group-OyXGZbFx.js} +1 -1
- package/dist/client/assets/{toolbar-DQ2YVpXF.js → toolbar-BGgBqcbD.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DeXrhkGe.js → toolbar-icon-button-CyWbgFMR.js} +1 -1
- package/dist/client/assets/{track-J__dE1p5.js → track-BmC8g6Tw.js} +1 -1
- package/dist/client/assets/{types-C9oYptqr.js → types-C6WokDyE.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DMdw1ZKm.js → use-ai-providers-CsfPjUM-.js} +1 -1
- package/dist/client/assets/{use-automations-BrJQYtfT.js → use-automations-V8lTd1ft.js} +1 -1
- package/dist/client/assets/{use-autosave-DXppOUIw.js → use-autosave-Bd881RwB.js} +1 -1
- package/dist/client/assets/{use-connection-DueV7Dd9.js → use-connection-BM1ySErK.js} +1 -1
- package/dist/client/assets/{use-copy-DsM8BkMO.js → use-copy-pSJtH4fM.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CXxjUZ5c.js → use-create-virtual-mcp-D0NidtMX.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-I1vziWnN.js → use-date-fns-locale-DgRg5mjL.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Bep9W3RF.js → use-debounced-autosave-EYzF8Olk.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CjFrELYP.js → use-debounced-value-KdzTma4G.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BxzD46W5.js → use-decopilot-events-BXOAX3zK.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BBL_RJLP.js → use-delete-connection-BbNOjW2l.js} +1 -1
- package/dist/client/assets/{use-deployment-admin--_f948uh.js → use-deployment-admin-BASh3KDk.js} +1 -1
- package/dist/client/assets/{use-destination-route-WysfeR7S.js → use-destination-route-DZ6zuyom.js} +1 -1
- package/dist/client/assets/{use-file-configs-BByTBhTa.js → use-file-configs-BRCZqxCS.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-p1RdGJsc.js → use-infinite-scroll-CqmvxgxE.js} +1 -1
- package/dist/client/assets/{use-join-requests-D9qT6ziM.js → use-join-requests-D-siqVP0.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CTnEpyYI.js → use-mcp-auth-status-CkfQLxM4.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DtsRGdvB.js → use-mcp-client-Cjw7oL0k.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CD_IWJeZ.js → use-mcp-prompts-BN9qi7Ix.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BKHgcAxL.js → use-mcp-tools-DMULZKMD.js} +1 -1
- package/dist/client/assets/{use-members-NWhv5vIl.js → use-members-DhvUWOTO.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Bnmnhqje.js → use-navigate-to-agent-BtEQtkbQ.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CShcDth4.js → use-org-auth-client-5eX91FAP.js} +1 -1
- package/dist/client/assets/{use-org-notice-B64MrAd9.js → use-org-notice-CnZTeX-0.js} +1 -1
- package/dist/client/assets/{use-org-sso-DzsFzLff.js → use-org-sso-CF4YFYU9.js} +1 -1
- package/dist/client/assets/{use-organization-roles-7PFmB_rs.js → use-organization-roles-W-c6xLKD.js} +1 -1
- package/dist/client/assets/{use-organization-settings-nKtEvYQd.js → use-organization-settings-Di523P_b.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BNmxrdjd.js → use-panel-navigate-BA5KTGnu.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Bb6pjxJh.js → use-registry-connections-bgQe6Edq.js} +1 -1
- package/dist/client/assets/{use-secrets-CTUki73i.js → use-secrets-DWw60yIy.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BHSNiN-i.js → use-section-preview-base-Dne8hXr_.js} +1 -1
- package/dist/client/assets/{use-status-sounds-k-y4u-Dp.js → use-status-sounds-CZvvi-5S.js} +1 -1
- package/dist/client/assets/{use-tags-BOUHc_F8.js → use-tags-B-RutSus.js} +1 -1
- package/dist/client/assets/{use-view-mode-4DXLgMpz.js → use-view-mode-86puchYT.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C5Zt0ewM.js → use-virtual-mcp-DLU-VkLe.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-7dgy4-tR.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DBrABtQo.js +1 -0
- package/dist/client/assets/{users-DRzgVGBP.js → users-BT256VvZ.js} +1 -1
- package/dist/client/assets/{variant-calendar-TLlf4rAo.js → variant-calendar-DWf9sjyV.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CZECgOYC.js → view-mode-toggle-CB1VuRxL.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +616 -608
- package/dist/server/migrate.js +154 -154
- package/dist/server/server.js +527 -519
- package/package.json +1 -1
- package/dist/client/assets/api-keys-DM-VC8Ks.js +0 -1
- package/dist/client/assets/app-editor-ueQwisxj.js +0 -1
- package/dist/client/assets/record-editor-CQ7QMoAf.js +0 -1
- package/dist/client/assets/redirect-editor-B68PccpU.js +0 -1
- package/dist/client/assets/registry-CWd0I8mg.js +0 -2
- package/dist/client/assets/repositories-DoZh9xWv.js +0 -1
- package/dist/client/assets/settings-layout-DyOsDVbj.js +0 -1
- package/dist/client/assets/store-registry-D-puuJzT.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CU7gRlof.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-rXQ07VfR.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ae as ge,af as Ke,am as he,ag as xe,c as Y,b as se,G as Se,n as Pe,K as le,m as Oe,r as ae,e as be,j as s,b4 as pe,B as M,b7 as qe,t as te,dt as He,d as Ee,u as ze,dp as $e}from"./index-DR-7CxUP.js";import{a as Ie,b as Le,c as Me,R as Qe,d as Ue,e as de,u as Je,G as We}from"./repository-picker-Dn5CWMQu.js";import{i as Ye}from"./ArrowRight-Du9XgC-I.js";import{n as me}from"./LinkExternal01-B4pNNDj3.js";import{A as Te}from"./avatar-_tvfLV9T.js";import{d as Ve,h as Xe,c as Ze,b as et,D as tt}from"./dialog-wNMMbzXr.js";import{G as Be}from"./github-icon-CdMLfMj7.js";import{i as st}from"./GitBranch01-rChCKXuD.js";import{s as je}from"./Plus-BZSUkwsF.js";import{c as ve,d as ye,b as we,f as Ne,g as Ce,e as _e,a as ke,A as De}from"./alert-dialog-BxdFiiIi.js";import{B as fe}from"./badge-5xoC1FJQ.js";import{b as it,A as nt}from"./alert-DtchnFmi.js";import{R as rt}from"./require-capability-ry4-n_XW.js";import"./ChevronRight-DyhM_Luf.js";import"./input-By-Luuj6.js";import"./label-CHgW_ahI.js";import"./useInfiniteQuery-7dgy4-tR.js";import"./infiniteQueryObserver-DMi6D2_K.js";import"./ArrowLeft-Beb7uT2a.js";import"./collection-search-DRdf_GYh.js";import"./SearchMd-CC2qYhKq.js";import"./use-debounced-value-KdzTma4G.js";import"./User01-cnJUdVWa.js";import"./access-gate-DD56oGJy.js";import"./capability-load-error-QfuL86LE.js";const ot=ge({installations:Ke(ge({installationId:he(),login:xe(),avatarUrl:xe().nullable(),repositoryCount:he().nullable()}))});class Ge extends Error{constructor(e){super("GitHub connection request failed"),this.status=e}status}async function ue(t,e){const i=await fetch(t,e);if(!i.ok)throw new Ge(i.status);return i}const Ae=()=>null;function lt(t,e){const i=new BroadcastChannel(t);i.postMessage(e),i.close()}function at(t){const e=Y.c(94),{flowId:i,returning:f,onClose:n}=t,r=se(),{org:u}=Se(),g=Pe(),m=Ie(),l=`/api/${encodeURIComponent(u.slug)}/git-providers/github/flows/${encodeURIComponent(i)}`,c=`github-connect:${u.id}:${i}`;let a;e[0]!==i||e[1]!==u.id?(a=le.githubConnectFlow(u.id,i),e[0]=i,e[1]=u.id,e[2]=a):a=e[2];let p;e[3]!==l?(p=async()=>ot.parse(await(await ue(l)).json()),e[3]=l,e[4]=p):p=e[4];let o;e[5]!==a||e[6]!==p?(o={queryKey:a,queryFn:p,retry:!1,gcTime:0,refetchOnWindowFocus:"always"},e[5]=a,e[6]=p,e[7]=o):o=e[7];const d=Oe(o);let h;e[8]!==n||e[9]!==u.id||e[10]!==g?(h=function(){g.invalidateQueries({queryKey:le.gitAccounts(u.id)}),g.invalidateQueries({queryKey:le.repositories(u.id)}),n()},e[8]=n,e[9]=u.id,e[10]=g,e[11]=h):h=e[11];const C=h;let v;e[12]!==c||e[13]!==C||e[14]!==d||e[15]!==f?(v=()=>{const N=new BroadcastChannel(c),Z=()=>{f||d.refetch({cancelRefetch:!1})};return window.addEventListener("focus",Z),N.onmessage=W=>{W.data==="refresh"&&!f?(d.refetch(),N.postMessage("ack")):W.data==="ack"&&f?window.close():W.data==="complete"&&C()},f&&N.postMessage("refresh"),()=>{window.removeEventListener("focus",Z),N.close()}},e[12]=c,e[13]=C,e[14]=d,e[15]=f,e[16]=v):v=e[16],ae.useSyncExternalStore(v,Ae,Ae);let y;e[17]!==l?(y=async N=>ue(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({installationId:N})}),e[17]=l,e[18]=y):y=e[18];let x;e[19]!==c||e[20]!==C||e[21]!==r?(x=()=>{lt(c,"complete"),te.success(r("settings.repositories.githubConnected")),C()},e[19]=c,e[20]=C,e[21]=r,e[22]=x):x=e[22];let b;e[23]!==d||e[24]!==r?(b=()=>{d.refetch(),te.error(r("settings.repositories.oauthFailed"))},e[23]=d,e[24]=r,e[25]=b):b=e[25];let _;e[26]!==y||e[27]!==x||e[28]!==b?(_={mutationFn:y,onSuccess:x,onError:b},e[26]=y,e[27]=x,e[28]=b,e[29]=_):_=e[29];const k=be(_);let w;e[30]!==l?(w=()=>ue(l,{method:"DELETE"}),e[30]=l,e[31]=w):w=e[31];let A;e[32]!==r?(A=()=>te.error(r("settings.repositories.failed")),e[32]=r,e[33]=A):A=e[33];let R;e[34]!==n||e[35]!==w||e[36]!==A?(R={mutationFn:w,onSuccess:n,onError:A},e[34]=n,e[35]=w,e[36]=A,e[37]=R):R=e[37];const S=be(R),ee=`/${u.slug}/settings/repositories?git_flow=${i}&git_return=true`,V=m.data?.github.installPath,O=V?`${V}?returnTo=${encodeURIComponent(ee)}`:void 0,X=m.data?.github.connectPath,q=X?`${X}?returnTo=${encodeURIComponent(`/${u.slug}/settings/repositories`)}`:void 0,D=d.error instanceof Ge&&d.error.status===410,j=k.isPending||S.isPending;let P;e[38]!==j||e[39]!==S?(P=N=>{!N&&!j&&S.mutate()},e[38]=j,e[39]=S,e[40]=P):P=e[40];let E;e[41]!==r?(E=r("settings.repositories.addGithubAccount"),e[41]=r,e[42]=E):E=e[42];let z;e[43]!==E?(z=s.jsx(Ve,{children:E}),e[43]=E,e[44]=z):z=e[44];let $;e[45]!==u.name||e[46]!==r?($=r("settings.repositories.githubShareHint",{organization:u.name}),e[45]=u.name,e[46]=r,e[47]=$):$=e[47];let I;e[48]!==$?(I=s.jsx(Xe,{children:$}),e[48]=$,e[49]=I):I=e[49];let Q;e[50]!==z||e[51]!==I?(Q=s.jsxs(Ze,{className:"px-4 py-4 border-b border-border",children:[z,I]}),e[50]=z,e[51]=I,e[52]=Q):Q=e[52];let H;e[53]!==j||e[54]!==k||e[55]!==D||e[56]!==d.data||e[57]!==d.isError||e[58]!==d.isFetching||e[59]!==d.isPending||e[60]!==r?(H=d.isPending?s.jsx("div",{className:"p-4",children:s.jsx(pe,{className:"h-20 w-full"})}):d.isError?s.jsx("p",{role:"alert",className:"p-4 text-sm text-destructive",children:r(D?"settings.repositories.oauthExpired":"settings.repositories.githubRefreshFailed")}):d.data.installations.length===0?s.jsx("div",{className:"px-4 py-6 text-sm text-muted-foreground",children:r("settings.repositories.githubInstallHint")}):d.data.installations.map(N=>s.jsxs(M,{variant:"ghost",disabled:j||d.isFetching,className:"w-full h-auto rounded-none justify-start gap-3 px-4 py-3",onClick:()=>k.mutate(N.installationId),children:[s.jsx(Te,{url:N.avatarUrl??void 0,fallback:s.jsx(Be,{size:16}),size:"sm",shape:"circle",muted:!0}),s.jsxs("span",{className:"flex-1 min-w-0 text-left",children:[s.jsx("span",{className:"block truncate",children:N.login}),N.repositoryCount!==null&&s.jsx("span",{className:"block truncate text-xs text-muted-foreground font-normal",children:r(N.repositoryCount===1?"settings.repositories.githubAdministeredOne":"settings.repositories.githubAdministered",{count:String(N.repositoryCount)})})]}),s.jsx(Ye,{size:16})]},N.installationId)),e[53]=j,e[54]=k,e[55]=D,e[56]=d.data,e[57]=d.isError,e[58]=d.isFetching,e[59]=d.isPending,e[60]=r,e[61]=H):H=e[61];let J;e[62]!==H?(J=s.jsx("div",{className:"max-h-80 overflow-y-auto",children:H}),e[62]=H,e[63]=J):J=e[63];let U;e[64]!==j||e[65]!==D||e[66]!==O||e[67]!==r?(U=!D&&O&&s.jsx(M,{variant:"outline",size:"sm",asChild:!0,disabled:j,children:s.jsxs("a",{href:j?void 0:O,target:"_blank",rel:"noopener noreferrer","aria-disabled":j,children:[s.jsx(me,{size:14}),r("settings.repositories.installGithubAccount")]})}),e[64]=j,e[65]=D,e[66]=O,e[67]=r,e[68]=U):U=e[68];let T;e[69]!==j||e[70]!==D||e[71]!==d||e[72]!==r?(T=!D&&s.jsxs(M,{variant:"ghost",size:"sm",disabled:j||d.isFetching,onClick:()=>{d.refetch()},children:[s.jsx(qe,{size:14}),r("settings.repositories.checkGithubAccess")]}),e[69]=j,e[70]=D,e[71]=d,e[72]=r,e[73]=T):T=e[73];let B;e[74]!==j||e[75]!==D||e[76]!==q||e[77]!==r?(B=q&&s.jsx(M,{variant:"ghost",size:"sm",asChild:!0,disabled:j,children:s.jsx("a",{href:j?void 0:q,"aria-disabled":j,children:r(D?"settings.repositories.tryAgain":"settings.repositories.switchGithubUser")})}),e[74]=j,e[75]=D,e[76]=q,e[77]=r,e[78]=B):B=e[78];let G;e[79]!==U||e[80]!==T||e[81]!==B?(G=s.jsxs("div",{className:"border-t border-border px-4 py-3 flex flex-wrap gap-2",children:[U,T,B]}),e[79]=U,e[80]=T,e[81]=B,e[82]=G):G=e[82];let F;e[83]!==D||e[84]!==r?(F=!D&&s.jsx("p",{className:"px-4 pb-4 text-xs text-muted-foreground",children:r("settings.repositories.githubReturnHint")}),e[83]=D,e[84]=r,e[85]=F):F=e[85];let K;e[86]!==Q||e[87]!==J||e[88]!==G||e[89]!==F?(K=s.jsxs(et,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden",children:[Q,J,G,F]}),e[86]=Q,e[87]=J,e[88]=G,e[89]=F,e[90]=K):K=e[90];let L;return e[91]!==P||e[92]!==K?(L=s.jsx(tt,{open:!0,onOpenChange:P,children:K}),e[91]=P,e[92]=K,e[93]=L):L=e[93],L}function Fe(t){const e=Y.c(3),{provider:i,size:f}=t,n=f===void 0?16:f;let r;return e[0]!==i||e[1]!==n?(r=i==="gitlab"?s.jsx(We,{size:n,className:"text-muted-foreground"}):s.jsx(Be,{size:n,className:"text-muted-foreground"}),e[0]=i,e[1]=n,e[2]=r):r=e[2],r}function Re(t,e){return t instanceof Error&&t.message?t.message:e}function ct(t,e){return t.authKind==="github_app"?e("settings.repositories.authKindGithubApp"):t.authKind==="oauth"?e("settings.repositories.authKindOauth"):e("settings.repositories.authKindToken")}function dt(t,e){return t==="public"?e("settings.repositories.visibilityPublic"):t==="private"?e("settings.repositories.visibilityPrivate"):t==="internal"?e("settings.repositories.visibilityInternal"):null}function ut(t){const e=Y.c(56),{account:i,onDisconnect:f}=t,n=se(),{org:r}=Se(),u=Pe(),g=i.status==="revoked"||!i.servable;let m;e[0]!==i.avatarUrl?(m=i.avatarUrl?.trim()||void 0,e[0]=i.avatarUrl,e[1]=m):m=e[1];let l;e[2]!==i.type?(l=s.jsx(Fe,{provider:i.type}),e[2]=i.type,e[3]=l):l=e[3];let c;e[4]!==m||e[5]!==l?(c=s.jsx(Te,{url:m,fallback:l,shape:"circle",size:"sm",className:"size-9",muted:!0}),e[4]=m,e[5]=l,e[6]=c):c=e[6];let a;e[7]!==i.login?(a=s.jsx("span",{className:"font-medium text-sm truncate",children:i.login}),e[7]=i.login,e[8]=a):a=e[8];let p;e[9]!==g||e[10]!==n?(p=g&&s.jsx(fe,{variant:"outline",className:"shrink-0",children:n("settings.repositories.needsReconnect")}),e[9]=g,e[10]=n,e[11]=p):p=e[11];let o;e[12]!==a||e[13]!==p?(o=s.jsxs("div",{className:"flex items-center gap-2",children:[a,p]}),e[12]=a,e[13]=p,e[14]=o):o=e[14];const d=i.host;let h;e[15]!==i||e[16]!==n?(h=ct(i,n),e[15]=i,e[16]=n,e[17]=h):h=e[17];let C;e[18]!==i.host||e[19]!==h?(C=s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:[d," · ",h]}),e[18]=i.host,e[19]=h,e[20]=C):C=e[20];let v;e[21]!==i.connectedBy||e[22]!==n?(v=i.connectedBy?n("settings.repositories.connectedBy",{name:i.connectedBy.name}):n("settings.repositories.connectedByUnknown"),e[21]=i.connectedBy,e[22]=n,e[23]=v):v=e[23];let y;e[24]!==v?(y=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:v}),e[24]=v,e[25]=y):y=e[25];let x;e[26]!==g||e[27]!==n?(x=g&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n("settings.repositories.needsReconnectHint")}),e[26]=g,e[27]=n,e[28]=x):x=e[28];let b;e[29]!==y||e[30]!==x||e[31]!==o||e[32]!==C?(b=s.jsxs("div",{className:"min-w-0",children:[o,C,y,x]}),e[29]=y,e[30]=x,e[31]=o,e[32]=C,e[33]=b):b=e[33];let _;e[34]!==b||e[35]!==c?(_=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,b]}),e[34]=b,e[35]=c,e[36]=_):_=e[36];let k;e[37]!==i.id||e[38]!==i.installationId||e[39]!==i.servable||e[40]!==i.type||e[41]!==r||e[42]!==u||e[43]!==n?(k=i.type==="github"&&i.installationId&&i.servable&&s.jsx(M,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:`/api/${encodeURIComponent(r.slug)}/git-providers/github/accounts/${encodeURIComponent(i.id)}/manage`,target:"_blank",rel:"noopener noreferrer",onClick:()=>{u.invalidateQueries({queryKey:le.providerRepoSearch(r.id,i.id,"").slice(0,3),refetchType:"none"})},children:[s.jsx(me,{size:14}),n("settings.repositories.manageRepositoryAccess")]})}),e[37]=i.id,e[38]=i.installationId,e[39]=i.servable,e[40]=i.type,e[41]=r,e[42]=u,e[43]=n,e[44]=k):k=e[44];let w;e[45]!==n?(w=n("settings.repositories.disconnect"),e[45]=n,e[46]=w):w=e[46];let A;e[47]!==f||e[48]!==w?(A=s.jsx(M,{variant:"outline",size:"sm",onClick:f,children:w}),e[47]=f,e[48]=w,e[49]=A):A=e[49];let R;e[50]!==k||e[51]!==A?(R=s.jsxs("div",{className:"flex flex-wrap justify-end gap-2 max-w-full",children:[k,A]}),e[50]=k,e[51]=A,e[52]=R):R=e[52];let S;return e[53]!==_||e[54]!==R?(S=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[_,R]}),e[53]=_,e[54]=R,e[55]=S):S=e[55],S}function ft(t){const e=Y.c(45),{repository:i,onUnlink:f}=t,n=se();let r;e[0]!==i.visibility||e[1]!==n?(r=dt(i.visibility,n),e[0]=i.visibility,e[1]=n,e[2]=r):r=e[2];const u=r;let g;e[3]!==i.provider?(g=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(Fe,{provider:i.provider})}),e[3]=i.provider,e[4]=g):g=e[4];let m;e[5]!==i.path?(m=s.jsx("span",{className:"font-medium text-sm truncate",children:i.path}),e[5]=i.path,e[6]=m):m=e[6];let l;e[7]!==u?(l=u&&s.jsx(fe,{variant:"secondary",className:"shrink-0",children:u}),e[7]=u,e[8]=l):l=e[8];let c;e[9]!==i.accountId||e[10]!==n?(c=!i.accountId&&s.jsx(fe,{variant:"outline",className:"shrink-0",children:n("settings.repositories.anonymousClone")}),e[9]=i.accountId,e[10]=n,e[11]=c):c=e[11];let a;e[12]!==m||e[13]!==l||e[14]!==c?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[m,l,c]}),e[12]=m,e[13]=l,e[14]=c,e[15]=a):a=e[15];let p;e[16]!==i.defaultBranch||e[17]!==n?(p=i.defaultBranch?` · ${n("settings.repositories.defaultBranch",{branch:i.defaultBranch})}`:"",e[16]=i.defaultBranch,e[17]=n,e[18]=p):p=e[18];let o;e[19]!==i.host||e[20]!==p?(o=s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:[i.host,p]}),e[19]=i.host,e[20]=p,e[21]=o):o=e[21];let d;e[22]!==a||e[23]!==o?(d=s.jsxs("div",{className:"min-w-0",children:[a,o]}),e[22]=a,e[23]=o,e[24]=d):d=e[24];let h;e[25]!==g||e[26]!==d?(h=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[g,d]}),e[25]=g,e[26]=d,e[27]=h):h=e[27];const C=i.webUrl;let v;e[28]!==n?(v=n("settings.repositories.openInProvider"),e[28]=n,e[29]=v):v=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(me,{size:14}),e[30]=y):y=e[30];let x;e[31]!==i.webUrl||e[32]!==v?(x=s.jsx(M,{variant:"ghost",size:"sm",asChild:!0,children:s.jsx("a",{href:C,target:"_blank",rel:"noreferrer","aria-label":v,children:y})}),e[31]=i.webUrl,e[32]=v,e[33]=x):x=e[33];let b;e[34]!==n?(b=n("settings.repositories.unlink"),e[34]=n,e[35]=b):b=e[35];let _;e[36]!==f||e[37]!==b?(_=s.jsx(M,{variant:"outline",size:"sm",onClick:f,children:b}),e[36]=f,e[37]=b,e[38]=_):_=e[38];let k;e[39]!==x||e[40]!==_?(k=s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[x,_]}),e[39]=x,e[40]=_,e[41]=k):k=e[41];let w;return e[42]!==h||e[43]!==k?(w=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[h,k]}),e[42]=h,e[43]=k,e[44]=w):w=e[44],w}function pt(t){const e=Y.c(19),{onDisconnect:i}=t,f=se(),n=Ie(),r=Ue(),u=n.data?.github.configured===!0,g=(n.data?.gitlab.oauthHosts.length??0)>0,m=u||g;if(r.isError)throw r.error;let l;e[0]!==r.data?(l=r.data??[],e[0]=r.data,e[1]=l):l=e[1];const c=l;let a;e[2]!==f?(a=f("settings.repositories.accountsTitle"),e[2]=f,e[3]=a):a=e[3];let p;e[4]!==f?(p=f("settings.repositories.accountsDescription"),e[4]=f,e[5]=p):p=e[5];let o;e[6]!==c.length?(o=c.length>0?s.jsx(de,{}):null,e[6]=c.length,e[7]=o):o=e[7];let d;e[8]!==r.isPending||e[9]!==m||e[10]!==i||e[11]!==c||e[12]!==f?(d=r.isPending?s.jsx(pe,{className:"h-24 w-full"}):!m&&c.length===0?s.jsxs("div",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsx("p",{className:"font-medium text-sm",children:f("settings.repositories.noProvidersTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground max-w-sm",children:f("settings.repositories.noProvidersDescription")}),s.jsx(de,{})]}):c.length===0?s.jsxs("div",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(st,{size:20,className:"text-muted-foreground"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:f("settings.repositories.accountsEmptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:f("settings.repositories.accountsEmptyDescription")})]}),s.jsx(de,{})]}):s.jsx("section",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:c.map(C=>s.jsx(ut,{account:C,onDisconnect:()=>i(C)},C.id))}),e[8]=r.isPending,e[9]=m,e[10]=i,e[11]=c,e[12]=f,e[13]=d):d=e[13];let h;return e[14]!==a||e[15]!==p||e[16]!==o||e[17]!==d?(h=s.jsx($e,{title:a,headerClassName:"flex-col items-start 2xl:flex-row 2xl:items-center [&>div]:max-w-full",description:p,actions:o,children:d}),e[14]=a,e[15]=p,e[16]=o,e[17]=d,e[18]=h):h=e[18],h}function mt(t){const e=Y.c(21),{onAdd:i,onUnlink:f}=t,n=se(),r=Je();if(r.isError)throw r.error;let u;e[0]!==r.data?(u=r.data??[],e[0]=r.data,e[1]=u):u=e[1];const g=u;let m;e[2]!==n?(m=n("settings.repositories.reposTitle"),e[2]=n,e[3]=m):m=e[3];let l;e[4]!==n?(l=n("settings.repositories.reposDescription"),e[4]=n,e[5]=l):l=e[5];let c;e[6]!==i||e[7]!==g.length||e[8]!==n?(c=g.length>0?s.jsxs(M,{size:"sm",onClick:i,children:[s.jsx(je,{size:14}),n("settings.repositories.addRepository")]}):null,e[6]=i,e[7]=g.length,e[8]=n,e[9]=c):c=e[9];let a;e[10]!==i||e[11]!==f||e[12]!==r.isPending||e[13]!==g||e[14]!==n?(a=r.isPending?s.jsx(pe,{className:"h-24 w-full"}):g.length===0?s.jsxs("div",{"data-testid":"repositories-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:n("settings.repositories.reposEmptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:n("settings.repositories.reposEmptyDescription")})]}),s.jsxs(M,{size:"sm",onClick:i,children:[s.jsx(je,{size:14}),n("settings.repositories.addRepository")]})]}):s.jsx("section",{"data-testid":"repositories-list",className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:g.map(o=>s.jsx(ft,{repository:o,onUnlink:()=>f(o)},o.id))}),e[10]=i,e[11]=f,e[12]=r.isPending,e[13]=g,e[14]=n,e[15]=a):a=e[15];let p;return e[16]!==m||e[17]!==l||e[18]!==c||e[19]!==a?(p=s.jsx($e,{title:m,description:l,actions:c,children:a}),e[16]=m,e[17]=l,e[18]=c,e[19]=a,e[20]=p):p=e[20],p}function gt(){const t=Y.c(24),e=se(),i=Ee(),f=Ue();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1,select:bt},t[0]=n):n=t[0];const r=ze(n);if(!r||r==="no_installations"&&f.data?.some(xt))return null;let u;e:switch(r){case"no_installations":{let o;t[1]!==e?(o=e("settings.repositories.oauthNoInstallations"),t[1]=e,t[2]=o):o=t[2],u=o;break e}case"denied":case"access_denied":{let o;t[3]!==e?(o=e("settings.repositories.oauthDenied"),t[3]=e,t[4]=o):o=t[4],u=o;break e}case"missing_state":case"invalid_state":case"session_mismatch":{let o;t[5]!==e?(o=e("settings.repositories.oauthExpired"),t[5]=e,t[6]=o):o=t[6],u=o;break e}case"not_configured":{let o;t[7]!==e?(o=e("settings.repositories.oauthNotConfigured"),t[7]=e,t[8]=o):o=t[8],u=o;break e}default:{let o;t[9]!==e?(o=e("settings.repositories.oauthFailed"),t[9]=e,t[10]=o):o=t[10],u=o}}const g=r==="no_installations"?"info":"destructive";let m;t[11]!==u?(m=s.jsx(it,{className:"flex-1",children:u}),t[11]=u,t[12]=m):m=t[12];let l;t[13]!==i?(l=()=>{i({to:".",search:ht,replace:!0})},t[13]=i,t[14]=l):l=t[14];let c;t[15]!==e?(c=e("settings.repositories.dismiss"),t[15]=e,t[16]=c):c=t[16];let a;t[17]!==l||t[18]!==c?(a=s.jsx(M,{variant:"ghost",size:"sm",onClick:l,children:c}),t[17]=l,t[18]=c,t[19]=a):a=t[19];let p;return t[20]!==g||t[21]!==m||t[22]!==a?(p=s.jsxs(nt,{variant:g,children:[m,a]}),t[20]=g,t[21]=m,t[22]=a,t[23]=p):p=t[23],p}function ht(t){return{...t,git_error:void 0}}function xt(t){return t.type==="github"}function bt(t){return t.git_error}function jt(){const t=Y.c(93),e=se(),i=Ee();let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={strict:!1},t[0]=f):f=t[0];const n=ze(f),r=Le(),u=Me(),[g,m]=ae.useState(!1),[l,c]=ae.useState(null),[a,p]=ae.useState(null);let o;t[1]!==r||t[2]!==l||t[3]!==e?(o=function(){l&&r.mutate(l.id,{onSuccess:()=>te.success(e("settings.repositories.disconnected")),onError:ce=>te.error(Re(ce,e("settings.repositories.failed"))),onSettled:()=>c(null)})},t[1]=r,t[2]=l,t[3]=e,t[4]=o):o=t[4];const d=o;let h;t[5]!==u||t[6]!==a||t[7]!==e?(h=function(){a&&u.mutate(a.id,{onSuccess:()=>te.success(e("settings.repositories.unlinked")),onError:ce=>te.error(Re(ce,e("settings.repositories.failed"))),onSettled:()=>p(null)})},t[5]=u,t[6]=a,t[7]=e,t[8]=h):h=t[8];const C=h;let v;t[9]!==e?(v=e("settings.repositories.pageDescription"),t[9]=e,t[10]=v):v=t[10];let y;t[11]!==v?(y=s.jsx("p",{className:"text-sm text-muted-foreground",children:v}),t[11]=v,t[12]=y):y=t[12];let x;t[13]!==n.git_flow?(x=!n.git_flow&&s.jsx(gt,{}),t[13]=n.git_flow,t[14]=x):x=t[14];let b;t[15]!==i||t[16]!==n.git_flow||t[17]!==n.git_return?(b=n.git_flow&&s.jsx(at,{flowId:n.git_flow,returning:n.git_return===!0,onClose:()=>{i({to:".",search:vt,replace:!0})}}),t[15]=i,t[16]=n.git_flow,t[17]=n.git_return,t[18]=b):b=t[18];let _;t[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(pt,{onDisconnect:c}),t[19]=_):_=t[19];let k;t[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(mt,{onAdd:()=>m(!0),onUnlink:p}),t[20]=k):k=t[20];let w;t[21]!==g||t[22]!==e?(w=g&&s.jsx(Qe,{open:!0,onOpenChange:m,title:e("settings.repositories.addDialogTitle"),onPicked:()=>m(!1)}),t[21]=g,t[22]=e,t[23]=w):w=t[23];const A=l!==null;let R;t[24]===Symbol.for("react.memo_cache_sentinel")?(R=re=>{re||c(null)},t[24]=R):R=t[24];const S=l?.login??"";let ee;t[25]!==e||t[26]!==S?(ee=e("settings.repositories.disconnectTitle",{login:S}),t[25]=e,t[26]=S,t[27]=ee):ee=t[27];let V;t[28]!==ee?(V=s.jsx(ve,{children:ee}),t[28]=ee,t[29]=V):V=t[29];let O;t[30]!==e?(O=e("settings.repositories.disconnectDescription"),t[30]=e,t[31]=O):O=t[31];let X;t[32]!==O?(X=s.jsx(ye,{children:O}),t[32]=O,t[33]=X):X=t[33];let q;t[34]!==V||t[35]!==X?(q=s.jsxs(we,{children:[V,X]}),t[34]=V,t[35]=X,t[36]=q):q=t[36];let D;t[37]!==e?(D=e("settings.repositories.cancel"),t[37]=e,t[38]=D):D=t[38];let j;t[39]!==D?(j=s.jsx(Ne,{children:D}),t[39]=D,t[40]=j):j=t[40];let P;t[41]!==e?(P=e("settings.repositories.disconnect"),t[41]=e,t[42]=P):P=t[42];let E;t[43]!==d||t[44]!==P?(E=s.jsx(Ce,{onClick:d,children:P}),t[43]=d,t[44]=P,t[45]=E):E=t[45];let z;t[46]!==j||t[47]!==E?(z=s.jsxs(_e,{children:[j,E]}),t[46]=j,t[47]=E,t[48]=z):z=t[48];let $;t[49]!==q||t[50]!==z?($=s.jsxs(ke,{children:[q,z]}),t[49]=q,t[50]=z,t[51]=$):$=t[51];let I;t[52]!==A||t[53]!==$?(I=s.jsx(De,{open:A,onOpenChange:R,children:$}),t[52]=A,t[53]=$,t[54]=I):I=t[54];const Q=a!==null;let H;t[55]===Symbol.for("react.memo_cache_sentinel")?(H=re=>{re||p(null)},t[55]=H):H=t[55];const J=a?.path??"";let U;t[56]!==e||t[57]!==J?(U=e("settings.repositories.unlinkTitle",{path:J}),t[56]=e,t[57]=J,t[58]=U):U=t[58];let T;t[59]!==U?(T=s.jsx(ve,{children:U}),t[59]=U,t[60]=T):T=t[60];let B;t[61]!==e?(B=e("settings.repositories.unlinkDescription"),t[61]=e,t[62]=B):B=t[62];let G;t[63]!==B?(G=s.jsx(ye,{children:B}),t[63]=B,t[64]=G):G=t[64];let F;t[65]!==T||t[66]!==G?(F=s.jsxs(we,{children:[T,G]}),t[65]=T,t[66]=G,t[67]=F):F=t[67];let K;t[68]!==e?(K=e("settings.repositories.cancel"),t[68]=e,t[69]=K):K=t[69];let L;t[70]!==K?(L=s.jsx(Ne,{children:K}),t[70]=K,t[71]=L):L=t[71];let N;t[72]!==e?(N=e("settings.repositories.unlink"),t[72]=e,t[73]=N):N=t[73];let Z;t[74]!==C||t[75]!==N?(Z=s.jsx(Ce,{onClick:C,children:N}),t[74]=C,t[75]=N,t[76]=Z):Z=t[76];let W;t[77]!==L||t[78]!==Z?(W=s.jsxs(_e,{children:[L,Z]}),t[77]=L,t[78]=Z,t[79]=W):W=t[79];let ie;t[80]!==F||t[81]!==W?(ie=s.jsxs(ke,{children:[F,W]}),t[80]=F,t[81]=W,t[82]=ie):ie=t[82];let ne;t[83]!==Q||t[84]!==ie?(ne=s.jsx(De,{open:Q,onOpenChange:H,children:ie}),t[83]=Q,t[84]=ie,t[85]=ne):ne=t[85];let oe;return t[86]!==I||t[87]!==ne||t[88]!==y||t[89]!==x||t[90]!==b||t[91]!==w?(oe=s.jsxs(s.Fragment,{children:[y,x,b,_,k,w,I,ne]}),t[86]=I,t[87]=ne,t[88]=y,t[89]=x,t[90]=b,t[91]=w,t[92]=oe):oe=t[92],oe}function vt(t){return{...t,git_flow:void 0,git_return:void 0,git_error:void 0}}function yt(){const t=Y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(He,{group:"repositories",children:s.jsx(jt,{})}),t[0]=e):e=t[0],e}function Qt(){const t=Y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(rt,{capability:"file-configs:manage",area:"files",children:s.jsx(yt,{})}),t[0]=e):e=t[0],e}export{Qt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as M,b as T,G as _,n as x,aR as j,t as b,j as L}from"./index-
|
|
1
|
+
import{c as M,b as T,G as _,n as x,aR as j,t as b,j as L}from"./index-DR-7CxUP.js";import{u as O}from"./use-mcp-client-Cjw7oL0k.js";import{S}from"./constants-Daqiz8AS.js";import{u as V}from"./use-navigate-to-agent-BtEQtkbQ.js";import{R as D}from"./repository-picker-Dn5CWMQu.js";function F(n){const e=n.path.split("/"),r=e[e.length-1]??n.path;return{owner:e.slice(0,-1).join("/"),name:r,url:n.webUrl}}function G(n,e,r){return{title:e.name,description:r.description,pinned:!1,icon:null,metadata:{githubRepo:{owner:e.owner,name:e.name,url:e.url,repositoryId:n.id},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[]}}function B(n){const e=M.c(26),{open:r,onOpenChange:s,title:P,onImportComplete:m,mode:v}=n,a=v===void 0?"agent":v,t=T(),{org:o}=_(),h=x(),C=V();let p;e[0]!==o.id||e[1]!==o.slug?(p={connectionId:S,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=p):p=e[2];const k=O(p);let d;e[3]!==a||e[4]!==t||e[5]!==P?(d=P??t(a==="link"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[3]=a,e[4]=t,e[5]=P,e[6]=d):d=e[6];const y=d;let g;e[7]!==k||e[8]!==t?(g=async function(i,u){const l=await k.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:G(i,u,{description:t("common.repositoryPicker.agentDescription",{path:i.path})})}}),E=(l.structuredContent??l).item?.id;if(!E)throw new Error(t("common.repositoryPicker.createAgentFailed"));return E},e[7]=k,e[8]=t,e[9]=g):g=e[9];const I=g;let f;e[10]!==I||e[11]!==a||e[12]!==C||e[13]!==m||e[14]!==s||e[15]!==o.id||e[16]!==h||e[17]!==t?(f=async function(i){const u=F(i),l=a==="agent"?await I(i,u):null;j(h,o.id),s(!1),m?m({virtualMcpId:l,repository:i}):l?(b.success(t("common.githubRepoPicker.importedRepo",{name:u.name})),C(l)):b.success(t("common.githubRepoPicker.addedRepo",{name:u.name}))},e[10]=I,e[11]=a,e[12]=C,e[13]=m,e[14]=s,e[15]=o.id,e[16]=h,e[17]=t,e[18]=f):f=e[18];const w=f;let c;e[19]!==w?(c=A=>{const{repository:i}=A;return w(i)},e[19]=w,e[20]=c):c=e[20];let R;return e[21]!==s||e[22]!==r||e[23]!==y||e[24]!==c?(R=L.jsx(D,{open:r,onOpenChange:s,title:y,onPicked:c,onError:N}),e[21]=s,e[22]=r,e[23]=y,e[24]=c,e[25]=R):R=e[25],R}function N(n){return b.error(n)}export{B as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as P,j as l,G as z,a7 as D,K as R,m as ee,n as Y,e as V,r as L,b as H,l as J,b4 as te,t as ne,B as M,a4 as be,a1 as ye,a2 as je,h as re}from"./index-fS0pDoNW.js";import{i as se}from"./ChevronRight-Dk9nR_C7.js";import{d as ae,h as ce,c as de,e as ve,b as ue,D as fe}from"./dialog-DKxWMb0-.js";import{I as le}from"./input-DaMV0yqT.js";import{L as oe}from"./label-Cznjg7Mb.js";import{G as me}from"./github-icon-CeFWgmVz.js";import{u as Ne}from"./useInfiniteQuery-CU7gRlof.js";import{i as ke}from"./ArrowLeft-EySzpaMt.js";import{i as Pe}from"./GitBranch01-DRT2X7Dj.js";import{A as xe}from"./avatar-ncVfbaUx.js";import{C as pe}from"./collection-search-UW0xDxmi.js";import{u as Ce}from"./use-debounced-value-CjFrELYP.js";function Z(t){const e=P.c(4),{size:n,className:o}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx("path",{d:"M23.6004 9.5927l-.0337-.0862L20.3.9814a.851.851 0 00-.3362-.405.8748.8748 0 00-.9997.0539.8748.8748 0 00-.29.4399l-2.2055 6.748H7.5375L5.3318 1.0702a.8573.8573 0 00-.29-.4412.8748.8748 0 00-.9997-.0537.8585.8585 0 00-.3361.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 002.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 001.2197 0l1.4995-1.1321 2.462-1.8633 5.0062-3.7489.0125-.01a6.0682 6.0682 0 002.0094-7.003z"}),e[0]=s):s=e[0];let i;return e[1]!==o||e[2]!==n?(i=l.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:o,children:s}),e[1]=o,e[2]=n,e[3]=i):i=e[3],i}const Se=5*6e4;function Te(){const t=P.c(7),{org:e}=z(),n=D();let o;t[0]!==e.id?(o=R.gitProviderCapabilities(e.id),t[0]=e.id,t[1]=o):o=t[1];let s;t[2]!==n?(s=()=>n.call("GIT_PROVIDER_CAPABILITIES",{}),t[2]=n,t[3]=s):s=t[3];let i;return t[4]!==o||t[5]!==s?(i={queryKey:o,staleTime:Se,queryFn:s},t[4]=o,t[5]=s,t[6]=i):i=t[6],ee(i)}function we(){const t=P.c(7),{org:e}=z(),n=D();let o;t[0]!==e.id?(o=R.gitAccounts(e.id),t[0]=e.id,t[1]=o):o=t[1];let s;t[2]!==n?(s=async()=>(await n.call("GIT_ACCOUNT_LIST",{})).accounts,t[2]=n,t[3]=s):s=t[3];let i;return t[4]!==o||t[5]!==s?(i={queryKey:o,staleTime:6e4,queryFn:s},t[4]=o,t[5]=s,t[6]=i):i=t[6],ee(i)}function Ee(t){const e=P.c(9),{org:n}=z(),o=D();let s;e[0]!==t||e[1]!==n.id?(s=R.repositories(n.id,t),e[0]=t,e[1]=n.id,e[2]=s):s=e[2];let i;e[3]!==t||e[4]!==o?(i=async()=>(await o.call("REPOSITORY_LIST",{})).repositories,e[3]=t,e[4]=o,e[5]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,staleTime:6e4,queryFn:i},e[6]=s,e[7]=i,e[8]=r):r=e[8],ee(r)}function _e(t,e){const n=P.c(12),{org:o}=z(),s=D();let i;n[0]!==t||n[1]!==o.id||n[2]!==e?(i=R.providerRepoSearch(o.id,t??"",e),n[0]=t,n[1]=o.id,n[2]=e,n[3]=i):i=n[3];const r=t!==null;let f;n[4]!==t||n[5]!==e||n[6]!==s?(f=async u=>{const{pageParam:d}=u;return t===null?{repositories:[],hasMore:!1}:await s.call("REPOSITORY_SEARCH",{accountId:t,page:d,perPage:100,...e?{query:e}:{}})},n[4]=t,n[5]=e,n[6]=s,n[7]=f):f=n[7];let a;return n[8]!==i||n[9]!==r||n[10]!==f?(a={queryKey:i,enabled:r,initialPageParam:1,getNextPageParam:Ae,staleTime:3e4,retry:!1,queryFn:f},n[8]=i,n[9]=r,n[10]=f,n[11]=a):a=n[11],Ne(a)}function Ae(t,e){return t.hasMore?e.length+1:void 0}function $e(){const t=P.c(8),{org:e}=z(),n=D(),o=Y();let s;t[0]!==n?(s=async f=>(await n.call("GIT_ACCOUNT_CONNECT_TOKEN",f)).account,t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>o.invalidateQueries({queryKey:R.gitAccounts(e.id)}),t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],V(r)}function tt(){const t=P.c(8),{org:e}=z(),n=D(),o=Y();let s;t[0]!==n?(s=f=>n.call("GIT_ACCOUNT_DELETE",{id:f}),t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>{o.invalidateQueries({queryKey:R.gitAccounts(e.id)}),o.invalidateQueries({queryKey:R.repositories(e.id)})},t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],V(r)}function Le(){const t=P.c(8),{org:e}=z(),n=D(),o=Y();let s;t[0]!==n?(s=async f=>(await n.call("REPOSITORY_LINK",f)).repository,t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>o.invalidateQueries({queryKey:R.repositories(e.id)}),t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],V(r)}function st(){const t=P.c(8),{org:e}=z(),n=D(),o=Y();let s;t[0]!==n?(s=f=>n.call("REPOSITORY_DELETE",{id:f}),t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>o.invalidateQueries({queryKey:R.repositories(e.id)}),t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],V(r)}function Re(t,e){return t instanceof Error?t.message:e}function ze(t){const e=P.c(9),{layout:n,disabled:o}=t,s=n===void 0?"buttons":n,i=o===void 0?!1:o,[r,f]=L.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>f(!0),e[0]=a):a=e[0];let u;e[1]!==i||e[2]!==s?(u=l.jsx(Fe,{layout:s,disabled:i,onTokenDialog:a}),e[1]=i,e[2]=s,e[3]=u):u=e[3];let d;e[4]!==r?(d=r&&l.jsx(De,{open:!0,onOpenChange:f}),e[4]=r,e[5]=d):d=e[5];let c;return e[6]!==u||e[7]!==d?(c=l.jsxs(l.Fragment,{children:[u,d]}),e[6]=u,e[7]=d,e[8]=c):c=e[8],c}function De(t){const e=P.c(76),{open:n,onOpenChange:o}=t,s=H(),i=$e(),[r,f]=L.useState("gitlab.com"),[a,u]=L.useState("");let d;e[0]!==i||e[1]!==r||e[2]!==o||e[3]!==s||e[4]!==a?(d=function(){!r.trim()||!a.trim()||i.mutate({type:"gitlab",host:r.trim(),token:a.trim()},{onSuccess:W=>{ne.success(s("settings.repositories.connected",{login:W.login})),u(""),o(!1)},onError:W=>ne.error(Re(W,s("settings.repositories.failed")))})},e[0]=i,e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=d):d=e[5];const c=d;let h;e[6]!==s?(h=s("settings.repositories.tokenDialogTitle"),e[6]=s,e[7]=h):h=e[7];let p;e[8]!==h?(p=l.jsx(ae,{children:h}),e[8]=h,e[9]=p):p=e[9];let y;e[10]!==s?(y=s("settings.repositories.tokenDialogDescription"),e[10]=s,e[11]=y):y=e[11];let m;e[12]!==y?(m=l.jsx(ce,{children:y}),e[12]=y,e[13]=m):m=e[13];let x;e[14]!==p||e[15]!==m?(x=l.jsxs(de,{children:[p,m]}),e[14]=p,e[15]=m,e[16]=x):x=e[16];let b;e[17]!==s?(b=s("settings.repositories.tokenHostLabel"),e[17]=s,e[18]=b):b=e[18];let g;e[19]!==b?(g=l.jsx(oe,{htmlFor:"gitlab-host",children:b}),e[19]=b,e[20]=g):g=e[20];let j;e[21]===Symbol.for("react.memo_cache_sentinel")?(j=B=>f(B.target.value),e[21]=j):j=e[21];let N;e[22]!==s?(N=s("settings.repositories.tokenHostPlaceholder"),e[22]=s,e[23]=N):N=e[23];let C;e[24]!==r||e[25]!==N?(C=l.jsx(le,{id:"gitlab-host",value:r,onChange:j,placeholder:N}),e[24]=r,e[25]=N,e[26]=C):C=e[26];let S;e[27]!==C||e[28]!==g?(S=l.jsxs("div",{className:"flex flex-col gap-1.5",children:[g,C]}),e[27]=C,e[28]=g,e[29]=S):S=e[29];let v;e[30]!==s?(v=s("settings.repositories.tokenLabel"),e[30]=s,e[31]=v):v=e[31];let T;e[32]!==v?(T=l.jsx(oe,{htmlFor:"gitlab-token",children:v}),e[32]=v,e[33]=T):T=e[33];let _;e[34]===Symbol.for("react.memo_cache_sentinel")?(_=B=>u(B.target.value),e[34]=_):_=e[34];let w;e[35]!==s?(w=s("settings.repositories.tokenPlaceholder"),e[35]=s,e[36]=w):w=e[36];let A;e[37]!==w||e[38]!==a?(A=l.jsx(le,{id:"gitlab-token",type:"password",value:a,onChange:_,placeholder:w,autoComplete:"off"}),e[37]=w,e[38]=a,e[39]=A):A=e[39];let E;e[40]!==T||e[41]!==A?(E=l.jsxs("div",{className:"flex flex-col gap-1.5",children:[T,A]}),e[40]=T,e[41]=A,e[42]=E):E=e[42];let $;e[43]!==S||e[44]!==E?($=l.jsxs("div",{className:"flex flex-col gap-3",children:[S,E]}),e[43]=S,e[44]=E,e[45]=$):$=e[45];let k;e[46]!==o?(k=()=>o(!1),e[46]=o,e[47]=k):k=e[47];const ge=i.isPending;let F;e[48]!==s?(F=s("settings.repositories.cancel"),e[48]=s,e[49]=F):F=e[49];let O;e[50]!==i.isPending||e[51]!==k||e[52]!==F?(O=l.jsx(M,{variant:"outline",onClick:k,disabled:ge,children:F}),e[50]=i.isPending,e[51]=k,e[52]=F,e[53]=O):O=e[53];let G;e[54]!==i.isPending||e[55]!==r||e[56]!==a?(G=!r.trim()||!a.trim()||i.isPending,e[54]=i.isPending,e[55]=r,e[56]=a,e[57]=G):G=e[57];let I;e[58]!==i.isPending||e[59]!==s?(I=i.isPending?s("settings.repositories.connecting"):s("settings.repositories.connect"),e[58]=i.isPending,e[59]=s,e[60]=I):I=e[60];let q;e[61]!==c||e[62]!==G||e[63]!==I?(q=l.jsx(M,{onClick:c,disabled:G,children:I}),e[61]=c,e[62]=G,e[63]=I,e[64]=q):q=e[64];let K;e[65]!==O||e[66]!==q?(K=l.jsxs(ve,{children:[O,q]}),e[65]=O,e[66]=q,e[67]=K):K=e[67];let Q;e[68]!==$||e[69]!==K||e[70]!==x?(Q=l.jsxs(ue,{className:"sm:max-w-md",children:[x,$,K]}),e[68]=$,e[69]=K,e[70]=x,e[71]=Q):Q=e[71];let U;return e[72]!==o||e[73]!==n||e[74]!==Q?(U=l.jsx(fe,{open:n,onOpenChange:o,children:Q}),e[72]=o,e[73]=n,e[74]=Q,e[75]=U):U=e[75],U}function X(t){const e=P.c(25),{layout:n,label:o,description:s,icon:i,href:r,onClick:f,disabled:a}=t;let u;e[0]!==s||e[1]!==a||e[2]!==i||e[3]!==o||e[4]!==n?(u=n==="picker"?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:i}),l.jsxs("span",{className:"flex-1 min-w-0 text-left",children:[l.jsx("span",{className:"block text-sm font-medium",children:o}),l.jsx("span",{className:"block text-xs font-normal text-muted-foreground whitespace-normal",children:s})]}),!a&&l.jsx("span",{className:"shrink-0 text-muted-foreground",children:l.jsx(se,{size:16})})]}):l.jsxs(l.Fragment,{children:[i,o]}),e[0]=s,e[1]=a,e[2]=i,e[3]=o,e[4]=n,e[5]=u):u=e[5];const d=u,c=n==="picker"?"ghost":"outline",h=n==="picker"&&"w-full h-auto justify-start gap-3 rounded-none px-4 py-3 hover:bg-accent";let p;e[6]!==h?(p=J(h),e[6]=h,e[7]=p):p=e[7];const y=!!r&&!a;let m;e[8]!==d||e[9]!==a||e[10]!==r?(m=r&&!a?l.jsx("a",{href:r,children:d}):d,e[8]=d,e[9]=a,e[10]=r,e[11]=m):m=e[11];let x;e[12]!==a||e[13]!==o||e[14]!==f||e[15]!==c||e[16]!==p||e[17]!==y||e[18]!==m?(x=l.jsx(M,{size:"sm",variant:c,className:p,"aria-label":o,disabled:a,asChild:y,onClick:f,children:m}),e[12]=a,e[13]=o,e[14]=f,e[15]=c,e[16]=p,e[17]=y,e[18]=m,e[19]=x):x=e[19];const b=x;let g;return e[20]!==b||e[21]!==s||e[22]!==a||e[23]!==n?(g=n==="buttons"&&a?l.jsxs(be,{children:[l.jsx(ye,{asChild:!0,children:l.jsx("span",{tabIndex:0,children:b})}),l.jsx(je,{children:s})]}):b,e[20]=b,e[21]=s,e[22]=a,e[23]=n,e[24]=g):g=e[24],g}function Fe(t){const e=P.c(42),{layout:n,disabled:o,onTokenDialog:s}=t,i=H(),r=Te(),{org:f}=z(),a=`/${f.slug}/settings/repositories`;let u;e[0]!==a?(u=k=>`${k}?returnTo=${encodeURIComponent(a)}`,e[0]=a,e[1]=u):u=e[1];const d=u;if(r.isError){let k;return e[2]!==r.error.message?(k=l.jsx("p",{role:"alert",className:"text-sm text-destructive",children:r.error.message}),e[2]=r.error.message,e[3]=k):k=e[3],k}const c=r.data?.github,h=r.data?.gitlab,p=c?.configured===!0,y=(h?.oauthHosts.length??0)>0;if(r.isPending){let k;return e[4]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(te,{className:"h-9 w-40"}),e[4]=k):k=e[4],k}const m=n==="picker"?"flex-col":"flex-wrap items-center gap-2";let x;e[5]!==m?(x=J("flex",m),e[5]=m,e[6]=x):x=e[6];let b;e[7]!==i?(b=i("settings.repositories.addGithubAccount"),e[7]=i,e[8]=b):b=e[8];const g=p?"settings.repositories.browseAccount":"settings.repositories.githubUnavailable";let j;e[9]!==i||e[10]!==g?(j=i(g),e[9]=i,e[10]=g,e[11]=j):j=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(me,{size:16}),e[12]=N):N=e[12];const C=c?.connectPath?d(c.connectPath):void 0,S=o||!p||!c?.connectPath;let v;e[13]!==n||e[14]!==b||e[15]!==j||e[16]!==C||e[17]!==S?(v=l.jsx(X,{layout:n,label:b,description:j,icon:N,href:C,disabled:S}),e[13]=n,e[14]=b,e[15]=j,e[16]=C,e[17]=S,e[18]=v):v=e[18];let T;e[19]!==d||e[20]!==o||e[21]!==h||e[22]!==y||e[23]!==n||e[24]!==i?(T=y&&h?.connectPath&&l.jsx(X,{layout:n,label:i("settings.repositories.connectGitlab"),description:i("settings.repositories.browseAccount"),icon:l.jsx(Z,{size:16}),href:d(h.connectPath),disabled:o}),e[19]=d,e[20]=o,e[21]=h,e[22]=y,e[23]=n,e[24]=i,e[25]=T):T=e[25];let _;e[26]!==i?(_=i("settings.repositories.connectGitlabToken"),e[26]=i,e[27]=_):_=e[27];let w;e[28]!==i?(w=i("settings.repositories.gitlabTokenHint"),e[28]=i,e[29]=w):w=e[29];let A;e[30]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx(Z,{size:16}),e[30]=A):A=e[30];let E;e[31]!==o||e[32]!==n||e[33]!==s||e[34]!==_||e[35]!==w?(E=l.jsx(X,{layout:n,label:_,description:w,icon:A,onClick:s,disabled:o}),e[31]=o,e[32]=n,e[33]=s,e[34]=_,e[35]=w,e[36]=E):E=e[36];let $;return e[37]!==v||e[38]!==T||e[39]!==E||e[40]!==x?($=l.jsxs("div",{className:x,children:[v,T,E]}),e[37]=v,e[38]=T,e[39]=E,e[40]=x,e[41]=$):$=e[41],$}function ie(t){const e=P.c(3),{provider:n,className:o}=t;let s;return e[0]!==o||e[1]!==n?(s=n==="gitlab"?l.jsx(Z,{size:16,className:o}):l.jsx(me,{size:16,className:o}),e[0]=o,e[1]=n,e[2]=s):s=e[2],s}function Oe(t){return(t??[]).filter(e=>e.status==="active"&&e.servable)}function he(t){const e=P.c(20),{provider:n,path:o,host:s,hint:i,disabled:r,busy:f,onSelect:a}=t,u=r&&"opacity-60 cursor-not-allowed";let d;e[0]!==u?(d=J("w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors focus-visible:outline-none focus-visible:bg-accent",u),e[0]=u,e[1]=d):d=e[1];let c;e[2]!==n?(c=l.jsx("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:l.jsx(ie,{provider:n,className:"text-muted-foreground"})}),e[2]=n,e[3]=c):c=e[3];let h;e[4]!==o?(h=l.jsx("span",{className:"block text-sm font-medium truncate",children:o}),e[4]=o,e[5]=h):h=e[5];const p=i?`${s} · ${i}`:s;let y;e[6]!==p?(y=l.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:p}),e[6]=p,e[7]=y):y=e[7];let m;e[8]!==h||e[9]!==y?(m=l.jsxs("span",{className:"flex-1 min-w-0",children:[h,y]}),e[8]=h,e[9]=y,e[10]=m):m=e[10];let x;e[11]!==f?(x=f?l.jsx(re,{className:"size-4 text-muted-foreground"}):l.jsx(se,{size:16,className:"shrink-0 text-muted-foreground"}),e[11]=f,e[12]=x):x=e[12];let b;return e[13]!==r||e[14]!==a||e[15]!==d||e[16]!==c||e[17]!==m||e[18]!==x?(b=l.jsxs("button",{type:"button",disabled:r,onClick:a,className:d,children:[c,m,x]}),e[13]=r,e[14]=a,e[15]=d,e[16]=c,e[17]=m,e[18]=x,e[19]=b):b=e[19],b}function Ge(t){const e=P.c(25),{onPick:n,pendingPath:o}=t,s=H(),i=Ee(),[r,f]=L.useState("");if(i.isPending){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(te,{className:"h-24 w-full"}),e[0]=d):d=e[0],d}if(i.isError){let d;return e[1]!==i.error.message?(d=l.jsx("p",{role:"alert",className:"p-4 text-sm text-destructive",children:i.error.message}),e[1]=i.error.message,e[2]=d):d=e[2],d}let a,u;if(e[3]!==n||e[4]!==o||e[5]!==r||e[6]!==i.data||e[7]!==s){u=Symbol.for("react.early_return_sentinel");e:{const d=i.data??[];if(d.length===0){u=null;break e}let c;e[10]!==r?(c=j=>j.path.toLowerCase().includes(r.trim().toLowerCase()),e[10]=r,e[11]=c):c=e[11];const h=d.filter(c);let p;e[12]!==s?(p=s("common.repositoryPicker.searchPlaceholder"),e[12]=s,e[13]=p):p=e[13];const y=o!==null;let m;e[14]!==r||e[15]!==p||e[16]!==y?(m=l.jsx(pe,{value:r,onChange:f,placeholder:p,disabled:y}),e[14]=r,e[15]=p,e[16]=y,e[17]=m):m=e[17];let x;e[18]!==s?(x=s("common.repositoryPicker.linkedSection"),e[18]=s,e[19]=x):x=e[19];let b;e[20]!==x?(b=l.jsx("p",{className:"px-4 pt-4 pb-2 text-xs font-medium text-muted-foreground",children:x}),e[20]=x,e[21]=b):b=e[21];let g;e[22]!==n||e[23]!==o?(g=j=>l.jsx(he,{provider:j.provider,path:j.path,host:j.host,hint:j.defaultBranch,disabled:o!==null,busy:o===j.id,onSelect:()=>n(j)},j.id),e[22]=n,e[23]=o,e[24]=g):g=e[24],a=l.jsxs("div",{className:"pb-2",children:[m,b,h.length===0&&l.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:s("common.repositoryPicker.searchEmpty")}),h.map(g)]})}e[3]=n,e[4]=o,e[5]=r,e[6]=i.data,e[7]=s,e[8]=a,e[9]=u}else a=e[8],u=e[9];return u!==Symbol.for("react.early_return_sentinel")?u:a}function Ie(t){const e=P.c(35),{account:n,onLink:o,pendingPath:s}=t,i=H(),[r,f]=L.useState(""),a=Ce(r,300),u=L.useDeferredValue(a),d=r!==u,c=_e(n.id,u);let h,p,y,m;if(e[0]!==d||e[1]!==o||e[2]!==s||e[3]!==r||e[4]!==c.data?.pages||e[5]!==c.error||e[6]!==c.hasNextPage||e[7]!==c.isError||e[8]!==c.isFetching||e[9]!==c.isPending||e[10]!==i){const j=c.data?.pages.flatMap(qe)??[];y="h-80 min-h-0 flex flex-col overflow-hidden";let N;e[15]!==i?(N=i("common.repositoryPicker.searchPlaceholder"),e[15]=i,e[16]=N):N=e[16];const C=d||c.isFetching;e[17]!==r||e[18]!==N||e[19]!==C?(m=l.jsx(pe,{placeholder:N,value:r,onChange:f,isSearching:C}),e[17]=r,e[18]=N,e[19]=C,e[20]=m):m=e[20];const S=d?"opacity-40":"opacity-100";e[21]!==S?(h=J("flex-1 overflow-y-auto transition-opacity duration-150",S),e[21]=S,e[22]=h):h=e[22],p=c.isPending?l.jsx("div",{className:"flex-1 flex items-center justify-center py-10",children:l.jsx(re,{className:"size-4.5 text-muted-foreground"})}):c.isError?l.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:c.error instanceof Error?c.error.message:i("common.repositoryPicker.searchFailed")}):j.length===0?l.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:i(c.hasNextPage?"common.repositoryPicker.searchMore":"common.repositoryPicker.searchEmpty")}):j.map(v=>l.jsx(he,{provider:v.ref.provider,path:v.ref.path,host:v.ref.host,hint:v.visibility,disabled:s!==null,busy:s===v.ref.path,onSelect:()=>o(v.webUrl,v.ref.path)},`${v.ref.host}/${v.ref.path}`)),e[0]=d,e[1]=o,e[2]=s,e[3]=r,e[4]=c.data?.pages,e[5]=c.error,e[6]=c.hasNextPage,e[7]=c.isError,e[8]=c.isFetching,e[9]=c.isPending,e[10]=i,e[11]=h,e[12]=p,e[13]=y,e[14]=m}else h=e[11],p=e[12],y=e[13],m=e[14];let x;e[23]!==s||e[24]!==c||e[25]!==i?(x=c.hasNextPage&&l.jsx(M,{variant:"ghost",className:"w-full",disabled:c.isFetchingNextPage||s!==null,onClick:()=>{c.fetchNextPage()},children:i("common.repositoryPicker.loadMore")}),e[23]=s,e[24]=c,e[25]=i,e[26]=x):x=e[26];let b;e[27]!==h||e[28]!==p||e[29]!==x?(b=l.jsxs("div",{className:h,children:[p,x]}),e[27]=h,e[28]=p,e[29]=x,e[30]=b):b=e[30];let g;return e[31]!==y||e[32]!==m||e[33]!==b?(g=l.jsxs("div",{className:y,children:[m,b]}),e[31]=y,e[32]=m,e[33]=b,e[34]=g):g=e[34],g}function qe(t){return t.repositories}function Ke(t){const e=P.c(14),{accounts:n,onSelect:o,disabled:s}=t,i=H();let r;e[0]!==i?(r=i("common.repositoryPicker.browseSection"),e[0]=i,e[1]=r):r=e[1];let f;e[2]!==r?(f=l.jsx("p",{className:"px-4 py-2 text-xs font-medium text-muted-foreground",children:r}),e[2]=r,e[3]=f):f=e[3];let a;if(e[4]!==n||e[5]!==s||e[6]!==o){let d;e[8]!==s||e[9]!==o?(d=c=>l.jsxs("button",{type:"button",onClick:()=>o(c),disabled:s,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:opacity-50",children:[l.jsx(xe,{url:c.avatarUrl?.trim()||void 0,fallback:l.jsx(ie,{provider:c.type,className:"text-muted-foreground"}),shape:"circle",size:"sm",className:"size-8",muted:!0}),l.jsxs("span",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:"block text-sm font-medium truncate",children:c.login}),l.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:c.host})]}),l.jsx(se,{size:16,className:"text-muted-foreground"})]},c.id),e[8]=s,e[9]=o,e[10]=d):d=e[10],a=n.map(d),e[4]=n,e[5]=s,e[6]=o,e[7]=a}else a=e[7];let u;return e[11]!==f||e[12]!==a?(u=l.jsxs("div",{className:"py-2",children:[f,a]}),e[11]=f,e[12]=a,e[13]=u):u=e[13],u}function it({open:t,onOpenChange:e,title:n,onPicked:o,onError:s}){const i=H(),r=we(),f=Le(),[a,u]=L.useState(null),[d,c]=L.useState(null),[h,p]=L.useState(null),y=Oe(r.data);function m(g){const j=g instanceof Error?g.message:i("common.repositoryPicker.linkFailed");p(j),s?.(j)}async function x(g){c(g.id),p(null);try{await o({repository:g})}catch(j){m(j)}finally{c(null)}}async function b(g,j){if(a){c(j),p(null);try{const N=await f.mutateAsync({url:g,accountId:a.id});await o({repository:N})}catch(N){m(N)}finally{c(null)}}}return l.jsx(fe,{open:t,onOpenChange:g=>{d===null&&(g||(u(null),p(null)),e(g))},children:l.jsxs(ue,{className:"sm:max-w-lg max-h-[85svh] p-0 gap-0 overflow-hidden flex flex-col",children:[l.jsxs(de,{className:"sr-only",children:[l.jsx(ae,{children:n}),l.jsx(ce,{children:i("common.repositoryPicker.description")})]}),l.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 pr-12 gap-3 shrink-0",children:[a?l.jsx(M,{size:"icon",variant:"ghost",className:"size-6 -ml-1",disabled:d!==null,onClick:()=>u(null),"aria-label":i("common.repositoryPicker.back"),children:l.jsx(ke,{size:16})}):l.jsx(Pe,{size:16,className:"text-muted-foreground shrink-0"}),a&&l.jsx(xe,{url:a.avatarUrl?.trim()||void 0,fallback:l.jsx(ie,{provider:a.type,className:"text-muted-foreground"}),shape:"circle",size:"sm",className:"size-6",muted:!0}),l.jsx("span",{className:"text-sm font-medium truncate",children:a?a.login:n})]}),r.isPending?l.jsx("div",{className:"p-4",children:l.jsx(te,{className:"h-24 w-full"})}):r.isError?l.jsx("p",{role:"alert",className:"p-4 text-sm text-destructive",children:r.error.message}):a?l.jsx(Ie,{account:a,onLink:(g,j)=>{b(g,j)},pendingPath:d},a.id):l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l.jsx(Ge,{onPick:x,pendingPath:d}),y.length>0&&l.jsx(Ke,{accounts:y,onSelect:u,disabled:d!==null}),l.jsxs("div",{className:"border-t border-border py-2",children:[l.jsx("p",{className:"px-4 py-2 text-xs text-muted-foreground leading-relaxed",children:i("common.repositoryPicker.description")}),l.jsx(ze,{layout:"picker",disabled:d!==null})]})]}),h&&l.jsx("p",{role:"alert",className:"px-4 pb-3 text-sm text-destructive",children:h})]})})}export{Z as G,it as R,Te as a,tt as b,st as c,we as d,ze as e,Ee as u};
|
|
1
|
+
import{c as P,j as l,G as z,a7 as D,K as R,m as ee,n as Y,e as V,r as L,b as H,l as J,b4 as te,t as ne,B as M,a4 as be,a1 as ye,a2 as je,h as re}from"./index-DR-7CxUP.js";import{i as se}from"./ChevronRight-DyhM_Luf.js";import{d as ae,h as ce,c as de,e as ve,b as ue,D as fe}from"./dialog-wNMMbzXr.js";import{I as le}from"./input-By-Luuj6.js";import{L as oe}from"./label-CHgW_ahI.js";import{G as me}from"./github-icon-CdMLfMj7.js";import{u as Ne}from"./useInfiniteQuery-7dgy4-tR.js";import{i as ke}from"./ArrowLeft-Beb7uT2a.js";import{i as Pe}from"./GitBranch01-rChCKXuD.js";import{A as xe}from"./avatar-_tvfLV9T.js";import{C as pe}from"./collection-search-DRdf_GYh.js";import{u as Ce}from"./use-debounced-value-KdzTma4G.js";function Z(t){const e=P.c(4),{size:n,className:o}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx("path",{d:"M23.6004 9.5927l-.0337-.0862L20.3.9814a.851.851 0 00-.3362-.405.8748.8748 0 00-.9997.0539.8748.8748 0 00-.29.4399l-2.2055 6.748H7.5375L5.3318 1.0702a.8573.8573 0 00-.29-.4412.8748.8748 0 00-.9997-.0537.8585.8585 0 00-.3361.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 002.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 001.2197 0l1.4995-1.1321 2.462-1.8633 5.0062-3.7489.0125-.01a6.0682 6.0682 0 002.0094-7.003z"}),e[0]=s):s=e[0];let i;return e[1]!==o||e[2]!==n?(i=l.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:o,children:s}),e[1]=o,e[2]=n,e[3]=i):i=e[3],i}const Se=5*6e4;function Te(){const t=P.c(7),{org:e}=z(),n=D();let o;t[0]!==e.id?(o=R.gitProviderCapabilities(e.id),t[0]=e.id,t[1]=o):o=t[1];let s;t[2]!==n?(s=()=>n.call("GIT_PROVIDER_CAPABILITIES",{}),t[2]=n,t[3]=s):s=t[3];let i;return t[4]!==o||t[5]!==s?(i={queryKey:o,staleTime:Se,queryFn:s},t[4]=o,t[5]=s,t[6]=i):i=t[6],ee(i)}function we(){const t=P.c(7),{org:e}=z(),n=D();let o;t[0]!==e.id?(o=R.gitAccounts(e.id),t[0]=e.id,t[1]=o):o=t[1];let s;t[2]!==n?(s=async()=>(await n.call("GIT_ACCOUNT_LIST",{})).accounts,t[2]=n,t[3]=s):s=t[3];let i;return t[4]!==o||t[5]!==s?(i={queryKey:o,staleTime:6e4,queryFn:s},t[4]=o,t[5]=s,t[6]=i):i=t[6],ee(i)}function Ee(t){const e=P.c(9),{org:n}=z(),o=D();let s;e[0]!==t||e[1]!==n.id?(s=R.repositories(n.id,t),e[0]=t,e[1]=n.id,e[2]=s):s=e[2];let i;e[3]!==t||e[4]!==o?(i=async()=>(await o.call("REPOSITORY_LIST",{})).repositories,e[3]=t,e[4]=o,e[5]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,staleTime:6e4,queryFn:i},e[6]=s,e[7]=i,e[8]=r):r=e[8],ee(r)}function _e(t,e){const n=P.c(12),{org:o}=z(),s=D();let i;n[0]!==t||n[1]!==o.id||n[2]!==e?(i=R.providerRepoSearch(o.id,t??"",e),n[0]=t,n[1]=o.id,n[2]=e,n[3]=i):i=n[3];const r=t!==null;let f;n[4]!==t||n[5]!==e||n[6]!==s?(f=async u=>{const{pageParam:d}=u;return t===null?{repositories:[],hasMore:!1}:await s.call("REPOSITORY_SEARCH",{accountId:t,page:d,perPage:100,...e?{query:e}:{}})},n[4]=t,n[5]=e,n[6]=s,n[7]=f):f=n[7];let a;return n[8]!==i||n[9]!==r||n[10]!==f?(a={queryKey:i,enabled:r,initialPageParam:1,getNextPageParam:Ae,staleTime:3e4,retry:!1,queryFn:f},n[8]=i,n[9]=r,n[10]=f,n[11]=a):a=n[11],Ne(a)}function Ae(t,e){return t.hasMore?e.length+1:void 0}function $e(){const t=P.c(8),{org:e}=z(),n=D(),o=Y();let s;t[0]!==n?(s=async f=>(await n.call("GIT_ACCOUNT_CONNECT_TOKEN",f)).account,t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>o.invalidateQueries({queryKey:R.gitAccounts(e.id)}),t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],V(r)}function tt(){const t=P.c(8),{org:e}=z(),n=D(),o=Y();let s;t[0]!==n?(s=f=>n.call("GIT_ACCOUNT_DELETE",{id:f}),t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>{o.invalidateQueries({queryKey:R.gitAccounts(e.id)}),o.invalidateQueries({queryKey:R.repositories(e.id)})},t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],V(r)}function Le(){const t=P.c(8),{org:e}=z(),n=D(),o=Y();let s;t[0]!==n?(s=async f=>(await n.call("REPOSITORY_LINK",f)).repository,t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>o.invalidateQueries({queryKey:R.repositories(e.id)}),t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],V(r)}function st(){const t=P.c(8),{org:e}=z(),n=D(),o=Y();let s;t[0]!==n?(s=f=>n.call("REPOSITORY_DELETE",{id:f}),t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>o.invalidateQueries({queryKey:R.repositories(e.id)}),t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],V(r)}function Re(t,e){return t instanceof Error?t.message:e}function ze(t){const e=P.c(9),{layout:n,disabled:o}=t,s=n===void 0?"buttons":n,i=o===void 0?!1:o,[r,f]=L.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>f(!0),e[0]=a):a=e[0];let u;e[1]!==i||e[2]!==s?(u=l.jsx(Fe,{layout:s,disabled:i,onTokenDialog:a}),e[1]=i,e[2]=s,e[3]=u):u=e[3];let d;e[4]!==r?(d=r&&l.jsx(De,{open:!0,onOpenChange:f}),e[4]=r,e[5]=d):d=e[5];let c;return e[6]!==u||e[7]!==d?(c=l.jsxs(l.Fragment,{children:[u,d]}),e[6]=u,e[7]=d,e[8]=c):c=e[8],c}function De(t){const e=P.c(76),{open:n,onOpenChange:o}=t,s=H(),i=$e(),[r,f]=L.useState("gitlab.com"),[a,u]=L.useState("");let d;e[0]!==i||e[1]!==r||e[2]!==o||e[3]!==s||e[4]!==a?(d=function(){!r.trim()||!a.trim()||i.mutate({type:"gitlab",host:r.trim(),token:a.trim()},{onSuccess:W=>{ne.success(s("settings.repositories.connected",{login:W.login})),u(""),o(!1)},onError:W=>ne.error(Re(W,s("settings.repositories.failed")))})},e[0]=i,e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=d):d=e[5];const c=d;let h;e[6]!==s?(h=s("settings.repositories.tokenDialogTitle"),e[6]=s,e[7]=h):h=e[7];let p;e[8]!==h?(p=l.jsx(ae,{children:h}),e[8]=h,e[9]=p):p=e[9];let y;e[10]!==s?(y=s("settings.repositories.tokenDialogDescription"),e[10]=s,e[11]=y):y=e[11];let m;e[12]!==y?(m=l.jsx(ce,{children:y}),e[12]=y,e[13]=m):m=e[13];let x;e[14]!==p||e[15]!==m?(x=l.jsxs(de,{children:[p,m]}),e[14]=p,e[15]=m,e[16]=x):x=e[16];let b;e[17]!==s?(b=s("settings.repositories.tokenHostLabel"),e[17]=s,e[18]=b):b=e[18];let g;e[19]!==b?(g=l.jsx(oe,{htmlFor:"gitlab-host",children:b}),e[19]=b,e[20]=g):g=e[20];let j;e[21]===Symbol.for("react.memo_cache_sentinel")?(j=B=>f(B.target.value),e[21]=j):j=e[21];let N;e[22]!==s?(N=s("settings.repositories.tokenHostPlaceholder"),e[22]=s,e[23]=N):N=e[23];let C;e[24]!==r||e[25]!==N?(C=l.jsx(le,{id:"gitlab-host",value:r,onChange:j,placeholder:N}),e[24]=r,e[25]=N,e[26]=C):C=e[26];let S;e[27]!==C||e[28]!==g?(S=l.jsxs("div",{className:"flex flex-col gap-1.5",children:[g,C]}),e[27]=C,e[28]=g,e[29]=S):S=e[29];let v;e[30]!==s?(v=s("settings.repositories.tokenLabel"),e[30]=s,e[31]=v):v=e[31];let T;e[32]!==v?(T=l.jsx(oe,{htmlFor:"gitlab-token",children:v}),e[32]=v,e[33]=T):T=e[33];let _;e[34]===Symbol.for("react.memo_cache_sentinel")?(_=B=>u(B.target.value),e[34]=_):_=e[34];let w;e[35]!==s?(w=s("settings.repositories.tokenPlaceholder"),e[35]=s,e[36]=w):w=e[36];let A;e[37]!==w||e[38]!==a?(A=l.jsx(le,{id:"gitlab-token",type:"password",value:a,onChange:_,placeholder:w,autoComplete:"off"}),e[37]=w,e[38]=a,e[39]=A):A=e[39];let E;e[40]!==T||e[41]!==A?(E=l.jsxs("div",{className:"flex flex-col gap-1.5",children:[T,A]}),e[40]=T,e[41]=A,e[42]=E):E=e[42];let $;e[43]!==S||e[44]!==E?($=l.jsxs("div",{className:"flex flex-col gap-3",children:[S,E]}),e[43]=S,e[44]=E,e[45]=$):$=e[45];let k;e[46]!==o?(k=()=>o(!1),e[46]=o,e[47]=k):k=e[47];const ge=i.isPending;let F;e[48]!==s?(F=s("settings.repositories.cancel"),e[48]=s,e[49]=F):F=e[49];let O;e[50]!==i.isPending||e[51]!==k||e[52]!==F?(O=l.jsx(M,{variant:"outline",onClick:k,disabled:ge,children:F}),e[50]=i.isPending,e[51]=k,e[52]=F,e[53]=O):O=e[53];let G;e[54]!==i.isPending||e[55]!==r||e[56]!==a?(G=!r.trim()||!a.trim()||i.isPending,e[54]=i.isPending,e[55]=r,e[56]=a,e[57]=G):G=e[57];let I;e[58]!==i.isPending||e[59]!==s?(I=i.isPending?s("settings.repositories.connecting"):s("settings.repositories.connect"),e[58]=i.isPending,e[59]=s,e[60]=I):I=e[60];let q;e[61]!==c||e[62]!==G||e[63]!==I?(q=l.jsx(M,{onClick:c,disabled:G,children:I}),e[61]=c,e[62]=G,e[63]=I,e[64]=q):q=e[64];let K;e[65]!==O||e[66]!==q?(K=l.jsxs(ve,{children:[O,q]}),e[65]=O,e[66]=q,e[67]=K):K=e[67];let Q;e[68]!==$||e[69]!==K||e[70]!==x?(Q=l.jsxs(ue,{className:"sm:max-w-md",children:[x,$,K]}),e[68]=$,e[69]=K,e[70]=x,e[71]=Q):Q=e[71];let U;return e[72]!==o||e[73]!==n||e[74]!==Q?(U=l.jsx(fe,{open:n,onOpenChange:o,children:Q}),e[72]=o,e[73]=n,e[74]=Q,e[75]=U):U=e[75],U}function X(t){const e=P.c(25),{layout:n,label:o,description:s,icon:i,href:r,onClick:f,disabled:a}=t;let u;e[0]!==s||e[1]!==a||e[2]!==i||e[3]!==o||e[4]!==n?(u=n==="picker"?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:i}),l.jsxs("span",{className:"flex-1 min-w-0 text-left",children:[l.jsx("span",{className:"block text-sm font-medium",children:o}),l.jsx("span",{className:"block text-xs font-normal text-muted-foreground whitespace-normal",children:s})]}),!a&&l.jsx("span",{className:"shrink-0 text-muted-foreground",children:l.jsx(se,{size:16})})]}):l.jsxs(l.Fragment,{children:[i,o]}),e[0]=s,e[1]=a,e[2]=i,e[3]=o,e[4]=n,e[5]=u):u=e[5];const d=u,c=n==="picker"?"ghost":"outline",h=n==="picker"&&"w-full h-auto justify-start gap-3 rounded-none px-4 py-3 hover:bg-accent";let p;e[6]!==h?(p=J(h),e[6]=h,e[7]=p):p=e[7];const y=!!r&&!a;let m;e[8]!==d||e[9]!==a||e[10]!==r?(m=r&&!a?l.jsx("a",{href:r,children:d}):d,e[8]=d,e[9]=a,e[10]=r,e[11]=m):m=e[11];let x;e[12]!==a||e[13]!==o||e[14]!==f||e[15]!==c||e[16]!==p||e[17]!==y||e[18]!==m?(x=l.jsx(M,{size:"sm",variant:c,className:p,"aria-label":o,disabled:a,asChild:y,onClick:f,children:m}),e[12]=a,e[13]=o,e[14]=f,e[15]=c,e[16]=p,e[17]=y,e[18]=m,e[19]=x):x=e[19];const b=x;let g;return e[20]!==b||e[21]!==s||e[22]!==a||e[23]!==n?(g=n==="buttons"&&a?l.jsxs(be,{children:[l.jsx(ye,{asChild:!0,children:l.jsx("span",{tabIndex:0,children:b})}),l.jsx(je,{children:s})]}):b,e[20]=b,e[21]=s,e[22]=a,e[23]=n,e[24]=g):g=e[24],g}function Fe(t){const e=P.c(42),{layout:n,disabled:o,onTokenDialog:s}=t,i=H(),r=Te(),{org:f}=z(),a=`/${f.slug}/settings/repositories`;let u;e[0]!==a?(u=k=>`${k}?returnTo=${encodeURIComponent(a)}`,e[0]=a,e[1]=u):u=e[1];const d=u;if(r.isError){let k;return e[2]!==r.error.message?(k=l.jsx("p",{role:"alert",className:"text-sm text-destructive",children:r.error.message}),e[2]=r.error.message,e[3]=k):k=e[3],k}const c=r.data?.github,h=r.data?.gitlab,p=c?.configured===!0,y=(h?.oauthHosts.length??0)>0;if(r.isPending){let k;return e[4]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(te,{className:"h-9 w-40"}),e[4]=k):k=e[4],k}const m=n==="picker"?"flex-col":"flex-wrap items-center gap-2";let x;e[5]!==m?(x=J("flex",m),e[5]=m,e[6]=x):x=e[6];let b;e[7]!==i?(b=i("settings.repositories.addGithubAccount"),e[7]=i,e[8]=b):b=e[8];const g=p?"settings.repositories.browseAccount":"settings.repositories.githubUnavailable";let j;e[9]!==i||e[10]!==g?(j=i(g),e[9]=i,e[10]=g,e[11]=j):j=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(me,{size:16}),e[12]=N):N=e[12];const C=c?.connectPath?d(c.connectPath):void 0,S=o||!p||!c?.connectPath;let v;e[13]!==n||e[14]!==b||e[15]!==j||e[16]!==C||e[17]!==S?(v=l.jsx(X,{layout:n,label:b,description:j,icon:N,href:C,disabled:S}),e[13]=n,e[14]=b,e[15]=j,e[16]=C,e[17]=S,e[18]=v):v=e[18];let T;e[19]!==d||e[20]!==o||e[21]!==h||e[22]!==y||e[23]!==n||e[24]!==i?(T=y&&h?.connectPath&&l.jsx(X,{layout:n,label:i("settings.repositories.connectGitlab"),description:i("settings.repositories.browseAccount"),icon:l.jsx(Z,{size:16}),href:d(h.connectPath),disabled:o}),e[19]=d,e[20]=o,e[21]=h,e[22]=y,e[23]=n,e[24]=i,e[25]=T):T=e[25];let _;e[26]!==i?(_=i("settings.repositories.connectGitlabToken"),e[26]=i,e[27]=_):_=e[27];let w;e[28]!==i?(w=i("settings.repositories.gitlabTokenHint"),e[28]=i,e[29]=w):w=e[29];let A;e[30]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx(Z,{size:16}),e[30]=A):A=e[30];let E;e[31]!==o||e[32]!==n||e[33]!==s||e[34]!==_||e[35]!==w?(E=l.jsx(X,{layout:n,label:_,description:w,icon:A,onClick:s,disabled:o}),e[31]=o,e[32]=n,e[33]=s,e[34]=_,e[35]=w,e[36]=E):E=e[36];let $;return e[37]!==v||e[38]!==T||e[39]!==E||e[40]!==x?($=l.jsxs("div",{className:x,children:[v,T,E]}),e[37]=v,e[38]=T,e[39]=E,e[40]=x,e[41]=$):$=e[41],$}function ie(t){const e=P.c(3),{provider:n,className:o}=t;let s;return e[0]!==o||e[1]!==n?(s=n==="gitlab"?l.jsx(Z,{size:16,className:o}):l.jsx(me,{size:16,className:o}),e[0]=o,e[1]=n,e[2]=s):s=e[2],s}function Oe(t){return(t??[]).filter(e=>e.status==="active"&&e.servable)}function he(t){const e=P.c(20),{provider:n,path:o,host:s,hint:i,disabled:r,busy:f,onSelect:a}=t,u=r&&"opacity-60 cursor-not-allowed";let d;e[0]!==u?(d=J("w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors focus-visible:outline-none focus-visible:bg-accent",u),e[0]=u,e[1]=d):d=e[1];let c;e[2]!==n?(c=l.jsx("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:l.jsx(ie,{provider:n,className:"text-muted-foreground"})}),e[2]=n,e[3]=c):c=e[3];let h;e[4]!==o?(h=l.jsx("span",{className:"block text-sm font-medium truncate",children:o}),e[4]=o,e[5]=h):h=e[5];const p=i?`${s} · ${i}`:s;let y;e[6]!==p?(y=l.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:p}),e[6]=p,e[7]=y):y=e[7];let m;e[8]!==h||e[9]!==y?(m=l.jsxs("span",{className:"flex-1 min-w-0",children:[h,y]}),e[8]=h,e[9]=y,e[10]=m):m=e[10];let x;e[11]!==f?(x=f?l.jsx(re,{className:"size-4 text-muted-foreground"}):l.jsx(se,{size:16,className:"shrink-0 text-muted-foreground"}),e[11]=f,e[12]=x):x=e[12];let b;return e[13]!==r||e[14]!==a||e[15]!==d||e[16]!==c||e[17]!==m||e[18]!==x?(b=l.jsxs("button",{type:"button",disabled:r,onClick:a,className:d,children:[c,m,x]}),e[13]=r,e[14]=a,e[15]=d,e[16]=c,e[17]=m,e[18]=x,e[19]=b):b=e[19],b}function Ge(t){const e=P.c(25),{onPick:n,pendingPath:o}=t,s=H(),i=Ee(),[r,f]=L.useState("");if(i.isPending){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(te,{className:"h-24 w-full"}),e[0]=d):d=e[0],d}if(i.isError){let d;return e[1]!==i.error.message?(d=l.jsx("p",{role:"alert",className:"p-4 text-sm text-destructive",children:i.error.message}),e[1]=i.error.message,e[2]=d):d=e[2],d}let a,u;if(e[3]!==n||e[4]!==o||e[5]!==r||e[6]!==i.data||e[7]!==s){u=Symbol.for("react.early_return_sentinel");e:{const d=i.data??[];if(d.length===0){u=null;break e}let c;e[10]!==r?(c=j=>j.path.toLowerCase().includes(r.trim().toLowerCase()),e[10]=r,e[11]=c):c=e[11];const h=d.filter(c);let p;e[12]!==s?(p=s("common.repositoryPicker.searchPlaceholder"),e[12]=s,e[13]=p):p=e[13];const y=o!==null;let m;e[14]!==r||e[15]!==p||e[16]!==y?(m=l.jsx(pe,{value:r,onChange:f,placeholder:p,disabled:y}),e[14]=r,e[15]=p,e[16]=y,e[17]=m):m=e[17];let x;e[18]!==s?(x=s("common.repositoryPicker.linkedSection"),e[18]=s,e[19]=x):x=e[19];let b;e[20]!==x?(b=l.jsx("p",{className:"px-4 pt-4 pb-2 text-xs font-medium text-muted-foreground",children:x}),e[20]=x,e[21]=b):b=e[21];let g;e[22]!==n||e[23]!==o?(g=j=>l.jsx(he,{provider:j.provider,path:j.path,host:j.host,hint:j.defaultBranch,disabled:o!==null,busy:o===j.id,onSelect:()=>n(j)},j.id),e[22]=n,e[23]=o,e[24]=g):g=e[24],a=l.jsxs("div",{className:"pb-2",children:[m,b,h.length===0&&l.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:s("common.repositoryPicker.searchEmpty")}),h.map(g)]})}e[3]=n,e[4]=o,e[5]=r,e[6]=i.data,e[7]=s,e[8]=a,e[9]=u}else a=e[8],u=e[9];return u!==Symbol.for("react.early_return_sentinel")?u:a}function Ie(t){const e=P.c(35),{account:n,onLink:o,pendingPath:s}=t,i=H(),[r,f]=L.useState(""),a=Ce(r,300),u=L.useDeferredValue(a),d=r!==u,c=_e(n.id,u);let h,p,y,m;if(e[0]!==d||e[1]!==o||e[2]!==s||e[3]!==r||e[4]!==c.data?.pages||e[5]!==c.error||e[6]!==c.hasNextPage||e[7]!==c.isError||e[8]!==c.isFetching||e[9]!==c.isPending||e[10]!==i){const j=c.data?.pages.flatMap(qe)??[];y="h-80 min-h-0 flex flex-col overflow-hidden";let N;e[15]!==i?(N=i("common.repositoryPicker.searchPlaceholder"),e[15]=i,e[16]=N):N=e[16];const C=d||c.isFetching;e[17]!==r||e[18]!==N||e[19]!==C?(m=l.jsx(pe,{placeholder:N,value:r,onChange:f,isSearching:C}),e[17]=r,e[18]=N,e[19]=C,e[20]=m):m=e[20];const S=d?"opacity-40":"opacity-100";e[21]!==S?(h=J("flex-1 overflow-y-auto transition-opacity duration-150",S),e[21]=S,e[22]=h):h=e[22],p=c.isPending?l.jsx("div",{className:"flex-1 flex items-center justify-center py-10",children:l.jsx(re,{className:"size-4.5 text-muted-foreground"})}):c.isError?l.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:c.error instanceof Error?c.error.message:i("common.repositoryPicker.searchFailed")}):j.length===0?l.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:i(c.hasNextPage?"common.repositoryPicker.searchMore":"common.repositoryPicker.searchEmpty")}):j.map(v=>l.jsx(he,{provider:v.ref.provider,path:v.ref.path,host:v.ref.host,hint:v.visibility,disabled:s!==null,busy:s===v.ref.path,onSelect:()=>o(v.webUrl,v.ref.path)},`${v.ref.host}/${v.ref.path}`)),e[0]=d,e[1]=o,e[2]=s,e[3]=r,e[4]=c.data?.pages,e[5]=c.error,e[6]=c.hasNextPage,e[7]=c.isError,e[8]=c.isFetching,e[9]=c.isPending,e[10]=i,e[11]=h,e[12]=p,e[13]=y,e[14]=m}else h=e[11],p=e[12],y=e[13],m=e[14];let x;e[23]!==s||e[24]!==c||e[25]!==i?(x=c.hasNextPage&&l.jsx(M,{variant:"ghost",className:"w-full",disabled:c.isFetchingNextPage||s!==null,onClick:()=>{c.fetchNextPage()},children:i("common.repositoryPicker.loadMore")}),e[23]=s,e[24]=c,e[25]=i,e[26]=x):x=e[26];let b;e[27]!==h||e[28]!==p||e[29]!==x?(b=l.jsxs("div",{className:h,children:[p,x]}),e[27]=h,e[28]=p,e[29]=x,e[30]=b):b=e[30];let g;return e[31]!==y||e[32]!==m||e[33]!==b?(g=l.jsxs("div",{className:y,children:[m,b]}),e[31]=y,e[32]=m,e[33]=b,e[34]=g):g=e[34],g}function qe(t){return t.repositories}function Ke(t){const e=P.c(14),{accounts:n,onSelect:o,disabled:s}=t,i=H();let r;e[0]!==i?(r=i("common.repositoryPicker.browseSection"),e[0]=i,e[1]=r):r=e[1];let f;e[2]!==r?(f=l.jsx("p",{className:"px-4 py-2 text-xs font-medium text-muted-foreground",children:r}),e[2]=r,e[3]=f):f=e[3];let a;if(e[4]!==n||e[5]!==s||e[6]!==o){let d;e[8]!==s||e[9]!==o?(d=c=>l.jsxs("button",{type:"button",onClick:()=>o(c),disabled:s,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:opacity-50",children:[l.jsx(xe,{url:c.avatarUrl?.trim()||void 0,fallback:l.jsx(ie,{provider:c.type,className:"text-muted-foreground"}),shape:"circle",size:"sm",className:"size-8",muted:!0}),l.jsxs("span",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:"block text-sm font-medium truncate",children:c.login}),l.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:c.host})]}),l.jsx(se,{size:16,className:"text-muted-foreground"})]},c.id),e[8]=s,e[9]=o,e[10]=d):d=e[10],a=n.map(d),e[4]=n,e[5]=s,e[6]=o,e[7]=a}else a=e[7];let u;return e[11]!==f||e[12]!==a?(u=l.jsxs("div",{className:"py-2",children:[f,a]}),e[11]=f,e[12]=a,e[13]=u):u=e[13],u}function it({open:t,onOpenChange:e,title:n,onPicked:o,onError:s}){const i=H(),r=we(),f=Le(),[a,u]=L.useState(null),[d,c]=L.useState(null),[h,p]=L.useState(null),y=Oe(r.data);function m(g){const j=g instanceof Error?g.message:i("common.repositoryPicker.linkFailed");p(j),s?.(j)}async function x(g){c(g.id),p(null);try{await o({repository:g})}catch(j){m(j)}finally{c(null)}}async function b(g,j){if(a){c(j),p(null);try{const N=await f.mutateAsync({url:g,accountId:a.id});await o({repository:N})}catch(N){m(N)}finally{c(null)}}}return l.jsx(fe,{open:t,onOpenChange:g=>{d===null&&(g||(u(null),p(null)),e(g))},children:l.jsxs(ue,{className:"sm:max-w-lg max-h-[85svh] p-0 gap-0 overflow-hidden flex flex-col",children:[l.jsxs(de,{className:"sr-only",children:[l.jsx(ae,{children:n}),l.jsx(ce,{children:i("common.repositoryPicker.description")})]}),l.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 pr-12 gap-3 shrink-0",children:[a?l.jsx(M,{size:"icon",variant:"ghost",className:"size-6 -ml-1",disabled:d!==null,onClick:()=>u(null),"aria-label":i("common.repositoryPicker.back"),children:l.jsx(ke,{size:16})}):l.jsx(Pe,{size:16,className:"text-muted-foreground shrink-0"}),a&&l.jsx(xe,{url:a.avatarUrl?.trim()||void 0,fallback:l.jsx(ie,{provider:a.type,className:"text-muted-foreground"}),shape:"circle",size:"sm",className:"size-6",muted:!0}),l.jsx("span",{className:"text-sm font-medium truncate",children:a?a.login:n})]}),r.isPending?l.jsx("div",{className:"p-4",children:l.jsx(te,{className:"h-24 w-full"})}):r.isError?l.jsx("p",{role:"alert",className:"p-4 text-sm text-destructive",children:r.error.message}):a?l.jsx(Ie,{account:a,onLink:(g,j)=>{b(g,j)},pendingPath:d},a.id):l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l.jsx(Ge,{onPick:x,pendingPath:d}),y.length>0&&l.jsx(Ke,{accounts:y,onSelect:u,disabled:d!==null}),l.jsxs("div",{className:"border-t border-border py-2",children:[l.jsx("p",{className:"px-4 py-2 text-xs text-muted-foreground leading-relaxed",children:i("common.repositoryPicker.description")}),l.jsx(ze,{layout:"picker",disabled:d!==null})]})]}),h&&l.jsx("p",{role:"alert",className:"px-4 pb-3 text-sm text-destructive",children:h})]})})}export{Z as G,it as R,Te as a,tt as b,st as c,we as d,ze as e,Ee as u};
|
package/dist/client/assets/{require-capability-q7uVdBbT.js → require-capability-ry4-n_XW.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,b8 as l,j as m}from"./index-
|
|
1
|
+
import{c as p,b8 as l,j as m}from"./index-DR-7CxUP.js";import{A as u}from"./access-gate-DD56oGJy.js";function f(c){const t=p.c(6),{capability:n,area:r,children:a}=c,{granted:i,loading:s,error:o}=l(n);let e;return t[0]!==r||t[1]!==a||t[2]!==o||t[3]!==i||t[4]!==s?(e=m.jsx(u,{granted:i,loading:s,error:o,area:r,children:a}),t[0]=r,t[1]=a,t[2]=o,t[3]=i,t[4]=s,t[5]=e):e=t[5],e}export{f as R};
|
package/dist/client/assets/{required-auth-layout-CR5eG3sF.js → required-auth-layout-C6sCfFoS.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,b as u,a as f,j as s,h as d,N as h}from"./index-
|
|
1
|
+
import{c as a,b as u,a as f,j as s,h as d,N as h}from"./index-DR-7CxUP.js";function x(){const i=a.c(1),e=window.location.pathname+window.location.search;let n;if(i[0]===Symbol.for("react.memo_cache_sentinel")){const c=e==="/login"||e.startsWith("/login?")?{}:{next:e};n=s.jsx(h,{to:"/login",search:c,replace:!0}),i[0]=n}else n=i[0];return n}function j(i){const e=a.c(7),{children:n}=i,o=u(),{data:c,isPending:m}=f.useSession();if(c){let t;return e[0]!==n?(t=s.jsx(s.Fragment,{children:n}),e[0]=n,e[1]=t):t=e[1],t}if(m){let t;e[2]!==o?(t=o("common.loading"),e[2]=o,e[3]=t):t=e[3];let l;return e[4]!==t?(l=s.jsx("div",{className:"flex min-h-dvh w-full items-center justify-center",children:s.jsx(d,{className:"size-5 text-muted-foreground",label:t})}),e[4]=t,e[5]=l):l=e[5],l}let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(x,{}),e[6]=r):r=e[6],r}export{j as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-
|
|
1
|
+
import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-DR-7CxUP.js";import{I as D}from"./input-By-Luuj6.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,b as j,j as n,dq as w,dp as h,t as S,dr as K}from"./index-
|
|
1
|
+
import{c as x,b as j,j as n,dq as w,dp as h,t as S,dr as K}from"./index-DR-7CxUP.js";import{S as C}from"./switch-B_09jY5-.js";import{e as R,a as A,i as $,d as z,f as D,c as M,b as k}from"./UserSquare-CpUQtm07.js";import{i as E}from"./GitBranch01-rChCKXuD.js";import{i as F,u as O,j as P}from"./use-organization-settings-Di523P_b.js";function H(){const e=x.c(13),t=j();let s;e[0]!==t?(s=t("settings.review.title"),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==t?(i=t("settings.review.description"),e[2]=t,e[3]=i):i=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(g,{flag:"reviewer_enabled",icon:n.jsx(R,{size:16}),titleKey:"settings.review.reviewerTitle",descriptionKey:"settings.review.reviewerDescription"}),e[4]=o):o=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(g,{flag:"cheap_reviewer_model",icon:n.jsx(A,{size:16}),titleKey:"settings.review.cheapReviewerModelTitle",descriptionKey:"settings.review.cheapReviewerModelDescription"}),e[5]=r):r=e[5];let d,l;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(g,{flag:"auto_merge",icon:n.jsx($,{size:16}),titleKey:"settings.review.autoMergeTitle",descriptionKey:"settings.review.autoMergeDescription"}),l=n.jsx(L,{}),e[6]=d,e[7]=l):(d=e[6],l=e[7]);let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(g,{flag:"delivery_lanes_enabled",icon:n.jsx(z,{size:16}),titleKey:"settings.review.deliveryLanesTitle",descriptionKey:"settings.review.deliveryLanesDescription"}),e[8]=f):f=e[8];let a;e[9]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs(w,{children:[o,r,d,l,f,n.jsx(g,{flag:"auto_assign_report_tasks_to_super_agent",icon:n.jsx(D,{size:16}),titleKey:"settings.review.autoAssignReportTasksTitle",descriptionKey:"settings.review.autoAssignReportTasksDescription"})]}),e[9]=a):a=e[9];let c;return e[10]!==s||e[11]!==i?(c=n.jsx(h,{title:s,description:i,children:a}),e[10]=s,e[11]=i,e[12]=c):c=e[12],c}function J(){const e=x.c(8),t=j();let s;e[0]!==t?(s=t("settings.agentTools.title"),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==t?(i=t("settings.agentTools.description"),e[2]=t,e[3]=i):i=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(w,{children:n.jsx(g,{flag:"coding_agent_org_mcps",icon:n.jsx(M,{size:16}),titleKey:"settings.agentTools.orgMcpsTitle",descriptionKey:"settings.agentTools.orgMcpsDescription"})}),e[4]=o):o=e[4];let r;return e[5]!==s||e[6]!==i?(r=n.jsx(h,{title:s,description:i,children:o}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function N(){const e=x.c(5),t=j();let s;e[0]!==t?(s=t("sidebar.agentsSection.codeAgents"),e[0]=t,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(w,{children:n.jsx(g,{flag:"coding_agents_claude_code",icon:n.jsx(k,{size:16}),titleKey:"settings.agentTools.codingAgentsClaudeCodeTitle",descriptionKey:"settings.agentTools.codingAgentsClaudeCodeDescription"})}),e[2]=i):i=e[2];let o;return e[3]!==s?(o=n.jsx(h,{title:s,children:i}),e[3]=s,e[4]=o):o=e[4],o}function L(){const e=x.c(3),t=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(E,{size:16}),e[0]=s):s=e[0];let i;return e[1]!==t?(i=n.jsx(g,{flag:"auto_resolve_conflicts",icon:s,titleKey:"settings.review.autoResolveConflictsTitle",descriptionKey:"settings.review.autoResolveConflictsDescription",enabled:t}),e[1]=t,e[2]=i):i=e[2],i}function g(e){const t=x.c(23),{flag:s,icon:i,titleKey:o,descriptionKey:r,enabled:d}=e,l=j(),f=O(s),a=d??f,c=P();let p;t[0]!==l||t[1]!==o?(p=l(o),t[0]=l,t[1]=o,t[2]=p):p=t[2];let m;t[3]!==r||t[4]!==l?(m=l(r),t[3]=r,t[4]=l,t[5]=m):m=t[5];const T=c.isPending;let _;t[6]!==l||t[7]!==o?(_=l(o),t[6]=l,t[7]=o,t[8]=_):_=t[8];let u;t[9]!==s||t[10]!==c||t[11]!==l?(u=b=>c.mutate(s,b,{onError:()=>S.error(l("settings.review.updateError"))}),t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12];let v;t[13]!==a||t[14]!==c.isPending||t[15]!==_||t[16]!==u?(v=n.jsx(C,{checked:a,disabled:T,"aria-label":_,onCheckedChange:u}),t[13]=a,t[14]=c.isPending,t[15]=_,t[16]=u,t[17]=v):v=t[17];let y;return t[18]!==i||t[19]!==p||t[20]!==m||t[21]!==v?(y=n.jsx(K,{icon:i,title:p,description:m,action:v}),t[18]=i,t[19]=p,t[20]=m,t[21]=v,t[22]=y):y=t[22],y}export{J as A,N as C,H as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ie,r as Q,G as Ge,K as de,m as Ve,j as s,l as Z,h as Oe,B as ae,c as X,ae as qe,af as we,ag as re,ak as Ze,ah as Je,n as ot,aq as Ct,ar as bt,e as nt,t as Ce,o as Ye,P as Ne,z as it,dp as We,dq as Xe,dr as et,C as jt,a3 as Me,a4 as De,a1 as Pe,a2 as ve,ap as tt,bZ as Mt,u as rt,dt as at,fg as Dt,E as Pt,d as vt}from"./index-fS0pDoNW.js";import{u as Lt}from"./use-organization-roles-7PFmB_rs.js";import{u as Ke}from"./use-org-auth-client-CShcDth4.js";import{g as ct,a as yt}from"./role-color-Dn2tXDDF.js";import{B as be}from"./badge-rtLQpibV.js";import{A as dt,a as mt,c as ut,d as ft,b as gt,f as Tt,g as _t,e as ht}from"./alert-dialog-DuVJ7GC7.js";import{c as wt,D as Gt,b as Ut,a as kt}from"./dropdown-menu-CC8IMYtS.js";import{i as Bt}from"./DotsVertical-Bk31Y8qH.js";import{s as Be}from"./Plus-CgVmxzR4.js";import{s as Vt}from"./Trash01-BevWobXU.js";import{C as Yt}from"./collection-table-wrapper-STLb6VjQ.js";import{E as st}from"./empty-state-DA8cnNqW.js";import{S as ze}from"./search-input-BN_fecvo.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as Fe}from"./integration-icon-BFx8Gs71.js";import{u as Kt}from"./use-infinite-scroll-p1RdGJsc.js";import{C as Qe}from"./checkbox-D0oTwa58.js";import{i as zt}from"./ArrowLeft-EySzpaMt.js";import{u as Ft}from"./useSuspenseInfiniteQuery-rXQ07VfR.js";import{u as Qt}from"./use-mcp-client-DtsRGdvB.js";import{S as $t}from"./constants-Daqiz8AS.js";import{C as Ht}from"./collection-search-UW0xDxmi.js";import{p as qt}from"./connection-CU1s53fy.js";import{a as xt}from"./use-members-NWhv5vIl.js";import{g as pt}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-DueV7Dd9.js";import{u as Jt,g as Wt}from"./use-ai-providers-DMdw1ZKm.js";import{A as Rt}from"./avatar-ncVfbaUx.js";import{S as je}from"./switch-C0tiHttS.js";import{t as Xt}from"./ChevronUp-DLLvYK07.js";import{i as es}from"./ChevronRight-Dk9nR_C7.js";import{A as ts}from"./access-gate-DQan09qj.js";import"./Check-CmgBwUGv.js";import"./table-D4dLAB1m.js";import"./ArrowUp-39D5k7I2.js";import"./SearchMd-Cjr4mqh9.js";import"./Tool02-KStnzngn.js";import"./agent-icon-BrQLA9dC.js";import"./AlertCircle-piOaFPQJ.js";import"./Tool01-DdmZi7j_.js";import"./ArrowRight-CN1prjjJ.js";import"./TrendUp01-NTK3Zf_M.js";import"./ZoomOut-DpAkOD8e.js";import"./Users03-CrZajyAo.js";import"./CheckCircle-CwJqWx0e.js";import"./ChevronSelectorVertical-X68ci9mX.js";import"./UserSquare-l4Q5fPEZ.js";import"./Copy01-DlxhdgMn.js";import"./CreditCard01-CGG5tsm6.js";import"./Download01-CxTJDArl.js";import"./Settings02-Dss_LnvC.js";import"./Eye-UEYlbIHb.js";import"./Share07-CgTNZ1dk.js";import"./GitBranch01-DRT2X7Dj.js";import"./Globe01-Z6BbST4r.js";import"./XClose-C-bbcgCJ.js";import"./HardDrive--vlQvWpi.js";import"./Image01-rCxXluf6.js";import"./Key01-By90Yq6k.js";import"./Link01-CUe3c6G0.js";import"./LinkExternal01-D2pSy7v4.js";import"./Monitor01-CY2DbFkD.js";import"./Sun-DAVD-A5B.js";import"./Package-Bb4KYw9O.js";import"./Palette-o-NEtwsW.js";import"./Play-DpmIDjD8.js";import"./Shield01-CNbrlPDI.js";import"./Stars01-Dno5l14o.js";import"./Upload01-By19QANP.js";import"./User01-CDRv3_oY.js";import"./Users01-sAr72jTU.js";import"./XCircle-BTj4-tdv.js";import"./Zap-D6-O3NZl.js";import"./infiniteQueryObserver-B62setNi.js";import"./auth-CRmM4ftp.js";import"./capability-load-error-BAq8tXOS.js";const $e="basic-usage",He=[{id:$e,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","REPOSITORY_SEARCH_BRANCHES","GIT_PROVIDER_CAPABILITIES","GIT_ACCOUNT_LIST","REPOSITORY_LIST","REPOSITORY_SEARCH","CHANGE_REQUEST_STATE","CHANGE_REQUEST_LAST_MERGED","CHANGE_REQUEST_LIST_OPEN","CHANGE_REQUEST_CHECK_LOG","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_AUTOMATION_LIST","TASK_BOARD_AUTOMATION_UPSERT","TASK_BOARD_AUTOMATION_DELETE","TASK_BOARD_PROMPT_LIST","TASK_BOARD_PROMPT_UPSERT","TASK_BOARD_PROMPT_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_PREVIEW_PROBE","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE","NOTIFICATION_LIST","NOTIFICATION_MARK_READ","NOTIFICATION_SUBSCRIPTION_SET","NOTIFICATION_SUBSCRIPTION_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_AUTOMATION_LIST","JIRA_AUTOMATION_UPSERT","JIRA_AUTOMATION_DELETE","JIRA_RUN_START"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...He.find(t=>t.id===$e)?.tools??[]];const ss=["agents:manage","connections:manage"];new Set(He.filter(t=>ss.includes(t.id)).flatMap(t=>t.tools));function ls(){const t=new Map;for(const e of He){if(e.id===$e)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function os(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ns(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}function is(t){const e=X.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:c,onSelect:u,onToggle:f}=t,d=r?"bg-accent/50":"hover:bg-muted/50";let T;e[0]!==d?(T=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=T):T=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Fe,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let g;e[5]!==l.title?(g=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=g):g=e[6];let _;e[7]!==u||e[8]!==a||e[9]!==g?(_=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:u,children:[a,g]}),e[7]=u,e[8]=a,e[9]=g,e[10]=_):_=e[10];let m;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==f||e[15]!==c?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(Qe,{checked:n,onCheckedChange:f,onClick:rs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=f,e[15]=c,e[16]=m):m=e[16];let h;return e[17]!==T||e[18]!==_||e[19]!==m?(h=s.jsxs("div",{className:T,children:[_,m]}),e[17]=T,e[18]=_,e[19]=m,e[20]=h):h=e[20],h}function rs(t){return t.stopPropagation()}function as(t){const e=X.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,c=`tool-${l}-${r.name}`,u=n?"text-foreground":"text-muted-foreground";let f;e[0]!==u?(f=Z("text-sm font-medium",u),e[0]=u,e[1]=f):f=e[1];let d;e[2]!==f||e[3]!==r.name?(d=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:f,children:r.name})}),e[2]=f,e[3]=r.name,e[4]=d):d=e[4];let T;e[5]!==r.description?(T=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=T):T=e[6];let a;e[7]!==d||e[8]!==T?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,T]}),e[7]=d,e[8]=T,e[9]=a):a=e[9];const g=`tool-${l}-${r.name}`;let _;e[10]!==n||e[11]!==o||e[12]!==g?(_=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Qe,{id:g,checked:n,onCheckedChange:o,onClick:cs})}),e[10]=n,e[11]=o,e[12]=g,e[13]=_):_=e[13];let m;return e[14]!==c||e[15]!==a||e[16]!==_?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,_]}),e[14]=c,e[15]=a,e[16]=_,e[17]=m):m=e[17],m}function cs(t){return t.stopPropagation()}function ds({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,c]=Q.useState(""),u=r!==void 0?r:o,f=Q.useDeferredValue(u),[d,T]=Q.useState("all"),[a,g]=Q.useState(!1),_=Q.useRef(new Set(Object.keys(t))),{org:m}=Ge(),h=Qt({connectionId:$t,orgId:m.id,orgSlug:m.slug}),O=100,R=f.trim(),p=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,C=!!l,A={...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:0,...C&&{include_virtual:!0}},M=JSON.stringify(A),{data:S,fetchNextPage:b,hasNextPage:D,isFetchingNextPage:I}=Ft({queryKey:de.collectionListInfinite(h,m.id,"","CONNECTIONS",M),queryFn:async({pageParam:E=0})=>(await h.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:E,...C&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(E,w)=>{if(E?.hasMore)return w.reduce((H,q)=>H+(q?.items?.length??0),0)},staleTime:3e4}),N=S?.pages.flatMap(E=>E?.items??[])??[],P=Kt(b,D??!1,I),i=l?N.filter(E=>E.connection_type!=="VIRTUAL"?!0:qt(E.connection_url)!==l):N,x=_.current,U=[...x.values()].map(E=>i.find(w=>w.id===E)).filter(E=>E!==void 0),G=i.filter(E=>!x.has(E.id)),Y=[...U,...G],v=E=>{const w=t[E];return w!==void 0&&w.length>0},K=Y.filter(E=>{if(d==="all")return!0;const w=v(E.id);return d==="selected"?w:d==="unselected"?!w:!0}),[L,z]=Q.useState(Y[0]?.id??null),V=L?Y.find(E=>E.id===L)??null:null,{data:k,isFetching:B}=Ve({queryKey:de.collectionItem(h,m.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await h.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),$=k?.tools??[],J=(E,w)=>t[E]?.includes(w)??!1,te=(E,w)=>{const H=t[E]??[],q=H.includes(w),se={...t};if(q){const le=H.filter(ne=>ne!==w);le.length===0?delete se[E]:se[E]=le}else se[E]=[...H,w];e(se)},oe=E=>{const w=E===L?$:[];if(!w.length)return;const H=t[E]??[],q=w.map(ne=>ne.name),se=H.length>0&&q.every(ne=>H.includes(ne)),le={...t};se?delete le[E]:(le[E]=q,z(E)),e(le)},F=E=>{z(E),g(!0)},W=()=>{g(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[r===void 0&&s.jsx(Ht,{value:o,onChange:c,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>T("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>T("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>T("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:K.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(u?"common.toolSetSelector.noConnectionsFound":d==="selected"?"common.toolSetSelector.noServersSelected":d==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[K.map(E=>{const w=L===E.id,H=w?$.length:0,q=t[E.id]?.length??0;return s.jsx(is,{connection:{...E,tools:w?$:E.tools},isSelected:w,hasToolsEnabled:v(E.id),activeToolsCount:q,totalToolsCount:H,onSelect:()=>F(E.id),onToggle:()=>oe(E.id)},E.id)}),s.jsx("div",{ref:P,className:"h-4"}),I&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(zt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Fe,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:$.map(E=>s.jsx(as,{connectionId:V.id,tool:E,isSelected:J(V.id,E.name),onToggle:()=>te(V.id,E.name)},E.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const ms=qe({role:qe({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Je(),staticPermissions:we(re()),toolSet:Ze(re(),we(re())),allowAllModels:Je(),modelSet:Ze(re(),we(re())),memberIds:we(re())});function lt(t,e,l,r){const n=s.jsx(je,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(ve,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function us(t){const e=X.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie();let T;e[0]!==u?(T=u.trim().toLowerCase(),e[0]=u,e[1]=T):T=e[1];const a=Q.useDeferredValue(T);let g;if(e[2]!==l||e[3]!==a||e[4]!==n||e[5]!==o||e[6]!==f||e[7]!==u||e[8]!==r||e[9]!==d){const _=ls(),m=(I,N)=>{if(!f){if(l&&N){const P=_.flatMap(Ts).flatMap(gs);n(!1),o(P.filter(i=>!I.tools.includes(i)));return}l||o(ns(I,r,!N))}};let h;e[11]!==a?(h=I=>{const{section:N,capabilities:P}=I;return{section:N,capabilities:P.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=h):h=e[12];const O=_.map(h).filter(fs);let R;e[13]!==d?(R=d("settings.orgRoleDetail.general"),e[13]=d,e[14]=R):R=e[14];let p;e[15]!==d?(p=d("settings.orgRoleDetail.allOrgPermissions"),e[15]=d,e[16]=p):p=e[16];let C;e[17]!==d?(C=d("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=d,e[18]=C):C=e[18];let A;e[19]!==l||e[20]!==n||e[21]!==o?(A=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=A):A=e[22];let M;e[23]!==l||e[24]!==f||e[25]!==d||e[26]!==A?(M=lt(d,l,f,A),e[23]=l,e[24]=f,e[25]=d,e[26]=A,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==f?(S=f?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=f,e[32]=S):S=e[32];let b;e[33]!==S||e[34]!==p||e[35]!==C||e[36]!==M?(b=s.jsx(Xe,{children:s.jsx(et,{title:p,description:C,action:M,onClick:S})}),e[33]=S,e[34]=p,e[35]=C,e[36]=M,e[37]=b):b=e[37];let D;e[38]!==b||e[39]!==R?(D=s.jsx(We,{title:R,children:b}),e[38]=b,e[39]=R,e[40]=D):D=e[40],g=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,O.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:d("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:u})}):O.map(I=>{const{section:N,capabilities:P}=I;return s.jsx(We,{title:N,children:s.jsx(Xe,{children:P.map(i=>{const x=os(i,r,l);return s.jsx(et,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(jt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:lt(d,x,f,()=>m(i,x)),onClick:f?void 0:()=>m(i,x)},i.id)})})},N)})]})}),e[2]=l,e[3]=a,e[4]=n,e[5]=o,e[6]=f,e[7]=u,e[8]=r,e[9]=d,e[10]=g}else g=e[10];return g}function fs(t){return t.capabilities.length>0}function gs(t){return t.tools}function Ts(t){return t.capabilities}const St={anthropic:"Anthropic",openrouter:"OpenRouter"},_s={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function hs(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function Es(t){return _s[t]??St[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const At=30;function xs(t){const e=X.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:c,allConnectionModelIds:u,selectedModels:f,allowAllModels:d,allConnectionModelsSelected:T,onToggleModel:a,onExitAllowAll:g,readOnly:_,defaultExpanded:m}=t,h=ie(),[O,R]=Q.useState(m),p=m||O,C=R,[A,M]=Q.useState(At);let S;e[0]!==T||e[1]!==d||e[2]!==f?(S=I=>d||T||f.includes("*")||f.includes(I),e[0]=T,e[1]=d,e[2]=f,e[3]=S):S=e[3];const b=S;let D;if(e[4]!==u||e[5]!==d||e[6]!==l||e[7]!==p||e[8]!==o||e[9]!==b||e[10]!==c||e[11]!==g||e[12]!==a||e[13]!==_||e[14]!==r||e[15]!==n||e[16]!==h||e[17]!==A){let I;e[19]!==b?(I=B=>b(B.id),e[19]=b,e[20]=I):I=e[20];const N=c.filter(I).length,P=c.slice(0,A),i=c.length>A;let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=()=>C(As),e[21]=x):x=e[21];const U=o??Et[r]??It;let G;e[22]!==n||e[23]!==U?(G=s.jsx(Fe,{icon:U,name:n,size:"sm"}),e[22]=n,e[23]=U,e[24]=G):G=e[24];let Y;e[25]!==n?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=Y):Y=e[26];let v;e[27]!==G||e[28]!==Y?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,Y]}),e[27]=G,e[28]=Y,e[29]=v):v=e[29];const K=h("settings.orgRoleDetail.enabledCount",{enabledCount:N,total:c.length});let L;e[30]!==K?(L=s.jsx(be,{variant:"secondary",className:"text-xs text-muted-foreground",children:K}),e[30]=K,e[31]=L):L=e[31];let z;e[32]!==p?(z=p?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=p,e[33]=z):z=e[33];let V;e[34]!==L||e[35]!==z?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[L,z]}),e[34]=L,e[35]=z,e[36]=V):V=e[36];let k;e[37]!==V||e[38]!==v?(k=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:x,children:[v,V]}),e[37]=V,e[38]=v,e[39]=k):k=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[k,p&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[P.map(B=>{const $=b(B.id),J=()=>{if(!_){if(d){g(l,u,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!_&&"hover:bg-muted/50 cursor-pointer"),onClick:J,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ss,children:_?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:$,disabled:!0,onCheckedChange:Rs})})}),s.jsx(ve,{children:s.jsx("p",{children:h("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:$,onCheckedChange:J})})]},B.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>M(ps),children:h("settings.orgRoleDetail.showMore",{remaining:c.length-A})})]})]}),e[4]=u,e[5]=d,e[6]=l,e[7]=p,e[8]=o,e[9]=b,e[10]=c,e[11]=g,e[12]=a,e[13]=_,e[14]=r,e[15]=n,e[16]=h,e[17]=A,e[18]=D}else D=e[18];return D}function ps(t){return t+At}function Rs(){}function Ss(t){return t.stopPropagation()}function As(t){return!t}function Ns(t){const e=X.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:u,searchQuery:f,readOnly:d}=t,T=Wt(l.id);let a,g,_,m,h;if(e[0]!==u||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==T||e[8]!==d||e[9]!==f||e[10]!==r){h=Symbol.for("react.early_return_sentinel");e:{let p;e[16]!==l.label?(p=x=>({...x,id:x.modelId,provider:l.label}),e[16]=l.label,e[17]=p):p=e[17];const C=T.filter(js).map(p),A=f.trim().toLowerCase(),M=A?C.filter(x=>x.title.toLowerCase().includes(A)||x.id.toLowerCase().includes(A)||x.provider?.toLowerCase().includes(A)):C;if(M.length===0){h=null;break e}const S=new Map;for(const x of M){const U=hs(x.id,l.providerId),G=S.get(U)??{models:[],logo:null};G.models.push({id:x.id,title:Is(x.title),logo:x.logo}),!G.logo&&x.logo&&(G.logo=x.logo),S.set(U,G)}const b=Array.from(S.entries()).map(bs).sort(Cs),D=b.length===1||A.length>0;_="flex flex-col gap-3";const I=Et[l.providerId]??It;let N;e[18]!==l.providerId||e[19]!==I?(N=s.jsx("img",{src:I,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=I,e[20]=N):N=e[20];const P=St[l.providerId]??l.providerId;let i;e[21]!==P?(i=s.jsx("h4",{className:"text-sm font-medium",children:P}),e[21]=P,e[22]=i):i=e[22],e[23]!==i||e[24]!==N?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[N,i]}),e[23]=i,e[24]=N,e[25]=m):m=e[25],a="flex flex-col gap-3",g=b.map(x=>s.jsx(xs,{connectionId:l.id,subProviderId:x.id,subProviderName:x.name,groupLogo:x.logo,models:x.models,allConnectionModelIds:C.map(Os),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:u,onToggleModel:o,onExitAllowAll:c,readOnly:d,defaultExpanded:D},x.id))}e[0]=u,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=T,e[8]=d,e[9]=f,e[10]=r,e[11]=a,e[12]=g,e[13]=_,e[14]=m,e[15]=h}else a=e[11],g=e[12],_=e[13],m=e[14],h=e[15];if(h!==Symbol.for("react.early_return_sentinel"))return h;let O;e[26]!==a||e[27]!==g?(O=s.jsx("div",{className:a,children:g}),e[26]=a,e[27]=g,e[28]=O):O=e[28];let R;return e[29]!==_||e[30]!==m||e[31]!==O?(R=s.jsxs("div",{className:_,children:[m,O]}),e[29]=_,e[30]=m,e[31]=O,e[32]=R):R=e[32],R}function Os(t){return t.id}function Cs(t,e){return t.name.localeCompare(e.name)}function bs(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function js(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie(),T=Q.useDeferredValue(u),a=Jt();let g;e[0]!==r||e[1]!==o?(g=(I,N)=>{const P=r[I]??[],i={...r};if(P.includes(N)){const x=P.filter(U=>U!==N);x.length===0?delete i[I]:i[I]=x}else i[I]=[...P,N];o(i)},e[0]=r,e[1]=o,e[2]=g):g=e[2];const _=g;let m;e[3]!==r||e[4]!==n||e[5]!==o?(m=(I,N,P)=>{n(!1),o({...r,[I]:N.filter(i=>i!==P)})},e[3]=r,e[4]=n,e[5]=o,e[6]=m):m=e[6];const h=m,O=!f&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==O?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",O),e[7]=O,e[8]=R):R=e[8];let p;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==f?(p=()=>{if(f)return;const I=!l;n(I),I&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=f,e[13]=p):p=e[13];let C;e[14]!==d?(C=d("settings.orgRoleDetail.allModels"),e[14]=d,e[15]=C):C=e[15];let A;e[16]!==C?(A=s.jsx("span",{className:"text-sm font-medium",children:C}),e[16]=C,e[17]=A):A=e[17];let M;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==f||e[22]!==d?(M=s.jsx("div",{onClick:Ps,children:f?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(ve,{children:s.jsx("p",{children:d("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:l,onCheckedChange:I=>{n(I),I&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=f,e[22]=d,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==p||e[26]!==A||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:p,children:[A,M]}),e[24]=R,e[25]=p,e[26]=A,e[27]=M,e[28]=S):S=e[28];let b;e[29]!==a||e[30]!==l||e[31]!==T||e[32]!==h||e[33]!==r||e[34]!==f||e[35]!==d||e[36]!==_?(b=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:d("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(I=>s.jsx(Q.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Oe,{className:"size-4"}),d("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ns,{connection:I,selectedModels:r[I.id]??[],allowAllModels:l,onToggleModel:_,onExitAllowAll:h,allConnectionModelsSelected:(r[I.id]??[]).includes("*"),searchQuery:T,readOnly:f})},I.id)),e[29]=a,e[30]=l,e[31]=T,e[32]=h,e[33]=r,e[34]=f,e[35]=d,e[36]=_,e[37]=b):b=e[37];let D;return e[38]!==S||e[39]!==b?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,b]}),e[38]=S,e[39]=b,e[40]=D):D=e[40],D}function Ds(){}function Ps(t){return t.stopPropagation()}function vs(t){const e=X.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,c=ie(),[u,f]=Q.useState(""),d=Q.useDeferredValue(u);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=[],e[0]=T):T=e[0];const[a,g]=Q.useState(T),{data:_}=xt();let m,h,O,R,p,C,A,M,S,b,D;if(e[1]!==_?.data?.members||e[2]!==d||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==u||e[8]!==n||e[9]!==c){const L=_?.data?.members??[];let z;e[21]!==d?(z=F=>{const W=d.toLowerCase();return F.user?.name?.toLowerCase().includes(W)||F.user?.email?.toLowerCase().includes(W)},e[21]=d,e[22]=z):z=e[22];const V=L.filter(z);let k;e[23]!==o||e[24]!==r||e[25]!==a?(k=()=>{o(a),g([]),r(!1)},e[23]=o,e[24]=r,e[25]=a,e[26]=k):k=e[26],O=k,h=dt,b=l,D=r,m=mt,M="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let $;e[29]!==B?($=s.jsx(ut,{children:B}),e[29]=B,e[30]=$):$=e[30];let J;e[31]!==c?(J=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=J):J=e[32];let te;e[33]!==J?(te=s.jsx(ft,{children:J}),e[33]=J,e[34]=te):te=e[34],e[35]!==$||e[36]!==te?(S=s.jsxs(gt,{className:"px-6 pt-6",children:[$,te]}),e[35]=$,e[36]=te,e[37]=S):S=e[37],C="flex flex-col h-80";let oe;e[38]!==c?(oe=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=oe):oe=e[39],e[40]!==u||e[41]!==oe?(A=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ze,{value:u,onChange:f,placeholder:oe,className:"w-full"})}),e[40]=u,e[41]=oe,e[42]=A):A=e[42],R="flex-1 overflow-auto",p=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(u?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const W=F.role!=="owner",E=n.includes(F.id),w=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!W||E?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Qe,{checked:w||E,onCheckedChange:()=>{!W||E||g(H=>H.includes(F.id)?H.filter(q=>q!==F.id):[...H,F.id])},disabled:!W||E}),s.jsx(Rt,{url:F.user?.image??void 0,fallback:pt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!W&&s.jsx(be,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),E&&W&&s.jsx(be,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=_?.data?.members,e[2]=d,e[3]=o,e[4]=r,e[5]=l,e[6]=a,e[7]=u,e[8]=n,e[9]=c,e[10]=m,e[11]=h,e[12]=O,e[13]=R,e[14]=p,e[15]=C,e[16]=A,e[17]=M,e[18]=S,e[19]=b,e[20]=D}else m=e[10],h=e[11],O=e[12],R=e[13],p=e[14],C=e[15],A=e[16],M=e[17],S=e[18],b=e[19],D=e[20];let I;e[43]!==R||e[44]!==p?(I=s.jsx("div",{className:R,children:p}),e[43]=R,e[44]=p,e[45]=I):I=e[45];let N;e[46]!==I||e[47]!==C||e[48]!==A?(N=s.jsxs("div",{className:C,children:[A,I]}),e[46]=I,e[47]=C,e[48]=A,e[49]=N):N=e[49];let P;e[50]!==c?(P=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=P):P=e[51];let i;e[52]!==P?(i=s.jsx(Tt,{children:P}),e[52]=P,e[53]=i):i=e[53];const x=a.length===0;let U;e[54]!==a.length||e[55]!==c?(U=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=U):U=e[56];let G;e[57]!==O||e[58]!==x||e[59]!==U?(G=s.jsx(_t,{onClick:O,disabled:x,children:U}),e[57]=O,e[58]=x,e[59]=U,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(ht,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let v;e[64]!==m||e[65]!==N||e[66]!==Y||e[67]!==M||e[68]!==S?(v=s.jsxs(m,{className:M,children:[S,N,Y]}),e[64]=m,e[65]=N,e[66]=Y,e[67]=M,e[68]=S,e[69]=v):v=e[69];let K;return e[70]!==h||e[71]!==v||e[72]!==b||e[73]!==D?(K=s.jsx(h,{open:b,onOpenChange:D,children:v}),e[70]=h,e[71]=v,e[72]=b,e[73]=D,e[74]=K):K=e[74],K}function Ls(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:u,onAddMemberDialogOpenChange:f}=t,d=n===void 0?!1:n,T=o===void 0?void 0:o,a=ie(),g=Q.useDeferredValue(c),{data:_}=xt();let m,h,O;if(e[0]!==_?.data?.members||e[1]!==g||e[2]!==l||e[3]!==r||e[4]!==d||e[5]!==T||e[6]!==c||e[7]!==a){const M=_?.data?.members??[];let S;e[11]!==l?(S=i=>l.includes(i.id),e[11]=l,e[12]=S):S=e[12];const b=M.filter(S);let D;e[13]!==g?(D=i=>{const x=g.toLowerCase();return i.user?.name?.toLowerCase().includes(x)||i.user?.email?.toLowerCase().includes(x)},e[13]=g,e[14]=D):D=e[14];const I=b.filter(D);let N;e[15]!==T||e[16]!==a?(N=T??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=T,e[16]=a,e[17]=N):N=e[17];const P=N;O="flex flex-col h-full",m="flex-1 overflow-auto",h=b.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):I.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:I.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Rt,{url:i.user?.image??void 0,fallback:pt(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),d?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(tt,{size:16})})})}),s.jsx(ve,{children:s.jsx("p",{children:P})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(x=>x!==i.id)),children:s.jsx(tt,{size:16})})]},i.id))}),e[0]=_?.data?.members,e[1]=g,e[2]=l,e[3]=r,e[4]=d,e[5]=T,e[6]=c,e[7]=a,e[8]=m,e[9]=h,e[10]=O}else m=e[8],h=e[9],O=e[10];let R;e[18]!==m||e[19]!==h?(R=s.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=R):R=e[20];let p;e[21]!==l||e[22]!==r?(p=M=>r([...l,...M]),e[21]=l,e[22]=r,e[23]=p):p=e[23];let C;e[24]!==u||e[25]!==l||e[26]!==f||e[27]!==p?(C=s.jsx(vs,{open:u,onOpenChange:f,selectedMemberIds:l,onAddMembers:p}),e[24]=u,e[25]=l,e[26]=f,e[27]=p,e[28]=C):C=e[28];let A;return e[29]!==O||e[30]!==R||e[31]!==C?(A=s.jsxs("div",{className:O,children:[R,C]}),e[29]=O,e[30]=R,e[31]=C,e[32]=A):A=e[32],A}function ys(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-6 text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx(Q.Suspense,{fallback:l,children:s.jsx(Ls,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const ws={owner:[],admin:[],user:[]};function Gs(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:ws[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),c=o?[]:n.filter(a=>a!=="*"),u={};for(const[a,g]of Object.entries(r))if(!(a==="self"||a==="models"))if(a==="*")for(const _ of l)u[_.id]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g;else{const _=l.find(m=>m.id===a);_&&(u[a]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g)}const f=r.models||[],d=f.length===0||f.includes("*:*"),T={};if(!d)for(const a of f){const g=a.indexOf(":");if(g===-1)continue;const _=a.slice(0,g),m=a.slice(g+1);T[_]||(T[_]=[]),T[_].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:u,allowAllModels:d,modelSet:T,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function ks(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const c=e.find(u=>u.id===r)?.tools?.map(u=>u.name)??[];l[r]=c.length>0&&c.every(u=>n.includes(u))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const c of o)r.push(`${n}:${c}`);r.length>0&&(l.models=r)}return l}function Bs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Vs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,c=ie();let u;e[0]!==o||e[1]!==c?(u=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=u):u=e[2];const f=u;if(l){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Be,{size:16}),e[3]=g):g=e[3];let _;e[4]!==c?(_=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=_):_=e[5];let m;e[6]!==_?(m=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[g,_]})})}),e[6]=_,e[7]=m):m=e[7];let h;e[8]!==f?(h=s.jsx(ve,{children:s.jsx("p",{children:f})}),e[8]=f,e[9]=h):h=e[9];let O;return e[10]!==m||e[11]!==h?(O=s.jsx(Me,{children:s.jsxs(De,{children:[m,h]})}),e[10]=m,e[11]=h,e[12]=O):O=e[12],O}let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:16}),e[13]=d):d=e[13];let T;e[14]!==c?(T=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=T):T=e[15];let a;return e[16]!==n||e[17]!==T?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[d,T]}),e[16]=n,e[17]=T,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Ge(),r=Ke(),n=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==r?(c=()=>r.organization.listMembers(),e[2]=r,e[3]=c):c=e[3];let u;e[4]!==o||e[5]!==c?(u={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=u):u=e[6];const{data:f,isPending:d}=Ve(u);if(d||!n){let _;return e[7]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}),e[7]=_):_=e[7],_}let T;e[8]!==f?.data?.members?(T=f?.data?.members??[],e[8]=f?.data?.members,e[9]=T):T=e[9];const a=T;let g;return e[10]!==n||e[11]!==a||e[12]!==t?(g=s.jsx(Ks,{...t,members:a,connections:n}),e[10]=n,e[11]=a,e[12]=t,e[13]=g):g=e[13],g}function Ks({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:c}=Ge(),u=Ke(),f=ot(),d=t.kind==="builtin",T=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[g,_]=Q.useState(d?"org":"mcp"),m=Ct({resolver:bt(ms),defaultValues:Bs(t,r,n)}),h=m.formState.isValid,O=m.formState.isDirty,R=nt({mutationFn:async i=>{const x=ks(i,n),U=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),G=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(v,K)=>{const L=r.filter(k=>k.role===(K??v)).map(k=>k.id),z=i.memberIds.filter(k=>!L.includes(k)),V=L.filter(k=>!i.memberIds.includes(k));for(const k of z){const B=await u.organization.updateMemberRole({memberId:k,role:[v]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const k of V){const B=await u.organization.updateMemberRole({memberId:k,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(i.role.slug),i;if(i.role.id){const v=i.role.label.toLowerCase().replace(/\s+/g,"-"),K=i.role.slug,L=v!==K,z=await u.organization.updateRole({roleId:i.role.id,data:{permission:x,...L?{roleName:v}:{}}});if(z?.error)throw new Error(z.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(L?v:K,L?K:void 0),L?{...i,role:{...i.role,slug:v}}:i}else{const v=await u.organization.createRole({role:U,permission:x});if(v?.error)throw new Error(v.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const K of i.memberIds){const L=await u.organization.updateMemberRole({memberId:K,role:[U]});if(L?.error)throw new Error(L.error.message)}return{...i,role:{...i.role,id:v.data?.roleData?.id,slug:U}}}},onSuccess:(i,x)=>{f.invalidateQueries({queryKey:de.members(c)}),f.invalidateQueries({queryKey:de.organizationRoles(c)});const U=!x.role.id&&!x.role.slug,G=x.role.slug==="owner"&&!x.role.id;Ye(G?"role_members_updated":U?"role_created":"role_updated",{role_slug:x.role.slug??null}),Ce.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":U?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),m.reset(i),l(i.role.id)},onError:i=>{Ce.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),p=m.handleSubmit(i=>{if(!i.role.label.trim()){Ce.error(o("settings.orgRoleDetail.roleNameIsRequired")),m.setFocus("role.label");return}R.mutate(i)}),C=!T,A=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...T?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,b]=Q.useState(""),[D,I]=Q.useState(!1),N=i=>{_(i),b("")},P={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ne,{children:s.jsxs(Ne.Content,{className:Z("flex flex-col",g!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ne.Title,{actions:C&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:p,disabled:R.isPending||!h||!O,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?ct(t.role,!0):yt(m.watch("role.label")))}),T&&s.jsx(it,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...m.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:A})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(i=>s.jsx("button",{type:"button",onClick:()=>N(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",g===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ze,{value:S,onChange:b,placeholder:P[g]??"Search...",className:"w-full md:w-[375px]"}),g==="members"&&s.jsx(Vs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>I(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",g!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(g!=="org"&&"h-full overflow-hidden",g!=="models"&&g!=="org"&&"border border-border rounded-xl bg-card"),children:[g==="mcp"&&!T&&s.jsx(ds,{toolSet:m.watch("toolSet"),onToolSetChange:i=>m.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:S}),g==="org"&&s.jsx(us,{allowAllStaticPermissions:m.watch("allowAllStaticPermissions"),staticPermissions:m.watch("staticPermissions"),onAllowAllChange:i=>m.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>m.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="models"&&s.jsx(Ms,{allowAllModels:m.watch("allowAllModels"),modelSet:m.watch("modelSet"),onAllowAllChange:i=>m.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>m.setValue("modelSet",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="members"&&s.jsx(ys,{memberIds:m.watch("memberIds"),onMemberIdsChange:i=>m.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:D,onAddMemberDialogOpenChange:I})]})})]})})}function zs(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Fs(t){const e=X.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:c}=Mt();let u;return e[0]!==l||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o?(u=s.jsx(ts,{granted:n,loading:o,error:c,area:l,children:r}),e[0]=l,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function $s(){const t=X.c(128),e=ie(),[l,r]=Q.useState(""),[n,o]=Q.useState(null),c=vt();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[0]=u):u=t[0];const{role:f}=rt(u),{locator:d}=Ge(),T=Ke(),a=ot(),{customRoles:g,refetch:_}=Lt();let m;t[1]!==c?(m=j=>c({to:".",search:y=>({...y,role:j})}),t[1]=c,t[2]=m):m=t[2];const h=m;let O;e:{if(!f){O=null;break e}if(f==="new"){O={kind:"new"};break e}if(f.startsWith("builtin-")){O={kind:"builtin",role:f.slice(8)};break e}let j;t[3]!==f?(j=ee=>ee.id===f,t[3]=f,t[4]=j):j=t[4];const y=g.find(j);O=y?{kind:"custom",role:y}:null}const R=O;let p;t[5]!==d?(p=de.members(d),t[5]=d,t[6]=p):p=t[6];let C;t[7]!==T?(C=()=>T.organization.listMembers(),t[7]=T,t[8]=C):C=t[8];let A;t[9]!==p||t[10]!==C?(A={queryKey:p,queryFn:C},t[9]=p,t[10]=C,t[11]=A):A=t[11];const{data:M}=Ve(A);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const b=S;let D;t[14]!==b?(D=j=>b.filter(y=>y.role===j).length,t[14]=b,t[15]=D):D=t[15];const I=D;let N;if(t[16]!==g||t[17]!==I||t[18]!==l||t[19]!==e){let j;t[21]!==I||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:I(ce.role),label:e(ce.labelKey)}}),t[21]=I,t[22]=e,t[23]=j):j=t[23];const y=Qs.map(j);let ee;t[24]!==I?(ee=ce=>({kind:"custom",role:{...ce,memberCount:I(ce.role)}}),t[24]=I,t[25]=ee):ee=t[25];const Nt=g.map(ee);if(N=[...y,...Nt],l){const ce=l.toLowerCase();N=N.filter(Ot=>Ot.role.label.toLowerCase().includes(ce))}t[16]=g,t[17]=I,t[18]=l,t[19]=e,t[20]=N}else N=t[20];let P;t[26]!==T?(P=async j=>{const y=await T.organization.deleteRole({roleId:j});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=T,t[27]=P):P=t[27];const i=nt({mutationFn:P,onSuccess:(j,y)=>{Ye("role_deleted",{role_id:y}),a.invalidateQueries({queryKey:de.members(d)}),a.invalidateQueries({queryKey:de.organizationRoles(d)}),Ce.success(e("settings.roles.deletedSuccessfully")),_(),R?.kind==="custom"&&R.role.id===y&&h(void 0)},onError:Ws});let x;t[28]!==e?(x=e("settings.roles.columnRole"),t[28]=e,t[29]=x):x=t[29];let U;t[30]!==x?(U={id:"role",header:x,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=x,t[31]=U):U=t[31];let G;t[32]!==e?(G=e("settings.roles.columnType"),t[32]=e,t[33]=G):G=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(be,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(be,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let v;t[36]!==G||t[37]!==Y?(v={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=v):v=t[38];let K;t[39]!==e?(K=e("settings.roles.columnPermissions"),t[39]=e,t[40]=K):K=t[40];let L;t[41]!==e?(L=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const y=j.role,ee=[];return y.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):y.staticPermissionCount&&y.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:y.staticPermissionCount})),y.allowsAllConnections?ee.push(e("settings.roles.allConnections")):y.connectionCount&&y.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:y.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=L):L=t[42];let z;t[43]!==K||t[44]!==L?(z={id:"permissions",header:K,render:L,cellClassName:"flex-1 min-w-0"},t[43]=K,t[44]=L,t[45]=z):z=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let k;t[48]!==V?(k={id:"members",header:V,render:Zs,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=k):k=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(wt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(Ut,{align:"end",onClick:Hs,children:s.jsxs(kt,{variant:"destructive",onClick:()=>{const y=j.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let $;t[52]!==U||t[53]!==v||t[54]!==z||t[55]!==k||t[56]!==B?($=[U,v,z,k,B],t[52]=U,t[53]=v,t[54]=z,t[55]=k,t[56]=B,t[57]=$):$=t[57];const J=$;let te;t[58]!==h?(te=j=>{if(j.kind==="builtin")h(`builtin-${j.role.role}`);else{const y=j.role;h(y.id)}},t[58]=h,t[59]=te):te=t[59];const oe=te;if(R){let j;t[60]!==h?(j=()=>h(void 0),t[60]=h,t[61]=j):j=t[61];let y;return t[62]!==_||t[63]!==h?(y=()=>{_(),h(void 0)},t[62]=_,t[63]=h,t[64]=y):y=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:y},zs(R))}let F;t[65]!==e?(F=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=F):F=t[66];let W;t[67]===Symbol.for("react.memo_cache_sentinel")?(W=j=>{j.key==="Escape"&&(r(""),j.target.blur())},t[67]=W):W=t[67];let E;t[68]!==l||t[69]!==F?(E=s.jsx(ze,{value:l,onChange:r,placeholder:F,className:"w-full md:w-[375px]",onKeyDown:W}),t[68]=l,t[69]=F,t[70]=E):E=t[70];let w;t[71]!==h?(w=()=>h("new"),t[71]=h,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Be,{size:16}),t[73]=H):H=t[73];let q;t[74]!==e?(q=e("settings.roles.createRole"),t[74]=e,t[75]=q):q=t[75];let se;t[76]!==w||t[77]!==q?(se=s.jsxs(ae,{onClick:w,children:[H,q]}),t[76]=w,t[77]=q,t[78]=se):se=t[78];let le;t[79]!==E||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,se]}),t[79]=E,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(st,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(st,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let me;t[85]!==N||t[86]!==J||t[87]!==oe||t[88]!==ne?(me=s.jsx(Yt,{columns:J,data:N,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=N,t[86]=J,t[87]=oe,t[88]=ne,t[89]=me):me=t[89];const Ue=n!==null;let Le;t[90]===Symbol.for("react.memo_cache_sentinel")?(Le=j=>!j&&o(null),t[90]=Le):Le=t[90];let ue;t[91]!==e?(ue=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=ue):ue=t[92];let fe;t[93]!==ue?(fe=s.jsx(ut,{children:ue}),t[93]=ue,t[94]=fe):fe=t[94];const ke=n?.label??"";let ge;t[95]!==e||t[96]!==ke?(ge=e("settings.roles.deleteRoleConfirm",{role:ke}),t[95]=e,t[96]=ke,t[97]=ge):ge=t[97];let Te;t[98]!==ge?(Te=s.jsx(ft,{children:ge}),t[98]=ge,t[99]=Te):Te=t[99];let _e;t[100]!==fe||t[101]!==Te?(_e=s.jsxs(gt,{children:[fe,Te]}),t[100]=fe,t[101]=Te,t[102]=_e):_e=t[102];let he;t[103]!==e?(he=e("settings.roles.cancel"),t[103]=e,t[104]=he):he=t[104];let Ee;t[105]!==he?(Ee=s.jsx(Tt,{children:he}),t[105]=he,t[106]=Ee):Ee=t[106];let Ie;t[107]!==i||t[108]!==n?(Ie=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ie):Ie=t[109];let xe;t[110]!==e?(xe=e("settings.roles.delete"),t[110]=e,t[111]=xe):xe=t[111];let pe;t[112]!==Ie||t[113]!==xe?(pe=s.jsx(_t,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:xe}),t[112]=Ie,t[113]=xe,t[114]=pe):pe=t[114];let Re;t[115]!==Ee||t[116]!==pe?(Re=s.jsxs(ht,{children:[Ee,pe]}),t[115]=Ee,t[116]=pe,t[117]=Re):Re=t[117];let Se;t[118]!==_e||t[119]!==Re?(Se=s.jsxs(mt,{children:[_e,Re]}),t[118]=_e,t[119]=Re,t[120]=Se):Se=t[120];let Ae;t[121]!==Ue||t[122]!==Se?(Ae=s.jsx(dt,{open:Ue,onOpenChange:Le,children:Se}),t[121]=Ue,t[122]=Se,t[123]=Ae):Ae=t[123];let ye;return t[124]!==le||t[125]!==me||t[126]!==Ae?(ye=s.jsxs(at,{group:"members",className:"gap-6",children:[le,me,Ae]}),t[124]=le,t[125]=me,t[126]=Ae,t[127]=ye):ye=t[127],ye}function Hs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Zs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",ct(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(it,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ws(t,e){Ye("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),Ce.error(t instanceof Error?t.message:"Failed to delete role")}function Xs(){const t=X.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=rt(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let c;t[5]!==r?(c=r?s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}):s.jsx(at,{group:"members",className:"gap-6",children:s.jsx(Dt,{})}),t[5]=r,t[6]=c):c=t[6];let u;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($s,{}),t[7]=u):u=t[7];let f;t[8]!==c?(f=s.jsx(Q.Suspense,{fallback:c,children:u}),t[8]=c,t[9]=f):f=t[9];let d;return t[10]!==o||t[11]!==f?(d=s.jsx(Pt,{fallback:o,children:f}),t[10]=o,t[11]=f,t[12]=d):d=t[12],d}function So(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{area:"roles",children:s.jsx(Xs,{})}),t[0]=e):e=t[0],e}export{So as default};
|
|
1
|
+
import{b as ie,r as Q,G as Ge,K as de,m as Ve,j as s,l as Z,h as Oe,B as ae,c as X,ae as qe,af as we,ag as re,ak as Ze,ah as Je,n as ot,aq as Ct,ar as bt,e as nt,t as Ce,o as Ye,P as Ne,z as it,dp as We,dq as Xe,dr as et,C as jt,a3 as Me,a4 as De,a1 as Pe,a2 as ve,ap as tt,bZ as Mt,u as rt,dt as at,fg as Dt,E as Pt,d as vt}from"./index-DR-7CxUP.js";import{u as Lt}from"./use-organization-roles-W-c6xLKD.js";import{u as Ke}from"./use-org-auth-client-5eX91FAP.js";import{g as ct,a as yt}from"./role-color-Dn2tXDDF.js";import{B as be}from"./badge-5xoC1FJQ.js";import{A as dt,a as mt,c as ut,d as ft,b as gt,f as Tt,g as _t,e as ht}from"./alert-dialog-BxdFiiIi.js";import{c as wt,D as Gt,b as Ut,a as kt}from"./dropdown-menu-BvPxOnm0.js";import{i as Bt}from"./DotsVertical-CXA4FBF-.js";import{s as Be}from"./Plus-BZSUkwsF.js";import{s as Vt}from"./Trash01-DCX9ydiU.js";import{C as Yt}from"./collection-table-wrapper-CnvktR4-.js";import{E as st}from"./empty-state-C-SubUW6.js";import{S as ze}from"./search-input-jf5-JJb9.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as Fe}from"./integration-icon-CpzKJe80.js";import{u as Kt}from"./use-infinite-scroll-CqmvxgxE.js";import{C as Qe}from"./checkbox-DdiWS6j9.js";import{i as zt}from"./ArrowLeft-Beb7uT2a.js";import{u as Ft}from"./useSuspenseInfiniteQuery-DBrABtQo.js";import{u as Qt}from"./use-mcp-client-Cjw7oL0k.js";import{S as $t}from"./constants-Daqiz8AS.js";import{C as Ht}from"./collection-search-DRdf_GYh.js";import{p as qt}from"./connection-C75DYl44.js";import{a as xt}from"./use-members-DhvUWOTO.js";import{g as pt}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-BM1ySErK.js";import{u as Jt,g as Wt}from"./use-ai-providers-CsfPjUM-.js";import{A as Rt}from"./avatar-_tvfLV9T.js";import{S as je}from"./switch-B_09jY5-.js";import{t as Xt}from"./ChevronUp-CGseLBwf.js";import{i as es}from"./ChevronRight-DyhM_Luf.js";import{A as ts}from"./access-gate-DD56oGJy.js";import"./Check-Bqh0edDs.js";import"./table-C9B_yGws.js";import"./ArrowUp-_u4Yru0Q.js";import"./SearchMd-CC2qYhKq.js";import"./Tool02-_HC8oqfU.js";import"./agent-icon-B7AXGQ6P.js";import"./AlertCircle-D5wzOxIg.js";import"./Tool01-CgvePMtM.js";import"./ArrowRight-Du9XgC-I.js";import"./TrendUp01-DhL5-hJo.js";import"./ZoomOut-DiztYlpQ.js";import"./Users03-BZkJWCNu.js";import"./CheckCircle-P3KELI_n.js";import"./ChevronSelectorVertical-S2WVRFJv.js";import"./UserSquare-CpUQtm07.js";import"./Copy01-CQ5n9k6R.js";import"./CreditCard01-DQ2UyAUW.js";import"./Download01-EHABWuSq.js";import"./Settings02-3O7I-4oK.js";import"./Eye-4ikW46Xl.js";import"./Share07-B043tEsF.js";import"./GitBranch01-rChCKXuD.js";import"./Globe01-DQGNcxVn.js";import"./XClose-C2dpX0F_.js";import"./HardDrive-CALvWP4_.js";import"./Image01-BrxwhCeX.js";import"./Key01-D_IxGQOL.js";import"./Link01-DvvkHs6T.js";import"./LinkExternal01-B4pNNDj3.js";import"./Monitor01-Cb0G367h.js";import"./Sun-BUQJT4KF.js";import"./Package-Bfk8OrRH.js";import"./Palette-B6tq__pc.js";import"./Play-BKI4FgKL.js";import"./Shield01-DSyesTES.js";import"./Stars01-D0DXnyE9.js";import"./Upload01-CNkQbAmi.js";import"./User01-cnJUdVWa.js";import"./Users01-CPNdhBFx.js";import"./XCircle-4con0UUu.js";import"./Zap-Bsbv5icR.js";import"./infiniteQueryObserver-DMi6D2_K.js";import"./auth-BTVKfAUC.js";import"./capability-load-error-QfuL86LE.js";const $e="basic-usage",He=[{id:$e,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","REPOSITORY_SEARCH_BRANCHES","GIT_PROVIDER_CAPABILITIES","GIT_ACCOUNT_LIST","REPOSITORY_LIST","REPOSITORY_SEARCH","CHANGE_REQUEST_STATE","CHANGE_REQUEST_LAST_MERGED","CHANGE_REQUEST_LIST_OPEN","CHANGE_REQUEST_CHECK_LOG","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_AUTOMATION_LIST","TASK_BOARD_AUTOMATION_UPSERT","TASK_BOARD_AUTOMATION_DELETE","TASK_BOARD_PROMPT_LIST","TASK_BOARD_PROMPT_UPSERT","TASK_BOARD_PROMPT_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_PREVIEW_PROBE","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE","NOTIFICATION_LIST","NOTIFICATION_MARK_READ","NOTIFICATION_SUBSCRIPTION_SET","NOTIFICATION_SUBSCRIPTION_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_AUTOMATION_LIST","JIRA_AUTOMATION_UPSERT","JIRA_AUTOMATION_DELETE","JIRA_RUN_START"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...He.find(t=>t.id===$e)?.tools??[]];const ss=["agents:manage","connections:manage"];new Set(He.filter(t=>ss.includes(t.id)).flatMap(t=>t.tools));function ls(){const t=new Map;for(const e of He){if(e.id===$e)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function os(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ns(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}function is(t){const e=X.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:c,onSelect:u,onToggle:f}=t,d=r?"bg-accent/50":"hover:bg-muted/50";let T;e[0]!==d?(T=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=T):T=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Fe,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let g;e[5]!==l.title?(g=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=g):g=e[6];let _;e[7]!==u||e[8]!==a||e[9]!==g?(_=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:u,children:[a,g]}),e[7]=u,e[8]=a,e[9]=g,e[10]=_):_=e[10];let m;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==f||e[15]!==c?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(Qe,{checked:n,onCheckedChange:f,onClick:rs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=f,e[15]=c,e[16]=m):m=e[16];let h;return e[17]!==T||e[18]!==_||e[19]!==m?(h=s.jsxs("div",{className:T,children:[_,m]}),e[17]=T,e[18]=_,e[19]=m,e[20]=h):h=e[20],h}function rs(t){return t.stopPropagation()}function as(t){const e=X.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,c=`tool-${l}-${r.name}`,u=n?"text-foreground":"text-muted-foreground";let f;e[0]!==u?(f=Z("text-sm font-medium",u),e[0]=u,e[1]=f):f=e[1];let d;e[2]!==f||e[3]!==r.name?(d=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:f,children:r.name})}),e[2]=f,e[3]=r.name,e[4]=d):d=e[4];let T;e[5]!==r.description?(T=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=T):T=e[6];let a;e[7]!==d||e[8]!==T?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,T]}),e[7]=d,e[8]=T,e[9]=a):a=e[9];const g=`tool-${l}-${r.name}`;let _;e[10]!==n||e[11]!==o||e[12]!==g?(_=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Qe,{id:g,checked:n,onCheckedChange:o,onClick:cs})}),e[10]=n,e[11]=o,e[12]=g,e[13]=_):_=e[13];let m;return e[14]!==c||e[15]!==a||e[16]!==_?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,_]}),e[14]=c,e[15]=a,e[16]=_,e[17]=m):m=e[17],m}function cs(t){return t.stopPropagation()}function ds({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,c]=Q.useState(""),u=r!==void 0?r:o,f=Q.useDeferredValue(u),[d,T]=Q.useState("all"),[a,g]=Q.useState(!1),_=Q.useRef(new Set(Object.keys(t))),{org:m}=Ge(),h=Qt({connectionId:$t,orgId:m.id,orgSlug:m.slug}),O=100,R=f.trim(),p=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,C=!!l,A={...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:0,...C&&{include_virtual:!0}},M=JSON.stringify(A),{data:S,fetchNextPage:b,hasNextPage:D,isFetchingNextPage:I}=Ft({queryKey:de.collectionListInfinite(h,m.id,"","CONNECTIONS",M),queryFn:async({pageParam:E=0})=>(await h.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:E,...C&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(E,w)=>{if(E?.hasMore)return w.reduce((H,q)=>H+(q?.items?.length??0),0)},staleTime:3e4}),N=S?.pages.flatMap(E=>E?.items??[])??[],P=Kt(b,D??!1,I),i=l?N.filter(E=>E.connection_type!=="VIRTUAL"?!0:qt(E.connection_url)!==l):N,x=_.current,U=[...x.values()].map(E=>i.find(w=>w.id===E)).filter(E=>E!==void 0),G=i.filter(E=>!x.has(E.id)),Y=[...U,...G],v=E=>{const w=t[E];return w!==void 0&&w.length>0},K=Y.filter(E=>{if(d==="all")return!0;const w=v(E.id);return d==="selected"?w:d==="unselected"?!w:!0}),[L,z]=Q.useState(Y[0]?.id??null),V=L?Y.find(E=>E.id===L)??null:null,{data:k,isFetching:B}=Ve({queryKey:de.collectionItem(h,m.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await h.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),$=k?.tools??[],J=(E,w)=>t[E]?.includes(w)??!1,te=(E,w)=>{const H=t[E]??[],q=H.includes(w),se={...t};if(q){const le=H.filter(ne=>ne!==w);le.length===0?delete se[E]:se[E]=le}else se[E]=[...H,w];e(se)},oe=E=>{const w=E===L?$:[];if(!w.length)return;const H=t[E]??[],q=w.map(ne=>ne.name),se=H.length>0&&q.every(ne=>H.includes(ne)),le={...t};se?delete le[E]:(le[E]=q,z(E)),e(le)},F=E=>{z(E),g(!0)},W=()=>{g(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[r===void 0&&s.jsx(Ht,{value:o,onChange:c,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>T("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>T("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>T("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:K.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(u?"common.toolSetSelector.noConnectionsFound":d==="selected"?"common.toolSetSelector.noServersSelected":d==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[K.map(E=>{const w=L===E.id,H=w?$.length:0,q=t[E.id]?.length??0;return s.jsx(is,{connection:{...E,tools:w?$:E.tools},isSelected:w,hasToolsEnabled:v(E.id),activeToolsCount:q,totalToolsCount:H,onSelect:()=>F(E.id),onToggle:()=>oe(E.id)},E.id)}),s.jsx("div",{ref:P,className:"h-4"}),I&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(zt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Fe,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:$.map(E=>s.jsx(as,{connectionId:V.id,tool:E,isSelected:J(V.id,E.name),onToggle:()=>te(V.id,E.name)},E.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const ms=qe({role:qe({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Je(),staticPermissions:we(re()),toolSet:Ze(re(),we(re())),allowAllModels:Je(),modelSet:Ze(re(),we(re())),memberIds:we(re())});function lt(t,e,l,r){const n=s.jsx(je,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(ve,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function us(t){const e=X.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie();let T;e[0]!==u?(T=u.trim().toLowerCase(),e[0]=u,e[1]=T):T=e[1];const a=Q.useDeferredValue(T);let g;if(e[2]!==l||e[3]!==a||e[4]!==n||e[5]!==o||e[6]!==f||e[7]!==u||e[8]!==r||e[9]!==d){const _=ls(),m=(I,N)=>{if(!f){if(l&&N){const P=_.flatMap(Ts).flatMap(gs);n(!1),o(P.filter(i=>!I.tools.includes(i)));return}l||o(ns(I,r,!N))}};let h;e[11]!==a?(h=I=>{const{section:N,capabilities:P}=I;return{section:N,capabilities:P.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=h):h=e[12];const O=_.map(h).filter(fs);let R;e[13]!==d?(R=d("settings.orgRoleDetail.general"),e[13]=d,e[14]=R):R=e[14];let p;e[15]!==d?(p=d("settings.orgRoleDetail.allOrgPermissions"),e[15]=d,e[16]=p):p=e[16];let C;e[17]!==d?(C=d("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=d,e[18]=C):C=e[18];let A;e[19]!==l||e[20]!==n||e[21]!==o?(A=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=A):A=e[22];let M;e[23]!==l||e[24]!==f||e[25]!==d||e[26]!==A?(M=lt(d,l,f,A),e[23]=l,e[24]=f,e[25]=d,e[26]=A,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==f?(S=f?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=f,e[32]=S):S=e[32];let b;e[33]!==S||e[34]!==p||e[35]!==C||e[36]!==M?(b=s.jsx(Xe,{children:s.jsx(et,{title:p,description:C,action:M,onClick:S})}),e[33]=S,e[34]=p,e[35]=C,e[36]=M,e[37]=b):b=e[37];let D;e[38]!==b||e[39]!==R?(D=s.jsx(We,{title:R,children:b}),e[38]=b,e[39]=R,e[40]=D):D=e[40],g=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,O.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:d("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:u})}):O.map(I=>{const{section:N,capabilities:P}=I;return s.jsx(We,{title:N,children:s.jsx(Xe,{children:P.map(i=>{const x=os(i,r,l);return s.jsx(et,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(jt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:lt(d,x,f,()=>m(i,x)),onClick:f?void 0:()=>m(i,x)},i.id)})})},N)})]})}),e[2]=l,e[3]=a,e[4]=n,e[5]=o,e[6]=f,e[7]=u,e[8]=r,e[9]=d,e[10]=g}else g=e[10];return g}function fs(t){return t.capabilities.length>0}function gs(t){return t.tools}function Ts(t){return t.capabilities}const St={anthropic:"Anthropic",openrouter:"OpenRouter"},_s={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function hs(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function Es(t){return _s[t]??St[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const At=30;function xs(t){const e=X.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:c,allConnectionModelIds:u,selectedModels:f,allowAllModels:d,allConnectionModelsSelected:T,onToggleModel:a,onExitAllowAll:g,readOnly:_,defaultExpanded:m}=t,h=ie(),[O,R]=Q.useState(m),p=m||O,C=R,[A,M]=Q.useState(At);let S;e[0]!==T||e[1]!==d||e[2]!==f?(S=I=>d||T||f.includes("*")||f.includes(I),e[0]=T,e[1]=d,e[2]=f,e[3]=S):S=e[3];const b=S;let D;if(e[4]!==u||e[5]!==d||e[6]!==l||e[7]!==p||e[8]!==o||e[9]!==b||e[10]!==c||e[11]!==g||e[12]!==a||e[13]!==_||e[14]!==r||e[15]!==n||e[16]!==h||e[17]!==A){let I;e[19]!==b?(I=B=>b(B.id),e[19]=b,e[20]=I):I=e[20];const N=c.filter(I).length,P=c.slice(0,A),i=c.length>A;let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=()=>C(As),e[21]=x):x=e[21];const U=o??Et[r]??It;let G;e[22]!==n||e[23]!==U?(G=s.jsx(Fe,{icon:U,name:n,size:"sm"}),e[22]=n,e[23]=U,e[24]=G):G=e[24];let Y;e[25]!==n?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=Y):Y=e[26];let v;e[27]!==G||e[28]!==Y?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,Y]}),e[27]=G,e[28]=Y,e[29]=v):v=e[29];const K=h("settings.orgRoleDetail.enabledCount",{enabledCount:N,total:c.length});let L;e[30]!==K?(L=s.jsx(be,{variant:"secondary",className:"text-xs text-muted-foreground",children:K}),e[30]=K,e[31]=L):L=e[31];let z;e[32]!==p?(z=p?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=p,e[33]=z):z=e[33];let V;e[34]!==L||e[35]!==z?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[L,z]}),e[34]=L,e[35]=z,e[36]=V):V=e[36];let k;e[37]!==V||e[38]!==v?(k=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:x,children:[v,V]}),e[37]=V,e[38]=v,e[39]=k):k=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[k,p&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[P.map(B=>{const $=b(B.id),J=()=>{if(!_){if(d){g(l,u,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!_&&"hover:bg-muted/50 cursor-pointer"),onClick:J,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ss,children:_?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:$,disabled:!0,onCheckedChange:Rs})})}),s.jsx(ve,{children:s.jsx("p",{children:h("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:$,onCheckedChange:J})})]},B.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>M(ps),children:h("settings.orgRoleDetail.showMore",{remaining:c.length-A})})]})]}),e[4]=u,e[5]=d,e[6]=l,e[7]=p,e[8]=o,e[9]=b,e[10]=c,e[11]=g,e[12]=a,e[13]=_,e[14]=r,e[15]=n,e[16]=h,e[17]=A,e[18]=D}else D=e[18];return D}function ps(t){return t+At}function Rs(){}function Ss(t){return t.stopPropagation()}function As(t){return!t}function Ns(t){const e=X.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:u,searchQuery:f,readOnly:d}=t,T=Wt(l.id);let a,g,_,m,h;if(e[0]!==u||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==T||e[8]!==d||e[9]!==f||e[10]!==r){h=Symbol.for("react.early_return_sentinel");e:{let p;e[16]!==l.label?(p=x=>({...x,id:x.modelId,provider:l.label}),e[16]=l.label,e[17]=p):p=e[17];const C=T.filter(js).map(p),A=f.trim().toLowerCase(),M=A?C.filter(x=>x.title.toLowerCase().includes(A)||x.id.toLowerCase().includes(A)||x.provider?.toLowerCase().includes(A)):C;if(M.length===0){h=null;break e}const S=new Map;for(const x of M){const U=hs(x.id,l.providerId),G=S.get(U)??{models:[],logo:null};G.models.push({id:x.id,title:Is(x.title),logo:x.logo}),!G.logo&&x.logo&&(G.logo=x.logo),S.set(U,G)}const b=Array.from(S.entries()).map(bs).sort(Cs),D=b.length===1||A.length>0;_="flex flex-col gap-3";const I=Et[l.providerId]??It;let N;e[18]!==l.providerId||e[19]!==I?(N=s.jsx("img",{src:I,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=I,e[20]=N):N=e[20];const P=St[l.providerId]??l.providerId;let i;e[21]!==P?(i=s.jsx("h4",{className:"text-sm font-medium",children:P}),e[21]=P,e[22]=i):i=e[22],e[23]!==i||e[24]!==N?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[N,i]}),e[23]=i,e[24]=N,e[25]=m):m=e[25],a="flex flex-col gap-3",g=b.map(x=>s.jsx(xs,{connectionId:l.id,subProviderId:x.id,subProviderName:x.name,groupLogo:x.logo,models:x.models,allConnectionModelIds:C.map(Os),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:u,onToggleModel:o,onExitAllowAll:c,readOnly:d,defaultExpanded:D},x.id))}e[0]=u,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=T,e[8]=d,e[9]=f,e[10]=r,e[11]=a,e[12]=g,e[13]=_,e[14]=m,e[15]=h}else a=e[11],g=e[12],_=e[13],m=e[14],h=e[15];if(h!==Symbol.for("react.early_return_sentinel"))return h;let O;e[26]!==a||e[27]!==g?(O=s.jsx("div",{className:a,children:g}),e[26]=a,e[27]=g,e[28]=O):O=e[28];let R;return e[29]!==_||e[30]!==m||e[31]!==O?(R=s.jsxs("div",{className:_,children:[m,O]}),e[29]=_,e[30]=m,e[31]=O,e[32]=R):R=e[32],R}function Os(t){return t.id}function Cs(t,e){return t.name.localeCompare(e.name)}function bs(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function js(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie(),T=Q.useDeferredValue(u),a=Jt();let g;e[0]!==r||e[1]!==o?(g=(I,N)=>{const P=r[I]??[],i={...r};if(P.includes(N)){const x=P.filter(U=>U!==N);x.length===0?delete i[I]:i[I]=x}else i[I]=[...P,N];o(i)},e[0]=r,e[1]=o,e[2]=g):g=e[2];const _=g;let m;e[3]!==r||e[4]!==n||e[5]!==o?(m=(I,N,P)=>{n(!1),o({...r,[I]:N.filter(i=>i!==P)})},e[3]=r,e[4]=n,e[5]=o,e[6]=m):m=e[6];const h=m,O=!f&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==O?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",O),e[7]=O,e[8]=R):R=e[8];let p;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==f?(p=()=>{if(f)return;const I=!l;n(I),I&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=f,e[13]=p):p=e[13];let C;e[14]!==d?(C=d("settings.orgRoleDetail.allModels"),e[14]=d,e[15]=C):C=e[15];let A;e[16]!==C?(A=s.jsx("span",{className:"text-sm font-medium",children:C}),e[16]=C,e[17]=A):A=e[17];let M;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==f||e[22]!==d?(M=s.jsx("div",{onClick:Ps,children:f?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(ve,{children:s.jsx("p",{children:d("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:l,onCheckedChange:I=>{n(I),I&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=f,e[22]=d,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==p||e[26]!==A||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:p,children:[A,M]}),e[24]=R,e[25]=p,e[26]=A,e[27]=M,e[28]=S):S=e[28];let b;e[29]!==a||e[30]!==l||e[31]!==T||e[32]!==h||e[33]!==r||e[34]!==f||e[35]!==d||e[36]!==_?(b=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:d("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(I=>s.jsx(Q.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Oe,{className:"size-4"}),d("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ns,{connection:I,selectedModels:r[I.id]??[],allowAllModels:l,onToggleModel:_,onExitAllowAll:h,allConnectionModelsSelected:(r[I.id]??[]).includes("*"),searchQuery:T,readOnly:f})},I.id)),e[29]=a,e[30]=l,e[31]=T,e[32]=h,e[33]=r,e[34]=f,e[35]=d,e[36]=_,e[37]=b):b=e[37];let D;return e[38]!==S||e[39]!==b?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,b]}),e[38]=S,e[39]=b,e[40]=D):D=e[40],D}function Ds(){}function Ps(t){return t.stopPropagation()}function vs(t){const e=X.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,c=ie(),[u,f]=Q.useState(""),d=Q.useDeferredValue(u);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=[],e[0]=T):T=e[0];const[a,g]=Q.useState(T),{data:_}=xt();let m,h,O,R,p,C,A,M,S,b,D;if(e[1]!==_?.data?.members||e[2]!==d||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==u||e[8]!==n||e[9]!==c){const L=_?.data?.members??[];let z;e[21]!==d?(z=F=>{const W=d.toLowerCase();return F.user?.name?.toLowerCase().includes(W)||F.user?.email?.toLowerCase().includes(W)},e[21]=d,e[22]=z):z=e[22];const V=L.filter(z);let k;e[23]!==o||e[24]!==r||e[25]!==a?(k=()=>{o(a),g([]),r(!1)},e[23]=o,e[24]=r,e[25]=a,e[26]=k):k=e[26],O=k,h=dt,b=l,D=r,m=mt,M="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let $;e[29]!==B?($=s.jsx(ut,{children:B}),e[29]=B,e[30]=$):$=e[30];let J;e[31]!==c?(J=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=J):J=e[32];let te;e[33]!==J?(te=s.jsx(ft,{children:J}),e[33]=J,e[34]=te):te=e[34],e[35]!==$||e[36]!==te?(S=s.jsxs(gt,{className:"px-6 pt-6",children:[$,te]}),e[35]=$,e[36]=te,e[37]=S):S=e[37],C="flex flex-col h-80";let oe;e[38]!==c?(oe=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=oe):oe=e[39],e[40]!==u||e[41]!==oe?(A=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ze,{value:u,onChange:f,placeholder:oe,className:"w-full"})}),e[40]=u,e[41]=oe,e[42]=A):A=e[42],R="flex-1 overflow-auto",p=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(u?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const W=F.role!=="owner",E=n.includes(F.id),w=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!W||E?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Qe,{checked:w||E,onCheckedChange:()=>{!W||E||g(H=>H.includes(F.id)?H.filter(q=>q!==F.id):[...H,F.id])},disabled:!W||E}),s.jsx(Rt,{url:F.user?.image??void 0,fallback:pt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!W&&s.jsx(be,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),E&&W&&s.jsx(be,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=_?.data?.members,e[2]=d,e[3]=o,e[4]=r,e[5]=l,e[6]=a,e[7]=u,e[8]=n,e[9]=c,e[10]=m,e[11]=h,e[12]=O,e[13]=R,e[14]=p,e[15]=C,e[16]=A,e[17]=M,e[18]=S,e[19]=b,e[20]=D}else m=e[10],h=e[11],O=e[12],R=e[13],p=e[14],C=e[15],A=e[16],M=e[17],S=e[18],b=e[19],D=e[20];let I;e[43]!==R||e[44]!==p?(I=s.jsx("div",{className:R,children:p}),e[43]=R,e[44]=p,e[45]=I):I=e[45];let N;e[46]!==I||e[47]!==C||e[48]!==A?(N=s.jsxs("div",{className:C,children:[A,I]}),e[46]=I,e[47]=C,e[48]=A,e[49]=N):N=e[49];let P;e[50]!==c?(P=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=P):P=e[51];let i;e[52]!==P?(i=s.jsx(Tt,{children:P}),e[52]=P,e[53]=i):i=e[53];const x=a.length===0;let U;e[54]!==a.length||e[55]!==c?(U=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=U):U=e[56];let G;e[57]!==O||e[58]!==x||e[59]!==U?(G=s.jsx(_t,{onClick:O,disabled:x,children:U}),e[57]=O,e[58]=x,e[59]=U,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(ht,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let v;e[64]!==m||e[65]!==N||e[66]!==Y||e[67]!==M||e[68]!==S?(v=s.jsxs(m,{className:M,children:[S,N,Y]}),e[64]=m,e[65]=N,e[66]=Y,e[67]=M,e[68]=S,e[69]=v):v=e[69];let K;return e[70]!==h||e[71]!==v||e[72]!==b||e[73]!==D?(K=s.jsx(h,{open:b,onOpenChange:D,children:v}),e[70]=h,e[71]=v,e[72]=b,e[73]=D,e[74]=K):K=e[74],K}function Ls(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:u,onAddMemberDialogOpenChange:f}=t,d=n===void 0?!1:n,T=o===void 0?void 0:o,a=ie(),g=Q.useDeferredValue(c),{data:_}=xt();let m,h,O;if(e[0]!==_?.data?.members||e[1]!==g||e[2]!==l||e[3]!==r||e[4]!==d||e[5]!==T||e[6]!==c||e[7]!==a){const M=_?.data?.members??[];let S;e[11]!==l?(S=i=>l.includes(i.id),e[11]=l,e[12]=S):S=e[12];const b=M.filter(S);let D;e[13]!==g?(D=i=>{const x=g.toLowerCase();return i.user?.name?.toLowerCase().includes(x)||i.user?.email?.toLowerCase().includes(x)},e[13]=g,e[14]=D):D=e[14];const I=b.filter(D);let N;e[15]!==T||e[16]!==a?(N=T??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=T,e[16]=a,e[17]=N):N=e[17];const P=N;O="flex flex-col h-full",m="flex-1 overflow-auto",h=b.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):I.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:I.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Rt,{url:i.user?.image??void 0,fallback:pt(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),d?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(tt,{size:16})})})}),s.jsx(ve,{children:s.jsx("p",{children:P})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(x=>x!==i.id)),children:s.jsx(tt,{size:16})})]},i.id))}),e[0]=_?.data?.members,e[1]=g,e[2]=l,e[3]=r,e[4]=d,e[5]=T,e[6]=c,e[7]=a,e[8]=m,e[9]=h,e[10]=O}else m=e[8],h=e[9],O=e[10];let R;e[18]!==m||e[19]!==h?(R=s.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=R):R=e[20];let p;e[21]!==l||e[22]!==r?(p=M=>r([...l,...M]),e[21]=l,e[22]=r,e[23]=p):p=e[23];let C;e[24]!==u||e[25]!==l||e[26]!==f||e[27]!==p?(C=s.jsx(vs,{open:u,onOpenChange:f,selectedMemberIds:l,onAddMembers:p}),e[24]=u,e[25]=l,e[26]=f,e[27]=p,e[28]=C):C=e[28];let A;return e[29]!==O||e[30]!==R||e[31]!==C?(A=s.jsxs("div",{className:O,children:[R,C]}),e[29]=O,e[30]=R,e[31]=C,e[32]=A):A=e[32],A}function ys(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-6 text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx(Q.Suspense,{fallback:l,children:s.jsx(Ls,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const ws={owner:[],admin:[],user:[]};function Gs(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:ws[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),c=o?[]:n.filter(a=>a!=="*"),u={};for(const[a,g]of Object.entries(r))if(!(a==="self"||a==="models"))if(a==="*")for(const _ of l)u[_.id]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g;else{const _=l.find(m=>m.id===a);_&&(u[a]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g)}const f=r.models||[],d=f.length===0||f.includes("*:*"),T={};if(!d)for(const a of f){const g=a.indexOf(":");if(g===-1)continue;const _=a.slice(0,g),m=a.slice(g+1);T[_]||(T[_]=[]),T[_].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:u,allowAllModels:d,modelSet:T,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function ks(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const c=e.find(u=>u.id===r)?.tools?.map(u=>u.name)??[];l[r]=c.length>0&&c.every(u=>n.includes(u))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const c of o)r.push(`${n}:${c}`);r.length>0&&(l.models=r)}return l}function Bs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Vs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,c=ie();let u;e[0]!==o||e[1]!==c?(u=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=u):u=e[2];const f=u;if(l){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Be,{size:16}),e[3]=g):g=e[3];let _;e[4]!==c?(_=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=_):_=e[5];let m;e[6]!==_?(m=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[g,_]})})}),e[6]=_,e[7]=m):m=e[7];let h;e[8]!==f?(h=s.jsx(ve,{children:s.jsx("p",{children:f})}),e[8]=f,e[9]=h):h=e[9];let O;return e[10]!==m||e[11]!==h?(O=s.jsx(Me,{children:s.jsxs(De,{children:[m,h]})}),e[10]=m,e[11]=h,e[12]=O):O=e[12],O}let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:16}),e[13]=d):d=e[13];let T;e[14]!==c?(T=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=T):T=e[15];let a;return e[16]!==n||e[17]!==T?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[d,T]}),e[16]=n,e[17]=T,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Ge(),r=Ke(),n=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==r?(c=()=>r.organization.listMembers(),e[2]=r,e[3]=c):c=e[3];let u;e[4]!==o||e[5]!==c?(u={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=u):u=e[6];const{data:f,isPending:d}=Ve(u);if(d||!n){let _;return e[7]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}),e[7]=_):_=e[7],_}let T;e[8]!==f?.data?.members?(T=f?.data?.members??[],e[8]=f?.data?.members,e[9]=T):T=e[9];const a=T;let g;return e[10]!==n||e[11]!==a||e[12]!==t?(g=s.jsx(Ks,{...t,members:a,connections:n}),e[10]=n,e[11]=a,e[12]=t,e[13]=g):g=e[13],g}function Ks({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:c}=Ge(),u=Ke(),f=ot(),d=t.kind==="builtin",T=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[g,_]=Q.useState(d?"org":"mcp"),m=Ct({resolver:bt(ms),defaultValues:Bs(t,r,n)}),h=m.formState.isValid,O=m.formState.isDirty,R=nt({mutationFn:async i=>{const x=ks(i,n),U=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),G=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(v,K)=>{const L=r.filter(k=>k.role===(K??v)).map(k=>k.id),z=i.memberIds.filter(k=>!L.includes(k)),V=L.filter(k=>!i.memberIds.includes(k));for(const k of z){const B=await u.organization.updateMemberRole({memberId:k,role:[v]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const k of V){const B=await u.organization.updateMemberRole({memberId:k,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(i.role.slug),i;if(i.role.id){const v=i.role.label.toLowerCase().replace(/\s+/g,"-"),K=i.role.slug,L=v!==K,z=await u.organization.updateRole({roleId:i.role.id,data:{permission:x,...L?{roleName:v}:{}}});if(z?.error)throw new Error(z.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(L?v:K,L?K:void 0),L?{...i,role:{...i.role,slug:v}}:i}else{const v=await u.organization.createRole({role:U,permission:x});if(v?.error)throw new Error(v.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const K of i.memberIds){const L=await u.organization.updateMemberRole({memberId:K,role:[U]});if(L?.error)throw new Error(L.error.message)}return{...i,role:{...i.role,id:v.data?.roleData?.id,slug:U}}}},onSuccess:(i,x)=>{f.invalidateQueries({queryKey:de.members(c)}),f.invalidateQueries({queryKey:de.organizationRoles(c)});const U=!x.role.id&&!x.role.slug,G=x.role.slug==="owner"&&!x.role.id;Ye(G?"role_members_updated":U?"role_created":"role_updated",{role_slug:x.role.slug??null}),Ce.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":U?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),m.reset(i),l(i.role.id)},onError:i=>{Ce.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),p=m.handleSubmit(i=>{if(!i.role.label.trim()){Ce.error(o("settings.orgRoleDetail.roleNameIsRequired")),m.setFocus("role.label");return}R.mutate(i)}),C=!T,A=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...T?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,b]=Q.useState(""),[D,I]=Q.useState(!1),N=i=>{_(i),b("")},P={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ne,{children:s.jsxs(Ne.Content,{className:Z("flex flex-col",g!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ne.Title,{actions:C&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:p,disabled:R.isPending||!h||!O,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?ct(t.role,!0):yt(m.watch("role.label")))}),T&&s.jsx(it,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...m.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:A})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(i=>s.jsx("button",{type:"button",onClick:()=>N(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",g===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ze,{value:S,onChange:b,placeholder:P[g]??"Search...",className:"w-full md:w-[375px]"}),g==="members"&&s.jsx(Vs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>I(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",g!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(g!=="org"&&"h-full overflow-hidden",g!=="models"&&g!=="org"&&"border border-border rounded-xl bg-card"),children:[g==="mcp"&&!T&&s.jsx(ds,{toolSet:m.watch("toolSet"),onToolSetChange:i=>m.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:S}),g==="org"&&s.jsx(us,{allowAllStaticPermissions:m.watch("allowAllStaticPermissions"),staticPermissions:m.watch("staticPermissions"),onAllowAllChange:i=>m.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>m.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="models"&&s.jsx(Ms,{allowAllModels:m.watch("allowAllModels"),modelSet:m.watch("modelSet"),onAllowAllChange:i=>m.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>m.setValue("modelSet",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="members"&&s.jsx(ys,{memberIds:m.watch("memberIds"),onMemberIdsChange:i=>m.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:D,onAddMemberDialogOpenChange:I})]})})]})})}function zs(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Fs(t){const e=X.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:c}=Mt();let u;return e[0]!==l||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o?(u=s.jsx(ts,{granted:n,loading:o,error:c,area:l,children:r}),e[0]=l,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function $s(){const t=X.c(128),e=ie(),[l,r]=Q.useState(""),[n,o]=Q.useState(null),c=vt();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[0]=u):u=t[0];const{role:f}=rt(u),{locator:d}=Ge(),T=Ke(),a=ot(),{customRoles:g,refetch:_}=Lt();let m;t[1]!==c?(m=j=>c({to:".",search:y=>({...y,role:j})}),t[1]=c,t[2]=m):m=t[2];const h=m;let O;e:{if(!f){O=null;break e}if(f==="new"){O={kind:"new"};break e}if(f.startsWith("builtin-")){O={kind:"builtin",role:f.slice(8)};break e}let j;t[3]!==f?(j=ee=>ee.id===f,t[3]=f,t[4]=j):j=t[4];const y=g.find(j);O=y?{kind:"custom",role:y}:null}const R=O;let p;t[5]!==d?(p=de.members(d),t[5]=d,t[6]=p):p=t[6];let C;t[7]!==T?(C=()=>T.organization.listMembers(),t[7]=T,t[8]=C):C=t[8];let A;t[9]!==p||t[10]!==C?(A={queryKey:p,queryFn:C},t[9]=p,t[10]=C,t[11]=A):A=t[11];const{data:M}=Ve(A);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const b=S;let D;t[14]!==b?(D=j=>b.filter(y=>y.role===j).length,t[14]=b,t[15]=D):D=t[15];const I=D;let N;if(t[16]!==g||t[17]!==I||t[18]!==l||t[19]!==e){let j;t[21]!==I||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:I(ce.role),label:e(ce.labelKey)}}),t[21]=I,t[22]=e,t[23]=j):j=t[23];const y=Qs.map(j);let ee;t[24]!==I?(ee=ce=>({kind:"custom",role:{...ce,memberCount:I(ce.role)}}),t[24]=I,t[25]=ee):ee=t[25];const Nt=g.map(ee);if(N=[...y,...Nt],l){const ce=l.toLowerCase();N=N.filter(Ot=>Ot.role.label.toLowerCase().includes(ce))}t[16]=g,t[17]=I,t[18]=l,t[19]=e,t[20]=N}else N=t[20];let P;t[26]!==T?(P=async j=>{const y=await T.organization.deleteRole({roleId:j});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=T,t[27]=P):P=t[27];const i=nt({mutationFn:P,onSuccess:(j,y)=>{Ye("role_deleted",{role_id:y}),a.invalidateQueries({queryKey:de.members(d)}),a.invalidateQueries({queryKey:de.organizationRoles(d)}),Ce.success(e("settings.roles.deletedSuccessfully")),_(),R?.kind==="custom"&&R.role.id===y&&h(void 0)},onError:Ws});let x;t[28]!==e?(x=e("settings.roles.columnRole"),t[28]=e,t[29]=x):x=t[29];let U;t[30]!==x?(U={id:"role",header:x,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=x,t[31]=U):U=t[31];let G;t[32]!==e?(G=e("settings.roles.columnType"),t[32]=e,t[33]=G):G=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(be,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(be,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let v;t[36]!==G||t[37]!==Y?(v={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=v):v=t[38];let K;t[39]!==e?(K=e("settings.roles.columnPermissions"),t[39]=e,t[40]=K):K=t[40];let L;t[41]!==e?(L=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const y=j.role,ee=[];return y.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):y.staticPermissionCount&&y.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:y.staticPermissionCount})),y.allowsAllConnections?ee.push(e("settings.roles.allConnections")):y.connectionCount&&y.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:y.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=L):L=t[42];let z;t[43]!==K||t[44]!==L?(z={id:"permissions",header:K,render:L,cellClassName:"flex-1 min-w-0"},t[43]=K,t[44]=L,t[45]=z):z=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let k;t[48]!==V?(k={id:"members",header:V,render:Zs,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=k):k=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(wt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(Ut,{align:"end",onClick:Hs,children:s.jsxs(kt,{variant:"destructive",onClick:()=>{const y=j.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let $;t[52]!==U||t[53]!==v||t[54]!==z||t[55]!==k||t[56]!==B?($=[U,v,z,k,B],t[52]=U,t[53]=v,t[54]=z,t[55]=k,t[56]=B,t[57]=$):$=t[57];const J=$;let te;t[58]!==h?(te=j=>{if(j.kind==="builtin")h(`builtin-${j.role.role}`);else{const y=j.role;h(y.id)}},t[58]=h,t[59]=te):te=t[59];const oe=te;if(R){let j;t[60]!==h?(j=()=>h(void 0),t[60]=h,t[61]=j):j=t[61];let y;return t[62]!==_||t[63]!==h?(y=()=>{_(),h(void 0)},t[62]=_,t[63]=h,t[64]=y):y=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:y},zs(R))}let F;t[65]!==e?(F=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=F):F=t[66];let W;t[67]===Symbol.for("react.memo_cache_sentinel")?(W=j=>{j.key==="Escape"&&(r(""),j.target.blur())},t[67]=W):W=t[67];let E;t[68]!==l||t[69]!==F?(E=s.jsx(ze,{value:l,onChange:r,placeholder:F,className:"w-full md:w-[375px]",onKeyDown:W}),t[68]=l,t[69]=F,t[70]=E):E=t[70];let w;t[71]!==h?(w=()=>h("new"),t[71]=h,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Be,{size:16}),t[73]=H):H=t[73];let q;t[74]!==e?(q=e("settings.roles.createRole"),t[74]=e,t[75]=q):q=t[75];let se;t[76]!==w||t[77]!==q?(se=s.jsxs(ae,{onClick:w,children:[H,q]}),t[76]=w,t[77]=q,t[78]=se):se=t[78];let le;t[79]!==E||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,se]}),t[79]=E,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(st,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(st,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let me;t[85]!==N||t[86]!==J||t[87]!==oe||t[88]!==ne?(me=s.jsx(Yt,{columns:J,data:N,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=N,t[86]=J,t[87]=oe,t[88]=ne,t[89]=me):me=t[89];const Ue=n!==null;let Le;t[90]===Symbol.for("react.memo_cache_sentinel")?(Le=j=>!j&&o(null),t[90]=Le):Le=t[90];let ue;t[91]!==e?(ue=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=ue):ue=t[92];let fe;t[93]!==ue?(fe=s.jsx(ut,{children:ue}),t[93]=ue,t[94]=fe):fe=t[94];const ke=n?.label??"";let ge;t[95]!==e||t[96]!==ke?(ge=e("settings.roles.deleteRoleConfirm",{role:ke}),t[95]=e,t[96]=ke,t[97]=ge):ge=t[97];let Te;t[98]!==ge?(Te=s.jsx(ft,{children:ge}),t[98]=ge,t[99]=Te):Te=t[99];let _e;t[100]!==fe||t[101]!==Te?(_e=s.jsxs(gt,{children:[fe,Te]}),t[100]=fe,t[101]=Te,t[102]=_e):_e=t[102];let he;t[103]!==e?(he=e("settings.roles.cancel"),t[103]=e,t[104]=he):he=t[104];let Ee;t[105]!==he?(Ee=s.jsx(Tt,{children:he}),t[105]=he,t[106]=Ee):Ee=t[106];let Ie;t[107]!==i||t[108]!==n?(Ie=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ie):Ie=t[109];let xe;t[110]!==e?(xe=e("settings.roles.delete"),t[110]=e,t[111]=xe):xe=t[111];let pe;t[112]!==Ie||t[113]!==xe?(pe=s.jsx(_t,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:xe}),t[112]=Ie,t[113]=xe,t[114]=pe):pe=t[114];let Re;t[115]!==Ee||t[116]!==pe?(Re=s.jsxs(ht,{children:[Ee,pe]}),t[115]=Ee,t[116]=pe,t[117]=Re):Re=t[117];let Se;t[118]!==_e||t[119]!==Re?(Se=s.jsxs(mt,{children:[_e,Re]}),t[118]=_e,t[119]=Re,t[120]=Se):Se=t[120];let Ae;t[121]!==Ue||t[122]!==Se?(Ae=s.jsx(dt,{open:Ue,onOpenChange:Le,children:Se}),t[121]=Ue,t[122]=Se,t[123]=Ae):Ae=t[123];let ye;return t[124]!==le||t[125]!==me||t[126]!==Ae?(ye=s.jsxs(at,{group:"members",className:"gap-6",children:[le,me,Ae]}),t[124]=le,t[125]=me,t[126]=Ae,t[127]=ye):ye=t[127],ye}function Hs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Zs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",ct(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(it,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ws(t,e){Ye("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),Ce.error(t instanceof Error?t.message:"Failed to delete role")}function Xs(){const t=X.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=rt(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let c;t[5]!==r?(c=r?s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}):s.jsx(at,{group:"members",className:"gap-6",children:s.jsx(Dt,{})}),t[5]=r,t[6]=c):c=t[6];let u;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($s,{}),t[7]=u):u=t[7];let f;t[8]!==c?(f=s.jsx(Q.Suspense,{fallback:c,children:u}),t[8]=c,t[9]=f):f=t[9];let d;return t[10]!==o||t[11]!==f?(d=s.jsx(Pt,{fallback:o,children:f}),t[10]=o,t[11]=f,t[12]=d):d=t[12],d}function So(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{area:"roles",children:s.jsx(Xs,{})}),t[0]=e):e=t[0],e}export{So as default};
|