decocms 4.242.2 → 4.242.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BLjRxtCg.js → AlertCircle-DpbDmpl4.js} +1 -1
- package/dist/client/assets/{AreaChart-CA8B3Hpq.js → AreaChart-df8seS54.js} +1 -1
- package/dist/client/assets/{ArrowLeft-4DPAq3FZ.js → ArrowLeft-6Uvqwled.js} +1 -1
- package/dist/client/assets/{ArrowUp-BlEU92Im.js → ArrowUp-CZqWUJZy.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-C9RBdXzS.js → ArrowUpRight-BkqhcGtY.js} +1 -1
- package/dist/client/assets/{Check-DmmvaREF.js → Check-BeLWQxAW.js} +1 -1
- package/dist/client/assets/{CheckCircle-BkWleJAQ.js → CheckCircle-DIdAaiEB.js} +1 -1
- package/dist/client/assets/{ChevronDown-DNdWMHBq.js → ChevronDown-BPLhBbcC.js} +1 -1
- package/dist/client/assets/{ChevronRight-9kh8mw1-.js → ChevronRight-CjwWuSKC.js} +1 -1
- package/dist/client/assets/{ChevronUp-BiwzfQ34.js → ChevronUp-CRIfPNig.js} +1 -1
- package/dist/client/assets/{Copy01-BSyOJtDU.js → Copy01-D0UklT6j.js} +1 -1
- package/dist/client/assets/{CreditCard01-DoI0r0lf.js → CreditCard01-DFMnSd2M.js} +1 -1
- package/dist/client/assets/{DotsVertical-B6vdrZcL.js → DotsVertical-BJksCEBT.js} +1 -1
- package/dist/client/assets/{Download01-BgrKWanC.js → Download01-nz2y-YpD.js} +1 -1
- package/dist/client/assets/{Eye-BYu9YoCE.js → Eye-BNVQo7YS.js} +1 -1
- package/dist/client/assets/{FilterLines-CCtu81Kl.js → FilterLines-uRbQkChb.js} +1 -1
- package/dist/client/assets/{Globe01-C1UG-2uT.js → Globe01-DyvYVxg0.js} +1 -1
- package/dist/client/assets/{Globe04-Cxhs4JQB.js → Globe04-CeHN-qAt.js} +1 -1
- package/dist/client/assets/{HardDrive-B12yjnMo.js → HardDrive-BeQR0yEZ.js} +1 -1
- package/dist/client/assets/{Key01-BukaugKD.js → Key01-PmvG5GId.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DrPXFVcs.js → LayoutLeft-DR7AqeCR.js} +1 -1
- package/dist/client/assets/{LinkExternal01-ndPw69oF.js → LinkExternal01-DT2zbGiX.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-QOtE0O6M.js → LockUnlocked01-CT3ndXQj.js} +1 -1
- package/dist/client/assets/{LogOut01-Bbc7nVd2.js → LogOut01-DfBxSCYF.js} +1 -1
- package/dist/client/assets/{Monitor01-CRJNkg5D.js → Monitor01-CiLYUYXU.js} +1 -1
- package/dist/client/assets/{Palette-BN_nVtlo.js → Palette-BjyqEmv9.js} +1 -1
- package/dist/client/assets/{Play-bVmySP8F.js → Play-CTk0UTMj.js} +1 -1
- package/dist/client/assets/{Plus-D5q8r_KL.js → Plus-DzCY9mis.js} +1 -1
- package/dist/client/assets/{SearchLg-rLVtLHTP.js → SearchLg-CNfPTXFn.js} +1 -1
- package/dist/client/assets/{SearchMd-Bp11Ucvw.js → SearchMd-OSuucajh.js} +1 -1
- package/dist/client/assets/{Settings02-B_z0TMYn.js → Settings02-RnwqI_s-.js} +1 -1
- package/dist/client/assets/{Share07-W-6cq5W5.js → Share07-BoScN-lz.js} +1 -1
- package/dist/client/assets/{Shield01-KwFVdxDC.js → Shield01-DdHjMTFG.js} +1 -1
- package/dist/client/assets/{Stars01-D0mCYLdv.js → Stars01-BzOjLpPa.js} +1 -1
- package/dist/client/assets/{Stars02-kTE1_Iz0.js → Stars02-ZvnK7ym4.js} +1 -1
- package/dist/client/assets/{Sun-BDMTS65q.js → Sun-BT6a4BZg.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DfPnwT9V.js → SwitchHorizontal01-DCaXJWr6.js} +1 -1
- package/dist/client/assets/{Tool01-Ch6hlwSh.js → Tool01-Cb9-cwvE.js} +1 -1
- package/dist/client/assets/{Tool02-BxxsZkJA.js → Tool02-Dm-HMyEA.js} +1 -1
- package/dist/client/assets/{Trash01-BKz4fodI.js → Trash01-BHrMtwc3.js} +1 -1
- package/dist/client/assets/{TrendUp01-BjzF1ujp.js → TrendUp01-Z8clCfER.js} +1 -1
- package/dist/client/assets/{Upload01-CXZS5Xwb.js → Upload01-2qIzd6_3.js} +1 -1
- package/dist/client/assets/{User01-y6pFDwBd.js → User01-BKatvp0L.js} +1 -1
- package/dist/client/assets/{Users01-jj6G1H_Q.js → Users01-CBTIjE5d.js} +1 -1
- package/dist/client/assets/{Users03-B84s50Qe.js → Users03-Dv7QIiTO.js} +1 -1
- package/dist/client/assets/{X-1tpdcA57.js → X-LPyt3QJh.js} +1 -1
- package/dist/client/assets/{XCircle-DMCkoBS4.js → XCircle-DS9QsRD5.js} +1 -1
- package/dist/client/assets/{XClose-B923cVgj.js → XClose-Bkkx5eo2.js} +1 -1
- package/dist/client/assets/{YAxis-BbymNVh5.js → YAxis-oxEVrq_b.js} +1 -1
- package/dist/client/assets/{Zap-BQaeLyOX.js → Zap-G9arss8j.js} +1 -1
- package/dist/client/assets/{ZapSquare-B9aIlv3d.js → ZapSquare-D9HA-qmU.js} +1 -1
- package/dist/client/assets/{access-gate-8Cz30Bir.js → access-gate-CIdWo-EK.js} +1 -1
- package/dist/client/assets/{agent-icon-CV9SA5HA.js → agent-icon-Lcxstdy4.js} +1 -1
- package/dist/client/assets/{agents-list-pqZ-9MWi.js → agents-list-BIPvRvRI.js} +1 -1
- package/dist/client/assets/{ai-providers-DxyjtoAT.js → ai-providers-Bu5KAA6S.js} +1 -1
- package/dist/client/assets/{alert-j4K7O3iH.js → alert-AZBXp4Rw.js} +1 -1
- package/dist/client/assets/{alert-dialog-BpwE-DrS.js → alert-dialog-aISOIg4b.js} +1 -1
- package/dist/client/assets/{api-keys-Dxeqjeid.js → api-keys-CyFBHai0.js} +1 -1
- package/dist/client/assets/{app-editor-D9jMqb2B.js → app-editor-zGy5vbmQ.js} +1 -1
- package/dist/client/assets/{auth-DUWfQtFk.js → auth-CdMGqX15.js} +1 -1
- package/dist/client/assets/{auth-catchall-DzFUjdds.js → auth-catchall-BFuTTh7j.js} +1 -1
- package/dist/client/assets/{auth-entry-Ce6CuYbZ.js → auth-entry-Cuehy7hy.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BYfGawU4.js → auth-split-layout-B51Spkn_.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DxByWe6U.js → authenticate-and-persist-oauth-DjdQ3ZXC.js} +1 -1
- package/dist/client/assets/{automation-list-row-BM7KHgfL.js → automation-list-row-CWUigfWg.js} +1 -1
- package/dist/client/assets/{automation-runs-DFhDj2sR.js → automation-runs-2J7H3O77.js} +1 -1
- package/dist/client/assets/{automations-De_hPliJ.js → automations-BfUgRgKy.js} +1 -1
- package/dist/client/assets/{avatar-DLABdBS5.js → avatar-DI7p-s35.js} +1 -1
- package/dist/client/assets/{badge-Dmi1Edkl.js → badge-DVuU5L9V.js} +1 -1
- package/dist/client/assets/{billing-pQt5Wccx.js → billing-6kdVWTJp.js} +1 -1
- package/dist/client/assets/{block-document-D0USNHwK.js → block-document-DNbOnC6B.js} +1 -1
- package/dist/client/assets/{buckets-CHfLvih1.js → buckets-COsrCd7A.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BWXfpmvm.js → bulk-category-panel-yhsdOa28.js} +1 -1
- package/dist/client/assets/{capability-load-error-CWzCLzJM.js → capability-load-error-DWPGLqLm.js} +1 -1
- package/dist/client/assets/{card-pQ1UNz7f.js → card-BQFnpKaq.js} +1 -1
- package/dist/client/assets/{cards-Bj2o7opa.js → cards-DsZ08iqo.js} +1 -1
- package/dist/client/assets/{category-editor-wCbxNnON.js → category-editor-CP3Pz9EK.js} +1 -1
- package/dist/client/assets/{chart-CDj0WlGN.js → chart-Cl3k_g6W.js} +1 -1
- package/dist/client/assets/{chat-context-DGqU4TNb.js → chat-context-wxNjMmEU.js} +1 -1
- package/dist/client/assets/{checkbox-BZSdoD6r.js → checkbox-BTDCoEWb.js} +1 -1
- package/dist/client/assets/{choose-editor-C9QohQqE.js → choose-editor-BWUj33zS.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BvlVq2Y8.js → cli-auth-success-CQx8YSc7.js} +1 -1
- package/dist/client/assets/{collection-detail-rgWATjwV.js → collection-detail-DWZZmpBM.js} +1 -1
- package/dist/client/assets/{collection-display-button-tVJ931UZ.js → collection-display-button-DylckwsO.js} +1 -1
- package/dist/client/assets/{collection-search-D-gCLHmQ.js → collection-search-Dp0g6sxT.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BG9uTgkm.js → collection-table-wrapper-DxCwDVmP.js} +1 -1
- package/dist/client/assets/{collection-tabs-RgVTGYAL.js → collection-tabs-C78C6EX0.js} +1 -1
- package/dist/client/assets/{command-1iBMuqnC.js → command-CUBfHJdq.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-2n8teMae.js → commerce-onboarding-B-wtcnH1.js} +1 -1
- package/dist/client/assets/{connect-CtMyB9A1.js → connect-Cz3L3TMX.js} +1 -1
- package/dist/client/assets/{connection-DiQYN4WI.js → connection-CawmtQf4.js} +1 -1
- package/dist/client/assets/{connection-card-B7oew6Sj.js → connection-card-DFbRzPnk.js} +1 -1
- package/dist/client/assets/{connection-detail-Z_OJ-BIW.js → connection-detail-BqNBBnV3.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BL37f2pG.js → connection-form-helpers-ogjoGViU.js} +1 -1
- package/dist/client/assets/{connections-Bq7431v_.js → connections-Cxb1CnMN.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DxUDV3kB.js → decopilot-sse-pool-R2p5G030.js} +1 -1
- package/dist/client/assets/{dialog-DYbfOzPC.js → dialog-D0DoVc3r.js} +1 -1
- package/dist/client/assets/{domain-settings-DB1_-ET2.js → domain-settings-amIEGZ9u.js} +1 -1
- package/dist/client/assets/{drawer-DfpL6ei_.js → drawer-DcdefnqI.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DD28on4T.js → dropdown-menu-CHw-kEIe.js} +1 -1
- package/dist/client/assets/{empty-state-B0vBNoRU.js → empty-state-CGMCTLHD.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D0xv_Xpw.js → extract-connection-data-0m6mxuSv.js} +1 -1
- package/dist/client/assets/{file-explorer-BgAirbWR.js → file-explorer-CiWCIrib.js} +1 -1
- package/dist/client/assets/{file-type-icon-Bv7bwy1X.js → file-type-icon-vSB8bJUE.js} +1 -1
- package/dist/client/assets/{form-B8WNeuMM.js → form-CKIJGFw1.js} +1 -1
- package/dist/client/assets/{general-BzdEqWOs.js → general-CZfDvrL7.js} +1 -1
- package/dist/client/assets/{github-repo-picker-6YNSKnAB.js → github-repo-picker-nuuO1BJj.js} +1 -1
- package/dist/client/assets/{hooks-BH5ncP0o.js → hooks-7Syk3eDo.js} +1 -1
- package/dist/client/assets/{index-B01cmNcm.js → index-6bDbSKKA.js} +1 -1
- package/dist/client/assets/{index-DSYKgx16.js → index-9A9Q8J_H.js} +1 -1
- package/dist/client/assets/{index-BknjSN7Q.js → index-B3zCMdDN.js} +1 -1
- package/dist/client/assets/{index-CWr5yogT.js → index-BTl7Qhcu.js} +6 -6
- package/dist/client/assets/{index-llVAr4bS.js → index-ByXN8IcD.js} +1 -1
- package/dist/client/assets/{index-CWPWY8A2.js → index-CXYcVzkd.js} +1 -1
- package/dist/client/assets/{index-D3vycpy0.js → index-DFY57nNK.js} +1 -1
- package/dist/client/assets/{index-Cnu-uVYE.js → index-DW7SP2KF.js} +49 -49
- package/dist/client/assets/{index-CvagHRqr.js → index-LcrNCMks.js} +1 -1
- package/dist/client/assets/{index-D3MvvsdR.js → index-ZY27tbMr.js} +1 -1
- package/dist/client/assets/{index-redirect-BHE5x8Ah.js → index-redirect-Dg8lO66a.js} +1 -1
- package/dist/client/assets/{infra-billing-BUuSz5bV.js → infra-billing-mcv_gs6A.js} +1 -1
- package/dist/client/assets/{input-BwBLAcU4.js → input-D7bjRaiL.js} +1 -1
- package/dist/client/assets/{integration-icon-vMqCOva6.js → integration-icon-DvR5xNjT.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DhlH9sKX.js → invite-member-dialog-CQOsCwDo.js} +1 -1
- package/dist/client/assets/{label-L3jOsH6N.js → label-Be6bBbor.js} +1 -1
- package/dist/client/assets/{layout-Cys6ogu0.js → layout-DA0FrD1Q.js} +1 -1
- package/dist/client/assets/{login-CFzoSPvf.js → login-DQ2aTV8T.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D80_H96F.js → mcp-oauth-RQxm51yJ.js} +1 -1
- package/dist/client/assets/{members-BKDp7yW6.js → members-DCg8N7Ao.js} +1 -1
- package/dist/client/assets/{monaco-editor-DAZ7H6GV.js → monaco-editor-DnCDMSyo.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-3LrHb9nO.js → monitoring-stats-row-CGtBxdIU.js} +1 -1
- package/dist/client/assets/{multi-select-C4vrBfBX.js → multi-select-BM68N1Cj.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cto4zhfM.js → oauth-callback-B-LHN-yF.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Br3BeFpb.js → oauth-callback-ai-provider-B-5t-mW5.js} +1 -1
- package/dist/client/assets/{onboarding-oEhIHOlU.js → onboarding-CC656p3J.js} +1 -1
- package/dist/client/assets/{org-layout-Dyx0ZMPc.js → org-layout-V7zvD3cQ.js} +1 -1
- package/dist/client/assets/{organization-choice-CIo1vTrz.js → organization-choice-D4zV6Hf6.js} +1 -1
- package/dist/client/assets/{orgs-DNiAvqgw.js → orgs-B5ACJ-lj.js} +1 -1
- package/dist/client/assets/{page-seo-form-BkGoe1rY.js → page-seo-form-B4mx1blO.js} +1 -1
- package/dist/client/assets/{popover-DwADEOUa.js → popover-DgQxky2a.js} +1 -1
- package/dist/client/assets/{post-editor-DLMpYcNq.js → post-editor-De4LdGxw.js} +1 -1
- package/dist/client/assets/{primitives-Br8uKVR3.js → primitives-CRp6J0M_.js} +1 -1
- package/dist/client/assets/{profile-vhnHD8qW.js → profile-c8f_FnC4.js} +1 -1
- package/dist/client/assets/{project-app-view-CYxQ2muC.js → project-app-view-BH8TQOXj.js} +1 -1
- package/dist/client/assets/record-editor-B0i-c_kX.js +1 -0
- package/dist/client/assets/redirect-editor-DZPHvrtH.js +1 -0
- package/dist/client/assets/registry-DPabUjp9.js +2 -0
- package/dist/client/assets/{registry-layout-DUl6hNhd.js → registry-layout-3Wxl5OUj.js} +1 -1
- package/dist/client/assets/{reports-COSkzA4A.js → reports-B4HhUbwT.js} +1 -1
- package/dist/client/assets/{require-capability-D5-lnGcd.js → require-capability-C3ujpajl.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CTaIYIP8.js → required-auth-layout-D-qsvCCy.js} +1 -1
- package/dist/client/assets/{reset-password-aiRP5Ays.js → reset-password-DzLa7w6g.js} +1 -1
- package/dist/client/assets/roles-BklCWvE0.js +1 -0
- package/dist/client/assets/{search-input-WQSq4YL_.js → search-input-DSFfEluQ.js} +1 -1
- package/dist/client/assets/{secrets-CGJllEqD.js → secrets-DwlY9ha6.js} +1 -1
- package/dist/client/assets/{sections-editor-DylFjjZJ.js → sections-editor-BZ_0xlCp.js} +1 -1
- package/dist/client/assets/{select-CBSZ0Lug.js → select-CESIFQDf.js} +1 -1
- package/dist/client/assets/{select-model-BsfCtu4R.js → select-model-2gMKulEf.js} +1 -1
- package/dist/client/assets/{self-tool-result-DNAq-vwW.js → self-tool-result-BYW8f83x.js} +1 -1
- package/dist/client/assets/{seo-editor-CaCy-khG.js → seo-editor-BeJ-aOWV.js} +1 -1
- package/dist/client/assets/{settings-layout-BUm34cp5.js → settings-layout-D1o7KVZ4.js} +1 -1
- package/dist/client/assets/{settings-section-dcT_loqd.js → settings-section-sXWZszDJ.js} +1 -1
- package/dist/client/assets/{settings-subnav-DDOL5KMy.js → settings-subnav-D5JWKLk5.js} +1 -1
- package/dist/client/assets/{shell-controls-BmjqugkY.js → shell-controls-CHdJUO6W.js} +1 -1
- package/dist/client/assets/{shell-layout-CWaRwowP.js → shell-layout-D7gnCgqn.js} +1 -1
- package/dist/client/assets/{sidebar-Vbdz435r.js → sidebar-CMCU7OMz.js} +1 -1
- package/dist/client/assets/{skeleton-Doum5PuE.js → skeleton-DUrFo-pD.js} +1 -1
- package/dist/client/assets/{spinner-mYPpwvbF.js → spinner-BaLpWO3H.js} +1 -1
- package/dist/client/assets/{sso-CB4rcaK-.js → sso-CD4l1OID.js} +1 -1
- package/dist/client/assets/{store-DUvebUaH.js → store-BtCVavgQ.js} +1 -1
- package/dist/client/assets/store-registry-CgX4rLht.js +2 -0
- package/dist/client/assets/{studio-tools-D1WTrFr3.js → studio-tools-D-buMmW7.js} +1 -1
- package/dist/client/assets/{switch-WxAjh6LN.js → switch-Df5wDw3E.js} +1 -1
- package/dist/client/assets/{synced-repos-aMHOq-mr.js → synced-repos-COVqXIAK.js} +1 -1
- package/dist/client/assets/{tab-id-BONWRXY7.js → tab-id-DKJXJeSB.js} +1 -1
- package/dist/client/assets/{table-UKOQwvgs.js → table-BvlkOjlb.js} +1 -1
- package/dist/client/assets/{tabs-BAYBhY-B.js → tabs-ChXHfRsn.js} +1 -1
- package/dist/client/assets/{tasks-nH_8KZqG.js → tasks-Dx-Jnfmi.js} +1 -1
- package/dist/client/assets/{textarea-DVsSqFc7.js → textarea-CxyGETjB.js} +1 -1
- package/dist/client/assets/{toggle-group-D6mnwc67.js → toggle-group-BO35wHlq.js} +1 -1
- package/dist/client/assets/{toolbar-DZTLMAXr.js → toolbar-6DesbU9x.js} +1 -1
- package/dist/client/assets/{tooltip-sh5Vcy5o.js → tooltip-BwJyzC_0.js} +1 -1
- package/dist/client/assets/{track-CKQNca1N.js → track-BZdiiryX.js} +1 -1
- package/dist/client/assets/{types-C3iOdauk.js → types-DN30c8di.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CkzENZaN.js → use-ai-providers-B69eT_NQ.js} +1 -1
- package/dist/client/assets/{use-api-keys-D4YfcKbJ.js → use-api-keys-CW_ECRZy.js} +1 -1
- package/dist/client/assets/{use-automations-C4J3LwJ2.js → use-automations-CV-WrCUr.js} +1 -1
- package/dist/client/assets/{use-autosave-Dkw6F1L0.js → use-autosave-CJsegnhk.js} +1 -1
- package/dist/client/assets/{use-capability-CL8dQHM2.js → use-capability-DXwGFsqD.js} +1 -1
- package/dist/client/assets/{use-clock-tick-M8gtO9os.js → use-clock-tick-DwLQwdIM.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-DN1X4IW5.js → use-commerce-diagnostic-BZMAQwlL.js} +1 -1
- package/dist/client/assets/{use-connection-VGDVVQ1z.js → use-connection-DuD5ipdN.js} +1 -1
- package/dist/client/assets/{use-copy-mgcX5rsE.js → use-copy-BN27Q7JV.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bb0Ipg7x.js → use-create-virtual-mcp-DLEtAgkq.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CSRoYyDm.js → use-debounced-autosave-CpBdqu6k.js} +1 -1
- package/dist/client/assets/{use-debounced-value-E15h5LD3.js → use-debounced-value-UtlYWenV.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-9PMCbvpN.js → use-decopilot-events-CFDC275t.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CGA2fNyP.js → use-delete-connection-Nnsvx1hE.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DNmprhu5.js → use-deployment-admin-C1C8ebUh.js} +1 -1
- package/dist/client/assets/{use-file-configs-hzSNmpOq.js → use-file-configs-Bp-Tbkpb.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-vVtYR3JQ.js → use-infinite-scroll-B-Anz7bJ.js} +1 -1
- package/dist/client/assets/{use-join-requests-JyJucFLT.js → use-join-requests-iCFMHBEP.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Xm6nDmkT.js → use-mcp-client-Bw8xJhM_.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-HjqcWuQ-.js → use-mcp-tools-DleqyIvr.js} +1 -1
- package/dist/client/assets/{use-members-z3sg-hyj.js → use-members-CMStqEvj.js} +1 -1
- package/dist/client/assets/{use-mobile-HeXjiu3p.js → use-mobile-Do5Syn_e.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DYKLjse3.js → use-navigate-to-agent-FqU0kChq.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-B-BgSqMX.js → use-open-billing-url-qHT8HnXm.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CsEC-8-N.js → use-org-auth-client-DaS_JoLm.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CWwFdJOO.js → use-org-repo-syncs-mPpZW-JJ.js} +1 -1
- package/dist/client/assets/{use-org-sso-AZ9iXYy7.js → use-org-sso-BaXZDqQP.js} +1 -1
- package/dist/client/assets/{use-organization-roles-oMLLQKe1.js → use-organization-roles-BZrBMscL.js} +1 -1
- package/dist/client/assets/{use-organization-settings-pLz4lAB-.js → use-organization-settings-Dz8Eu7gM.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DgQVTAzb.js → use-registry-connections-D0zPhxUH.js} +1 -1
- package/dist/client/assets/{use-secrets-DZNeLfQZ.js → use-secrets-K7ODdpvg.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-D3BRL2b2.js → use-section-preview-base-BbLXFNZa.js} +1 -1
- package/dist/client/assets/{use-settings-tabs-CcNnEhAR.js → use-settings-tabs-wIBZFCcC.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B4kDHcys.js → use-status-sounds-CUvwATk-.js} +1 -1
- package/dist/client/assets/{use-tags-CyfUnJtt.js → use-tags-CyNtUCi7.js} +1 -1
- package/dist/client/assets/{use-view-mode-DYjx6Ji4.js → use-view-mode-CBfR4ZB0.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DlpcZhPC.js → use-virtual-mcp-DRJ-nmUB.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CJ7mkzKf.js +1 -0
- package/dist/client/assets/{useRouterState-CmHV9E7D.js → useRouterState-DdHFwscD.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CMig0MgC.js +1 -0
- package/dist/client/assets/{users-PcUYJwI1.js → users-PZWmPfu5.js} +1 -1
- package/dist/client/assets/{variant-calendar-BJx8Xiwa.js → variant-calendar-Cixa7Hpo.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B4YcCrH-.js → view-mode-toggle-CON7J5_6.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +548 -528
- package/dist/server/server.js +362 -342
- package/package.json +1 -1
- package/dist/client/assets/record-editor-Cp-acnY_.js +0 -1
- package/dist/client/assets/redirect-editor-D-6AASqj.js +0 -1
- package/dist/client/assets/registry-C7xHW0Tg.js +0 -2
- package/dist/client/assets/roles-CemfFg5d.js +0 -1
- package/dist/client/assets/store-registry-Di-zm9xf.js +0 -2
- package/dist/client/assets/useInfiniteQuery-P2P-hfvq.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bm6Pr5PC.js +0 -1
package/dist/client/assets/{require-capability-D5-lnGcd.js → require-capability-C3ujpajl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,j as m}from"./index-
|
|
1
|
+
import{c as p,j as m}from"./index-BTl7Qhcu.js";import{u as l}from"./use-capability-DXwGFsqD.js";import{A as u}from"./access-gate-CIdWo-EK.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
|
package/dist/client/assets/{required-auth-layout-CTaIYIP8.js → required-auth-layout-D-qsvCCy.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,j as s,A as a,S as m,g as h,i as u,N as g}from"./index-
|
|
1
|
+
import{c as l,j as s,A as a,S as m,g as h,i as u,N as g}from"./index-BTl7Qhcu.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(g,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function f(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{f 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-BTl7Qhcu.js";import{I as D}from"./input-D7bjRaiL.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as ie,r as F,F as Ue,K as me,n as ze,j as s,m as q,k as Oe,B as ce,c as X,X as Je,Y as ke,Z as re,a1 as We,a2 as Xe,o as it,$ as bt,a0 as Ot,e as rt,t as je,p as Ke,y as at,z as jt,E as Mt,d as Dt,u as vt}from"./index-BTl7Qhcu.js";import{u as Lt}from"./use-organization-roles-BZrBMscL.js";import{u as Fe}from"./use-org-auth-client-DaS_JoLm.js";import{g as ct,a as yt}from"./role-color-Dn2tXDDF.js";import{B as Me}from"./badge-DVuU5L9V.js";import{A as dt,a as mt,c as ut,d as ft,b as gt,f as ht,g as xt,e as pt}from"./alert-dialog-aISOIg4b.js";import{c as Pt,D as wt,b as Gt,a as kt}from"./dropdown-menu-CHw-kEIe.js";import{a as Ut}from"./DotsVertical-BJksCEBT.js";import{s as Ye}from"./Plus-DzCY9mis.js";import{s as Bt}from"./Trash01-BHrMtwc3.js";import{C as Vt}from"./collection-table-wrapper-DxCwDVmP.js";import{P as ae}from"./index-9A9Q8J_H.js";import{E as et}from"./empty-state-CGMCTLHD.js";import{S as $e}from"./search-input-DSFfEluQ.js";import{P as Tt,D as _t}from"./ai-providers-logos-DD3qZ33J.js";import{I as Qe}from"./integration-icon-DvR5xNjT.js";import{u as Yt}from"./use-infinite-scroll-B-Anz7bJ.js";import{C as He}from"./checkbox-BTDCoEWb.js";import{i as zt}from"./ArrowLeft-6Uvqwled.js";import{u as Kt}from"./useSuspenseInfiniteQuery-CMig0MgC.js";import{u as Ft,S as $t}from"./use-mcp-client-Bw8xJhM_.js";import{C as Qt}from"./collection-search-Dp0g6sxT.js";import{p as Ht}from"./connection-CawmtQf4.js";import{a as Et}from"./use-members-CMStqEvj.js";import{g as It}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-DuD5ipdN.js";import{u as qt,g as Jt}from"./use-ai-providers-B69eT_NQ.js";import{A as Rt}from"./avatar-DI7p-s35.js";import{S as De}from"./switch-Df5wDw3E.js";import{b as ve,c as Le,T as ye,a as Pe}from"./tooltip-BwJyzC_0.js";import{S as tt,a as st,b as lt}from"./settings-section-sXWZszDJ.js";import{t as Wt}from"./ChevronDown-BPLhBbcC.js";import{i as Xt}from"./ChevronRight-CjwWuSKC.js";import{i as ot}from"./X-LPyt3QJh.js";import{a as es}from"./use-capability-DXwGFsqD.js";import{A as ts}from"./access-gate-CIdWo-EK.js";import{S as ss}from"./settings-subnav-D5JWKLk5.js";import"./Check-BeLWQxAW.js";import"./table-BvlkOjlb.js";import"./ArrowUp-CZqWUJZy.js";import"./sidebar-CMCU7OMz.js";import"./LayoutLeft-DR7AqeCR.js";import"./use-mobile-Do5Syn_e.js";import"./SearchMd-OSuucajh.js";import"./Tool02-Dm-HMyEA.js";import"./agent-icon-Lcxstdy4.js";import"./AlertCircle-DpbDmpl4.js";import"./Tool01-Cb9-cwvE.js";import"./XCircle-DS9QsRD5.js";import"./ArrowUpRight-BkqhcGtY.js";import"./TrendUp01-Z8clCfER.js";import"./ZapSquare-D9HA-qmU.js";import"./Users03-Dv7QIiTO.js";import"./CheckCircle-DIdAaiEB.js";import"./ChevronUp-CRIfPNig.js";import"./Stars02-ZvnK7ym4.js";import"./Copy01-D0UklT6j.js";import"./CreditCard01-DFMnSd2M.js";import"./Download01-nz2y-YpD.js";import"./Settings02-RnwqI_s-.js";import"./Eye-BNVQo7YS.js";import"./FilterLines-uRbQkChb.js";import"./Share07-BoScN-lz.js";import"./Globe01-DyvYVxg0.js";import"./Globe04-CeHN-qAt.js";import"./SwitchHorizontal01-DCaXJWr6.js";import"./HardDrive-BeQR0yEZ.js";import"./Key01-PmvG5GId.js";import"./LinkExternal01-DT2zbGiX.js";import"./LockUnlocked01-CT3ndXQj.js";import"./LogOut01-DfBxSCYF.js";import"./Monitor01-CiLYUYXU.js";import"./Sun-BT6a4BZg.js";import"./Palette-BjyqEmv9.js";import"./Play-CTk0UTMj.js";import"./SearchLg-CNfPTXFn.js";import"./Shield01-DdHjMTFG.js";import"./Stars01-BzOjLpPa.js";import"./Upload01-2qIzd6_3.js";import"./User01-BKatvp0L.js";import"./Users01-CBTIjE5d.js";import"./XClose-Bkkx5eo2.js";import"./Zap-G9arss8j.js";import"./auth-CdMGqX15.js";import"./studio-tools-D-buMmW7.js";import"./card-BQFnpKaq.js";import"./capability-load-error-DWPGLqLm.js";import"./useRouterState-DdHFwscD.js";import"./use-settings-tabs-wIBZFCcC.js";const Ze="basic-usage",qe=[{id:Ze,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","GITHUB_SEARCH_BRANCHES","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_ITEM_PRS_GET","TASK_BOARD_ITEM_PR_LINK","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"]},{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_SYNC_RUN"]},{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}];[...qe.find(t=>t.id===Ze)?.tools??[]];const ls=["agents:manage","connections:manage"];new Set(qe.filter(t=>ls.includes(t.id)).flatMap(t=>t.tools));function os(){const t=new Map;for(const e of qe){if(e.id===Ze)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 ns(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function is(t,e,l){if(l){const i=new Set(e);for(const o of t.tools)i.add(o);return Array.from(i)}const n=new Set(e);for(const i of t.tools)n.delete(i);return Array.from(n)}function rs(t){const e=X.c(21),{connection:l,isSelected:n,hasToolsEnabled:i,activeToolsCount:o,totalToolsCount:c,onSelect:g,onToggle:h}=t,m=n?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==m?(f=q("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",m),e[0]=m,e[1]=f):f=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Qe,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let u;e[5]!==l.title?(u=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]=u):u=e[6];let x;e[7]!==g||e[8]!==a||e[9]!==u?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[a,u]}),e[7]=g,e[8]=a,e[9]=u,e[10]=x):x=e[10];let d;e[11]!==o||e[12]!==l.tools||e[13]!==i||e[14]!==h||e[15]!==c?(d=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(He,{checked:i,onCheckedChange:h,onClick:as})]}),e[11]=o,e[12]=l.tools,e[13]=i,e[14]=h,e[15]=c,e[16]=d):d=e[16];let p;return e[17]!==f||e[18]!==x||e[19]!==d?(p=s.jsxs("div",{className:f,children:[x,d]}),e[17]=f,e[18]=x,e[19]=d,e[20]=p):p=e[20],p}function as(t){return t.stopPropagation()}function cs(t){const e=X.c(18),{connectionId:l,tool:n,isSelected:i,onToggle:o}=t,c=`tool-${l}-${n.name}`,g=i?"text-foreground":"text-muted-foreground";let h;e[0]!==g?(h=q("text-sm font-medium",g),e[0]=g,e[1]=h):h=e[1];let m;e[2]!==h||e[3]!==n.name?(m=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:h,children:n.name})}),e[2]=h,e[3]=n.name,e[4]=m):m=e[4];let f;e[5]!==n.description?(f=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=f):f=e[6];let a;e[7]!==m||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,f]}),e[7]=m,e[8]=f,e[9]=a):a=e[9];const u=`tool-${l}-${n.name}`;let x;e[10]!==i||e[11]!==o||e[12]!==u?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(He,{id:u,checked:i,onCheckedChange:o,onClick:ds})}),e[10]=i,e[11]=o,e[12]=u,e[13]=x):x=e[13];let d;return e[14]!==c||e[15]!==a||e[16]!==x?(d=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,x]}),e[14]=c,e[15]=a,e[16]=x,e[17]=d):d=e[17],d}function ds(t){return t.stopPropagation()}function ms({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const i=ie(),[o,c]=F.useState(""),g=n!==void 0?n:o,h=F.useDeferredValue(g),[m,f]=F.useState("all"),[a,u]=F.useState(!1),x=F.useRef(new Set(Object.keys(t))),{org:d}=Ue(),p=Ft({connectionId:$t,orgId:d.id,orgSlug:d.slug}),C=100,R=h.trim(),I=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,b=!!l,N={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:0,...b&&{include_virtual:!0}},M=JSON.stringify(N),{data:S,fetchNextPage:O,hasNextPage:D,isFetchingNextPage:_}=Kt({queryKey:me.collectionListInfinite(p,d.id,"","CONNECTIONS",M),queryFn:async({pageParam:T=0})=>(await p.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:T,...b&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,w)=>{if(T?.hasMore)return w.reduce((Q,W)=>Q+(W?.items?.length??0),0)},staleTime:3e4}),A=S?.pages.flatMap(T=>T?.items??[])??[],v=Yt(O,D??!1,_),r=l?A.filter(T=>T.connection_type!=="VIRTUAL"?!0:Ht(T.connection_url)!==l):A,E=x.current,k=[...E.values()].map(T=>r.find(w=>w.id===T)).filter(T=>T!==void 0),G=r.filter(T=>!E.has(T.id)),Y=[...k,...G],L=T=>{const w=t[T];return w!==void 0&&w.length>0},z=Y.filter(T=>{if(m==="all")return!0;const w=L(T.id);return m==="selected"?w:m==="unselected"?!w:!0}),[y,K]=F.useState(Y[0]?.id??null),V=y?Y.find(T=>T.id===y)??null:null,{data:U,isFetching:B}=ze({queryKey:me.collectionItem(p,d.id,"","CONNECTIONS",y??""),queryFn:async()=>y?(await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:y}})).structuredContent?.item??null:null,enabled:!!y,staleTime:3e4}),H=U?.tools??[],J=(T,w)=>t[T]?.includes(w)??!1,te=(T,w)=>{const Q=t[T]??[],W=Q.includes(w),se={...t};if(W){const le=Q.filter(ne=>ne!==w);le.length===0?delete se[T]:se[T]=le}else se[T]=[...Q,w];e(se)},oe=T=>{const w=T===y?H:[];if(!w.length)return;const Q=t[T]??[],W=w.map(ne=>ne.name),se=Q.length>0&&W.every(ne=>Q.includes(ne)),le={...t};se?delete le[T]:(le[T]=W,K(T)),e(le)},$=T=>{K(T),u(!0)},Z=()=>{u(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:q("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[n===void 0&&s.jsx(Qt,{value:o,onChange:c,placeholder:i("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>f("all"),className:q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>f("selected"),className:q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>f("unselected"),className:q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:z.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:i(g?"common.toolSetSelector.noConnectionsFound":m==="selected"?"common.toolSetSelector.noServersSelected":m==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[z.map(T=>{const w=y===T.id,Q=w?H.length:0,W=t[T.id]?.length??0;return s.jsx(rs,{connection:{...T,tools:w?H:T.tools},isSelected:w,hasToolsEnabled:L(T.id),activeToolsCount:W,totalToolsCount:Q,onSelect:()=>$(T.id),onToggle:()=>oe(T.id)},T.id)}),s.jsx("div",{ref:v,className:"h-4"}),_&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:q("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(ce,{variant:"ghost",size:"sm",onClick:Z,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(Qe,{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,{size:18,className:"animate-spin text-muted-foreground"})}):H.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:H.map(T=>s.jsx(cs,{connectionId:V.id,tool:T,isSelected:J(V.id,T.name),onToggle:()=>te(V.id,T.name)},T.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:i("common.toolSetSelector.selectConnection")})})})]})}const us=Je({role:Je({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Xe(),staticPermissions:ke(re()),toolSet:We(re(),ke(re())),allowAllModels:Xe(),modelSet:We(re(),ke(re())),memberIds:ke(re())});function nt(t,e,l,n){const i=s.jsx(De,{checked:e,disabled:l,onCheckedChange:n});return l?s.jsx(ve,{children:s.jsxs(Le,{children:[s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:i})}),s.jsx(Pe,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):i}function fs(t){const e=X.c(41),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:i,onPermissionsChange:o,readOnly:c,searchQuery:g}=t,h=c===void 0?!1:c,m=ie();let f;e[0]!==g?(f=g.trim().toLowerCase(),e[0]=g,e[1]=f):f=e[1];const a=F.useDeferredValue(f);let u;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==o||e[6]!==h||e[7]!==g||e[8]!==n||e[9]!==m){const x=os(),d=(_,A)=>{if(!h){if(l&&A){const v=x.flatMap(xs).flatMap(hs);i(!1),o(v.filter(r=>!_.tools.includes(r)));return}l||o(is(_,n,!A))}};let p;e[11]!==a?(p=_=>{const{section:A,capabilities:v}=_;return{section:A,capabilities:v.filter(r=>!a||r.label.toLowerCase().includes(a)||r.description.toLowerCase().includes(a))}},e[11]=a,e[12]=p):p=e[12];const C=x.map(p).filter(gs);let R;e[13]!==m?(R=m("settings.orgRoleDetail.general"),e[13]=m,e[14]=R):R=e[14];let I;e[15]!==m?(I=m("settings.orgRoleDetail.allOrgPermissions"),e[15]=m,e[16]=I):I=e[16];let b;e[17]!==m?(b=m("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=m,e[18]=b):b=e[18];let N;e[19]!==l||e[20]!==i||e[21]!==o?(N=()=>{i(!l),o([])},e[19]=l,e[20]=i,e[21]=o,e[22]=N):N=e[22];let M;e[23]!==l||e[24]!==h||e[25]!==m||e[26]!==N?(M=nt(m,l,h,N),e[23]=l,e[24]=h,e[25]=m,e[26]=N,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==i||e[30]!==o||e[31]!==h?(S=h?void 0:()=>{i(!l),o([])},e[28]=l,e[29]=i,e[30]=o,e[31]=h,e[32]=S):S=e[32];let O;e[33]!==S||e[34]!==I||e[35]!==b||e[36]!==M?(O=s.jsx(st,{children:s.jsx(lt,{title:I,description:b,action:M,onClick:S})}),e[33]=S,e[34]=I,e[35]=b,e[36]=M,e[37]=O):O=e[37];let D;e[38]!==O||e[39]!==R?(D=s.jsx(tt,{title:R,children:O}),e[38]=O,e[39]=R,e[40]=D):D=e[40],u=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,C.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:m("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:g})}):C.map(_=>{const{section:A,capabilities:v}=_;return s.jsx(tt,{title:A,children:s.jsx(st,{children:v.map(r=>{const E=ns(r,n,l);return s.jsx(lt,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[r.label,r.dangerous&&s.jsx(jt,{size:12,className:"text-warning shrink-0"})]}),description:r.description,action:nt(m,E,h,()=>d(r,E)),onClick:h?void 0:()=>d(r,E)},r.id)})})},A)})]})}),e[2]=l,e[3]=a,e[4]=i,e[5]=o,e[6]=h,e[7]=g,e[8]=n,e[9]=m,e[10]=u}else u=e[10];return u}function gs(t){return t.capabilities.length>0}function hs(t){return t.tools}function xs(t){return t.capabilities}const St={anthropic:"Anthropic",openrouter:"OpenRouter"},ps={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 Ts(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function _s(t){return ps[t]??St[t]??t}function Es(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Nt=30;function Is(t){const e=X.c(40),{connectionId:l,subProviderId:n,subProviderName:i,groupLogo:o,models:c,allConnectionModelIds:g,selectedModels:h,allowAllModels:m,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:u,readOnly:x,defaultExpanded:d}=t,p=ie(),[C,R]=F.useState(d),I=d||C,b=R,[N,M]=F.useState(Nt);let S;e[0]!==f||e[1]!==m||e[2]!==h?(S=_=>m||f||h.includes("*")||h.includes(_),e[0]=f,e[1]=m,e[2]=h,e[3]=S):S=e[3];const O=S;let D;if(e[4]!==g||e[5]!==m||e[6]!==l||e[7]!==I||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==u||e[12]!==a||e[13]!==x||e[14]!==n||e[15]!==i||e[16]!==p||e[17]!==N){let _;e[19]!==O?(_=B=>O(B.id),e[19]=O,e[20]=_):_=e[20];const A=c.filter(_).length,v=c.slice(0,N),r=c.length>N;let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=()=>b(As),e[21]=E):E=e[21];const k=o??Tt[n]??_t;let G;e[22]!==i||e[23]!==k?(G=s.jsx(Qe,{icon:k,name:i,size:"sm"}),e[22]=i,e[23]=k,e[24]=G):G=e[24];let Y;e[25]!==i?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[25]=i,e[26]=Y):Y=e[26];let L;e[27]!==G||e[28]!==Y?(L=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]=L):L=e[29];const z=p("settings.orgRoleDetail.enabledCount",{enabledCount:A,total:c.length});let y;e[30]!==z?(y=s.jsx(Me,{variant:"secondary",className:"text-xs text-muted-foreground",children:z}),e[30]=z,e[31]=y):y=e[31];let K;e[32]!==I?(K=I?s.jsx(Wt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=I,e[33]=K):K=e[33];let V;e[34]!==y||e[35]!==K?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[y,K]}),e[34]=y,e[35]=K,e[36]=V):V=e[36];let U;e[37]!==V||e[38]!==L?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:E,children:[L,V]}),e[37]=V,e[38]=L,e[39]=U):U=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,I&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[v.map(B=>{const H=O(B.id),J=()=>{if(!x){if(m){u(l,g,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:q("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"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:Ns,children:x?s.jsx(ve,{children:s.jsxs(Le,{children:[s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:H,disabled:!0,onCheckedChange:Ss})})}),s.jsx(Pe,{children:s.jsx("p",{children:p("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:H,onCheckedChange:J})})]},B.id)}),r&&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(Rs),children:p("settings.orgRoleDetail.showMore",{remaining:c.length-N})})]})]}),e[4]=g,e[5]=m,e[6]=l,e[7]=I,e[8]=o,e[9]=O,e[10]=c,e[11]=u,e[12]=a,e[13]=x,e[14]=n,e[15]=i,e[16]=p,e[17]=N,e[18]=D}else D=e[18];return D}function Rs(t){return t+Nt}function Ss(){}function Ns(t){return t.stopPropagation()}function As(t){return!t}function Cs(t){const e=X.c(33),{connection:l,selectedModels:n,allowAllModels:i,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:g,searchQuery:h,readOnly:m}=t,f=Jt(l.id);let a,u,x,d,p;if(e[0]!==g||e[1]!==i||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==n){p=Symbol.for("react.early_return_sentinel");e:{let I;e[16]!==l.label?(I=E=>({...E,id:E.modelId,provider:l.label}),e[16]=l.label,e[17]=I):I=e[17];const b=f.filter(Ms).map(I),N=h.trim().toLowerCase(),M=N?b.filter(E=>E.title.toLowerCase().includes(N)||E.id.toLowerCase().includes(N)||E.provider?.toLowerCase().includes(N)):b;if(M.length===0){p=null;break e}const S=new Map;for(const E of M){const k=Ts(E.id,l.providerId),G=S.get(k)??{models:[],logo:null};G.models.push({id:E.id,title:Es(E.title),logo:E.logo}),!G.logo&&E.logo&&(G.logo=E.logo),S.set(k,G)}const O=Array.from(S.entries()).map(js).sort(Os),D=O.length===1||N.length>0;x="flex flex-col gap-3";const _=Tt[l.providerId]??_t;let A;e[18]!==l.providerId||e[19]!==_?(A=s.jsx("img",{src:_,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]=_,e[20]=A):A=e[20];const v=St[l.providerId]??l.providerId;let r;e[21]!==v?(r=s.jsx("h4",{className:"text-sm font-medium",children:v}),e[21]=v,e[22]=r):r=e[22],e[23]!==r||e[24]!==A?(d=s.jsxs("div",{className:"flex items-center gap-2",children:[A,r]}),e[23]=r,e[24]=A,e[25]=d):d=e[25],a="flex flex-col gap-3",u=O.map(E=>s.jsx(Is,{connectionId:l.id,subProviderId:E.id,subProviderName:E.name,groupLogo:E.logo,models:E.models,allConnectionModelIds:b.map(bs),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:g,onToggleModel:o,onExitAllowAll:c,readOnly:m,defaultExpanded:D},E.id))}e[0]=g,e[1]=i,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=f,e[8]=m,e[9]=h,e[10]=n,e[11]=a,e[12]=u,e[13]=x,e[14]=d,e[15]=p}else a=e[11],u=e[12],x=e[13],d=e[14],p=e[15];if(p!==Symbol.for("react.early_return_sentinel"))return p;let C;e[26]!==a||e[27]!==u?(C=s.jsx("div",{className:a,children:u}),e[26]=a,e[27]=u,e[28]=C):C=e[28];let R;return e[29]!==x||e[30]!==d||e[31]!==C?(R=s.jsxs("div",{className:x,children:[d,C]}),e[29]=x,e[30]=d,e[31]=C,e[32]=R):R=e[32],R}function bs(t){return t.id}function Os(t,e){return t.name.localeCompare(e.name)}function js(t){const[e,l]=t;return{id:e,name:_s(e),logo:l.logo,models:l.models}}function Ms(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function Ds(t){const e=X.c(41),{allowAllModels:l,modelSet:n,onAllowAllChange:i,onModelSetChange:o,readOnly:c,searchQuery:g}=t,h=c===void 0?!1:c,m=ie(),f=F.useDeferredValue(g),a=qt();let u;e[0]!==n||e[1]!==o?(u=(_,A)=>{const v=n[_]??[],r={...n};if(v.includes(A)){const E=v.filter(k=>k!==A);E.length===0?delete r[_]:r[_]=E}else r[_]=[...v,A];o(r)},e[0]=n,e[1]=o,e[2]=u):u=e[2];const x=u;let d;e[3]!==n||e[4]!==i||e[5]!==o?(d=(_,A,v)=>{i(!1),o({...n,[_]:A.filter(r=>r!==v)})},e[3]=n,e[4]=i,e[5]=o,e[6]=d):d=e[6];const p=d,C=!h&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==C?(R=q("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",C),e[7]=C,e[8]=R):R=e[8];let I;e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==h?(I=()=>{if(h)return;const _=!l;i(_),_&&o({})},e[9]=l,e[10]=i,e[11]=o,e[12]=h,e[13]=I):I=e[13];let b;e[14]!==m?(b=m("settings.orgRoleDetail.allModels"),e[14]=m,e[15]=b):b=e[15];let N;e[16]!==b?(N=s.jsx("span",{className:"text-sm font-medium",children:b}),e[16]=b,e[17]=N):N=e[17];let M;e[18]!==l||e[19]!==i||e[20]!==o||e[21]!==h||e[22]!==m?(M=s.jsx("div",{onClick:Ls,children:h?s.jsx(ve,{children:s.jsxs(Le,{children:[s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:l,disabled:!0,onCheckedChange:vs})})}),s.jsx(Pe,{children:s.jsx("p",{children:m("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:l,onCheckedChange:_=>{i(_),_&&o({})}})}),e[18]=l,e[19]=i,e[20]=o,e[21]=h,e[22]=m,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==I||e[26]!==N||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:I,children:[N,M]}),e[24]=R,e[25]=I,e[26]=N,e[27]=M,e[28]=S):S=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==f||e[32]!==p||e[33]!==n||e[34]!==h||e[35]!==m||e[36]!==x?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:m("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(_=>s.jsx(F.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 animate-spin"}),m("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Cs,{connection:_,selectedModels:n[_.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:p,allConnectionModelsSelected:(n[_.id]??[]).includes("*"),searchQuery:f,readOnly:h})},_.id)),e[29]=a,e[30]=l,e[31]=f,e[32]=p,e[33]=n,e[34]=h,e[35]=m,e[36]=x,e[37]=O):O=e[37];let D;return e[38]!==S||e[39]!==O?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,O]}),e[38]=S,e[39]=O,e[40]=D):D=e[40],D}function vs(){}function Ls(t){return t.stopPropagation()}function ys(t){const e=X.c(75),{open:l,onOpenChange:n,selectedMemberIds:i,onAddMembers:o}=t,c=ie(),[g,h]=F.useState(""),m=F.useDeferredValue(g);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[0]=f):f=e[0];const[a,u]=F.useState(f),{data:x}=Et();let d,p,C,R,I,b,N,M,S,O,D;if(e[1]!==x?.data?.members||e[2]!==m||e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==g||e[8]!==i||e[9]!==c){const y=x?.data?.members??[];let K;e[21]!==m?(K=$=>{const Z=m.toLowerCase();return $.user?.name?.toLowerCase().includes(Z)||$.user?.email?.toLowerCase().includes(Z)},e[21]=m,e[22]=K):K=e[22];const V=y.filter(K);let U;e[23]!==o||e[24]!==n||e[25]!==a?(U=()=>{o(a),u([]),n(!1)},e[23]=o,e[24]=n,e[25]=a,e[26]=U):U=e[26],C=U,p=dt,O=l,D=n,d=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 H;e[29]!==B?(H=s.jsx(ut,{children:B}),e[29]=B,e[30]=H):H=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]!==H||e[36]!==te?(S=s.jsxs(gt,{className:"px-6 pt-6",children:[H,te]}),e[35]=H,e[36]=te,e[37]=S):S=e[37],b="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]!==g||e[41]!==oe?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx($e,{value:g,onChange:h,placeholder:oe,className:"w-full"})}),e[40]=g,e[41]=oe,e[42]=N):N=e[42],R="flex-1 overflow-auto",I=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(g?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map($=>{const Z=$.role!=="owner",T=i.includes($.id),w=a.includes($.id);return s.jsxs("label",{className:q("flex items-center gap-3 p-2 rounded-lg",!Z||T?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(He,{checked:w||T,onCheckedChange:()=>{!Z||T||u(Q=>Q.includes($.id)?Q.filter(W=>W!==$.id):[...Q,$.id])},disabled:!Z||T}),s.jsx(Rt,{url:$.user?.image??void 0,fallback:It($.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:$.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:$.user?.email})]}),!Z&&s.jsx(Me,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),T&&Z&&s.jsx(Me,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},$.id)})}),e[1]=x?.data?.members,e[2]=m,e[3]=o,e[4]=n,e[5]=l,e[6]=a,e[7]=g,e[8]=i,e[9]=c,e[10]=d,e[11]=p,e[12]=C,e[13]=R,e[14]=I,e[15]=b,e[16]=N,e[17]=M,e[18]=S,e[19]=O,e[20]=D}else d=e[10],p=e[11],C=e[12],R=e[13],I=e[14],b=e[15],N=e[16],M=e[17],S=e[18],O=e[19],D=e[20];let _;e[43]!==R||e[44]!==I?(_=s.jsx("div",{className:R,children:I}),e[43]=R,e[44]=I,e[45]=_):_=e[45];let A;e[46]!==_||e[47]!==b||e[48]!==N?(A=s.jsxs("div",{className:b,children:[N,_]}),e[46]=_,e[47]=b,e[48]=N,e[49]=A):A=e[49];let v;e[50]!==c?(v=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=v):v=e[51];let r;e[52]!==v?(r=s.jsx(ht,{children:v}),e[52]=v,e[53]=r):r=e[53];const E=a.length===0;let k;e[54]!==a.length||e[55]!==c?(k=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=k):k=e[56];let G;e[57]!==C||e[58]!==E||e[59]!==k?(G=s.jsx(xt,{onClick:C,disabled:E,children:k}),e[57]=C,e[58]=E,e[59]=k,e[60]=G):G=e[60];let Y;e[61]!==r||e[62]!==G?(Y=s.jsxs(pt,{className:"px-6 pb-6",children:[r,G]}),e[61]=r,e[62]=G,e[63]=Y):Y=e[63];let L;e[64]!==d||e[65]!==A||e[66]!==Y||e[67]!==M||e[68]!==S?(L=s.jsxs(d,{className:M,children:[S,A,Y]}),e[64]=d,e[65]=A,e[66]=Y,e[67]=M,e[68]=S,e[69]=L):L=e[69];let z;return e[70]!==p||e[71]!==L||e[72]!==O||e[73]!==D?(z=s.jsx(p,{open:O,onOpenChange:D,children:L}),e[70]=p,e[71]=L,e[72]=O,e[73]=D,e[74]=z):z=e[74],z}function Ps(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:n,readOnly:i,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:g,onAddMemberDialogOpenChange:h}=t,m=i===void 0?!1:i,f=o===void 0?void 0:o,a=ie(),u=F.useDeferredValue(c),{data:x}=Et();let d,p,C;if(e[0]!==x?.data?.members||e[1]!==u||e[2]!==l||e[3]!==n||e[4]!==m||e[5]!==f||e[6]!==c||e[7]!==a){const M=x?.data?.members??[];let S;e[11]!==l?(S=r=>l.includes(r.id),e[11]=l,e[12]=S):S=e[12];const O=M.filter(S);let D;e[13]!==u?(D=r=>{const E=u.toLowerCase();return r.user?.name?.toLowerCase().includes(E)||r.user?.email?.toLowerCase().includes(E)},e[13]=u,e[14]=D):D=e[14];const _=O.filter(D);let A;e[15]!==f||e[16]!==a?(A=f??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=f,e[16]=a,e[17]=A):A=e[17];const v=A;C="flex flex-col h-full",d="flex-1 overflow-auto",p=O.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")})]})}):_.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:_.map(r=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Rt,{url:r.user?.image??void 0,fallback:It(r.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:r.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r.user?.email})]}),m?s.jsx(ve,{children:s.jsxs(Le,{children:[s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:s.jsx(ce,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:r.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(ot,{size:16})})})}),s.jsx(Pe,{children:s.jsx("p",{children:v})})]})}):s.jsx(ce,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:r.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>n(l.filter(E=>E!==r.id)),children:s.jsx(ot,{size:16})})]},r.id))}),e[0]=x?.data?.members,e[1]=u,e[2]=l,e[3]=n,e[4]=m,e[5]=f,e[6]=c,e[7]=a,e[8]=d,e[9]=p,e[10]=C}else d=e[8],p=e[9],C=e[10];let R;e[18]!==d||e[19]!==p?(R=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=R):R=e[20];let I;e[21]!==l||e[22]!==n?(I=M=>n([...l,...M]),e[21]=l,e[22]=n,e[23]=I):I=e[23];let b;e[24]!==g||e[25]!==l||e[26]!==h||e[27]!==I?(b=s.jsx(ys,{open:g,onOpenChange:h,selectedMemberIds:l,onAddMembers:I}),e[24]=g,e[25]=l,e[26]=h,e[27]=I,e[28]=b):b=e[28];let N;return e[29]!==C||e[30]!==R||e[31]!==b?(N=s.jsxs("div",{className:C,children:[R,b]}),e[29]=C,e[30]=R,e[31]=b,e[32]=N):N=e[32],N}function ws(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,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx(F.Suspense,{fallback:l,children:s.jsx(Ps,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const Gs={owner:[],admin:[],user:[]};function ks(t,e,l,n){const i=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:Gs[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const n=t.permission||{},i=n.self||[],o=i.includes("*"),c=o?[]:i.filter(a=>a!=="*"),g={};for(const[a,u]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const x of l)g[x.id]=u.includes("*")?x.tools?.map(d=>d.name)??[]:u;else{const x=l.find(d=>d.id===a);x&&(g[a]=u.includes("*")?x.tools?.map(d=>d.name)??[]:u)}const h=n.models||[],m=h.length===0||h.includes("*:*"),f={};if(!m)for(const a of h){const u=a.indexOf(":");if(u===-1)continue;const x=a.slice(0,u),d=a.slice(u+1);f[x]||(f[x]=[]),f[x].push(d)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:g,allowAllModels:m,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Bs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,i]of Object.entries(t.toolSet))if(i.length>0){const c=e.find(g=>g.id===n)?.tools?.map(g=>g.name)??[];l[n]=c.length>0&&c.every(g=>i.includes(g))?["*"]:i}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[i,o]of Object.entries(t.modelSet))for(const c of o)n.push(`${i}:${c}`);n.length>0&&(l.models=n)}return l}function Vs(t,e,l){return t.kind==="builtin"?ks(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 Ys(t){const e=X.c(19),{readOnly:l,readOnlyMessage:n,onOpen:i}=t,o=n===void 0?void 0:n,c=ie();let g;e[0]!==o||e[1]!==c?(g=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=g):g=e[2];const h=g;if(l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ye,{size:16}),e[3]=u):u=e[3];let x;e[4]!==c?(x=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=x):x=e[5];let d;e[6]!==x?(d=s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ce,{variant:"outline",size:"sm",disabled:!0,children:[u,x]})})}),e[6]=x,e[7]=d):d=e[7];let p;e[8]!==h?(p=s.jsx(Pe,{children:s.jsx("p",{children:h})}),e[8]=h,e[9]=p):p=e[9];let C;return e[10]!==d||e[11]!==p?(C=s.jsx(ve,{children:s.jsxs(Le,{children:[d,p]})}),e[10]=d,e[11]=p,e[12]=C):C=e[12],C}let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ye,{size:16}),e[13]=m):m=e[13];let f;e[14]!==c?(f=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=f):f=e[15];let a;return e[16]!==i||e[17]!==f?(a=s.jsxs(ce,{variant:"outline",size:"sm",onClick:i,children:[m,f]}),e[16]=i,e[17]=f,e[18]=a):a=e[18],a}function zs(t){const e=X.c(14),{locator:l}=Ue(),n=Fe(),i=Zt();let o;e[0]!==l?(o=me.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n?(c=()=>n.organization.listMembers(),e[2]=n,e[3]=c):c=e[3];let g;e[4]!==o||e[5]!==c?(g={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=g):g=e[6];const{data:h,isPending:m}=ze(g);if(m||!i){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=x):x=e[7],x}let f;e[8]!==h?.data?.members?(f=h?.data?.members??[],e[8]=h?.data?.members,e[9]=f):f=e[9];const a=f;let u;return e[10]!==i||e[11]!==a||e[12]!==t?(u=s.jsx(Ks,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=u):u=e[13],u}function Ks({target:t,onBack:e,onSaved:l,members:n,connections:i}){const o=ie(),{locator:c}=Ue(),g=Fe(),h=it(),m=t.kind==="builtin",f=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[u,x]=F.useState(m?"org":"mcp"),d=bt({resolver:Ot(us),defaultValues:Vs(t,n,i)}),p=d.formState.isValid,C=d.formState.isDirty,R=rt({mutationFn:async r=>{const E=Bs(r,i),k=r.role.slug||r.role.label.toLowerCase().replace(/\s+/g,"-"),G=(r.role.slug==="owner"||r.role.slug==="admin"||r.role.slug==="user")&&!r.role.id,Y=async(L,z)=>{const y=n.filter(U=>U.role===(z??L)).map(U=>U.id),K=r.memberIds.filter(U=>!y.includes(U)),V=y.filter(U=>!r.memberIds.includes(U));for(const U of K){const B=await g.organization.updateMemberRole({memberId:U,role:[L]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await g.organization.updateMemberRole({memberId:U,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(r.role.slug),r;if(r.role.id){const L=r.role.label.toLowerCase().replace(/\s+/g,"-"),z=r.role.slug,y=L!==z,K=await g.organization.updateRole({roleId:r.role.id,data:{permission:E,...y?{roleName:L}:{}}});if(K?.error)throw new Error(K.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(y?L:z,y?z:void 0),y?{...r,role:{...r.role,slug:L}}:r}else{const L=await g.organization.createRole({role:k,permission:E});if(L?.error)throw new Error(L.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const z of r.memberIds){const y=await g.organization.updateMemberRole({memberId:z,role:[k]});if(y?.error)throw new Error(y.error.message)}return{...r,role:{...r.role,id:L.data?.roleData?.id,slug:k}}}},onSuccess:(r,E)=>{h.invalidateQueries({queryKey:me.members(c)}),h.invalidateQueries({queryKey:me.organizationRoles(c)});const k=!E.role.id&&!E.role.slug,G=E.role.slug==="owner"&&!E.role.id;Ke(G?"role_members_updated":k?"role_created":"role_updated",{role_slug:E.role.slug??null}),je.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),d.reset(r),l(r.role.id)},onError:r=>{je.error(r instanceof Error?r.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),I=d.handleSubmit(r=>{if(!r.role.label.trim()){je.error(o("settings.orgRoleDetail.roleNameIsRequired")),d.setFocus("role.label");return}R.mutate(r)}),b=!f,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...f?[]:[{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,O]=F.useState(""),[D,_]=F.useState(!1),A=r=>{x(r),O("")},v={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(ae,{children:s.jsxs(ae.Content,{className:q("flex flex-col",u!=="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(ae.Title,{actions:b&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ce,{size:"sm",onClick:I,disabled:R.isPending||!p||!C,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:q("size-2.5 rounded-full shrink-0",t.kind==="builtin"?ct(t.role,!0):yt(d.watch("role.label")))}),f&&s.jsx(at,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...d.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:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(r=>s.jsx("button",{type:"button",onClick:()=>A(r.id),className:q("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",u===r.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:r.label},r.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx($e,{value:S,onChange:O,placeholder:v[u]??"Search...",className:"w-full md:w-[375px]"}),u==="members"&&s.jsx(Ys,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>_(!0)})]})]})}),s.jsx("div",{className:q("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",u!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:q(u!=="org"&&"h-full overflow-hidden",u!=="models"&&u!=="org"&&"border border-border rounded-xl bg-card"),children:[u==="mcp"&&!f&&s.jsx(ms,{toolSet:d.watch("toolSet"),onToolSetChange:r=>d.setValue("toolSet",r,{shouldDirty:!0}),searchQuery:S}),u==="org"&&s.jsx(fs,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:r=>d.setValue("allowAllStaticPermissions",r,{shouldDirty:!0}),onPermissionsChange:r=>d.setValue("staticPermissions",r,{shouldDirty:!0}),readOnly:f,searchQuery:S}),u==="models"&&s.jsx(Ds,{allowAllModels:d.watch("allowAllModels"),modelSet:d.watch("modelSet"),onAllowAllChange:r=>d.setValue("allowAllModels",r,{shouldDirty:!0}),onModelSetChange:r=>d.setValue("modelSet",r,{shouldDirty:!0}),readOnly:f,searchQuery:S}),u==="members"&&s.jsx(ws,{memberIds:d.watch("memberIds"),onMemberIdsChange:r=>d.setValue("memberIds",r,{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:_})]})})]})})}function Fs(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function $s(t){const e=X.c(6),{area:l,children:n}=t,{isPrivileged:i,loading:o,error:c}=es();let g;return e[0]!==l||e[1]!==n||e[2]!==c||e[3]!==i||e[4]!==o?(g=s.jsx(ts,{granted:i,loading:o,error:c,area:l,children:n}),e[0]=l,e[1]=n,e[2]=c,e[3]=i,e[4]=o,e[5]=g):g=e[5],g}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Hs(){const t=X.c(131),e=ie(),[l,n]=F.useState(""),[i,o]=F.useState(null),c=Dt();let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g={strict:!1},t[0]=g):g=t[0];const{role:h}=vt(g),{locator:m}=Ue(),f=Fe(),a=it(),{customRoles:u,refetch:x}=Lt();let d;t[1]!==c?(d=j=>c({to:".",search:P=>({...P,role:j})}),t[1]=c,t[2]=d):d=t[2];const p=d;let C;e:{if(!h){C=null;break e}if(h==="new"){C={kind:"new"};break e}if(h.startsWith("builtin-")){C={kind:"builtin",role:h.slice(8)};break e}let j;t[3]!==h?(j=ee=>ee.id===h,t[3]=h,t[4]=j):j=t[4];const P=u.find(j);C=P?{kind:"custom",role:P}:null}const R=C;let I;t[5]!==m?(I=me.members(m),t[5]=m,t[6]=I):I=t[6];let b;t[7]!==f?(b=()=>f.organization.listMembers(),t[7]=f,t[8]=b):b=t[8];let N;t[9]!==I||t[10]!==b?(N={queryKey:I,queryFn:b},t[9]=I,t[10]=b,t[11]=N):N=t[11];const{data:M}=ze(N);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const O=S;let D;t[14]!==O?(D=j=>O.filter(P=>P.role===j).length,t[14]=O,t[15]=D):D=t[15];const _=D;let A;if(t[16]!==u||t[17]!==_||t[18]!==l||t[19]!==e){let j;t[21]!==_||t[22]!==e?(j=de=>({kind:"builtin",role:{...de,memberCount:_(de.role),label:e(de.labelKey)}}),t[21]=_,t[22]=e,t[23]=j):j=t[23];const P=Qs.map(j);let ee;t[24]!==_?(ee=de=>({kind:"custom",role:{...de,memberCount:_(de.role)}}),t[24]=_,t[25]=ee):ee=t[25];const At=u.map(ee);if(A=[...P,...At],l){const de=l.toLowerCase();A=A.filter(Ct=>Ct.role.label.toLowerCase().includes(de))}t[16]=u,t[17]=_,t[18]=l,t[19]=e,t[20]=A}else A=t[20];let v;t[26]!==f?(v=async j=>{const P=await f.organization.deleteRole({roleId:j});if(P?.error)throw new Error(P.error.message);return P?.data},t[26]=f,t[27]=v):v=t[27];const r=rt({mutationFn:v,onSuccess:(j,P)=>{Ke("role_deleted",{role_id:P}),a.invalidateQueries({queryKey:me.members(m)}),a.invalidateQueries({queryKey:me.organizationRoles(m)}),je.success(e("settings.roles.deletedSuccessfully")),x(),R?.kind==="custom"&&R.role.id===P&&p(void 0)},onError:Xs});let E;t[28]!==e?(E=e("settings.roles.columnRole"),t[28]=e,t[29]=E):E=t[29];let k;t[30]!==E?(k={id:"role",header:E,render:Ws,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=E,t[31]=k):k=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(Me,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Me,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let L;t[36]!==G||t[37]!==Y?(L={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=L):L=t[38];let z;t[39]!==e?(z=e("settings.roles.columnPermissions"),t[39]=e,t[40]=z):z=t[40];let y;t[41]!==e?(y=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 P=j.role,ee=[];return P.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):P.staticPermissionCount&&P.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:P.staticPermissionCount})),P.allowsAllConnections?ee.push(e("settings.roles.allConnections")):P.connectionCount&&P.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:P.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]=y):y=t[42];let K;t[43]!==z||t[44]!==y?(K={id:"permissions",header:z,render:y,cellClassName:"flex-1 min-w-0"},t[43]=z,t[44]=y,t[45]=K):K=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let U;t[48]!==V?(U={id:"members",header:V,render:Js,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(Pt,{children:[s.jsx(wt,{asChild:!0,children:s.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Ut,{size:16})})}),s.jsx(Gt,{align:"end",onClick:Zs,children:s.jsxs(kt,{variant:"destructive",onClick:()=>{const P=j.role;P.id&&o({id:P.id,label:P.label})},children:[s.jsx(Bt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let H;t[52]!==k||t[53]!==L||t[54]!==K||t[55]!==U||t[56]!==B?(H=[k,L,K,U,B],t[52]=k,t[53]=L,t[54]=K,t[55]=U,t[56]=B,t[57]=H):H=t[57];const J=H;let te;t[58]!==p?(te=j=>{if(j.kind==="builtin")p(`builtin-${j.role.role}`);else{const P=j.role;p(P.id)}},t[58]=p,t[59]=te):te=t[59];const oe=te;if(R){let j;t[60]!==p?(j=()=>p(void 0),t[60]=p,t[61]=j):j=t[61];let P;return t[62]!==x||t[63]!==p?(P=()=>{x(),p(void 0)},t[62]=x,t[63]=p,t[64]=P):P=t[64],s.jsx(zs,{target:R,onBack:j,onSaved:P},Fs(R))}let $;t[65]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(ss,{group:"members"}),t[65]=$):$=t[65];let Z;t[66]!==e?(Z=e("settings.roles.searchPlaceholder"),t[66]=e,t[67]=Z):Z=t[67];let T;t[68]===Symbol.for("react.memo_cache_sentinel")?(T=j=>{j.key==="Escape"&&(n(""),j.target.blur())},t[68]=T):T=t[68];let w;t[69]!==l||t[70]!==Z?(w=s.jsx($e,{value:l,onChange:n,placeholder:Z,className:"w-full md:w-[375px]",onKeyDown:T}),t[69]=l,t[70]=Z,t[71]=w):w=t[71];let Q;t[72]!==p?(Q=()=>p("new"),t[72]=p,t[73]=Q):Q=t[73];let W;t[74]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ye,{size:16}),t[74]=W):W=t[74];let se;t[75]!==e?(se=e("settings.roles.createRole"),t[75]=e,t[76]=se):se=t[76];let le;t[77]!==Q||t[78]!==se?(le=s.jsxs(ce,{onClick:Q,children:[W,se]}),t[77]=Q,t[78]=se,t[79]=le):le=t[79];let ne;t[80]!==w||t[81]!==le?(ne=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[w,le]}),t[80]=w,t[81]=le,t[82]=ne):ne=t[82];let ue;t[83]!==l||t[84]!==e?(ue=l?s.jsx(et,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(et,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[83]=l,t[84]=e,t[85]=ue):ue=t[85];let fe;t[86]!==A||t[87]!==J||t[88]!==oe||t[89]!==ue?(fe=s.jsx(Vt,{columns:J,data:A,isLoading:!1,onRowClick:oe,emptyState:ue}),t[86]=A,t[87]=J,t[88]=oe,t[89]=ue,t[90]=fe):fe=t[90];let ge;t[91]!==ne||t[92]!==fe?(ge=s.jsx(ae.Content,{children:s.jsx(ae.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[$,ne,fe]})})}),t[91]=ne,t[92]=fe,t[93]=ge):ge=t[93];const Be=i!==null;let we;t[94]===Symbol.for("react.memo_cache_sentinel")?(we=j=>!j&&o(null),t[94]=we):we=t[94];let he;t[95]!==e?(he=e("settings.roles.deleteRoleTitle"),t[95]=e,t[96]=he):he=t[96];let xe;t[97]!==he?(xe=s.jsx(ut,{children:he}),t[97]=he,t[98]=xe):xe=t[98];const Ve=i?.label??"";let pe;t[99]!==e||t[100]!==Ve?(pe=e("settings.roles.deleteRoleConfirm",{role:Ve}),t[99]=e,t[100]=Ve,t[101]=pe):pe=t[101];let Te;t[102]!==pe?(Te=s.jsx(ft,{children:pe}),t[102]=pe,t[103]=Te):Te=t[103];let _e;t[104]!==xe||t[105]!==Te?(_e=s.jsxs(gt,{children:[xe,Te]}),t[104]=xe,t[105]=Te,t[106]=_e):_e=t[106];let Ee;t[107]!==e?(Ee=e("settings.roles.cancel"),t[107]=e,t[108]=Ee):Ee=t[108];let Ie;t[109]!==Ee?(Ie=s.jsx(ht,{children:Ee}),t[109]=Ee,t[110]=Ie):Ie=t[110];let Re;t[111]!==r||t[112]!==i?(Re=()=>{i?.id&&r.mutate(i.id),o(null)},t[111]=r,t[112]=i,t[113]=Re):Re=t[113];let Se;t[114]!==e?(Se=e("settings.roles.delete"),t[114]=e,t[115]=Se):Se=t[115];let Ne;t[116]!==Re||t[117]!==Se?(Ne=s.jsx(xt,{onClick:Re,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Se}),t[116]=Re,t[117]=Se,t[118]=Ne):Ne=t[118];let Ae;t[119]!==Ie||t[120]!==Ne?(Ae=s.jsxs(pt,{children:[Ie,Ne]}),t[119]=Ie,t[120]=Ne,t[121]=Ae):Ae=t[121];let Ce;t[122]!==_e||t[123]!==Ae?(Ce=s.jsxs(mt,{children:[_e,Ae]}),t[122]=_e,t[123]=Ae,t[124]=Ce):Ce=t[124];let be;t[125]!==Be||t[126]!==Ce?(be=s.jsx(dt,{open:Be,onOpenChange:we,children:Ce}),t[125]=Be,t[126]=Ce,t[127]=be):be=t[127];let Ge;return t[128]!==ge||t[129]!==be?(Ge=s.jsxs(ae,{children:[ge,be]}),t[128]=ge,t[129]=be,t[130]=Ge):Ge=t[130],Ge}function Zs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Js(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Ws(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:q("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(at,{size:12,className:"text-muted-foreground shrink-0"})]})}function Xs(t,e){Ke("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),je.error(t instanceof Error?t.message:"Failed to delete role")}function el(){const t=X.c(7),e=ie();let l;t[0]!==e?(l=e("settings.roles.failedToLoad"),t[0]=e,t[1]=l):l=t[1];let n;t[2]!==l?(n=s.jsx(ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:l})})}),t[2]=l,t[3]=n):n=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(F.Suspense,{fallback:s.jsx(ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Hs,{})}),t[4]=i):i=t[4];let o;return t[5]!==n?(o=s.jsx(Mt,{fallback:n,children:i}),t[5]=n,t[6]=o):o=t[6],o}function Go(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($s,{area:"roles",children:s.jsx(el,{})}),t[0]=e):e=t[0],e}export{Go as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,m as w,j as a,k as j}from"./index-
|
|
1
|
+
import{c as b,m as w,j as a,k as j}from"./index-BTl7Qhcu.js";import{i as k}from"./SearchMd-OSuucajh.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:m,disabled:i}=f,p=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==m?(n=m?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(k,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=m,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==p||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=p,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,b as y,j as s,E as $,r as v,y as k,B as _,t as w}from"./index-CWr5yogT.js";import{i as F}from"./AlertCircle-BLjRxtCg.js";import{s as E}from"./Plus-D5q8r_KL.js";import{s as B}from"./User01-y6pFDwBd.js";import{t as L}from"./Users01-jj6G1H_Q.js";import{e as O,d as R,a as A,b as I,h as q,c as V}from"./dialog-DYbfOzPC.js";import{I as z}from"./input-BwBLAcU4.js";import{L as N}from"./label-L3jOsH6N.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-CBSZ0Lug.js";import{S as M}from"./skeleton-Doum5PuE.js";import{T as Q}from"./textarea-DVsSqFc7.js";import{P as C}from"./index-DSYKgx16.js";import{c as U}from"./settings-section-dcT_loqd.js";import{u as W,a as X}from"./use-secrets-DZNeLfQZ.js";import{R as Y}from"./require-capability-D5-lnGcd.js";import"./X-1tpdcA57.js";import"./tooltip-sh5Vcy5o.js";import"./Check-DmmvaREF.js";import"./ChevronDown-DNdWMHBq.js";import"./ChevronUp-BiwzfQ34.js";import"./sidebar-Vbdz435r.js";import"./LayoutLeft-DrPXFVcs.js";import"./use-mobile-HeXjiu3p.js";import"./card-pQ1UNz7f.js";import"./ArrowUpRight-C9RBdXzS.js";import"./studio-tools-D1WTrFr3.js";import"./use-capability-CL8dQHM2.js";import"./access-gate-8Cz30Bir.js";import"./capability-load-error-CWzCLzJM.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?B:L;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let o;e[3]!==c?(o=s.jsx(c,{size:12}),e[3]=c,e[4]=o):o=e[4];let a;return e[5]!==l||e[6]!==o?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[o,l]}),e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let o;e[8]!==r.description?(o=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=o):o=e[9];let a;e[10]!==l||e[11]!==o?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,o]})]}),e[10]=l,e[11]=o,e[12]=a):a=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let o;e[5]!==i?(o=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=o):o=e[6];let a;e[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==l||e[10]!==a?(u=s.jsxs("div",{children:[l,a]}),e[9]=l,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[o,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){c("organization"),l(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!o))try{await m.mutateAsync({scope:i,name:n.trim(),value:o,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>c(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>l(f.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:o,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!o,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,c]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=m):m=t[2],m}let n,l,o;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e(p,{count:r.length}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c(!0),t[14]=f):f=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:f,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,o=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=o}else n=t[5],l=t[6],o=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==o||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,l,o,a]}),t[25]=n,t[26]=l,t[27]=o,t[28]=a,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{Re as default};
|
|
1
|
+
import{c as j,b as y,j as s,E as $,r as v,y as k,B as _,t as w}from"./index-BTl7Qhcu.js";import{i as F}from"./AlertCircle-DpbDmpl4.js";import{s as E}from"./Plus-DzCY9mis.js";import{s as B}from"./User01-BKatvp0L.js";import{t as L}from"./Users01-CBTIjE5d.js";import{e as O,d as R,a as A,b as I,h as q,c as V}from"./dialog-D0DoVc3r.js";import{I as z}from"./input-D7bjRaiL.js";import{L as N}from"./label-Be6bBbor.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-CESIFQDf.js";import{S as M}from"./skeleton-DUrFo-pD.js";import{T as Q}from"./textarea-CxyGETjB.js";import{P as C}from"./index-9A9Q8J_H.js";import{c as U}from"./settings-section-sXWZszDJ.js";import{u as W,a as X}from"./use-secrets-K7ODdpvg.js";import{R as Y}from"./require-capability-C3ujpajl.js";import"./X-LPyt3QJh.js";import"./tooltip-BwJyzC_0.js";import"./Check-BeLWQxAW.js";import"./ChevronDown-BPLhBbcC.js";import"./ChevronUp-CRIfPNig.js";import"./sidebar-CMCU7OMz.js";import"./LayoutLeft-DR7AqeCR.js";import"./use-mobile-Do5Syn_e.js";import"./card-BQFnpKaq.js";import"./ArrowUpRight-BkqhcGtY.js";import"./studio-tools-D-buMmW7.js";import"./use-capability-DXwGFsqD.js";import"./access-gate-CIdWo-EK.js";import"./capability-load-error-DWPGLqLm.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?B:L;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let o;e[3]!==c?(o=s.jsx(c,{size:12}),e[3]=c,e[4]=o):o=e[4];let a;return e[5]!==l||e[6]!==o?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[o,l]}),e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let o;e[8]!==r.description?(o=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=o):o=e[9];let a;e[10]!==l||e[11]!==o?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,o]})]}),e[10]=l,e[11]=o,e[12]=a):a=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let o;e[5]!==i?(o=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=o):o=e[6];let a;e[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==l||e[10]!==a?(u=s.jsxs("div",{children:[l,a]}),e[9]=l,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[o,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){c("organization"),l(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!o))try{await m.mutateAsync({scope:i,name:n.trim(),value:o,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>c(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>l(f.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:o,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!o,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,c]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=m):m=t[2],m}let n,l,o;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e(p,{count:r.length}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c(!0),t[14]=f):f=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:f,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,o=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=o}else n=t[5],l=t[6],o=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==o||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,l,o,a]}),t[25]=n,t[26]=l,t[27]=o,t[28]=a,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{Re as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as Ge,b as ct,r as w,m as $e,j as n,ac as Xn,B as Xe,k as Zn,o as Lo,t as J,K as Ko}from"./index-CWr5yogT.js";import{ap as es,aq as Fo,ar as Io,as as Oo,at as $o,a4 as ts,a5 as Qt,au as ns,av as ss,a6 as os,a7 as as,aw as rs,ax as zo,ae as is,af as ls,ay as Ho,az as Uo,aA as cs,O as qo,a8 as us,a9 as Mt,ac as ds,ad as ms,aa as fs,ak as ps,aB as Go,aC as Bt,aD as gs,aE as Wo,S as hs,aF as lt,G as vs,aG as Yo,aH as Jo,aI as Qo,aJ as Xo,D as Zo,F as ea,aK as ta,aL as na,aM as sa,aN as oa,ai as qt,aO as Gt,aP as aa,aQ as St,aR as Pt,aS as ra,aT as ia,aU as tt,aV as Ln,aW as la,aX as Ct,aY as Wt,aZ as ca,a_ as mn,a$ as ua,b0 as kt,b1 as da,b2 as ma,b3 as fa,b4 as pa,b5 as ga,b6 as xt,b7 as ha,b8 as va,b9 as ba,I as Sa,ba as Kn,bb as At,bc as Fn,bd as In,be as xa,bf as ya,bg as _a,bh as ja,bi as fn,bj as On,bk as $n,bl as Tt,bm as Yt,bn as zn,bo as Ea,bp as pn,bq as Ra,br as wa,bs as ka,bt as Ta,bu as Na}from"./index-Cnu-uVYE.js";import{t as Va}from"./ChevronDown-DNdWMHBq.js";import{ah as hn,y as Da,W as bs,H as Pa,x as Ss,ao as Ca,u as Aa}from"./agent-icon-CV9SA5HA.js";import{i as xs}from"./ChevronRight-9kh8mw1-.js";import{n as Ma}from"./ChevronUp-BiwzfQ34.js";import{i as Ba}from"./Globe01-C1UG-2uT.js";import{B as Jt}from"./automation-runs-DFhDj2sR.js";import{c as yt,T as _t,a as jt}from"./tooltip-sh5Vcy5o.js";import{b as La,h as Ka,a as Fa,c as Ia,d as Oa,e as $a}from"./dialog-DYbfOzPC.js";import{I as za}from"./input-BwBLAcU4.js";import{a as ys}from"./Copy01-BSyOJtDU.js";import{i as Ha}from"./Settings02-B_z0TMYn.js";import{s as Ua}from"./Eye-BYu9YoCE.js";import{s as _s}from"./TrendUp01-BjzF1ujp.js";import{s as vn}from"./Plus-D5q8r_KL.js";import{s as js}from"./Trash01-BKz4fodI.js";import{i as qa}from"./Zap-BQaeLyOX.js";import{D as Es,a as vt,c as Rs,b as ws,i as Ga}from"./dropdown-menu-DD28on4T.js";import{S as Wa,r as Hn,u as Ya,d as Ja,a as Qa,i as Xa,f as Za,P as er,b as tr}from"./page-seo-form-BkGoe1rY.js";import{c as nr}from"./Tool01-Ch6hlwSh.js";import{u as sr,A as or}from"./use-section-preview-base-D3BRL2b2.js";import"./ArrowUp-BlEU92Im.js";import"./chat-context-DGqU4TNb.js";import"./tab-id-BONWRXY7.js";import"./Check-DmmvaREF.js";import"./Download01-BgrKWanC.js";import"./hooks-BH5ncP0o.js";import"./use-mcp-client-Xm6nDmkT.js";import"./auth-DUWfQtFk.js";import"./decopilot-sse-pool-DxUDV3kB.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DlpcZhPC.js";import"./use-ai-providers-CkzENZaN.js";import"./studio-tools-D1WTrFr3.js";import"./use-decopilot-events-9PMCbvpN.js";import"./use-organization-settings-pLz4lAB-.js";import"./spinner-mYPpwvbF.js";import"./drawer-DfpL6ei_.js";import"./collection-search-D-gCLHmQ.js";import"./SearchMd-Bp11Ucvw.js";import"./use-mobile-HeXjiu3p.js";import"./chart-CDj0WlGN.js";import"./index-llVAr4bS.js";import"./X-1tpdcA57.js";import"./shell-layout-CWaRwowP.js";import"./avatar-DLABdBS5.js";import"./User01-y6pFDwBd.js";import"./Users03-B84s50Qe.js";import"./SearchLg-rLVtLHTP.js";import"./Stars02-kTE1_Iz0.js";import"./XClose-B923cVgj.js";import"./CheckCircle-BkWleJAQ.js";import"./FilterLines-CCtu81Kl.js";import"./Monitor01-CRJNkg5D.js";import"./required-auth-layout-CTaIYIP8.js";import"./use-org-sso-AZ9iXYy7.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./XCircle-DMCkoBS4.js";import"./Upload01-CXZS5Xwb.js";import"./AlertCircle-BLjRxtCg.js";import"./form-B8WNeuMM.js";import"./label-L3jOsH6N.js";import"./select-CBSZ0Lug.js";import"./ArrowLeft-4DPAq3FZ.js";import"./tabs-BAYBhY-B.js";import"./Tool02-BxxsZkJA.js";import"./toggle-group-D6mnwc67.js";import"./use-commerce-diagnostic-DN1X4IW5.js";import"./sidebar-Vbdz435r.js";import"./LayoutLeft-DrPXFVcs.js";import"./popover-DwADEOUa.js";import"./self-tool-result-DNAq-vwW.js";import"./alert-dialog-BpwE-DrS.js";import"./integration-icon-vMqCOva6.js";import"./extract-connection-data-D0xv_Xpw.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-E15h5LD3.js";import"./LinkExternal01-ndPw69oF.js";import"./authenticate-and-persist-oauth-DxByWe6U.js";import"./mcp-oauth-D80_H96F.js";import"./track-CKQNca1N.js";import"./toolbar-DZTLMAXr.js";import"./skeleton-Doum5PuE.js";import"./github-repo-picker-6YNSKnAB.js";import"./use-connection-VGDVVQ1z.js";import"./LockUnlocked01-QOtE0O6M.js";import"./use-mcp-tools-HjqcWuQ-.js";import"./use-navigate-to-agent-DYKLjse3.js";import"./reusable-new-chat-CouMjkYR.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-B7oew6Sj.js";import"./use-registry-connections-DgQVTAzb.js";import"./useInfiniteQuery-P2P-hfvq.js";import"./use-infinite-scroll-vVtYR3JQ.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-pQ1UNz7f.js";import"./textarea-DVsSqFc7.js";import"./connection-form-helpers-BL37f2pG.js";import"./collection-tabs-RgVTGYAL.js";import"./badge-Dmi1Edkl.js";import"./useSuspenseInfiniteQuery-Bm6Pr5PC.js";import"./command-1iBMuqnC.js";import"./index-D3MvvsdR.js";import"./use-clock-tick-M8gtO9os.js";import"./DotsVertical-B6vdrZcL.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-open-billing-url-B-BgSqMX.js";import"./select-model-BsfCtu4R.js";import"./checkbox-BZSdoD6r.js";import"./Key01-BukaugKD.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-dcT_loqd.js";import"./ArrowUpRight-C9RBdXzS.js";import"./Stars01-D0mCYLdv.js";import"./cards-Bj2o7opa.js";import"./Share07-W-6cq5W5.js";import"./Palette-BN_nVtlo.js";import"./file-type-icon-Bv7bwy1X.js";import"./question-004-sINsf4GQ.js";import"./use-members-z3sg-hyj.js";import"./use-org-auth-client-CsEC-8-N.js";import"./use-status-sounds-B4kDHcys.js";import"./empty-state-B0vBNoRU.js";import"./ZapSquare-B9aIlv3d.js";import"./types-C3iOdauk.js";import"./use-capability-CL8dQHM2.js";import"./use-file-configs-hzSNmpOq.js";import"./monaco-editor-DAZ7H6GV.js";import"./pt-BR-CLy76QW2.js";import"./switch-WxAjh6LN.js";import"./Play-bVmySP8F.js";import"./use-debounced-autosave-CSRoYyDm.js";import"./index-DSYKgx16.js";import"./search-input-WQSq4YL_.js";import"./index-CvagHRqr.js";import"./Users01-jj6G1H_Q.js";import"./use-secrets-DZNeLfQZ.js";import"./AreaChart-CA8B3Hpq.js";import"./use-copy-mgcX5rsE.js";import"./SwitchHorizontal01-DfPnwT9V.js";import"./use-tags-CyfUnJtt.js";import"./get-initials-D-f_fDFw.js";import"./use-automations-C4J3LwJ2.js";import"./automation-list-row-BM7KHgfL.js";import"./use-org-repo-syncs-CWwFdJOO.js";import"./CreditCard01-DoI0r0lf.js";import"./Globe04-Cxhs4JQB.js";import"./HardDrive-B12yjnMo.js";import"./LogOut01-Bbc7nVd2.js";import"./Sun-BDMTS65q.js";import"./Shield01-KwFVdxDC.js";import"./table-UKOQwvgs.js";function ar(m){return m.schema?.definitions??m.schema?.$defs??{}}function ks(m,e){const a=ar(e),c=a[btoa(m)];if(!c)return[];const d=[c];if(Array.isArray(c.allOf)){const h=c.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof h=="string"){const b=a[h.replace("#/definitions/","")];b&&d.push(b)}}return d}function rr(m,e){for(const a of ks(m,e)){const c=typeof a.image=="string"?a.image:void 0;if(c?.includes("{{{"))return c}}function ir(m,e){if(!e)return;const a=es(m);if(!a)return;const c=rr(a.resolveType,e);if(!c)return;const d=Fo(c,a.data);if(d)return Io(d)}const lr={escape:$o};function cr(m,e){for(const a of ks(m,e)){const c=typeof a.title=="string"?a.title:void 0;if(c?.includes("{{"))return c}}function ur(m,e){if(!e)return;const a=es(m);if(a)try{const c=cr(a.resolveType,e);return c&&Oo.render(c,a.data,{},lr).trim()||void 0}catch{return}}const dr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",mr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Un(m){return Array.from({length:m},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Ts(m){return m.map((e,a)=>({...e,index:a}))}function fr(m,e){if(e===m.length)return m;if(e<m.length)return Ts(m.slice(0,e));const a=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...a]}function Ns(m){const e=Ge.c(25),{section:a,raw:c,meta:d}=m,h=a.isSavedBlock===!0,b=a.isMultivariate===!0;let g;e[0]!==d||e[1]!==c?(g=c&&d?ir(c,d):void 0,e[0]=d,e[1]=c,e[2]=g):g=e[2];const v=g;let f;e[3]!==d||e[4]!==b||e[5]!==c||e[6]!==h?(f=c&&d&&!h&&!b?ur(c,d):void 0,e[3]=d,e[4]=b,e[5]=c,e[6]=h,e[7]=f):f=e[7];const E=f;let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Da,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=N):N=e[8];let V;e[9]!==v?(V=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=v,e[10]=V):V=e[10];let j;e[11]!==b||e[12]!==h?(j=h?{color:qo}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=b,e[12]=h,e[13]=j):j=e[13];let l;e[14]!==j?(l=n.jsx(hn,{className:"h-4 w-4 shrink-0",style:j}),e[14]=j,e[15]=l):l=e[15];const x=a.isHidden&&"line-through opacity-50";let r;e[16]!==x?(r=$e("min-w-0 flex-1 truncate text-sm font-medium",x),e[16]=x,e[17]=r):r=e[17];const D=E??a.label;let i;e[18]!==r||e[19]!==D?(i=n.jsx("span",{className:r,children:D}),e[18]=r,e[19]=D,e[20]=i):i=e[20];let R;return e[21]!==i||e[22]!==V||e[23]!==l?(R=n.jsxs(n.Fragment,{children:[N,V,l,i]}),e[21]=i,e[22]=V,e[23]=l,e[24]=R):R=e[24],R}const pr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",gr="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",hr="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function gn(m,e){return $e("h-7 shrink-0 overflow-hidden",e?pr:m?hr:gr)}function Vs(m,e){const a=m.isSavedBlock===!0,c=m.isMultivariate===!0;return $e("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?dr:c?cs:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function vr(m){const e=Ge.c(82),{section:a,raw:c,meta:d,sortableId:h,selected:b,onSelect:g,onDelete:v,onDuplicate:f,onMakeReusable:E,onToggleHidden:N,onToggleLazy:V,onAddVariant:j,onDetach:l}=m,x=ct(),r=c?rs(c.__resolveType??""):!1,D=a.isHidden===!0,i=r||D;let R;e[0]!==a?(R=zo(a),e[0]=a,e[1]=R):R=e[1];const M=R;let I;e[2]!==h?(I={id:h,animateLayoutChanges:_r},e[2]=h,e[3]=I):I=e[3];const{attributes:H,listeners:p,setNodeRef:B,transform:pe,isDragging:L}=is(I);let le;e[4]!==pe?(le=ls.Transform.toString(pe?{...pe,x:0}:null),e[4]=pe,e[5]=le):le=e[5];const P=L?0:void 0;let te;e[6]!==le||e[7]!==P?(te={transform:le,opacity:P},e[6]=le,e[7]=P,e[8]=te):te=e[8];const O=te;let oe;e[9]!==a?(oe=Ho(a),e[9]=a,e[10]=oe):oe=e[10];const De=oe,xe="button",Q=0;let X;e[11]!==g?(X=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),g())},e[11]=g,e[12]=X):X=e[12];const ge=L?"cursor-grabbing":"cursor-pointer";let ne;e[13]!==a||e[14]!==b||e[15]!==ge?(ne=$e("touch-none transition-colors",ge,Vs(a,b)),e[13]=a,e[14]=b,e[15]=ge,e[16]=ne):ne=e[16];let K;e[17]!==d||e[18]!==c||e[19]!==a?(K=n.jsx(Ns,{section:a,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=a,e[20]=K):K=e[20];const ze=!a.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":x(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:$e(gn(i,r)),onClick:T=>{T.stopPropagation(),V()},onPointerDown:yr,children:n.jsx(qa,{className:$e("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:x(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),nt=!a.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":x(D?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:$e(gn(i,D)),onClick:T=>{T.stopPropagation(),N()},onPointerDown:xr,children:D?n.jsx(Ha,{className:"h-3.5 w-3.5"}):n.jsx(Ua,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:x(D?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Ke=Rs,Me=Es,W=!0,Z=Xe,Fe="button",Pe="ghost",ye="icon";let ce;e[21]!==x?(ce=x("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=x,e[22]=ce):ce=e[22];const he=$e(gn(i,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let _e;e[23]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(bs,{className:"h-3.5 w-3.5"}),e[23]=_e):_e=e[23];let we;e[24]!==Z||e[25]!==ce||e[26]!==he?(we=n.jsx(Z,{type:Fe,variant:Pe,size:ye,"aria-label":ce,className:he,onClick:Sr,onPointerDown:br,children:_e}),e[24]=Z,e[25]=ce,e[26]=he,e[27]=we):we=e[27];let ve;e[28]!==Me||e[29]!==we?(ve=n.jsx(Me,{asChild:W,children:we}),e[28]=Me,e[29]=we,e[30]=ve):ve=e[30];let ae;e[31]!==f?(ae=T=>{T.stopPropagation(),f()},e[31]=f,e[32]=ae):ae=e[32];let Ce;e[33]===Symbol.for("react.memo_cache_sentinel")?(Ce=n.jsx(ys,{className:"h-4 w-4"}),e[33]=Ce):Ce=e[33];let je;e[34]!==x?(je=x("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=x,e[35]=je):je=e[35];let me;e[36]!==ae||e[37]!==je?(me=n.jsxs(vt,{onClick:ae,children:[Ce,je]}),e[36]=ae,e[37]=je,e[38]=me):me=e[38];let $;e[39]!==M||e[40]!==j||e[41]!==x?($=M&&n.jsxs(vt,{className:Uo,onClick:T=>{T.stopPropagation(),j()},children:[n.jsx(_s,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=M,e[40]=j,e[41]=x,e[42]=$):$=e[42];let fe;e[43]!==De||e[44]!==E||e[45]!==x?(fe=De&&n.jsxs(vt,{className:mr,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(hn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=De,e[44]=E,e[45]=x,e[46]=fe):fe=e[46];let Ae;e[47]!==l||e[48]!==a.isMultivariate||e[49]!==a.isSavedBlock||e[50]!==x?(Ae=a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(vt,{onClick:T=>{T.stopPropagation(),l()},children:[n.jsx(hn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=l,e[48]=a.isMultivariate,e[49]=a.isSavedBlock,e[50]=x,e[51]=Ae):Ae=e[51];let be;e[52]!==v?(be=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=be):be=e[53];let ke;e[54]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(js,{className:"h-4 w-4"}),e[54]=ke):ke=e[54];let se;e[55]!==x?(se=x("sectionsEditor.sectionList.deleteMenuItem"),e[55]=x,e[56]=se):se=e[56];let ie;e[57]!==be||e[58]!==se?(ie=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:be,children:[ke,se]}),e[57]=be,e[58]=se,e[59]=ie):ie=e[59];let ue;e[60]!==me||e[61]!==$||e[62]!==fe||e[63]!==Ae||e[64]!==ie?(ue=n.jsxs(ws,{align:"end",className:"w-44",children:[me,$,fe,Ae,ie]}),e[60]=me,e[61]=$,e[62]=fe,e[63]=Ae,e[64]=ie,e[65]=ue):ue=e[65];let Ee;e[66]!==Ke||e[67]!==ve||e[68]!==ue?(Ee=n.jsxs(Ke,{children:[ve,ue]}),e[66]=Ke,e[67]=ve,e[68]=ue,e[69]=Ee):Ee=e[69];let de;return e[70]!==H||e[71]!==p||e[72]!==g||e[73]!==B||e[74]!==O||e[75]!==ne||e[76]!==K||e[77]!==ze||e[78]!==nt||e[79]!==Ee||e[80]!==X?(de=n.jsxs("div",{ref:B,style:O,...H,...p,role:xe,tabIndex:Q,onClick:g,onKeyDown:X,className:ne,children:[K,ze,nt,Ee]}),e[70]=H,e[71]=p,e[72]=g,e[73]=B,e[74]=O,e[75]=ne,e[76]=K,e[77]=ze,e[78]=nt,e[79]=Ee,e[80]=X,e[81]=de):de=e[81],de}function br(m){return m.stopPropagation()}function Sr(m){return m.stopPropagation()}function xr(m){return m.stopPropagation()}function yr(m){return m.stopPropagation()}function _r(){return!1}function jr(m){const e=Ge.c(104),{listKey:a,rawSections:c,sections:d,meta:h,selectedIndex:b,onSelect:g,onReorder:v,onDelete:f,onDuplicate:E,onMakeReusable:N,onToggleHidden:V,onToggleLazy:j,onAddVariant:l,onDetach:x,onAddSection:r,canAddSection:D}=m,i=D===void 0?!0:D,R=ct();let M;e[0]!==d.length?(M=()=>Un(d.length),e[0]=d.length,e[1]=M):M=e[1];const[I,H]=w.useState(M),[p,B]=w.useState(null),[pe,L]=w.useState(a),[le,P]=w.useState(d.length),te=w.useRef(!1);pe!==a?(L(a),P(d.length),H(Un(d.length))):le!==d.length&&(P(d.length),H(de=>fr(de,d.length)));let O;e[2]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[2]=O):O=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:us},e[3]=oe):oe=e[3];const De=ts(Qt(as,O),Qt(os,oe));let xe;e[4]!==I?(xe=I.map(Er),e[4]=I,e[5]=xe):xe=e[5];const Q=xe;let X;e[6]===Symbol.for("react.memo_cache_sentinel")?(X=de=>{B(String(de.active.id))},e[6]=X):X=e[6];const ge=X;let ne;e[7]!==Q||e[8]!==v?(ne=de=>{B(null);const{active:T,over:re}=de;if(!re||T.id===re.id)return;const F=Q.indexOf(String(T.id)),Be=Q.indexOf(String(re.id));F===-1||Be===-1||(H(ut=>Ts(Mt([...ut],F,Be))),te.current=!0,requestAnimationFrame(()=>{te.current=!1}),v?.(F,Be))},e[7]=Q,e[8]=v,e[9]=ne):ne=e[9];const K=ne;let ze;e[10]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{B(null)},e[10]=ze):ze=e[10];const nt=ze;let Ke,Me,W,Z,Fe,Pe,ye,ce,he,_e,we,ve,ae,Ce,je;if(e[11]!==p||e[12]!==i||e[13]!==I||e[14]!==Q||e[15]!==K||e[16]!==h||e[17]!==r||e[18]!==l||e[19]!==f||e[20]!==x||e[21]!==E||e[22]!==N||e[23]!==g||e[24]!==V||e[25]!==j||e[26]!==c||e[27]!==d||e[28]!==b||e[29]!==De||e[30]!==R){Ce=Symbol.for("react.early_return_sentinel");e:{const de=T=>{te.current||g(T)};if(e[46]!==p||e[47]!==i||e[48]!==I||e[49]!==r||e[50]!==c||e[51]!==d||e[52]!==R){const T=p?I.find(re=>re.id===p):null;if(Z=T!=null?d[T.index]:null,W=T!=null?c[T.index]:void 0,I.length===0){let re;e[56]!==R?(re=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=re):re=e[57];let F;e[58]!==re?(F=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:re}),e[58]=re,e[59]=F):F=e[59];const Be=!i;let ut;e[60]===Symbol.for("react.memo_cache_sentinel")?(ut=n.jsx(vn,{size:14}),e[60]=ut):ut=e[60];let Te;e[61]!==R?(Te=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=Te):Te=e[62];let We;e[63]!==r||e[64]!==Be||e[65]!==Te?(We=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Be,onClick:r,children:[ut,Te]}),e[63]=r,e[64]=Be,e[65]=Te,e[66]=We):We=e[66];let Ie;e[67]!==F||e[68]!==We?(Ie=n.jsxs("div",{className:"space-y-2",children:[F,We]}),e[67]=F,e[68]=We,e[69]=Ie):Ie=e[69],Ce=Ie;break e}ae=$e(T&&"cursor-grabbing"),e[46]=p,e[47]=i,e[48]=I,e[49]=r,e[50]=c,e[51]=d,e[52]=R,e[53]=W,e[54]=Z,e[55]=ae}else W=e[53],Z=e[54],ae=e[55];Me=ds,ce=De,he=ms,_e=ge,we=K,ve=nt,Ke=fs,Pe=Q,ye=ps,je="space-y-1",Fe=I.map(T=>{const re=d[T.index];return re?n.jsx(vr,{sortableId:T.id,section:re,raw:c[T.index],meta:h,selected:b===T.index,onSelect:()=>de(T.index),onDelete:()=>f(T.index),onDuplicate:()=>E(T.index),onMakeReusable:()=>N(T.index),onToggleHidden:()=>V(T.index),onToggleLazy:()=>j(T.index),onAddVariant:()=>l(T.index),onDetach:()=>x(T.index)},T.id):null})}e[11]=p,e[12]=i,e[13]=I,e[14]=Q,e[15]=K,e[16]=h,e[17]=r,e[18]=l,e[19]=f,e[20]=x,e[21]=E,e[22]=N,e[23]=g,e[24]=V,e[25]=j,e[26]=c,e[27]=d,e[28]=b,e[29]=De,e[30]=R,e[31]=Ke,e[32]=Me,e[33]=W,e[34]=Z,e[35]=Fe,e[36]=Pe,e[37]=ye,e[38]=ce,e[39]=he,e[40]=_e,e[41]=we,e[42]=ve,e[43]=ae,e[44]=Ce,e[45]=je}else Ke=e[31],Me=e[32],W=e[33],Z=e[34],Fe=e[35],Pe=e[36],ye=e[37],ce=e[38],he=e[39],_e=e[40],we=e[41],ve=e[42],ae=e[43],Ce=e[44],je=e[45];if(Ce!==Symbol.for("react.early_return_sentinel"))return Ce;let me;e[70]!==Fe||e[71]!==je?(me=n.jsx("div",{className:je,children:Fe}),e[70]=Fe,e[71]=je,e[72]=me):me=e[72];let $;e[73]!==Ke||e[74]!==Pe||e[75]!==ye||e[76]!==me?($=n.jsx(Ke,{items:Pe,strategy:ye,children:me}),e[73]=Ke,e[74]=Pe,e[75]=ye,e[76]=me,e[77]=$):$=e[77];let fe;e[78]!==W||e[79]!==Z||e[80]!==h?(fe=Z?n.jsx("div",{className:$e("cursor-grabbing shadow-lg ring-1 ring-border/60",Vs(Z,!1)),children:n.jsx(Ns,{section:Z,raw:W,meta:h})}):null,e[78]=W,e[79]=Z,e[80]=h,e[81]=fe):fe=e[81];let Ae;e[82]!==fe?(Ae=Xn.createPortal(n.jsx(ns,{dropAnimation:ss,children:fe}),document.body),e[82]=fe,e[83]=Ae):Ae=e[83];let be;e[84]!==Me||e[85]!==ce||e[86]!==he||e[87]!==_e||e[88]!==we||e[89]!==ve||e[90]!==$||e[91]!==Ae?(be=n.jsxs(Me,{sensors:ce,collisionDetection:he,onDragStart:_e,onDragEnd:we,onDragCancel:ve,children:[$,Ae]}),e[84]=Me,e[85]=ce,e[86]=he,e[87]=_e,e[88]=we,e[89]=ve,e[90]=$,e[91]=Ae,e[92]=be):be=e[92];const ke=!i;let se;e[93]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(vn,{size:14}),e[93]=se):se=e[93];let ie;e[94]!==R?(ie=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ie):ie=e[95];let ue;e[96]!==r||e[97]!==ke||e[98]!==ie?(ue=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ke,onClick:r,children:[se,ie]}),e[96]=r,e[97]=ke,e[98]=ie,e[99]=ue):ue=e[99];let Ee;return e[100]!==ae||e[101]!==be||e[102]!==ue?(Ee=n.jsxs("div",{className:ae,children:[be,ue]}),e[100]=ae,e[101]=be,e[102]=ue,e[103]=Ee):Ee=e[103],Ee}function Er(m){return m.id}function qn(m){const e=Ge.c(57),{open:a,initialName:c,autoLabel:d,isPending:h,onSubmit:b,onOpenChange:g}=m,v=h===void 0?!1:h,f=ct(),[E,N]=w.useState(c),[V,j]=w.useState(a);a!==V&&(j(a),a&&N(c));let l;e[0]!==v||e[1]!==g?(l=ge=>{!ge&&!v&&g(!1)},e[0]=v,e[1]=g,e[2]=l):l=e[2];const x=l;let r;e[3]!==v||e[4]!==E||e[5]!==b?(r=async ge=>{ge.preventDefault(),!v&&await b(E.trim())},e[3]=v,e[4]=E,e[5]=b,e[6]=r):r=e[6];const D=r;let i;e[7]!==f?(i=f("sectionsEditor.variantRenameDialog.title"),e[7]=f,e[8]=i):i=e[8];let R;e[9]!==i?(R=n.jsx(La,{children:i}),e[9]=i,e[10]=R):R=e[10];let M;e[11]!==d||e[12]!==f?(M=f("sectionsEditor.variantRenameDialog.description",{fallback:d||f("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=d,e[12]=f,e[13]=M):M=e[13];let I;e[14]!==M?(I=n.jsx(Ka,{children:M}),e[14]=M,e[15]=I):I=e[15];let H;e[16]!==R||e[17]!==I?(H=n.jsxs(Fa,{children:[R,I]}),e[16]=R,e[17]=I,e[18]=H):H=e[18];let p;e[19]!==f?(p=f("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=f,e[20]=p):p=e[20];let B;e[21]!==p?(B=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:p}),e[21]=p,e[22]=B):B=e[22];let pe;e[23]===Symbol.for("react.memo_cache_sentinel")?(pe=ge=>N(ge.target.value),e[23]=pe):pe=e[23];let L;e[24]!==d||e[25]!==v||e[26]!==E?(L=n.jsx(za,{id:"variant-rename-name",value:E,onChange:pe,placeholder:d,autoFocus:!0,disabled:v}),e[24]=d,e[25]=v,e[26]=E,e[27]=L):L=e[27];let le;e[28]!==B||e[29]!==L?(le=n.jsxs("div",{className:"space-y-1.5 py-4",children:[B,L]}),e[28]=B,e[29]=L,e[30]=le):le=e[30];let P;e[31]!==g?(P=()=>g(!1),e[31]=g,e[32]=P):P=e[32];let te;e[33]!==f?(te=f("sectionsEditor.variantRenameDialog.cancel"),e[33]=f,e[34]=te):te=e[34];let O;e[35]!==v||e[36]!==P||e[37]!==te?(O=n.jsx(Xe,{type:"button",variant:"outline",onClick:P,disabled:v,children:te}),e[35]=v,e[36]=P,e[37]=te,e[38]=O):O=e[38];let oe;e[39]!==v||e[40]!==f?(oe=v?n.jsxs(n.Fragment,{children:[n.jsx(Zn,{size:14,className:"animate-spin"}),f("sectionsEditor.variantRenameDialog.saving")]}):f("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=f,e[41]=oe):oe=e[41];let De;e[42]!==v||e[43]!==oe?(De=n.jsx(Xe,{type:"submit",disabled:v,children:oe}),e[42]=v,e[43]=oe,e[44]=De):De=e[44];let xe;e[45]!==O||e[46]!==De?(xe=n.jsxs(Ia,{children:[O,De]}),e[45]=O,e[46]=De,e[47]=xe):xe=e[47];let Q;e[48]!==D||e[49]!==le||e[50]!==xe||e[51]!==H?(Q=n.jsx(Oa,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,le,xe]})}),e[48]=D,e[49]=le,e[50]=xe,e[51]=H,e[52]=Q):Q=e[52];let X;return e[53]!==x||e[54]!==a||e[55]!==Q?(X=n.jsx($a,{open:a,onOpenChange:x,children:Q}),e[53]=x,e[54]=a,e[55]=Q,e[56]=X):X=e[56],X}function Ds(m){const e=Ge.c(5),{rule:a,matchers:c}=m,d=a?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const f=c.find(E=>E.resolveType===d)?.iconName??Go(d);h=Pa(f),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const b=h;if(!b)return null;let g;return e[3]!==b?(g=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=g):g=e[4],g}function Gn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
1
|
+
import{c as Ge,b as ct,r as w,m as $e,j as n,ac as Xn,B as Xe,k as Zn,o as Lo,t as J,K as Ko}from"./index-BTl7Qhcu.js";import{ap as es,aq as Fo,ar as Io,as as Oo,at as $o,a4 as ts,a5 as Qt,au as ns,av as ss,a6 as os,a7 as as,aw as rs,ax as zo,ae as is,af as ls,ay as Ho,az as Uo,aA as cs,O as qo,a8 as us,a9 as Mt,ac as ds,ad as ms,aa as fs,ak as ps,aB as Go,aC as Bt,aD as gs,aE as Wo,S as hs,aF as lt,G as vs,aG as Yo,aH as Jo,aI as Qo,aJ as Xo,D as Zo,F as ea,aK as ta,aL as na,aM as sa,aN as oa,ai as qt,aO as Gt,aP as aa,aQ as St,aR as Pt,aS as ra,aT as ia,aU as tt,aV as Ln,aW as la,aX as Ct,aY as Wt,aZ as ca,a_ as mn,a$ as ua,b0 as kt,b1 as da,b2 as ma,b3 as fa,b4 as pa,b5 as ga,b6 as xt,b7 as ha,b8 as va,b9 as ba,I as Sa,ba as Kn,bb as At,bc as Fn,bd as In,be as xa,bf as ya,bg as _a,bh as ja,bi as fn,bj as On,bk as $n,bl as Tt,bm as Yt,bn as zn,bo as Ea,bp as pn,bq as Ra,br as wa,bs as ka,bt as Ta,bu as Na}from"./index-DW7SP2KF.js";import{t as Va}from"./ChevronDown-BPLhBbcC.js";import{ah as hn,y as Da,W as bs,H as Pa,x as Ss,ao as Ca,u as Aa}from"./agent-icon-Lcxstdy4.js";import{i as xs}from"./ChevronRight-CjwWuSKC.js";import{n as Ma}from"./ChevronUp-CRIfPNig.js";import{i as Ba}from"./Globe01-DyvYVxg0.js";import{B as Jt}from"./automation-runs-2J7H3O77.js";import{c as yt,T as _t,a as jt}from"./tooltip-BwJyzC_0.js";import{b as La,h as Ka,a as Fa,c as Ia,d as Oa,e as $a}from"./dialog-D0DoVc3r.js";import{I as za}from"./input-D7bjRaiL.js";import{a as ys}from"./Copy01-D0UklT6j.js";import{i as Ha}from"./Settings02-RnwqI_s-.js";import{s as Ua}from"./Eye-BNVQo7YS.js";import{s as _s}from"./TrendUp01-Z8clCfER.js";import{s as vn}from"./Plus-DzCY9mis.js";import{s as js}from"./Trash01-BHrMtwc3.js";import{i as qa}from"./Zap-G9arss8j.js";import{D as Es,a as vt,c as Rs,b as ws,i as Ga}from"./dropdown-menu-CHw-kEIe.js";import{S as Wa,r as Hn,u as Ya,d as Ja,a as Qa,i as Xa,f as Za,P as er,b as tr}from"./page-seo-form-B4mx1blO.js";import{c as nr}from"./Tool01-Cb9-cwvE.js";import{u as sr,A as or}from"./use-section-preview-base-BbLXFNZa.js";import"./ArrowUp-CZqWUJZy.js";import"./chat-context-wxNjMmEU.js";import"./tab-id-DKJXJeSB.js";import"./Check-BeLWQxAW.js";import"./Download01-nz2y-YpD.js";import"./hooks-7Syk3eDo.js";import"./use-mcp-client-Bw8xJhM_.js";import"./auth-CdMGqX15.js";import"./decopilot-sse-pool-R2p5G030.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DRJ-nmUB.js";import"./use-ai-providers-B69eT_NQ.js";import"./studio-tools-D-buMmW7.js";import"./use-decopilot-events-CFDC275t.js";import"./use-organization-settings-Dz8Eu7gM.js";import"./spinner-BaLpWO3H.js";import"./drawer-DcdefnqI.js";import"./collection-search-Dp0g6sxT.js";import"./SearchMd-OSuucajh.js";import"./use-mobile-Do5Syn_e.js";import"./chart-Cl3k_g6W.js";import"./index-ByXN8IcD.js";import"./X-LPyt3QJh.js";import"./shell-layout-D7gnCgqn.js";import"./avatar-DI7p-s35.js";import"./User01-BKatvp0L.js";import"./Users03-Dv7QIiTO.js";import"./SearchLg-CNfPTXFn.js";import"./Stars02-ZvnK7ym4.js";import"./XClose-Bkkx5eo2.js";import"./CheckCircle-DIdAaiEB.js";import"./FilterLines-uRbQkChb.js";import"./Monitor01-CiLYUYXU.js";import"./required-auth-layout-D-qsvCCy.js";import"./use-org-sso-BaXZDqQP.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./XCircle-DS9QsRD5.js";import"./Upload01-2qIzd6_3.js";import"./AlertCircle-DpbDmpl4.js";import"./form-CKIJGFw1.js";import"./label-Be6bBbor.js";import"./select-CESIFQDf.js";import"./ArrowLeft-6Uvqwled.js";import"./tabs-ChXHfRsn.js";import"./Tool02-Dm-HMyEA.js";import"./toggle-group-BO35wHlq.js";import"./use-commerce-diagnostic-BZMAQwlL.js";import"./sidebar-CMCU7OMz.js";import"./LayoutLeft-DR7AqeCR.js";import"./popover-DgQxky2a.js";import"./self-tool-result-BYW8f83x.js";import"./alert-dialog-aISOIg4b.js";import"./integration-icon-DvR5xNjT.js";import"./extract-connection-data-0m6mxuSv.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-UtlYWenV.js";import"./LinkExternal01-DT2zbGiX.js";import"./authenticate-and-persist-oauth-DjdQ3ZXC.js";import"./mcp-oauth-RQxm51yJ.js";import"./track-BZdiiryX.js";import"./toolbar-6DesbU9x.js";import"./skeleton-DUrFo-pD.js";import"./github-repo-picker-nuuO1BJj.js";import"./use-connection-DuD5ipdN.js";import"./LockUnlocked01-CT3ndXQj.js";import"./use-mcp-tools-DleqyIvr.js";import"./use-navigate-to-agent-FqU0kChq.js";import"./reusable-new-chat-CouMjkYR.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-DFbRzPnk.js";import"./use-registry-connections-D0zPhxUH.js";import"./useInfiniteQuery-CJ7mkzKf.js";import"./use-infinite-scroll-B-Anz7bJ.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-BQFnpKaq.js";import"./textarea-CxyGETjB.js";import"./connection-form-helpers-ogjoGViU.js";import"./collection-tabs-C78C6EX0.js";import"./badge-DVuU5L9V.js";import"./useSuspenseInfiniteQuery-CMig0MgC.js";import"./command-CUBfHJdq.js";import"./index-ZY27tbMr.js";import"./use-clock-tick-DwLQwdIM.js";import"./DotsVertical-BJksCEBT.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-open-billing-url-qHT8HnXm.js";import"./select-model-2gMKulEf.js";import"./checkbox-BTDCoEWb.js";import"./Key01-PmvG5GId.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-sXWZszDJ.js";import"./ArrowUpRight-BkqhcGtY.js";import"./Stars01-BzOjLpPa.js";import"./cards-DsZ08iqo.js";import"./Share07-BoScN-lz.js";import"./Palette-BjyqEmv9.js";import"./file-type-icon-vSB8bJUE.js";import"./question-004-sINsf4GQ.js";import"./use-members-CMStqEvj.js";import"./use-org-auth-client-DaS_JoLm.js";import"./use-status-sounds-CUvwATk-.js";import"./empty-state-CGMCTLHD.js";import"./ZapSquare-D9HA-qmU.js";import"./types-DN30c8di.js";import"./use-capability-DXwGFsqD.js";import"./use-file-configs-Bp-Tbkpb.js";import"./monaco-editor-DnCDMSyo.js";import"./pt-BR-CLy76QW2.js";import"./switch-Df5wDw3E.js";import"./Play-CTk0UTMj.js";import"./use-debounced-autosave-CpBdqu6k.js";import"./index-9A9Q8J_H.js";import"./search-input-DSFfEluQ.js";import"./index-LcrNCMks.js";import"./Users01-CBTIjE5d.js";import"./use-secrets-K7ODdpvg.js";import"./AreaChart-df8seS54.js";import"./use-copy-BN27Q7JV.js";import"./SwitchHorizontal01-DCaXJWr6.js";import"./use-tags-CyNtUCi7.js";import"./get-initials-D-f_fDFw.js";import"./use-automations-CV-WrCUr.js";import"./automation-list-row-CWUigfWg.js";import"./use-org-repo-syncs-mPpZW-JJ.js";import"./CreditCard01-DFMnSd2M.js";import"./Globe04-CeHN-qAt.js";import"./HardDrive-BeQR0yEZ.js";import"./LogOut01-DfBxSCYF.js";import"./Sun-BT6a4BZg.js";import"./Shield01-DdHjMTFG.js";import"./table-BvlkOjlb.js";function ar(m){return m.schema?.definitions??m.schema?.$defs??{}}function ks(m,e){const a=ar(e),c=a[btoa(m)];if(!c)return[];const d=[c];if(Array.isArray(c.allOf)){const h=c.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof h=="string"){const b=a[h.replace("#/definitions/","")];b&&d.push(b)}}return d}function rr(m,e){for(const a of ks(m,e)){const c=typeof a.image=="string"?a.image:void 0;if(c?.includes("{{{"))return c}}function ir(m,e){if(!e)return;const a=es(m);if(!a)return;const c=rr(a.resolveType,e);if(!c)return;const d=Fo(c,a.data);if(d)return Io(d)}const lr={escape:$o};function cr(m,e){for(const a of ks(m,e)){const c=typeof a.title=="string"?a.title:void 0;if(c?.includes("{{"))return c}}function ur(m,e){if(!e)return;const a=es(m);if(a)try{const c=cr(a.resolveType,e);return c&&Oo.render(c,a.data,{},lr).trim()||void 0}catch{return}}const dr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",mr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Un(m){return Array.from({length:m},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Ts(m){return m.map((e,a)=>({...e,index:a}))}function fr(m,e){if(e===m.length)return m;if(e<m.length)return Ts(m.slice(0,e));const a=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...a]}function Ns(m){const e=Ge.c(25),{section:a,raw:c,meta:d}=m,h=a.isSavedBlock===!0,b=a.isMultivariate===!0;let g;e[0]!==d||e[1]!==c?(g=c&&d?ir(c,d):void 0,e[0]=d,e[1]=c,e[2]=g):g=e[2];const v=g;let f;e[3]!==d||e[4]!==b||e[5]!==c||e[6]!==h?(f=c&&d&&!h&&!b?ur(c,d):void 0,e[3]=d,e[4]=b,e[5]=c,e[6]=h,e[7]=f):f=e[7];const E=f;let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Da,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=N):N=e[8];let V;e[9]!==v?(V=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=v,e[10]=V):V=e[10];let j;e[11]!==b||e[12]!==h?(j=h?{color:qo}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=b,e[12]=h,e[13]=j):j=e[13];let l;e[14]!==j?(l=n.jsx(hn,{className:"h-4 w-4 shrink-0",style:j}),e[14]=j,e[15]=l):l=e[15];const x=a.isHidden&&"line-through opacity-50";let r;e[16]!==x?(r=$e("min-w-0 flex-1 truncate text-sm font-medium",x),e[16]=x,e[17]=r):r=e[17];const D=E??a.label;let i;e[18]!==r||e[19]!==D?(i=n.jsx("span",{className:r,children:D}),e[18]=r,e[19]=D,e[20]=i):i=e[20];let R;return e[21]!==i||e[22]!==V||e[23]!==l?(R=n.jsxs(n.Fragment,{children:[N,V,l,i]}),e[21]=i,e[22]=V,e[23]=l,e[24]=R):R=e[24],R}const pr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",gr="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",hr="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function gn(m,e){return $e("h-7 shrink-0 overflow-hidden",e?pr:m?hr:gr)}function Vs(m,e){const a=m.isSavedBlock===!0,c=m.isMultivariate===!0;return $e("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?dr:c?cs:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function vr(m){const e=Ge.c(82),{section:a,raw:c,meta:d,sortableId:h,selected:b,onSelect:g,onDelete:v,onDuplicate:f,onMakeReusable:E,onToggleHidden:N,onToggleLazy:V,onAddVariant:j,onDetach:l}=m,x=ct(),r=c?rs(c.__resolveType??""):!1,D=a.isHidden===!0,i=r||D;let R;e[0]!==a?(R=zo(a),e[0]=a,e[1]=R):R=e[1];const M=R;let I;e[2]!==h?(I={id:h,animateLayoutChanges:_r},e[2]=h,e[3]=I):I=e[3];const{attributes:H,listeners:p,setNodeRef:B,transform:pe,isDragging:L}=is(I);let le;e[4]!==pe?(le=ls.Transform.toString(pe?{...pe,x:0}:null),e[4]=pe,e[5]=le):le=e[5];const P=L?0:void 0;let te;e[6]!==le||e[7]!==P?(te={transform:le,opacity:P},e[6]=le,e[7]=P,e[8]=te):te=e[8];const O=te;let oe;e[9]!==a?(oe=Ho(a),e[9]=a,e[10]=oe):oe=e[10];const De=oe,xe="button",Q=0;let X;e[11]!==g?(X=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),g())},e[11]=g,e[12]=X):X=e[12];const ge=L?"cursor-grabbing":"cursor-pointer";let ne;e[13]!==a||e[14]!==b||e[15]!==ge?(ne=$e("touch-none transition-colors",ge,Vs(a,b)),e[13]=a,e[14]=b,e[15]=ge,e[16]=ne):ne=e[16];let K;e[17]!==d||e[18]!==c||e[19]!==a?(K=n.jsx(Ns,{section:a,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=a,e[20]=K):K=e[20];const ze=!a.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":x(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:$e(gn(i,r)),onClick:T=>{T.stopPropagation(),V()},onPointerDown:yr,children:n.jsx(qa,{className:$e("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:x(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),nt=!a.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":x(D?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:$e(gn(i,D)),onClick:T=>{T.stopPropagation(),N()},onPointerDown:xr,children:D?n.jsx(Ha,{className:"h-3.5 w-3.5"}):n.jsx(Ua,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:x(D?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Ke=Rs,Me=Es,W=!0,Z=Xe,Fe="button",Pe="ghost",ye="icon";let ce;e[21]!==x?(ce=x("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=x,e[22]=ce):ce=e[22];const he=$e(gn(i,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let _e;e[23]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(bs,{className:"h-3.5 w-3.5"}),e[23]=_e):_e=e[23];let we;e[24]!==Z||e[25]!==ce||e[26]!==he?(we=n.jsx(Z,{type:Fe,variant:Pe,size:ye,"aria-label":ce,className:he,onClick:Sr,onPointerDown:br,children:_e}),e[24]=Z,e[25]=ce,e[26]=he,e[27]=we):we=e[27];let ve;e[28]!==Me||e[29]!==we?(ve=n.jsx(Me,{asChild:W,children:we}),e[28]=Me,e[29]=we,e[30]=ve):ve=e[30];let ae;e[31]!==f?(ae=T=>{T.stopPropagation(),f()},e[31]=f,e[32]=ae):ae=e[32];let Ce;e[33]===Symbol.for("react.memo_cache_sentinel")?(Ce=n.jsx(ys,{className:"h-4 w-4"}),e[33]=Ce):Ce=e[33];let je;e[34]!==x?(je=x("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=x,e[35]=je):je=e[35];let me;e[36]!==ae||e[37]!==je?(me=n.jsxs(vt,{onClick:ae,children:[Ce,je]}),e[36]=ae,e[37]=je,e[38]=me):me=e[38];let $;e[39]!==M||e[40]!==j||e[41]!==x?($=M&&n.jsxs(vt,{className:Uo,onClick:T=>{T.stopPropagation(),j()},children:[n.jsx(_s,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=M,e[40]=j,e[41]=x,e[42]=$):$=e[42];let fe;e[43]!==De||e[44]!==E||e[45]!==x?(fe=De&&n.jsxs(vt,{className:mr,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(hn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=De,e[44]=E,e[45]=x,e[46]=fe):fe=e[46];let Ae;e[47]!==l||e[48]!==a.isMultivariate||e[49]!==a.isSavedBlock||e[50]!==x?(Ae=a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(vt,{onClick:T=>{T.stopPropagation(),l()},children:[n.jsx(hn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=l,e[48]=a.isMultivariate,e[49]=a.isSavedBlock,e[50]=x,e[51]=Ae):Ae=e[51];let be;e[52]!==v?(be=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=be):be=e[53];let ke;e[54]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(js,{className:"h-4 w-4"}),e[54]=ke):ke=e[54];let se;e[55]!==x?(se=x("sectionsEditor.sectionList.deleteMenuItem"),e[55]=x,e[56]=se):se=e[56];let ie;e[57]!==be||e[58]!==se?(ie=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:be,children:[ke,se]}),e[57]=be,e[58]=se,e[59]=ie):ie=e[59];let ue;e[60]!==me||e[61]!==$||e[62]!==fe||e[63]!==Ae||e[64]!==ie?(ue=n.jsxs(ws,{align:"end",className:"w-44",children:[me,$,fe,Ae,ie]}),e[60]=me,e[61]=$,e[62]=fe,e[63]=Ae,e[64]=ie,e[65]=ue):ue=e[65];let Ee;e[66]!==Ke||e[67]!==ve||e[68]!==ue?(Ee=n.jsxs(Ke,{children:[ve,ue]}),e[66]=Ke,e[67]=ve,e[68]=ue,e[69]=Ee):Ee=e[69];let de;return e[70]!==H||e[71]!==p||e[72]!==g||e[73]!==B||e[74]!==O||e[75]!==ne||e[76]!==K||e[77]!==ze||e[78]!==nt||e[79]!==Ee||e[80]!==X?(de=n.jsxs("div",{ref:B,style:O,...H,...p,role:xe,tabIndex:Q,onClick:g,onKeyDown:X,className:ne,children:[K,ze,nt,Ee]}),e[70]=H,e[71]=p,e[72]=g,e[73]=B,e[74]=O,e[75]=ne,e[76]=K,e[77]=ze,e[78]=nt,e[79]=Ee,e[80]=X,e[81]=de):de=e[81],de}function br(m){return m.stopPropagation()}function Sr(m){return m.stopPropagation()}function xr(m){return m.stopPropagation()}function yr(m){return m.stopPropagation()}function _r(){return!1}function jr(m){const e=Ge.c(104),{listKey:a,rawSections:c,sections:d,meta:h,selectedIndex:b,onSelect:g,onReorder:v,onDelete:f,onDuplicate:E,onMakeReusable:N,onToggleHidden:V,onToggleLazy:j,onAddVariant:l,onDetach:x,onAddSection:r,canAddSection:D}=m,i=D===void 0?!0:D,R=ct();let M;e[0]!==d.length?(M=()=>Un(d.length),e[0]=d.length,e[1]=M):M=e[1];const[I,H]=w.useState(M),[p,B]=w.useState(null),[pe,L]=w.useState(a),[le,P]=w.useState(d.length),te=w.useRef(!1);pe!==a?(L(a),P(d.length),H(Un(d.length))):le!==d.length&&(P(d.length),H(de=>fr(de,d.length)));let O;e[2]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[2]=O):O=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:us},e[3]=oe):oe=e[3];const De=ts(Qt(as,O),Qt(os,oe));let xe;e[4]!==I?(xe=I.map(Er),e[4]=I,e[5]=xe):xe=e[5];const Q=xe;let X;e[6]===Symbol.for("react.memo_cache_sentinel")?(X=de=>{B(String(de.active.id))},e[6]=X):X=e[6];const ge=X;let ne;e[7]!==Q||e[8]!==v?(ne=de=>{B(null);const{active:T,over:re}=de;if(!re||T.id===re.id)return;const F=Q.indexOf(String(T.id)),Be=Q.indexOf(String(re.id));F===-1||Be===-1||(H(ut=>Ts(Mt([...ut],F,Be))),te.current=!0,requestAnimationFrame(()=>{te.current=!1}),v?.(F,Be))},e[7]=Q,e[8]=v,e[9]=ne):ne=e[9];const K=ne;let ze;e[10]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{B(null)},e[10]=ze):ze=e[10];const nt=ze;let Ke,Me,W,Z,Fe,Pe,ye,ce,he,_e,we,ve,ae,Ce,je;if(e[11]!==p||e[12]!==i||e[13]!==I||e[14]!==Q||e[15]!==K||e[16]!==h||e[17]!==r||e[18]!==l||e[19]!==f||e[20]!==x||e[21]!==E||e[22]!==N||e[23]!==g||e[24]!==V||e[25]!==j||e[26]!==c||e[27]!==d||e[28]!==b||e[29]!==De||e[30]!==R){Ce=Symbol.for("react.early_return_sentinel");e:{const de=T=>{te.current||g(T)};if(e[46]!==p||e[47]!==i||e[48]!==I||e[49]!==r||e[50]!==c||e[51]!==d||e[52]!==R){const T=p?I.find(re=>re.id===p):null;if(Z=T!=null?d[T.index]:null,W=T!=null?c[T.index]:void 0,I.length===0){let re;e[56]!==R?(re=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=re):re=e[57];let F;e[58]!==re?(F=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:re}),e[58]=re,e[59]=F):F=e[59];const Be=!i;let ut;e[60]===Symbol.for("react.memo_cache_sentinel")?(ut=n.jsx(vn,{size:14}),e[60]=ut):ut=e[60];let Te;e[61]!==R?(Te=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=Te):Te=e[62];let We;e[63]!==r||e[64]!==Be||e[65]!==Te?(We=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Be,onClick:r,children:[ut,Te]}),e[63]=r,e[64]=Be,e[65]=Te,e[66]=We):We=e[66];let Ie;e[67]!==F||e[68]!==We?(Ie=n.jsxs("div",{className:"space-y-2",children:[F,We]}),e[67]=F,e[68]=We,e[69]=Ie):Ie=e[69],Ce=Ie;break e}ae=$e(T&&"cursor-grabbing"),e[46]=p,e[47]=i,e[48]=I,e[49]=r,e[50]=c,e[51]=d,e[52]=R,e[53]=W,e[54]=Z,e[55]=ae}else W=e[53],Z=e[54],ae=e[55];Me=ds,ce=De,he=ms,_e=ge,we=K,ve=nt,Ke=fs,Pe=Q,ye=ps,je="space-y-1",Fe=I.map(T=>{const re=d[T.index];return re?n.jsx(vr,{sortableId:T.id,section:re,raw:c[T.index],meta:h,selected:b===T.index,onSelect:()=>de(T.index),onDelete:()=>f(T.index),onDuplicate:()=>E(T.index),onMakeReusable:()=>N(T.index),onToggleHidden:()=>V(T.index),onToggleLazy:()=>j(T.index),onAddVariant:()=>l(T.index),onDetach:()=>x(T.index)},T.id):null})}e[11]=p,e[12]=i,e[13]=I,e[14]=Q,e[15]=K,e[16]=h,e[17]=r,e[18]=l,e[19]=f,e[20]=x,e[21]=E,e[22]=N,e[23]=g,e[24]=V,e[25]=j,e[26]=c,e[27]=d,e[28]=b,e[29]=De,e[30]=R,e[31]=Ke,e[32]=Me,e[33]=W,e[34]=Z,e[35]=Fe,e[36]=Pe,e[37]=ye,e[38]=ce,e[39]=he,e[40]=_e,e[41]=we,e[42]=ve,e[43]=ae,e[44]=Ce,e[45]=je}else Ke=e[31],Me=e[32],W=e[33],Z=e[34],Fe=e[35],Pe=e[36],ye=e[37],ce=e[38],he=e[39],_e=e[40],we=e[41],ve=e[42],ae=e[43],Ce=e[44],je=e[45];if(Ce!==Symbol.for("react.early_return_sentinel"))return Ce;let me;e[70]!==Fe||e[71]!==je?(me=n.jsx("div",{className:je,children:Fe}),e[70]=Fe,e[71]=je,e[72]=me):me=e[72];let $;e[73]!==Ke||e[74]!==Pe||e[75]!==ye||e[76]!==me?($=n.jsx(Ke,{items:Pe,strategy:ye,children:me}),e[73]=Ke,e[74]=Pe,e[75]=ye,e[76]=me,e[77]=$):$=e[77];let fe;e[78]!==W||e[79]!==Z||e[80]!==h?(fe=Z?n.jsx("div",{className:$e("cursor-grabbing shadow-lg ring-1 ring-border/60",Vs(Z,!1)),children:n.jsx(Ns,{section:Z,raw:W,meta:h})}):null,e[78]=W,e[79]=Z,e[80]=h,e[81]=fe):fe=e[81];let Ae;e[82]!==fe?(Ae=Xn.createPortal(n.jsx(ns,{dropAnimation:ss,children:fe}),document.body),e[82]=fe,e[83]=Ae):Ae=e[83];let be;e[84]!==Me||e[85]!==ce||e[86]!==he||e[87]!==_e||e[88]!==we||e[89]!==ve||e[90]!==$||e[91]!==Ae?(be=n.jsxs(Me,{sensors:ce,collisionDetection:he,onDragStart:_e,onDragEnd:we,onDragCancel:ve,children:[$,Ae]}),e[84]=Me,e[85]=ce,e[86]=he,e[87]=_e,e[88]=we,e[89]=ve,e[90]=$,e[91]=Ae,e[92]=be):be=e[92];const ke=!i;let se;e[93]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(vn,{size:14}),e[93]=se):se=e[93];let ie;e[94]!==R?(ie=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ie):ie=e[95];let ue;e[96]!==r||e[97]!==ke||e[98]!==ie?(ue=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ke,onClick:r,children:[se,ie]}),e[96]=r,e[97]=ke,e[98]=ie,e[99]=ue):ue=e[99];let Ee;return e[100]!==ae||e[101]!==be||e[102]!==ue?(Ee=n.jsxs("div",{className:ae,children:[be,ue]}),e[100]=ae,e[101]=be,e[102]=ue,e[103]=Ee):Ee=e[103],Ee}function Er(m){return m.id}function qn(m){const e=Ge.c(57),{open:a,initialName:c,autoLabel:d,isPending:h,onSubmit:b,onOpenChange:g}=m,v=h===void 0?!1:h,f=ct(),[E,N]=w.useState(c),[V,j]=w.useState(a);a!==V&&(j(a),a&&N(c));let l;e[0]!==v||e[1]!==g?(l=ge=>{!ge&&!v&&g(!1)},e[0]=v,e[1]=g,e[2]=l):l=e[2];const x=l;let r;e[3]!==v||e[4]!==E||e[5]!==b?(r=async ge=>{ge.preventDefault(),!v&&await b(E.trim())},e[3]=v,e[4]=E,e[5]=b,e[6]=r):r=e[6];const D=r;let i;e[7]!==f?(i=f("sectionsEditor.variantRenameDialog.title"),e[7]=f,e[8]=i):i=e[8];let R;e[9]!==i?(R=n.jsx(La,{children:i}),e[9]=i,e[10]=R):R=e[10];let M;e[11]!==d||e[12]!==f?(M=f("sectionsEditor.variantRenameDialog.description",{fallback:d||f("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=d,e[12]=f,e[13]=M):M=e[13];let I;e[14]!==M?(I=n.jsx(Ka,{children:M}),e[14]=M,e[15]=I):I=e[15];let H;e[16]!==R||e[17]!==I?(H=n.jsxs(Fa,{children:[R,I]}),e[16]=R,e[17]=I,e[18]=H):H=e[18];let p;e[19]!==f?(p=f("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=f,e[20]=p):p=e[20];let B;e[21]!==p?(B=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:p}),e[21]=p,e[22]=B):B=e[22];let pe;e[23]===Symbol.for("react.memo_cache_sentinel")?(pe=ge=>N(ge.target.value),e[23]=pe):pe=e[23];let L;e[24]!==d||e[25]!==v||e[26]!==E?(L=n.jsx(za,{id:"variant-rename-name",value:E,onChange:pe,placeholder:d,autoFocus:!0,disabled:v}),e[24]=d,e[25]=v,e[26]=E,e[27]=L):L=e[27];let le;e[28]!==B||e[29]!==L?(le=n.jsxs("div",{className:"space-y-1.5 py-4",children:[B,L]}),e[28]=B,e[29]=L,e[30]=le):le=e[30];let P;e[31]!==g?(P=()=>g(!1),e[31]=g,e[32]=P):P=e[32];let te;e[33]!==f?(te=f("sectionsEditor.variantRenameDialog.cancel"),e[33]=f,e[34]=te):te=e[34];let O;e[35]!==v||e[36]!==P||e[37]!==te?(O=n.jsx(Xe,{type:"button",variant:"outline",onClick:P,disabled:v,children:te}),e[35]=v,e[36]=P,e[37]=te,e[38]=O):O=e[38];let oe;e[39]!==v||e[40]!==f?(oe=v?n.jsxs(n.Fragment,{children:[n.jsx(Zn,{size:14,className:"animate-spin"}),f("sectionsEditor.variantRenameDialog.saving")]}):f("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=f,e[41]=oe):oe=e[41];let De;e[42]!==v||e[43]!==oe?(De=n.jsx(Xe,{type:"submit",disabled:v,children:oe}),e[42]=v,e[43]=oe,e[44]=De):De=e[44];let xe;e[45]!==O||e[46]!==De?(xe=n.jsxs(Ia,{children:[O,De]}),e[45]=O,e[46]=De,e[47]=xe):xe=e[47];let Q;e[48]!==D||e[49]!==le||e[50]!==xe||e[51]!==H?(Q=n.jsx(Oa,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,le,xe]})}),e[48]=D,e[49]=le,e[50]=xe,e[51]=H,e[52]=Q):Q=e[52];let X;return e[53]!==x||e[54]!==a||e[55]!==Q?(X=n.jsx($a,{open:a,onOpenChange:x,children:Q}),e[53]=x,e[54]=a,e[55]=Q,e[56]=X):X=e[56],X}function Ds(m){const e=Ge.c(5),{rule:a,matchers:c}=m,d=a?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const f=c.find(E=>E.resolveType===d)?.iconName??Go(d);h=Pa(f),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const b=h;if(!b)return null;let g;return e[3]!==b?(g=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=g):g=e[4],g}function Gn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
2
|
`)}function Wn(m){return m.map((e,a)=>({id:crypto.randomUUID(),index:a,variant:e}))}function Rr(m,e){const a=new Map;for(const c of m){const d=a.get(c.variant.label);d?d.push(c):a.set(c.variant.label,[c])}return e.map((c,d)=>({id:a.get(c.label)?.shift()?.id??crypto.randomUUID(),index:d,variant:c}))}function wr(m){return m.map((e,a)=>({...e,index:a}))}function Ps(m){const e=Ge.c(17),{label:a,effectiveRule:c,matchers:d,canDelete:h,dragging:b,onRename:g,onDuplicate:v,onDelete:f}=m,E=ct();let N;e[0]!==c||e[1]!==d?(N=n.jsx(Ds,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=N):N=e[2];let V;e[3]!==a?(V=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:a}),e[3]=a,e[4]=V):V=e[4];let j;e[5]!==h||e[6]!==b||e[7]!==a||e[8]!==f||e[9]!==v||e[10]!==g||e[11]!==E?(j=!b&&n.jsxs(Rs,{children:[n.jsx(Es,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":E("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:a}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Tr,onPointerDown:kr,children:n.jsx(bs,{size:14})})}),n.jsxs(ws,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:x=>{x.stopPropagation(),g?.()},children:[n.jsx(nr,{size:14}),E("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:x=>{x.stopPropagation(),v?.()},children:[n.jsx(ys,{size:14}),E("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Ga,{}),n.jsxs(vt,{variant:"destructive",disabled:!h,onClick:x=>{x.stopPropagation(),f?.()},children:[n.jsx(js,{size:14}),E("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=h,e[6]=b,e[7]=a,e[8]=f,e[9]=v,e[10]=g,e[11]=E,e[12]=j):j=e[12];let l;return e[13]!==N||e[14]!==V||e[15]!==j?(l=n.jsxs(n.Fragment,{children:[N,V,j]}),e[13]=N,e[14]=V,e[15]=j,e[16]=l):l=e[16],l}function kr(m){return m.stopPropagation()}function Tr(m){return m.stopPropagation()}function Nr(m){const e=Ge.c(33),{entry:a,isActive:c,canDelete:d,decofile:h,meta:b,matchers:g,onSelect:v,onRename:f,onDuplicate:E,onDelete:N}=m;let V;e[0]!==a.id?(V={id:a.id,animateLayoutChanges:Vr},e[0]=a.id,e[1]=V):V=e[1];const{attributes:j,listeners:l,setNodeRef:x,transform:r,isDragging:D}=is(V);let i;e[2]!==r?(i=ls.Transform.toString(r?{...r,x:0}:null),e[2]=r,e[3]=i):i=e[3];const R=D?0:void 0;let M;e[4]!==i||e[5]!==R?(M={transform:i,opacity:R},e[4]=i,e[5]=R,e[6]=M):M=e[6];const I=M,H=b??void 0;let p;e[7]!==h||e[8]!==a.variant.rule||e[9]!==H?(p=Bt(a.variant.rule,h,H),e[7]=h,e[8]=a.variant.rule,e[9]=H,e[10]=p):p=e[10];const B=p;let pe;e[11]!==v?(pe=oe=>{oe.target===oe.currentTarget&&(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),v())},e[11]=v,e[12]=pe):pe=e[12];const L=D?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",le=c?gs:cs;let P;e[13]!==L||e[14]!==le?(P=$e("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",L,le),e[13]=L,e[14]=le,e[15]=P):P=e[15];let te;e[16]!==d||e[17]!==B||e[18]!==a.variant.label||e[19]!==g||e[20]!==N||e[21]!==E||e[22]!==f?(te=n.jsx(Ps,{label:a.variant.label,effectiveRule:B,matchers:g,canDelete:d,onRename:f,onDuplicate:E,onDelete:N}),e[16]=d,e[17]=B,e[18]=a.variant.label,e[19]=g,e[20]=N,e[21]=E,e[22]=f,e[23]=te):te=e[23];let O;return e[24]!==j||e[25]!==l||e[26]!==v||e[27]!==x||e[28]!==I||e[29]!==P||e[30]!==te||e[31]!==pe?(O=n.jsx("div",{ref:x,style:I,...j,...l,onClick:v,onKeyDown:pe,className:P,children:te}),e[24]=j,e[25]=l,e[26]=v,e[27]=x,e[28]=I,e[29]=P,e[30]=te,e[31]=pe,e[32]=O):O=e[32],O}function Vr(){return!1}function Dr(m){const e=Ge.c(9),{variant:a,decofile:c,meta:d,matchers:h}=m,b=d??void 0;let g;e[0]!==c||e[1]!==b||e[2]!==a.rule?(g=Bt(a.rule,c,b),e[0]=c,e[1]=b,e[2]=a.rule,e[3]=g):g=e[3];const v=g;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=$e("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",gs),e[4]=f):f=e[4];let E;return e[5]!==v||e[6]!==h||e[7]!==a.label?(E=n.jsx("div",{className:f,children:n.jsx(Ps,{label:a.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=a.label,e[8]=E):E=e[8],E}function Pr(m){const e=Ge.c(91),{listKey:a,variants:c,activeIndex:d,decofile:h,meta:b,matchers:g,onSelect:v,onReorder:f,onRename:E,onDuplicate:N,onDelete:V,onAdd:j}=m,l=ct();let x;e[0]!==c?(x=()=>Wn(c),e[0]=c,e[1]=x):x=e[1];const[r,D]=w.useState(x),[i,R]=w.useState(null),[M,I]=w.useState(a),[H,p]=w.useState(c.length);let B;e[2]!==c?(B=()=>Gn(c),e[2]=c,e[3]=B):B=e[3];const[pe,L]=w.useState(B),le=w.useRef(!1),P=Gn(c);M!==a?(I(a),p(c.length),L(P),D(Wn(c))):(H!==c.length||pe!==P)&&(p(c.length),L(P),D(be=>Rr(be,c)));let te;e[4]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[4]=te):te=e[4];let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:us},e[5]=O):O=e[5];const oe=ts(Qt(as,te),Qt(os,O));let De;e[6]!==r?(De=r.map(Cr),e[6]=r,e[7]=De):De=e[7];const xe=De,Q=c.length>1;let X;e[8]!==r?(X=be=>{const ke=String(be.active.id);R(r.find(se=>se.id===ke)??null)},e[8]=r,e[9]=X):X=e[9];const ge=X;let ne;e[10]!==xe||e[11]!==f?(ne=be=>{R(null);const{active:ke,over:se}=be;if(!se||ke.id===se.id)return;const ie=xe.indexOf(String(ke.id)),ue=xe.indexOf(String(se.id));ie===-1||ue===-1||(D(Ee=>wr(Mt([...Ee],ie,ue))),le.current=!0,requestAnimationFrame(()=>{le.current=!1}),f(ie,ue))},e[10]=xe,e[11]=f,e[12]=ne):ne=e[12];const K=ne;let ze;e[13]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{R(null)},e[13]=ze):ze=e[13];const nt=ze;let Ke,Me,W,Z,Fe,Pe,ye,ce,he,_e,we,ve,ae;if(e[14]!==d||e[15]!==Q||e[16]!==h||e[17]!==r||e[18]!==xe||e[19]!==K||e[20]!==ge||e[21]!==g||e[22]!==b||e[23]!==j||e[24]!==V||e[25]!==N||e[26]!==E||e[27]!==v||e[28]!==oe||e[29]!==l){const be=F=>{le.current||v(F)};we="space-y-1 border-b p-2";let ke;e[43]!==l?(ke=l("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=l,e[44]=ke):ke=e[44];let se;e[45]!==ke?(se=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ke}),e[45]=ke,e[46]=se):se=e[46];let ie;e[47]!==l?(ie=l("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=l,e[48]=ie):ie=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(vn,{size:14}),e[49]=ue):ue=e[49];let Ee;e[50]!==j||e[51]!==ie?(Ee=n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":ie,className:"size-6",onClick:j,children:ue})}),e[50]=j,e[51]=ie,e[52]=Ee):Ee=e[52];let de;e[53]!==l?(de=l("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=l,e[54]=de):de=e[54];let T;e[55]!==de?(T=n.jsx(jt,{children:de}),e[55]=de,e[56]=T):T=e[56];let re;e[57]!==Ee||e[58]!==T?(re=n.jsxs(yt,{children:[Ee,T]}),e[57]=Ee,e[58]=T,e[59]=re):re=e[59],e[60]!==se||e[61]!==re?(ve=n.jsxs("div",{className:"flex items-center justify-between",children:[se,re]}),e[60]=se,e[61]=re,e[62]=ve):ve=e[62],Me=ds,Pe=oe,ye=ms,ce=ge,he=K,_e=nt,Ke=fs,Z=xe,Fe=ps,ae="space-y-0.5",W=r.map(F=>n.jsx(Nr,{entry:F,isActive:F.index===d,canDelete:Q,decofile:h,meta:b,matchers:g,onSelect:()=>be(F.index),onRename:()=>E(F.index),onDuplicate:()=>N(F.index),onDelete:()=>V(F.index)},F.id)),e[14]=d,e[15]=Q,e[16]=h,e[17]=r,e[18]=xe,e[19]=K,e[20]=ge,e[21]=g,e[22]=b,e[23]=j,e[24]=V,e[25]=N,e[26]=E,e[27]=v,e[28]=oe,e[29]=l,e[30]=Ke,e[31]=Me,e[32]=W,e[33]=Z,e[34]=Fe,e[35]=Pe,e[36]=ye,e[37]=ce,e[38]=he,e[39]=_e,e[40]=we,e[41]=ve,e[42]=ae}else Ke=e[30],Me=e[31],W=e[32],Z=e[33],Fe=e[34],Pe=e[35],ye=e[36],ce=e[37],he=e[38],_e=e[39],we=e[40],ve=e[41],ae=e[42];let Ce;e[63]!==W||e[64]!==ae?(Ce=n.jsx("div",{className:ae,children:W}),e[63]=W,e[64]=ae,e[65]=Ce):Ce=e[65];let je;e[66]!==Ke||e[67]!==Z||e[68]!==Fe||e[69]!==Ce?(je=n.jsx(Ke,{items:Z,strategy:Fe,children:Ce}),e[66]=Ke,e[67]=Z,e[68]=Fe,e[69]=Ce,e[70]=je):je=e[70];let me;e[71]!==i||e[72]!==h||e[73]!==g||e[74]!==b?(me=i?n.jsx(Dr,{variant:i.variant,decofile:h,meta:b,matchers:g}):null,e[71]=i,e[72]=h,e[73]=g,e[74]=b,e[75]=me):me=e[75];let $;e[76]!==me?($=Xn.createPortal(n.jsx(ns,{dropAnimation:ss,children:me}),document.body),e[76]=me,e[77]=$):$=e[77];let fe;e[78]!==Me||e[79]!==Pe||e[80]!==ye||e[81]!==ce||e[82]!==he||e[83]!==_e||e[84]!==je||e[85]!==$?(fe=n.jsxs(Me,{sensors:Pe,collisionDetection:ye,onDragStart:ce,onDragEnd:he,onDragCancel:_e,children:[je,$]}),e[78]=Me,e[79]=Pe,e[80]=ye,e[81]=ce,e[82]=he,e[83]=_e,e[84]=je,e[85]=$,e[86]=fe):fe=e[86];let Ae;return e[87]!==we||e[88]!==ve||e[89]!==fe?(Ae=n.jsxs("div",{className:we,children:[ve,fe]}),e[87]=we,e[88]=ve,e[89]=fe,e[90]=Ae):Ae=e[90],Ae}function Cr(m){return m.id}function Ar(m){const e=Ge.c(16),{schema:a,value:c,onChange:d,meta:h,decofile:b,onSaveReferencedBlock:g,sandbox:v}=m,f=ct();let E;e[0]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[0]=E):E=e[0];const[N,V]=w.useState(E);let j;e[1]!==N||e[2]!==f?(j=N.length>0&&n.jsxs("nav",{"aria-label":f("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>V([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:f("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(Ss,{className:"size-3.5"})}),N.map((r,D)=>{const i=D===N.length-1,R=vs(r);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(xs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>V(N.slice(0,D+1)),title:R,className:$e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",i?"font-medium text-foreground":"text-muted-foreground"),children:R})]},`${R}-${D}`)})]}),e[1]=N,e[2]=f,e[3]=j):j=e[3];let l;e[4]!==N||e[5]!==b||e[6]!==h||e[7]!==d||e[8]!==g||e[9]!==v||e[10]!==a||e[11]!==c?(l=n.jsx(hs,{schema:a,value:c,onChange:d,basePath:"",breadcrumbPath:N,onBreadcrumbChange:V,meta:h,decofile:b,onSaveReferencedBlock:g,sandbox:v}),e[4]=N,e[5]=b,e[6]=h,e[7]=d,e[8]=g,e[9]=v,e[10]=a,e[11]=c,e[12]=l):l=e[12];let x;return e[13]!==j||e[14]!==l?(x=n.jsxs("div",{className:"space-y-2",children:[j,l]}),e[13]=j,e[14]=l,e[15]=x):x=e[15],x}function Yn(m){const e=Ge.c(23),{activeSchema:a,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:b,breadcrumbPath:g,emptyMessage:v,beforeForm:f,seoResolveType:E,siteDefaultSeo:N,meta:V,decofile:j,onSaveReferencedBlock:l,sandbox:x,previewBaseUrl:r,onRequestAddSection:D}=m;let i;e[0]!==g?(i=g===void 0?[]:g,e[0]=g,e[1]=i):i=e[1];const R=i;let M;e[2]!==a||e[3]!==R||e[4]!==j||e[5]!==d||e[6]!==c||e[7]!==V||e[8]!==b||e[9]!==h||e[10]!==D||e[11]!==l||e[12]!==r||e[13]!==x||e[14]!==E||e[15]!==N?(M=a&&c?E?n.jsx(Wa,{schema:a,resolveType:E,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:b,siteDefaultSeo:N}):n.jsx(hs,{schema:a,value:c,onChange:h,basePath:"",breadcrumbPath:R,onBreadcrumbChange:b,meta:V,decofile:j,onSaveReferencedBlock:l,sandbox:x,previewBaseUrl:r,onRequestAddSection:D},d):null,e[2]=a,e[3]=R,e[4]=j,e[5]=d,e[6]=c,e[7]=V,e[8]=b,e[9]=h,e[10]=D,e[11]=l,e[12]=r,e[13]=x,e[14]=E,e[15]=N,e[16]=M):M=e[16];const I=M;let H;e[17]!==v||e[18]!==I?(H=I??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=I,e[19]=H):H=e[19];let p;return e[20]!==f||e[21]!==H?(p=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[f,H]})}),e[20]=f,e[21]=H,e[22]=p):p=e[22],p}const Mr="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Br(m,e){return Wo(m,e,lt)}function Lr(m){const e=Ge.c(19),{pageKey:a,initialName:c,initialPath:d,onFieldChange:h}=m,b=ct(),[g,v]=w.useState(c),[f,E]=w.useState(d),[N,V]=w.useState(a);N!==a&&(V(a),v(c),E(d));let j;e[0]!==h?(j=M=>{v(M.target.value),h("name",M.target.value)},e[0]=h,e[1]=j):j=e[1];let l;e[2]!==b?(l=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=l):l=e[3];let x;e[4]!==g||e[5]!==j||e[6]!==l?(x=n.jsx("input",{type:"text",value:g,onChange:j,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:l}),e[4]=g,e[5]=j,e[6]=l,e[7]=x):x=e[7];let r;e[8]!==h?(r=M=>{E(M.target.value),h("path",M.target.value)},e[8]=h,e[9]=r):r=e[9];let D;e[10]!==b?(D=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=D):D=e[11];let i;e[12]!==f||e[13]!==r||e[14]!==D?(i=n.jsx("input",{type:"text",value:f,onChange:r,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:D}),e[12]=f,e[13]=r,e[14]=D,e[15]=i):i=e[15];let R;return e[16]!==x||e[17]!==i?(R=n.jsxs("div",{className:"space-y-1",children:[x,i]}),e[16]=x,e[17]=i,e[18]=R):R=e[18],R}function Jn(m){const e=Ge.c(13),{onClick:a}=m,c=ct();let d;e[0]!==c?(d=c("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=c,e[1]=d):d=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(_s,{size:14}),e[2]=h):h=e[2];let b;e[3]!==a||e[4]!==d?(b=n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":d,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:a,children:h})}),e[3]=a,e[4]=d,e[5]=b):b=e[5];let g;e[6]!==c?(g=c("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=c,e[7]=g):g=e[7];let v;e[8]!==g?(v=n.jsx(jt,{side:"bottom",children:g}),e[8]=g,e[9]=v):v=e[9];let f;return e[10]!==b||e[11]!==v?(f=n.jsxs(yt,{children:[b,v]}),e[10]=b,e[11]=v,e[12]=f):f=e[12],f}function Qn(m){const e=Ge.c(21),{currentRt:a,currentLabel:c,currentGlobalKey:d,matchers:h,globals:b,onSelect:g,onSelectGlobal:v,schema:f,formValue:E,onChange:N,formKey:V,formWrapperClassName:j,meta:l,decofile:x,onSaveReferencedBlock:r,sandbox:D}=m;let i;e[0]!==d||e[1]!==c||e[2]!==a||e[3]!==b||e[4]!==h||e[5]!==g||e[6]!==v?(i=n.jsx(Yo,{currentRt:a,currentLabel:c,currentGlobalKey:d,matchers:h,globals:b,onSelect:g,onSelectGlobal:v}),e[0]=d,e[1]=c,e[2]=a,e[3]=b,e[4]=h,e[5]=g,e[6]=v,e[7]=i):i=e[7];let R;e[8]!==x||e[9]!==V||e[10]!==E||e[11]!==j||e[12]!==l||e[13]!==N||e[14]!==r||e[15]!==D||e[16]!==f?(R=f&&E&&n.jsx("div",{className:j,children:n.jsx(Ar,{schema:f,value:E,onChange:N,meta:l,decofile:x,onSaveReferencedBlock:r,sandbox:D},V)}),e[8]=x,e[9]=V,e[10]=E,e[11]=j,e[12]=l,e[13]=N,e[14]=r,e[15]=D,e[16]=f,e[17]=R):R=e[17];let M;return e[18]!==i||e[19]!==R?(M=n.jsxs(n.Fragment,{children:[i,R]}),e[18]=i,e[19]=R,e[20]=M):M=e[20],M}function Ac({orgSlug:m,virtualMcpId:e,branch:a,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:b=null,activeGlobalBlockKey:g=null,externalSelection:v,onSaved:f,initialEditSeo:E=!1,onExitSeo:N,onViewJsonFile:V,onVariantPreviewOverride:j}){const l=ct(),x=c?{orgSlug:m,virtualMcpId:e,branch:a,previewUrl:d}:null,{data:r,isLoading:D}=Jo(x),{data:i,isLoading:R}=Qo(x),M=Xo(),I=M?.entity?.id===e?M.entity.metadata?.siteSlug??null:null,H=sr({virtualMcpId:e,sandboxUrl:d}),[p,B]=w.useState(null),[pe,L]=w.useState(null),[le,P]=w.useState(null),[te,O]=w.useState(0),[oe,De]=w.useState(void 0),[xe,Q]=w.useState(null),[X,ge]=w.useState(null),[ne,K]=w.useState([]),ze=w.useRef(null),[nt,Ke]=w.useState(ne.length);nt!==ne.length&&(Ke(ne.length),requestAnimationFrame(()=>{ze.current&&(ze.current.scrollTop=0)}));const[Me,W]=w.useState(0),[Z,Fe]=w.useState(null),[Pe,ye]=w.useState(null),[ce,he]=w.useState(null),[_e,we]=w.useState(!0),[ve,ae]=w.useState(!1),[Ce,je]=w.useState(!1),me=w.useRef(null),[$,fe]=w.useState(E),[Ae,be]=w.useState(E);E&&!Ae&&(be(!0),fe(!0),B(null),L(null),P(null),K([])),!E&&Ae&&be(!1);const[ke,se]=w.useState(null),[ie,ue]=w.useState(void 0),[Ee,de]=w.useState([]),[T,re]=w.useState(0),[F,Be]=w.useState(0),[ut,Te]=w.useState(null),[We,Ie]=w.useState(null),[bn,Sn]=w.useState(null),Cs=Lo(),As=`${m}/${e}/${a}`,Xt=Zo({orgSlug:m,virtualMcpId:e,branch:a}),[Ms,Bs]=w.useState(h),[Ls,Ks]=w.useState(b),[Fs,Is]=w.useState(g);(Ms!==h||Ls!==b||Fs!==g)&&(queueMicrotask(()=>Xt.flush()),Bs(h),Ks(b),Is(g),B(null),L(null),P(null),O(0),Q(null),ge(null),Be(0),Te(null),Ie(null),K([]),W(t=>t+1),fe(!1),se(null),ue(void 0),de([]),re(t=>t+1));const Ne=ea({orgSlug:m,virtualMcpId:e,branch:a}),Lt=Sa((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>f?.(),onError:o=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),Zt=ta({orgSlug:m,virtualMcpId:e,branch:a}),[Nt,Kt]=w.useState(!1),He=w.useRef(null),st=w.useRef(null),ot=w.useRef(null),en=w.useRef({}),Ze=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||D||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Zn,{size:20,className:"animate-spin text-muted-foreground"})});if(!r||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Os=na(r),Ve=!!g,Ye=Ve?null:sa(Os,h,b),k=Ve?g:Ye?.key??null,tn=Ve&&g?r[g]:void 0,xn=Ve&&g&&tn?oa(g,tn):Ve&&g?g:"",Ft=!Ve&&k&&r[k]?r[k]:null,nn=$&&r&&i&&k&&Ye?Hn(r,{kind:"page",pageKey:k,pageName:String(Ye.name??""),path:String(Ye.path??"")},i):null,$s=$?Ft?.seo:void 0,sn=ie!==void 0?ie:$s,zs=$?Ya(sn):void 0,Hs=nn?.seoTypeOptions??[],Us=$&&i?Ja(i):"",yn=ke??zs??{},on=$&&nn?Qa(yn,nn):null,qs=$&&on&&Xa(sn)?qt(on,i):null,Gs=$?Za(r,i)?.seoData:void 0,qe=Ve?[{label:"Default",sections:[{__resolveType:g}]}]:Br(Ft?.sections,r??{}),It=qe.length>1,Oe=Math.min(te,qe.length-1),dt=qe[Oe],q=dt?.sections??[],Ue=Gt(q,r),_n=!Ve&&aa(Ft?.sections);if(Ve&&g&&bn!==g){Sn(g);const t=q[0],s=Ue[0];if(t&&s){B(0),Be(0),K([]);const o=St(t,s,r);o&&(L(o.data),P(o.resolveType),Ie(null),Te(null))}}!Ve&&bn!==null&&Sn(null),Ze.current={rawSections:q,parsedSections:Ue,decofile:r??{},activePageKey:k,pageVariants:qe,variantIndex:Oe,sectionVariantIndex:F,selectedSectionIndex:p};const Ws=()=>({multivariate:_n,index:Oe,variants:qe.map(t=>({rule:t.rule}))}),jn=(t,s)=>{if(!j)return;if(!k||!_n||t.length<=1){j(null);return}const o=zn(k,{multivariate:!0,index:s,variants:t},r,i);j(o.length>0?o:null)},Et=(t,s,o)=>{if(!j)return;if(!k){j(null);return}const u=Ws(),S=zn(k,u,r,i);if(!t||s<0){j(S.length>0?S:null);return}const _=Ea({pageKey:k,page:u,sectionIndex:s,sectionLazy:Ue[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:r,meta:i}),y=[...S,..._];j(y.length>0?y:null)},mt=(t,s,o,u=p??-1,S=!1)=>{const _=tt(t,s);if(!_){L(null),P(null),Ie(null),Te(null),S&&Et(null,u,o);return}const C=Ln(_,lt)[o];if(!C){L(null),P(null),Ie(null),Te(null),S&&Et(null,u,o);return}const ee=da(C.value,r);L(ee?.data??null),P(ee?.resolveType??null);const{resolveType:A,formValue:z}=Pt(C.rule,r,i??void 0);Ie(A),Te(z),S&&Et(_,u,o)},Vt=v?.index;if(v!==void 0&&(v?.seq??null)!==oe&&(De(v?.seq??null),typeof Vt=="number")){const t=q[Vt],s=Ue[Vt];if(t&&s)if(B(Vt),Be(0),K([]),W(o=>o+1),s.isMultivariate)mt(t,s,0,Vt);else{const o=St(t,s,r);o?(L(o.data),P(o.resolveType)):(L(null),P(null)),Ie(null),Te(null)}}const Ot={orgSlug:m,virtualMcpId:e,branch:a,previewUrl:d??void 0,siteSlug:I},an=le&&i?qt(le,i):null,Je=(t,s)=>{if(!k)return;He.current&&(clearTimeout(He.current),He.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),st.current&&(clearTimeout(st.current),st.current=null);const o=At(r,k,t,Oe,qe);Ne.mutate({blockKey:k,data:o},{onSuccess:()=>s?.onSuccess?.()??f?.(),onError:u=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},Rt=()=>{B(null),L(null),P(null),Be(0),Te(null),Ie(null),K([]),W(t=>t+1)},Ys=(t,s)=>{He.current&&clearTimeout(He.current);const o=Ze.current.sectionVariantIndex;He.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current,A=u[s];if(!A)return;const z=S[s];if(!z)return;if(z.isSavedBlock){const G=z.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;Ne.mutate({blockKey:G,data:t},{onSuccess:()=>f?.(),onError:Y=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}if(!y)return;const U={..._[y]},Re=[...u];if(z.isMultivariate){const G=tt(A,z);if(!G||!y)return;const Y=wa(G,o,t);Re[s]=xt(A,z,Y)}else if(z.isHidden){const G=rs(A.__resolveType),Y=G?{...A.section}:{...A},Le=Array.isArray(Y.variants)?[...Y.variants]:[];Le[0]&&(Le[0]={...Le[0],value:t}),Y.variants=Le,G?Re[s]={...A,section:Y}:Re[s]=Y}else z.isLazy?Re[s]={...A,section:t}:Re[s]=t;if(C.length>1){const G=U.sections,Y=[...G?.variants??[]];Y[ee]&&(Y[ee]={...Y[ee],value:Re}),U.sections={...G,variants:Y}}else U.sections=Re;Ne.mutate({blockKey:y,data:U},{onSuccess:()=>f?.(),onError:G=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))})},pn)},Js=t=>{B(t),Be(0),K([]),W(S=>S+1);const s=q[t],o=Ue[t];if(!s||!o)return;if(o.isMultivariate){mt(s,o,0,t);return}const u=St(s,o,r);if(!u){L(null),P(null),Ie(null),Te(null),Et(null,t,0);return}L(u.data),P(u.resolveType),Ie(null),Te(null),Et(null,t,0)},En=t=>{const s=t;L(s),p!==null&&Ys(s,p)},rn=t=>{if(!k||!r||!i||!Ye)return;const s={kind:"page",pageKey:k,pageName:String(Ye.name??""),path:String(Ye.path??"")},o=Hn(r,s,i);o&&Xt.save(k,()=>{const u=Cs.getQueryData(Ko.decofile(As))?.[k];if(!u||typeof u!="object"||u===null||Array.isArray(u))return null;const S={...u,...en.current};return en.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?tr(s,o,S,t.inner):S})},Qs=(t,s)=>{k&&(en.current[t]=s,rn())},Xs=(t,s)=>{if(!k)return;const o=Mt([...q],t,s);p!==null&&(p===t?B(s):t<p&&s>=p?B(p-1):t>p&&s<=p&&B(p+1)),Je(o)},Zs=t=>{if(!k)return;const s=q.filter((o,u)=>u!==t);p===t?Rt():p!==null&&p>t&&B(p-1),Je(s)},eo=t=>{if(!k)return;const s=q[t];if(!s)return;const o=[...q];o.splice(t+1,0,ja(s)),p!==null&&p>t&&B(p+1),Je(o)},to=t=>{if(!k)return;const s=q[t],o=Ue[t];if(!s||!o||o.isMultivariate)return;const u=o.isHidden?ya(s):_a(s);if(!u)return;const S=[...q];S[t]=u,p===t&&Rt(),Je(S)},no=t=>{if(!k)return;const s=q[t],o=Ue[t];if(!s||!o||o.isMultivariate)return;const u=xa(s);if(!u)return;const S=[...q];S[t]=u,p===t&&Rt(),Je(S)},so=t=>{if(!k)return;const s=q[t],o=Ue[t];if(!s||!o?.isSavedBlock)return;const u=St(s,o,r);if(!u?.data)return;const{name:S,..._}=u.data,y=[...q];o.isLazy?y[t]={...s,section:_}:y[t]=_,p===t&&Rt(),Je(y)},oo=t=>{if(!k)return;const s=[...q,{__resolveType:t.resolveType}],o=s.length-1;Je(s,{onSuccess:()=>{ae(!1),B(o),Be(0),K([]),W(y=>y+1);const u=s[o],S=Gt(s,r)[o];if(!u||!S)return;if(S.isMultivariate){mt(u,S,0);return}const _=St(u,S,r);if(!_){L(null),P(null),Ie(null),Te(null);return}L(_.data),P(_.resolveType),Ie(null),Te(null)}})},Rn=t=>{me.current=t.append,ae(!0)},ao=t=>{const s=me.current;if(!s){oo(t);return}s({__resolveType:t.resolveType}),ae(!1),me.current=null},ro=t=>{if(p===null)return;const s=q[p],o=Ue[p];!s||!o?.isMultivariate||(Be(t),K([]),W(u=>u+1),mt(s,o,t,p,!0))},io=t=>{if(p===null||!k)return;const s=q[p],o=Ue[p];if(!s||!o?.isMultivariate)return;const u=tt(s,o);if(!u)return;const S=va(u,t);if(!S){J.error(l("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const _=[...q];_[p]=xt(s,o,S);const y=S.variants;let C=F;t===F?C=Math.min(t,y.length-1):t<F&&(C=F-1),Be(C),K([]),W(ee=>ee+1),mt(_[p],o,C),Je(_)},lo=t=>{if(p===null||!k)return;const s=q[p],o=Ue[p];if(!s||!o?.isMultivariate)return;const u=tt(s,o);if(!u)return;const S=ba(u,t),_=[...q];_[p]=xt(s,o,S);const y=t+1;Be(y),K([]),W(C=>C+1),mt(_[p],o,y),Je(_)},co=(t,s)=>{if(p===null||!k||t===s)return;const o=q[p],u=Ue[p];if(!o||!u?.isMultivariate)return;const S=tt(o,u);if(!S)return;const _=ga(S,t,s),y=[...q];y[p]=xt(o,u,_);let C=F;F===t?C=s:t<F&&s>=F?C=F-1:t>F&&s<=F&&(C=F+1),Be(C),mt(y[p],u,C),Je(y)},ln=t=>{const s=t??p;if(s===null||!k)return;const o=q[s],u=Ue[s];if(!o||!u)return;const S=ma(o,u);if(!S){J.error(l("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const _=[...q];_[s]=S.section;const y=Gt(_,r)[s];if(!y?.isMultivariate){J.error(l("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}B(s),Be(S.newVariantIndex),K([]),W(C=>C+1),mt(S.section,y,S.newVariantIndex,s),Je(_)},uo=()=>{if(p===null||!k)return;const t=q[p],s=Ue[p];if(!t||!s?.isMultivariate)return;const o=tt(t,s);if(!o)return;const u=ha(t,s,o);if(!u){J.error(l("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...q];S[p]=u;const _=Gt(S,r)[p];if(!_)return;Be(0),Ie(null),Te(null),K([]),W(C=>C+1);const y=St(u,_,r);y?(L(y.data),P(y.resolveType)):(L(null),P(null)),Et(null,p,0),Je(S)},mo=async t=>{if(Z===null||!k)return;const s=fn(t,r);if(s){J.error(s);return}const o=q[Z],u=Ue[Z];if(!o||!u)return;const S=St(o,u,r);if(!S){J.error(l("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const _={...S.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:_});const y=[...q];y[Z]={__resolveType:t},await Ne.mutateAsync({blockKey:k,data:At(r,k,y,Oe,qe)}),p===Z&&Rt(),Fe(null),J.success(l("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),f?.()}catch(y){J.error(y instanceof Error?y.message:l("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},wn=dt?.rule;if(It&&p===null&&X===null&&wn){const{resolveType:t,formValue:s}=Pt(wn,r??{},i??void 0);ge(t),Q(s)}const $t=i?ra(i):[],kn=i&&r?ia(i,r):[],fo=!Ve&&!!(H&&i&&r),po=X&&i?qt(X,i):null,wt=()=>{st.current&&(clearTimeout(st.current),st.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Dt=async(t,s)=>{if(!(Ra(s,t,i)>0))try{await Zt.mutateAsync({blockKey:t})}catch(o){J.error(o instanceof Error?o.message:l("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Tn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:o,variantIndex:u}=Ze.current;if(!s)return;const S={...o[s]},_={...S.sections},y=[..._.variants??[]],C=y[u],ee=C?.rule;if(kt(ee,o,i)){const A=ee?.__resolveType??"",z=o[A],U=typeof z?.name=="string"?z.name:A,{__resolveType:Re,...G}=t;Ne.mutate({blockKey:A,data:Tt(Re??"",G,U)},{onSuccess:()=>f?.(),onError:Y=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}C&&(y[u]={...C,rule:t}),S.sections={..._,variants:y},Ne.mutate({blockKey:s,data:S},{onSuccess:()=>f?.(),onError:A=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:A.message}))})},pn)},go=t=>{ge(t);const s=t?Fn(t,i):{__resolveType:In};Q(t?s:{}),Tn(s)},ho=t=>{const s=t;Q(s);const o=X?{__resolveType:X,...s}:{...s};Tn(o)},vo=async t=>{wt();const{activePageKey:s,decofile:o,variantIndex:u}=Ze.current;if(!s)return;const S=o[s],_=S?.sections;if(!_||typeof _!="object"||Array.isArray(_))return;const y=_;if(!Array.isArray(y.variants))return;const C=[...y.variants],ee=C[u];if(!ee)return;const A=Ct(ee.rule,o,i),z=Yt(t);C[u]={...ee,rule:z};const U={...o,[s]:{...S,sections:{...y,variants:C}}},{resolveType:Re,formValue:G}=Pt(z,U,i??void 0);ge(Re),Q(G);try{await Ne.mutateAsync({blockKey:s,data:U[s]}),A&&A!==t&&await Dt(A,U),f?.()}catch(Y){J.error(Y instanceof Error?Y.message:l("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Nn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:o}=Ze.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current;if(!y)return;const A=u[s],z=S[s];if(!A||!z?.isMultivariate)return;const U=tt(A,z);if(!U)return;const G=(U.variants??[])[o]?.rule;if(kt(G,_,i)){const Se=G?.__resolveType??"",Qe=_[Se],rt=typeof Qe?.name=="string"?Qe.name:Se,{__resolveType:gt,...it}=t;Ne.mutate({blockKey:Se,data:Tt(gt??"",it,rt)},{onSuccess:()=>f?.(),onError:ht=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:ht.message}))});return}const Y=Kn(U,o,t),Le=[...u];Le[s]=xt(A,z,Y);const et=At(_,y,Le,ee,C);Ne.mutate({blockKey:y,data:et},{onSuccess:()=>f?.(),onError:Se=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))})},pn))},bo=t=>{Ie(t);const s=t?Fn(t,i):{__resolveType:In};Te(t?s:{}),Nn(s)},So=t=>{const s=t;Te(s);const o=We?{__resolveType:We,...s}:{...s};Nn(o)},xo=async t=>{wt();const{selectedSectionIndex:s,sectionVariantIndex:o,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current;if(s===null||!y)return;const A=u[s],z=S[s];if(!A||!z?.isMultivariate)return;const U=tt(A,z);if(!U)return;const Re=U.variants??[],G=Ct(Re[o]?.rule,_,i),Y=Yt(t),Le=Kn(U,o,Y),et=[...u];et[s]=xt(A,z,Le);const Se=At(_,y,et,ee,C),Qe={..._,[y]:Se},{resolveType:rt,formValue:gt}=Pt(Y,Qe,i??void 0);Ie(rt),Te(gt);try{await Ne.mutateAsync({blockKey:y,data:Se}),G&&G!==t&&await Dt(G,Qe),f?.()}catch(it){J.error(it instanceof Error?it.message:l("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!Ye)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.noPageFound",{currentPath:h})});if(Ve&&!tn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.globalBlockNotFound")});const ft=p!==null?Ue[p]??null:null,Vn=p!==null?q[p]:null,Dn=Vn&&ft?.isMultivariate?tt(Vn,ft):null,bt=Dn?Ln(Dn,lt):[],cn=Math.min(F,Math.max(bt.length-1,0)),zt=bt[cn]??null,pt=ft?.isMultivariate===!0,Pn=p!==null&&ft!==null,Ht=Pn&&(pt||!!(an&&pe)),yo=Ht&&!Ve&&ft?.isSavedBlock===!0,at=Ve||yo,_o=Ve?xn:ft?.label??"",jo=We&&i?qt(We,i):null,un=Ht&&(!Ve||ne.length>0)?Ve?[xn,...ne]:[Ye.name,ft.label,...pt&&zt?[zt.label]:[],...ne]:[],Eo=$&&Ye?[Ye.name,"SEO",...Ee]:[],Ut=$?Eo:at?un.length>0?un:[_o]:un,Ro=!$&&!Ve&&pt&&ne.length===0,Cn=()=>{if(!k)return;wt(),He.current&&(clearTimeout(He.current),He.current=null);const t=r[k],s=fa(t.sections,q);if(!s)return;const o=pa(s);Ne.mutate({blockKey:k,data:{...t,sections:s}},{onSuccess:()=>{O(o),B(null),L(null),P(null),K([]),Q(null),ge(null)},onError:u=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},dn=(t,s,o)=>{if(!k)return;wt(),He.current&&(clearTimeout(He.current),He.current=null);const u=r[k],S=u.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const _=S;if(!Array.isArray(_.variants))return;const y=t([..._.variants]);if(!y)return;const C=ka(_,y),ee={...r,[k]:{...u,sections:C}};Ne.mutate({blockKey:k,data:ee[k]},{onSuccess:()=>{s?.(),o&&Dt(o,ee)},onError:A=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:A.message}))})},wo=t=>{ye(null),O(t),B(null),L(null),P(null),K([]);const s=qe[t]?.rule,{resolveType:o,formValue:u}=Pt(s,r??{},i??void 0);ge(o),Q(u),jn(qe.map(S=>({rule:S.rule})),t)},ko=(t,s)=>{if(t===s)return;let o=Oe;Oe===t?o=s:t<Oe&&s>=Oe?o=Oe-1:t>Oe&&s<=Oe&&(o=Oe+1),O(o);const u=Mt(qe.map(S=>({rule:S.rule})),t,s);jn(u,o),dn(S=>Mt(S,t,s))},To=t=>{const s=qe[t]?.rule,o=Ct(s,r??{},i??void 0);dn(u=>u.length<=1?null:(u.splice(t,1),u),()=>{qe.length-1===1?O(0):t<Oe?O(Oe-1):t===Oe&&O(Math.max(0,t-1)),B(null),L(null),P(null),K([]),Q(null),ge(null)},o)},No=t=>{dn(s=>Ta(s,t),()=>{O(t+1),B(null),L(null),P(null),K([]),Q(null),ge(null)})},Vo=async(t,s)=>{wt(),He.current&&(clearTimeout(He.current),He.current=null);const o=Ze.current.activePageKey,u=Ze.current.decofile;if(!o)return;const S=u[o],_=S.sections;if(!_||typeof _!="object"||Array.isArray(_))return;const y=_;if(!Array.isArray(y.variants))return;const C=[...y.variants],ee=C[t];if(!ee?.rule||typeof ee.rule!="object"){J.error(l("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const A=ee.rule,z=s.trim();Kt(!0);try{if(!z){if(!kt(A,u,i)){ye(null);return}const et=A.__resolveType??"";C[t]={...ee,rule:On(A,u,i)};const Se={...u,[o]:{...S,sections:{...y,variants:C}}};await Ne.mutateAsync({blockKey:o,data:Se[o]}),await Dt(et,Se),ye(null),f?.();return}const U=$n(A,u,i);if(!U){J.error(l("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(U.blockKey){await Ne.mutateAsync({blockKey:U.blockKey,data:Tt(U.resolveType,U.data,z)}),ye(null),f?.();return}const Re=mn(z),G=fn(Re,u);if(G){J.error(G);return}const Y=Tt(U.resolveType,U.data,z);let Le=null;try{await Ne.mutateAsync({blockKey:Re,data:Y}),Le=Re,C[t]={...ee,rule:Yt(Re)},await Ne.mutateAsync({blockKey:o,data:{...S,sections:{...y,variants:C}}}),Le=null}catch(et){throw Le&&await Zt.mutateAsync({blockKey:Le}).catch(()=>{}),et}ye(null),J.success(l("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:z})),f?.()}catch(U){J.error(U instanceof Error?U.message:l("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},Do=async(t,s)=>{wt(),He.current&&(clearTimeout(He.current),He.current=null);const{selectedSectionIndex:o,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current;if(o===null||!y)return;const A=u[o],z=S[o];if(!A||!z?.isMultivariate)return;const U=tt(A,z);if(!U)return;const Re=U.variants??[],G=Re[t];if(!G?.rule||typeof G.rule!="object"){J.error(l("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Y=G.rule,Le=s.trim();Kt(!0);const et=async Se=>{const Qe={...U,variants:Se},rt=[...u];rt[o]=xt(A,z,Qe);const gt=At(_,y,rt,ee,C);return await Ne.mutateAsync({blockKey:y,data:gt}),{..._,[y]:gt}};try{if(!Le){if(!kt(Y,_,i)){he(null);return}const ht=Y.__resolveType??"",Bn=[...Re];Bn[t]={...G,rule:On(Y,_,i)};const Bo=await et(Bn);await Dt(ht,Bo),he(null),f?.();return}const Se=$n(Y,_,i);if(!Se){J.error(l("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Se.blockKey){await Ne.mutateAsync({blockKey:Se.blockKey,data:Tt(Se.resolveType,Se.data,Le)}),he(null),f?.();return}const Qe=mn(Le),rt=fn(Qe,_);if(rt){J.error(rt);return}const gt=Tt(Se.resolveType,Se.data,Le);let it=null;try{await Ne.mutateAsync({blockKey:Qe,data:gt}),it=Qe;const ht=[...Re];ht[t]={...G,rule:Yt(Qe)},await et(ht),it=null}catch(ht){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),ht}he(null),J.success(l("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Le})),f?.()}catch(Se){J.error(Se instanceof Error?Se.message:l("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},An=()=>{Rt()},Po=t=>{se(t),rn({inner:t})},Co=t=>{ue(t),rn({raw:t})},Ao=()=>{se(null),de([])},Mo=()=>re(t=>t+1),Mn=t=>{if($){if(t===0){Xt.flush(),fe(!1),se(null),ue(void 0),de([]),re(o=>o+1),N?.();return}if(t===1){de([]),re(o=>o+1);return}de(Ee.slice(0,t-1)),re(o=>o+1);return}if(Ve){K(ne.slice(0,t)),W(o=>o+1);return}if(t===0){An();return}if(t===1){K([]),W(o=>o+1);return}if(pt&&t===2){K([]),W(o=>o+1);return}const s=pt?2:1;K(ne.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:at||Ht||$?n.jsxs("div",{className:$e("border-b px-3 py-2.5",at&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Ut.length>1&&n.jsx("button",{type:"button",onClick:()=>Mn(Na(Ut.length,{isMultivariateSectionTop:Ro})),title:l("sectionsEditor.sectionsEditor.back"),"aria-label":l("sectionsEditor.sectionsEditor.back"),className:$e("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",at?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Ss,{className:"size-4"})}),!Ve&&It&&dt&&n.jsxs("button",{type:"button",onClick:An,title:l("sectionsEditor.sectionsEditor.editingInVariant",{variant:dt.label}),className:$e("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Mr),children:[n.jsx(Ds,{rule:Bt(dt.rule,r??{},i??void 0),matchers:$t}),n.jsx("span",{className:"max-w-[160px] truncate",children:dt.label})]}),n.jsx("nav",{"aria-label":l("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ut.map((t,s)=>{const o=s===Ut.length-1,u=vs(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(xs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Mn(s),title:u,className:$e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",o?at?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":at?"text-foreground/80":"text-muted-foreground",at?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:u})]},`${u}-${s}`)})}),at&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Ba,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:l("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Pn&&!pt&&!ft?.isHidden&&k&&n.jsx(Jn,{onClick:()=>ln()})]}),at&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:l("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(Lr,{pageKey:k,initialName:Ye.name,initialPath:Ye.path,onFieldChange:Qs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":l("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>fe(!0),children:n.jsx(Ca,{size:14})})}),n.jsx(jt,{side:"bottom",children:l("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":l("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>V&&k?V(k):je(!0),children:n.jsx(Aa,{size:14})})}),n.jsx(jt,{side:"bottom",children:l("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Jn,{onClick:Cn})]})}),$?n.jsx(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ft&&k?n.jsx(er,{rawSeo:sn,innerSeo:yn,defaultResolveType:Us,seoSchema:qs,activeResolveType:on,seoTypeOptions:Hs,formResetKey:T,siteDefaultSeo:Gs,onBreadcrumbChange:de,onPersistRaw:Co,onInnerChange:Po,onClearForm:Ao,onBumpFormKey:Mo}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ht?n.jsxs(Jt,{viewportRef:ze,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[pt&&bt.length>0&&ne.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(la,{listKey:`${k??""}:${p??""}`,variants:bt.map((t,s)=>({index:s,label:t.label})),selectedIndex:cn,onSelect:ro,onRename:he,onDuplicate:lo,onDelete:io,onRemoveAll:uo,onReorder:co,onAdd:()=>ln()}),pt&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Qn,{currentRt:We??"",currentLabel:Wt(zt?.rule,r??{},lt,i??void 0),currentGlobalKey:Ct(zt?.rule,r??{},i??void 0)??void 0,matchers:$t,globals:kn,onSelect:bo,onSelectGlobal:xo,schema:jo,formValue:ut,onChange:So,formKey:`${p??"none"}:${cn}:${We??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot})]})]}),n.jsx(Yn,{activeSchema:an,formValue:pe,formResetKey:Me,onFormChange:En,onBreadcrumbChange:K,breadcrumbPath:ne,emptyMessage:l("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot,previewBaseUrl:H,onRequestAddSection:Rn})]},"editor-section-form"):Ve?n.jsx(Jt,{viewportRef:ze,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Yn,{activeSchema:an,formValue:pe,formResetKey:Me,onFormChange:En,onBreadcrumbChange:K,breadcrumbPath:ne,emptyMessage:l("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot,previewBaseUrl:H,onRequestAddSection:Rn})},"editor-global-block"):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[It&&k&&n.jsx(Pr,{listKey:k,variants:qe,activeIndex:Oe,decofile:r??{},meta:i,matchers:$t,onSelect:wo,onReorder:ko,onRename:ye,onDuplicate:No,onDelete:To,onAdd:Cn}),It&&X!==null&&n.jsxs("div",{className:$e("px-3 border-b",_e?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>we(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":_e,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.sectionsEditor.variantRule")}),_e?n.jsx(Ma,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Va,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),_e&&n.jsx("div",{className:$e("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Qn,{currentRt:X,currentLabel:Wt(dt?.rule,r??{},lt,i??void 0),currentGlobalKey:Ct(dt?.rule,r??{},i??void 0)??void 0,matchers:$t,globals:kn,onSelect:go,onSelectGlobal:vo,schema:po,formValue:xe,onChange:ho,formKey:`${Oe}:${X??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(jr,{listKey:`${k??""}-${Oe}`,rawSections:q,sections:Ue,meta:i,selectedIndex:p,onSelect:Js,onReorder:Xs,onDelete:Zs,onDuplicate:eo,onMakeReusable:Fe,onToggleHidden:to,onToggleLazy:no,onAddVariant:ln,onDetach:so,onAddSection:()=>ae(!0),canAddSection:fo})})]},"editor-section-list"),n.jsx(ca,{open:Z!==null,onOpenChange:t=>{t||Fe(null)},defaultBlockId:Z!==null?mn(Ue[Z]?.label??""):"",isPending:Ne.isPending,onSubmit:mo}),H&&n.jsx(or,{open:ve,onOpenChange:t=>{ae(t),t||(me.current=null)},meta:i,decofile:r,previewBaseUrl:H,onSelect:ao}),Ce&&k&&r&&n.jsx(ua,{open:Ce,onOpenChange:je,pageKey:k,decofile:r}),Pe!==null&&n.jsx(qn,{open:!0,initialName:kt(qe[Pe]?.rule,r??{},i??void 0)?Wt(qe[Pe]?.rule,r??{},lt,i??void 0):"",autoLabel:lt(Bt(qe[Pe]?.rule,r??{},i??void 0)),isPending:Nt,onSubmit:async t=>{await Vo(Pe,t)},onOpenChange:t=>{!t&&!Nt&&ye(null)}}),ce!==null&&n.jsx(qn,{open:!0,initialName:kt(bt[ce]?.rule,r??{},i??void 0)?Wt(bt[ce]?.rule,r??{},lt,i??void 0):"",autoLabel:lt(Bt(bt[ce]?.rule,r??{},i??void 0)),isPending:Nt,onSubmit:async t=>{await Do(ce,t)},onOpenChange:t=>{!t&&!Nt&&he(null)}})]})}export{Ac as SectionsEditor};
|