decocms 4.577.1 → 4.578.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Bj2NuHQY.js → AlertCircle-BHOdje2-.js} +1 -1
- package/dist/client/assets/{AreaChart-wF798x8i.js → AreaChart--NTdNKkN.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DCMq103h.js → ArrowLeft-DwK9IQqr.js} +1 -1
- package/dist/client/assets/{ArrowUp-AwRcCsuH.js → ArrowUp-BKp-bI0t.js} +1 -1
- package/dist/client/assets/{BookOpen01-D2g_6Ti1.js → BookOpen01-CCzJ3iHg.js} +1 -1
- package/dist/client/assets/{CartesianChart-B6p3i5Ce.js → CartesianChart-DcsXR4up.js} +1 -1
- package/dist/client/assets/{CategoricalChart-Bjq2Qe33.js → CategoricalChart-BH2fCBYy.js} +1 -1
- package/dist/client/assets/{CheckCircle-BfCYdSA_.js → CheckCircle-CpYSXUlJ.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Bwduw2Hp.js → ChevronSelectorVertical-BfPzQt1M.js} +1 -1
- package/dist/client/assets/{ChevronUp-JSFuaLqF.js → ChevronUp-yM6kuF7B.js} +1 -1
- package/dist/client/assets/{CreditCard01-DsaJOWgX.js → CreditCard01-ClPhtnpy.js} +1 -1
- package/dist/client/assets/{Globe04-BBKBtEaK.js → Globe04-CpMO0Sfn.js} +1 -1
- package/dist/client/assets/{Key01-BTIXWKkS.js → Key01-BUefgO6r.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DjOOxf0e.js → LinkBroken01-Beajkv8Y.js} +1 -1
- package/dist/client/assets/{Minus-BAq-AD33.js → Minus-CkHBDYFP.js} +1 -1
- package/dist/client/assets/{Monitor01-CqtNhdJN.js → Monitor01-6Z9BL4ul.js} +1 -1
- package/dist/client/assets/{Play-kmXfE4Am.js → Play-QQIqJKj8.js} +1 -1
- package/dist/client/assets/{Plus-Bq5KiXqn.js → Plus-jqQtsDrV.js} +1 -1
- package/dist/client/assets/{ReferenceLine-CcfMMo9r.js → ReferenceLine-65eMf_HF.js} +1 -1
- package/dist/client/assets/{SearchMd-D1P7yVqT.js → SearchMd--9oaPr0p.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-CAQ4NRTU.js → ShoppingBag01-DWT7jnvZ.js} +1 -1
- package/dist/client/assets/{Sun-C5iV1Zpq.js → Sun-CBa0lZzX.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CP6L8rlm.js → SwitchHorizontal01-Be5wnM3M.js} +1 -1
- package/dist/client/assets/{Tool01-DAYJL0v-.js → Tool01-C_vFDQiZ.js} +1 -1
- package/dist/client/assets/{Tooltip-DiDmzDgy.js → Tooltip-BxRazsja.js} +1 -1
- package/dist/client/assets/{Trash01-Dt7pyOwE.js → Trash01-D4h16nnS.js} +1 -1
- package/dist/client/assets/{Upload01-CZ2h76oj.js → Upload01-DLWP4rJI.js} +1 -1
- package/dist/client/assets/UserSquare-DomA7Npc.js +1 -0
- package/dist/client/assets/{Users01-BZzvQda-.js → Users01-DQk985Hj.js} +1 -1
- package/dist/client/assets/{XClose-D2u966Hj.js → XClose-DsOcImLD.js} +1 -1
- package/dist/client/assets/{Zap-CDj8jJFt.js → Zap-CXSu8byh.js} +1 -1
- package/dist/client/assets/{access-gate-DL6Fx00C.js → access-gate-COWmI5bk.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DXVmpebU.js → add-connection-dialog-BcVopUkx.js} +1 -1
- package/dist/client/assets/agent-app-IytyCAeX.js +1 -0
- package/dist/client/assets/{agent-assets-C4JxM7ek.js → agent-assets-BiP4eXwk.js} +1 -1
- package/dist/client/assets/{agent-automation-BRLWOY9Z.js → agent-automation-DBUljkhT.js} +1 -1
- package/dist/client/assets/{agent-automations-Bi4PZQpt.js → agent-automations-SLj1xajz.js} +1 -1
- package/dist/client/assets/{agent-blog-CZFhSkNf.js → agent-blog-CwfLgnOy.js} +2 -2
- package/dist/client/assets/{agent-blog-post-DWjaJsuP.js → agent-blog-post-Dv9DOEk2.js} +2 -2
- package/dist/client/assets/{agent-calendar-DVRrZoQI.js → agent-calendar-CjQfj1Sz.js} +1 -1
- package/dist/client/assets/{agent-capabilities-DHVCvnvi.js → agent-capabilities-B2YgTs9t.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-zocgSqV4.js → agent-connect-sources-COR6xHVk.js} +1 -1
- package/dist/client/assets/agent-deck-BaQ_Lg8E.js +1 -0
- package/dist/client/assets/{agent-e2e-C7P50BKx.js → agent-e2e-CqM9gm_q.js} +1 -1
- package/dist/client/assets/agent-experiments-BQTqMeA9.js +1 -0
- package/dist/client/assets/{agent-file-CVIHN4Pv.js → agent-file-aW_ERFnN.js} +1 -1
- package/dist/client/assets/agent-hosting-D1eqz9SR.js +1 -0
- package/dist/client/assets/agent-icon-C-RKmmDR.js +1 -0
- package/dist/client/assets/agent-library-BMuykAhZ.js +1 -0
- package/dist/client/assets/agent-library-file-DMgZUrW5.js +1 -0
- package/dist/client/assets/agent-overview-BCgVG2tE.js +1 -0
- package/dist/client/assets/{agent-releases-Bxmxt--5.js → agent-releases-IeUzKjUs.js} +1 -1
- package/dist/client/assets/agent-settings-DmzwtPvi.js +1 -0
- package/dist/client/assets/{agent-site-editor-Bxgpwy-D.js → agent-site-editor-WH6jHL7m.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-CtuKhycC.js +2 -0
- package/dist/client/assets/agent-site-editor-content-6A0AHGJH.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DiYiv2sS.js +1 -0
- package/dist/client/assets/agent-view-BLZVy10x.js +1 -0
- package/dist/client/assets/{agent-view-guard-B4P_nOY3.js → agent-view-guard-DL_BQ0ym.js} +1 -1
- package/dist/client/assets/{ai-providers-CvpoHUFb.js → ai-providers-DQRQioIu.js} +1 -1
- package/dist/client/assets/{alert-0-4Lk02S.js → alert-DejWJPEC.js} +1 -1
- package/dist/client/assets/{analytics-sections-DEuK9yNO.js → analytics-sections-aJEg6Lrj.js} +1 -1
- package/dist/client/assets/api-keys-BVTq6_vY.js +1 -0
- package/dist/client/assets/{api-keys-BWb-_Fqf.js → api-keys-CtF2T7md.js} +1 -1
- package/dist/client/assets/{app-editor-DVjFa_ip.js → app-editor-BbInzuqi.js} +1 -1
- package/dist/client/assets/{asset-utils-DSh1-4fR.js → asset-utils-DLSL6NlD.js} +1 -1
- package/dist/client/assets/{auth-DFCgioOs.js → auth-DQhl82rC.js} +1 -1
- package/dist/client/assets/{auth-catchall-_w9pWMK8.js → auth-catchall-CKKMb7Qg.js} +1 -1
- package/dist/client/assets/{auth-entry-HAlWF4UX.js → auth-entry-GYtwsP_U.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BSaVPfK6.js → auth-split-layout-Den49bbd.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BGX0Y23v.js → authenticate-and-persist-oauth-BUdNrcOr.js} +1 -1
- package/dist/client/assets/{automation-list-row-Xayp8iFs.js → automation-list-row-BNUSbcf6.js} +1 -1
- package/dist/client/assets/{automation-runs-CUwzltO7.js → automation-runs-Pz0rgqnE.js} +1 -1
- package/dist/client/assets/{automations-C0bs2qin.js → automations-DQjVvCEj.js} +1 -1
- package/dist/client/assets/{badge-DbKUf3vA.js → badge-lysbeP9P.js} +1 -1
- package/dist/client/assets/{block-document-zkAHP8m2.js → block-document-DvtTe-B8.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DQL_zlqC.js → blocks-preview-workspace-context-CnaE8A0D.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BUfMyINR.js → blocks-tab-states-DScRj9jB.js} +1 -1
- package/dist/client/assets/{blog-preview-url-CT-VZElJ.js → blog-preview-url-BaS_j9Mv.js} +1 -1
- package/dist/client/assets/{blog-schema-Dys-tzF0.js → blog-schema-BZTYj2LA.js} +1 -1
- package/dist/client/assets/{blog-source-gate-CYaEgV9t.js → blog-source-gate-D36m3Pml.js} +1 -1
- package/dist/client/assets/{blog-view-gate-zXMdlu7Q.js → blog-view-gate-DZU_55_0.js} +1 -1
- package/dist/client/assets/{buckets-DOgpbimo.js → buckets-Bbtnc4QE.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BMf33123.js → build-improve-prompt-doc-Ukn_sIrt.js} +1 -1
- package/dist/client/assets/{calendar-5Nt9EKO9.js → calendar-RFGSgZO6.js} +1 -1
- package/dist/client/assets/{capability-load-error-BSxnBi9L.js → capability-load-error-zDoTf-tr.js} +1 -1
- package/dist/client/assets/{category-editor-DziWemO6.js → category-editor-Dji5QxhQ.js} +1 -1
- package/dist/client/assets/{category-tree-Cm0a3nBT.js → category-tree-hquVl_NC.js} +1 -1
- package/dist/client/assets/{chart-DPgJVmAl.js → chart-Y23GGTjZ.js} +1 -1
- package/dist/client/assets/{chat-context-D8Eje7xK.js → chat-context-o9Pyy_rd.js} +1 -1
- package/dist/client/assets/{chat-draft-ArmxHiV6.js → chat-draft-ZyzRFxm_.js} +1 -1
- package/dist/client/assets/{checkbox-CCw3an34.js → checkbox-BgJ_rDKP.js} +1 -1
- package/dist/client/assets/{choose-editor-CXiL24Bl.js → choose-editor-BE7aIxmQ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-c7wBWUO5.js → cli-auth-success-BlHmHrJ9.js} +1 -1
- package/dist/client/assets/{client-icons-CuJeSv2A.js → client-icons-ClEjJoc4.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-gxtK9SOp.js → cms-settings-editor-DTSvLtYU.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-chLFxeWf.js → cms-store-drafts-DChYgVhP.js} +1 -1
- package/dist/client/assets/{collapsible-CVtLl5wO.js → collapsible-Ck6jFTQH.js} +1 -1
- package/dist/client/assets/{collection-detail-D_Bcp_j6.js → collection-detail-Cu5F_YZk.js} +1 -1
- package/dist/client/assets/{collection-display-button-CnhRvkGN.js → collection-display-button-Cc8fDLFX.js} +1 -1
- package/dist/client/assets/{collection-search-CC2QUXh2.js → collection-search-Cr2_Tgzy.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DSy_nx4_.js → collection-table-wrapper-VD4O1Z7Z.js} +1 -1
- package/dist/client/assets/{collection-tabs-DHZJ_O9U.js → collection-tabs-BNEX9U1D.js} +1 -1
- package/dist/client/assets/{combobox-CB15NqGc.js → combobox-CqgGSY4o.js} +1 -1
- package/dist/client/assets/{command-BOSLOC8n.js → command-CnhVLB17.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CeNpBYo7.js → companion-mcps-section-CLNVvG7e.js} +1 -1
- package/dist/client/assets/{config-DqdBgCnO.js → config-a5cd-EVs.js} +1 -1
- package/dist/client/assets/{connect-WyHpmSHS.js → connect-4PrNRBjZ.js} +1 -1
- package/dist/client/assets/{connect-layout-D_zQARSX.js → connect-layout-CNlF_K4x.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-DHtZw9ff.js → connect-source-dialog-UDY4VqBo.js} +1 -1
- package/dist/client/assets/{connection-D0YCkaZO.js → connection-CV7VyK2j.js} +1 -1
- package/dist/client/assets/{connection-card-B1Rl2nXN.js → connection-card-DpuIDx02.js} +1 -1
- package/dist/client/assets/{connection-detail-LxUhih2_.js → connection-detail-BTx1Lau8.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CAOx4zgX.js → connection-form-helpers-BHr2mHhQ.js} +1 -1
- package/dist/client/assets/{connection-slug-BH_NX0Ks.js → connection-slug-D2uNKvQr.js} +1 -1
- package/dist/client/assets/{connections-BhxOwljy.js → connections-DyhjRe5H.js} +1 -1
- package/dist/client/assets/{content-tab-BdaE3oCc.js → content-tab-BGklezQM.js} +3 -3
- package/dist/client/assets/{context-BmOpD-Hr.js → context-Cw8yAq79.js} +1 -1
- package/dist/client/assets/{context-menu-Df7WW_d5.js → context-menu-DIqy9oGB.js} +1 -1
- package/dist/client/assets/{context-shell-cJbikpSJ.js → context-shell-DzGB0CzT.js} +3 -3
- package/dist/client/assets/{core.esm-CAA73EV4.js → core.esm-AubJLKZ-.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BLvG9G-Z.js → create-organization-dialog-D5uXvaYq.js} +1 -1
- package/dist/client/assets/{delete-copy-CAFEtw8Z.js → delete-copy-CdfctKz4.js} +1 -1
- package/dist/client/assets/{device-hint-DgkMhcRQ.js → device-hint-CFgRDD8m.js} +1 -1
- package/dist/client/assets/{discover-Cceep_sX.js → discover-DxhSOuBA.js} +1 -1
- package/dist/client/assets/{domain-settings-52h_8fKM.js → domain-settings-C9lZyHfM.js} +1 -1
- package/dist/client/assets/{drawer-B9PFQFcy.js → drawer-Donq2Zq_.js} +1 -1
- package/dist/client/assets/{editor-DZ4pzlHx.js → editor-BRySXv_B.js} +1 -1
- package/dist/client/assets/{editor-classes-Cb5f4sl2.js → editor-classes-8qIA7W4N.js} +1 -1
- package/dist/client/assets/{empty-message-CXYzekmD.js → empty-message-BAHk-1bK.js} +1 -1
- package/dist/client/assets/{empty-state-DMtSEEQ1.js → empty-state-BwFbOlsH.js} +1 -1
- package/dist/client/assets/{empty-state-BkAAjXrp.js → empty-state-DDTtYKkY.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-CDm4A9Wq.js → experiments-tab-choice-BM855EvI.js} +1 -1
- package/dist/client/assets/{extract-connection-data-u6K4j2aJ.js → extract-connection-data-DsPBwLZT.js} +1 -1
- package/dist/client/assets/{feature-gate-DFWAlRCv.js → feature-gate-CEBXLuF8.js} +1 -1
- package/dist/client/assets/{feature-paywall-BiIzjBeB.js → feature-paywall-DKb-BDqu.js} +1 -1
- package/dist/client/assets/{file-explorer-M__gA7Xu.js → file-explorer-C_M9KHGa.js} +1 -1
- package/dist/client/assets/{file-preview-D7WeSAA4.js → file-preview-ekcEL18H.js} +1 -1
- package/dist/client/assets/{file-share-button-BtW_yxzc.js → file-share-button-ZGH-qkC_.js} +1 -1
- package/dist/client/assets/{file-type-icon-mKSSLPP8.js → file-type-icon-D4Edy8Bo.js} +1 -1
- package/dist/client/assets/{folder-icon-DCyvwLH6.js → folder-icon-C46Lx0s6.js} +1 -1
- package/dist/client/assets/{form-8HJUl2GV.js → form-DddGN9Yh.js} +1 -1
- package/dist/client/assets/{frame-navigation-Bp6fuuV5.js → frame-navigation-HWq_5QB3.js} +1 -1
- package/dist/client/assets/{general-C9cj7tJH.js → general-brvHskhD.js} +1 -1
- package/dist/client/assets/{github-icon-DEvD-SlA.js → github-icon-CBn2nQtJ.js} +1 -1
- package/dist/client/assets/{held-block-view-DRxUlNuB.js → held-block-view-BFXBQ9fK.js} +1 -1
- package/dist/client/assets/{home-DR1hV3al.js → home-C--lHJVb.js} +1 -1
- package/dist/client/assets/{home-overview-CgBJdfHr.js → home-overview-DaE-41lI.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-DH_YtUfF.js → hosted-reconcile-CrIPblfo.js} +1 -1
- package/dist/client/assets/{icon-button-CadQrI05.js → icon-button-DYLciVFZ.js} +1 -1
- package/dist/client/assets/{index-CcTmEE1N.js → index-BJ5UuERb.js} +1 -1
- package/dist/client/assets/{index-yzkfeOP2.js → index-BNwuaZhD.js} +1 -1
- package/dist/client/assets/{index-8kUWDN7v.js → index-BZdAVrUU.js} +1 -1
- package/dist/client/assets/{index-C1fc6W9Q.js → index-BmYwClLx.js} +1 -1
- package/dist/client/assets/{index-DVdV24aR.js → index-BqD88VPt.js} +1 -1
- package/dist/client/assets/{index-CWKxkTwy.js → index-CHOxYhnv.js} +43 -43
- package/dist/client/assets/{index-t9nYrZiR.js → index-CXvGxxAm.js} +1 -1
- package/dist/client/assets/{index-Tvs593C1.js → index-C_bl8gsZ.js} +1 -1
- package/dist/client/assets/{index-ButqNodW.js → index-Cqxphjz0.js} +1 -1
- package/dist/client/assets/{index-gX7QfQio.js → index-DChf1qbF.js} +1 -1
- package/dist/client/assets/{index-BLdRRqFU.js → index-Dk-oU4JL.js} +1 -1
- package/dist/client/assets/{index-CzrYE4jE.js → index-DnxJcpC4.js} +1 -1
- package/dist/client/assets/{index-C5aoCNXr.js → index-Dz6MGtCy.js} +1 -1
- package/dist/client/assets/{index-C9E0iqgh.js → index-Ujlc9MWT.js} +1 -1
- package/dist/client/assets/{index-BvGbwvSS.js → index-W-F8Gjme.js} +1 -1
- package/dist/client/assets/{index-Bkf6As2Q.js → index-Z4MRwIRr.js} +1 -1
- package/dist/client/assets/{index-_sPF1edR.js → index-jntxieqb.js} +1 -1
- package/dist/client/assets/{index-redirect-DOlNtcAX.js → index-redirect-Bw8K1uPG.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DCK-YXw1.js → infiniteQueryObserver-Sb4-Zoh0.js} +1 -1
- package/dist/client/assets/{infra-billing-B-pN25L9.js → infra-billing-B222FxLt.js} +1 -1
- package/dist/client/assets/{input-DA-TtdGL.js → input-CHhCTfcg.js} +1 -1
- package/dist/client/assets/{input-1NX4JUHA.js → input-rNhKaUqk.js} +3 -3
- package/dist/client/assets/{integration-icon-C1bpkd7s.js → integration-icon-CM5LyK_z.js} +1 -1
- package/dist/client/assets/{item-actions-kNG-BlG3.js → item-actions-Cdz0dPi_.js} +1 -1
- package/dist/client/assets/{jira-icon-CnBOGlR6.js → jira-icon-CgHUBjzE.js} +1 -1
- package/dist/client/assets/{label-BXSXPHWU.js → label-B6kbb_qI.js} +1 -1
- package/dist/client/assets/{layout-C0J9eFzL.js → layout-8yHvgWm7.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-DbVWjlJ6.js → legacy-admin-welcome-dialog-C1EB7MCq.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DVKmxbFS.js → legacy-agents-deep-BQInfINZ.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-D0wT4Yry.js → legacy-main-redirect-CJKXe_S6.js} +1 -1
- package/dist/client/assets/library-CLMpbtIy.js +1 -0
- package/dist/client/assets/{library-tab-gK_7g-te.js → library-tab-CW_E0hfE.js} +1 -1
- package/dist/client/assets/{login-DnxvVl1t.js → login-CDwczf6C.js} +1 -1
- package/dist/client/assets/{markdown-DiEygcQw.js → markdown-Deyw3r6u.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BbTTGmQC.js → mcp-app-renderer-CEhql9SF.js} +1 -1
- package/dist/client/assets/{mcp-oauth-TUUsAJpA.js → mcp-oauth-BQtVOszP.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CQGGouuy.js → mcp-oauth-JUy-C_de.js} +1 -1
- package/dist/client/assets/{members-nUmVbnC9.js → members-DrjrN5qN.js} +1 -1
- package/dist/client/assets/{memory-Blrtbn8a.js → memory-BITIQ7DP.js} +1 -1
- package/dist/client/assets/{mock-board-CC-isAOX.js → mock-board-CprpumRW.js} +3 -3
- package/dist/client/assets/{monaco-editor-C9ZwdTpU.js → monaco-editor-CRckTkcR.js} +1 -1
- package/dist/client/assets/{monitoring-B36SUiOP.js → monitoring-GakxK6v8.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-H3pnSbDz.js → monitoring-stats-row-CCOAzga2.js} +1 -1
- package/dist/client/assets/{multi-select-obeT7dRo.js → multi-select-B_Fvyk0J.js} +1 -1
- package/dist/client/assets/{mustache-gM754ehf.js → mustache-BGNYir1R.js} +1 -1
- package/dist/client/assets/{named-rule-step-W9P9uG-f.js → named-rule-step-WRCKmihp.js} +1 -1
- package/dist/client/assets/{named-rule-view-BJLbVNsp.js → named-rule-view-BGKV11Gn.js} +1 -1
- package/dist/client/assets/{new-project-dialog-Cfdy4DZo.js → new-project-dialog-C9WcHYrC.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cxz67hG6.js → oauth-callback-DG6fghbH.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Diui0sS6.js → oauth-callback-ai-provider-BjKgNB2f.js} +1 -1
- package/dist/client/assets/{oauth-consent-BWS32jU1.js → oauth-consent-C8DnEY1C.js} +1 -1
- package/dist/client/assets/{onboarding-Cg2Txb26.js → onboarding-DWuD3Chf.js} +1 -1
- package/dist/client/assets/{openai-conversation-CGGu6BWJ.js → openai-conversation-BMcQmBgw.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-cd4O2LnM.js → optimistic-project-sidebar-views-xEm1EFDd.js} +1 -1
- package/dist/client/assets/{order-monitor-day-DrziIuIu.js → order-monitor-day-Cp9FGnxW.js} +1 -1
- package/dist/client/assets/{organization-choice-CPef1x_g.js → organization-choice-DC3kAtog.js} +1 -1
- package/dist/client/assets/{orgs--h6JaB89.js → orgs-C3ExmEUV.js} +1 -1
- package/dist/client/assets/{own-accounts-section-D0sCVz2F.js → own-accounts-section-D0We85Qt.js} +1 -1
- package/dist/client/assets/{pair-DbwVEDlq.js → pair-BoFr4FJb.js} +1 -1
- package/dist/client/assets/{parse-sections-CMxFIp3d.js → parse-sections-D9GxphKG.js} +2 -2
- package/dist/client/assets/plan-Bsk7Zd5h.js +1 -0
- package/dist/client/assets/{plan-ladder-XiZUV3-n.js → plan-ladder-D1iTEGuZ.js} +1 -1
- package/dist/client/assets/{plan-usage-card-BsCyr1kn.js → plan-usage-card-BJ5m6iCB.js} +1 -1
- package/dist/client/assets/{popover-CTEYICXO.js → popover-AfVmBiXN.js} +1 -1
- package/dist/client/assets/{post-calendar-DbsJgYWp.js → post-calendar-CuIdS76v.js} +1 -1
- package/dist/client/assets/{post-editor-GP7cTHEm.js → post-editor-BnakSlKS.js} +2 -2
- package/dist/client/assets/{preview-content-BYvAegAr.js → preview-content-DjjT4V-O.js} +1 -1
- package/dist/client/assets/{preview-dialog-tONoLcHy.js → preview-dialog-Ccy0t2uO.js} +1 -1
- package/dist/client/assets/{preview-panel-CxdwWGtV.js → preview-panel-lxiY3O14.js} +1 -1
- package/dist/client/assets/{preview-tab-BJQS3_gN.js → preview-tab-CqLWllse.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DVmdugXw.js → product-picker-dialog-D8WcSokk.js} +1 -1
- package/dist/client/assets/{profile-CFEIL030.js → profile-Drjsxz7t.js} +1 -1
- package/dist/client/assets/{project-app-view-DpcLMitT.js → project-app-view-iFxD19E8.js} +1 -1
- package/dist/client/assets/{project-apps-T4OBSnxG.js → project-apps-CNXyAUnR.js} +1 -1
- package/dist/client/assets/{project-icon-CsM5Xu_3.js → project-icon-D_A1aREs.js} +1 -1
- package/dist/client/assets/{project-index-CnwYmkRd.js → project-index-6AmZpE2T.js} +1 -1
- package/dist/client/assets/project-reports-Bph27UgY.js +1 -0
- package/dist/client/assets/project-tasks-g0DZAutp.js +1 -0
- package/dist/client/assets/{projects-D9OLRq0V.js → projects-C-jes6vD.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DAdhJyFi.js → projects-empty-state-CzS59zMw.js} +1 -1
- package/dist/client/assets/{prompts-hNC_o6uG.js → prompts-Cdt8Hsyk.js} +1 -1
- package/dist/client/assets/{record-editor-BUh6IBbj.js → record-editor-CDn5r9vK.js} +1 -1
- package/dist/client/assets/{redirect-editor-CRbYvUNE.js → redirect-editor-CjfokzC6.js} +1 -1
- package/dist/client/assets/reports-BNOk1CAK.js +1 -0
- package/dist/client/assets/{reports-CoqdbgJH.js → reports-W44854hR.js} +1 -1
- package/dist/client/assets/{reports-onboarding-B8pLePIS.js → reports-onboarding-B8EBbkkq.js} +1 -1
- package/dist/client/assets/{reports-tab-BTcGlLJG.js → reports-tab-CAQtX43j.js} +2 -2
- package/dist/client/assets/repositories-Bh3IcyhH.js +1 -0
- package/dist/client/assets/{repositories-cxta7jGt.js → repositories-DKNamez0.js} +1 -1
- package/dist/client/assets/{repository-binding-DScgU6HN.js → repository-binding-zOZEsVNQ.js} +1 -1
- package/dist/client/assets/{repository-picker-BUWqEoln.js → repository-picker-DQ8Ce_c3.js} +1 -1
- package/dist/client/assets/{require-capability-Cqs162cO.js → require-capability-DR3oejOb.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BiIyXd3D.js → required-auth-layout-D8CrwDut.js} +1 -1
- package/dist/client/assets/{reset-password-da4PvhID.js → reset-password-DMlXhive.js} +1 -1
- package/dist/client/assets/{resizable-Bf-xwR0k.js → resizable-DOkGVAXY.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CGJDnTEl.js → resolve-tab-icon-w8xgbNJA.js} +1 -1
- package/dist/client/assets/review-settings-CYZdQlMs.js +1 -0
- package/dist/client/assets/{role-color-C7dBdDUi.js → role-color-Dmigi-fS.js} +1 -1
- package/dist/client/assets/{roles-z96sRIvs.js → roles-LwSdhOgS.js} +1 -1
- package/dist/client/assets/route-Bq6SpTLT.js +1 -0
- package/dist/client/assets/{route-D7eWiLEQ.js → route-CxYCV9F1.js} +1 -1
- package/dist/client/assets/{route-UFlyMaLZ.js → route-DoHag-FN.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-DY2xu0Uo.js → sandbox-lifecycle-context-DrAhvgSp.js} +1 -1
- package/dist/client/assets/{save-status-DshwUBI8.js → save-status-CzYNQ6G2.js} +1 -1
- package/dist/client/assets/{schema-DWYnTC39.js → schema-BB8zKrPl.js} +1 -1
- package/dist/client/assets/{schema-DUByfd2Y.js → schema-Cf58u1YZ.js} +1 -1
- package/dist/client/assets/{scroll-area-EO9hsjie.js → scroll-area-w2Fr7CkP.js} +1 -1
- package/dist/client/assets/{search-input-Dc1w2xyv.js → search-input-CxzHzt1i.js} +1 -1
- package/dist/client/assets/{search-toggle-BZIowSkC.js → search-toggle-NGBAT2W1.js} +1 -1
- package/dist/client/assets/{secret-picker-t9uXEG8-.js → secret-picker-B1Sm2AGS.js} +1 -1
- package/dist/client/assets/{secrets-CPHCsh_T.js → secrets-BnQFmasl.js} +1 -1
- package/dist/client/assets/{section-array-field-BFg67nYp.js → section-array-field-D7aYRyOo.js} +1 -1
- package/dist/client/assets/{sections-CrmI_GQr.js → sections-BB3EA9UD.js} +1 -1
- package/dist/client/assets/{sections-editor-CrXI2Bvd.js → sections-editor-CgPW71Cu.js} +1 -1
- package/dist/client/assets/{select-model-_wNlq-Z9.js → select-model-DRmGTTKK.js} +1 -1
- package/dist/client/assets/{select-CWL8C0Pw.js → select-oOpcW8y8.js} +1 -1
- package/dist/client/assets/{seo-editor-B3mQn1CH.js → seo-editor-CHYDqTFC.js} +1 -1
- package/dist/client/assets/{separator-Cyq4ZO_K.js → separator-kcuCI0BI.js} +1 -1
- package/dist/client/assets/settings-tab-vjcKSXb3.js +1 -0
- package/dist/client/assets/{sheet-Bqz29cSo.js → sheet-B4sQvcZD.js} +1 -1
- package/dist/client/assets/{shell-layout-DVIwCYxA.js → shell-layout-C4gugWKg.js} +1 -1
- package/dist/client/assets/{site-draft-actions-DQ2Ndjsf.js → site-draft-actions-DpgDCYG8.js} +1 -1
- package/dist/client/assets/{site-draft-view-CIEvFlZ7.js → site-draft-view-BZ84hckI.js} +1 -1
- package/dist/client/assets/site-editor-BJf_n_54.js +1 -0
- package/dist/client/assets/site-editor-toast-CPe_RO4U.js +1 -0
- package/dist/client/assets/{skills-0h7pumIQ.js → skills-CUzlP_yL.js} +1 -1
- package/dist/client/assets/{slider-GCMZAdst.js → slider-DMICv7y9.js} +1 -1
- package/dist/client/assets/{sortable.esm-CYzspn3s.js → sortable.esm-DMidKm69.js} +1 -1
- package/dist/client/assets/{sso-Ca2H_kJv.js → sso-rrH5Y6U0.js} +1 -1
- package/dist/client/assets/{suggestion-CppSMZxc.js → suggestion-D5SniAVu.js} +1 -1
- package/dist/client/assets/{super-agent-icon-Dq0ZAaMf.js → super-agent-icon-CDMKv4pz.js} +1 -1
- package/dist/client/assets/{switch-DBO_GrNe.js → switch-DCbfNrSN.js} +1 -1
- package/dist/client/assets/{synced-repos-BTn3MABM.js → synced-repos-_SlW524E.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BaeBTavE.js → tab-icon-glyph-BmobLy_7.js} +1 -1
- package/dist/client/assets/{table-xCmpwB0s.js → table-BdoV93HO.js} +1 -1
- package/dist/client/assets/{tabs-rkhPwLiJ.js → tabs-CGFgLwIj.js} +1 -1
- package/dist/client/assets/{task-board-D7RCmGkN.js → task-board--eP68xys.js} +1 -1
- package/dist/client/assets/{task-route-BJeZEOaQ.js → task-route-Btx_tQTg.js} +1 -1
- package/dist/client/assets/{task-status-ISwbNtXh.js → task-status-BvghF77r.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-B3vmd83_.js → taskboard-analytics-BZAQkd-b.js} +1 -1
- package/dist/client/assets/tasks-BNPmBOf9.js +1 -0
- package/dist/client/assets/{tasks-BLz1W4rF.js → tasks-C8a0rX7H.js} +1 -1
- package/dist/client/assets/{textarea-CvY2QE-l.js → textarea-DiKdmgZC.js} +1 -1
- package/dist/client/assets/{thread-analytics-DmP3G179.js → thread-analytics-D3z89Y54.js} +1 -1
- package/dist/client/assets/{thread-intent-0TjSPqLd.js → thread-intent-otNmUDpT.js} +1 -1
- package/dist/client/assets/{thread-route-BbSych2c.js → thread-route-CVZs3lS7.js} +1 -1
- package/dist/client/assets/{thread-route-4ZjlovaL.js → thread-route-CkasfYkE.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-JQX8n1oy.js → thread-sheet-body-DcJJrL4A.js} +1 -1
- package/dist/client/assets/{time-range-picker-Bcp8sqUk.js → time-range-picker-DBVsSx_d.js} +1 -1
- package/dist/client/assets/{toggle-group-BPubP3Pi.js → toggle-group-DWJu5FLK.js} +1 -1
- package/dist/client/assets/{tool-namespace-c-MaHIy3.js → tool-namespace-BOC8taOg.js} +1 -1
- package/dist/client/assets/{tool-set-selector-qnchAzSg.js → tool-set-selector-BA1yDuio.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DqW_CkJO.js → toolbar-icon-button-Q9J4as0k.js} +1 -1
- package/dist/client/assets/{tooltip-mM1fQXaq.js → tooltip-D2JXB44W.js} +1 -1
- package/dist/client/assets/{tooltipContext-B2y0_sWP.js → tooltipContext-DFFEsXAa.js} +1 -1
- package/dist/client/assets/{track-XkKLQQJT.js → track-BoXXDgSF.js} +1 -1
- package/dist/client/assets/{types-E9_eqrxO.js → types-BQyA3BSs.js} +1 -1
- package/dist/client/assets/{url-slug-BVpN8K6B.js → url-slug-C5-8vP9h.js} +1 -1
- package/dist/client/assets/{usage-stats-DT9jvl-J.js → usage-stats-PiJNBrSI.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bku85sJ3.js → use-ai-providers-BJRvsFFm.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-Bwm7LB-d.js → use-apply-named-rule-Bx_7T9aq.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-BbPdenM-.js +1 -0
- package/dist/client/assets/{use-automations-D9iFnWhp.js → use-automations-D6sbYMe4.js} +1 -1
- package/dist/client/assets/{use-autosave-CLbBIg-P.js → use-autosave-B4Qmzq9F.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-D8GbwCrf.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-Cbkyo6cP.js → use-chat-layout-state-Do_nZB5B.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-XYKTfqt2.js → use-cms-publish-actions-xdyGorKy.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DCIdJC0W.js → use-connect-companion-vyHul4nj.js} +1 -1
- package/dist/client/assets/{use-connection-CLoaxXGr.js → use-connection-D0bmffUK.js} +1 -1
- package/dist/client/assets/{use-content-sync-14ry1gRC.js → use-content-sync-lsuVBOfK.js} +1 -1
- package/dist/client/assets/{use-copy-D3ELC0tX.js → use-copy-BMjPWKp8.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DU1bARSL.js → use-date-fns-locale-BGBBIFpr.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Dxp05968.js → use-debounced-autosave-7L7lz31t.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CgYJanEq.js → use-debounced-value-CoBOVCcY.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DlgC2mIc.js → use-deco-credits-DVIvAOkL.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DhxeqkWl.js → use-decopilot-events-Bvlss2N9.js} +1 -1
- package/dist/client/assets/{use-delete-block-BJD7162e.js → use-delete-block-C97xuHhI.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DtzGQTsr.js → use-delete-connection-tX5LcknK.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-8guQU4GC.js → use-deployment-admin-BLMaSYC-.js} +1 -1
- package/dist/client/assets/{use-entitlements-J4XPZF2l.js → use-entitlements-npCYsfMp.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BX0PGrG_.js → use-fast-preview-draft-url-Dd9sZXW3.js} +1 -1
- package/dist/client/assets/{use-file-configs-DngvlIXa.js → use-file-configs-H9DeMtGB.js} +1 -1
- package/dist/client/assets/{use-id-selection-Dkbf-QZH.js → use-id-selection-DwyVyKTM.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-b7aNeh2-.js → use-inbox-feed-CrWtaQnK.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BWIp-OKY.js → use-infinite-scroll-6BCwcRG9.js} +1 -1
- package/dist/client/assets/{use-join-requests-CdvnKUpu.js → use-join-requests-B4f6m6mx.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-i0OC0oRI.js → use-main-panel-tabs-CRM1n__j.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CxxAbIdU.js → use-mcp-auth-status-C-7pHlxN.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CmWEhN6T.js → use-mcp-client-CAI0PiRc.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-RB8yW0_L.js → use-mcp-prompts-DqQEh2Qr.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Bfew76Ae.js → use-mcp-tools-DTs06gsh.js} +1 -1
- package/dist/client/assets/{use-mobile-BZ5I1Gts.js → use-mobile-DlyIeamj.js} +1 -1
- package/dist/client/assets/{use-move-blocks-a-Gpcz1Q.js → use-move-blocks-CfkVWpoJ.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CMbT8SLE.js → use-navigate-to-agent-rf_XQPo1.js} +1 -1
- package/dist/client/assets/{use-never-published-Cq663vOp.js → use-never-published-DP-ayb_U.js} +1 -1
- package/dist/client/assets/{use-org-fs-D8fqy59B.js → use-org-fs-DzWj7Jta.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-D0tdQJ2P.js → use-org-repo-syncs-0oF8-eI-.js} +1 -1
- package/dist/client/assets/{use-org-sso-D-kGbeq_.js → use-org-sso-Bz3FXaUK.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BZz5ibUN.js → use-organization-settings-04SG-hKv.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-BbI14MhH.js → use-project-native-view-presence-C642E_7q.js} +1 -1
- package/dist/client/assets/{use-project-scope-3ijTexFj.js → use-project-scope-BTU4ukSL.js} +1 -1
- package/dist/client/assets/{use-recent-apps-CWPH7SDm.js → use-recent-apps-Bh-9Swg8.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-V-qftvBJ.js → use-reports-diagnostic-C6P63hrA.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-CBP-Uwww.js → use-sandbox-events-BgsP-jl-.js} +1 -1
- package/dist/client/assets/{use-secrets-CfMZEME2.js → use-secrets-CL1K9zBu.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DxIpbqPr.js → use-section-preview-base-DiLHxC8Z.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-Cbxz0vjB.js → use-sidebar-collapsed-D-c-hbM9.js} +1 -1
- package/dist/client/assets/{use-tags-DTSxZWpz.js → use-tags-0c8J6MeW.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BKNhIlpV.js → use-task-board-analytics-Bp8Wbi_t.js} +1 -1
- package/dist/client/assets/{use-task-board-events-MfMFlaj-.js → use-task-board-events-BC3zf7YM.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-i0iDRtks.js → use-task-board-item-prs-BByRm2Es.js} +1 -1
- package/dist/client/assets/{use-task-board-items-6-h_Haer.js → use-task-board-items-BhZCRvwX.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-BzepMvGT.js → use-task-board-prompts-BRt0XfbY.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CkJg1Id-.js → use-task-metadata-DK9jGytt.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DegzudvH.js → use-thread-outputs-DcXhIS9K.js} +1 -1
- package/dist/client/assets/{use-view-draft-kind-BQ4N5uEB.js → use-view-draft-kind-By-WcYfU.js} +1 -1
- package/dist/client/assets/{use-voice-input-vD0BpiqU.js → use-voice-input-Bt11fXlC.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Cr6l3hRz.js +1 -0
- package/dist/client/assets/{useQueries-D6BmTkII.js → useQueries-tOLR6QE3.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BEaEPCKW.js +1 -0
- package/dist/client/assets/{users-RduqDlHV.js → users-BW_rkyv3.js} +1 -1
- package/dist/client/assets/{utils-CkU_P8Ie.js → utils-2an1bWl1.js} +1 -1
- package/dist/client/assets/{variant-calendar-1rTVvyAx.js → variant-calendar-7xv9ohqO.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-B3zGkPXZ.js → variant-matcher-override-CGi_ZY_N.js} +1 -1
- package/dist/client/assets/{view-header-B-Vek7fH.js → view-header-DkkNDHNd.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DPJ0M-HO.js → virtual-mcp-D-PJ7-_0.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-DqTWfbxM.js → watch-sse-pool-Gp1E8HHl.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/migrate.js +245 -245
- package/dist/server/server.js +749 -748
- package/package.json +1 -1
- package/dist/client/assets/UserSquare-CBWDFbi3.js +0 -1
- package/dist/client/assets/agent-app-DClrb2ok.js +0 -1
- package/dist/client/assets/agent-deck-BQ_G3Xvk.js +0 -1
- package/dist/client/assets/agent-experiments-B7tgn9fP.js +0 -1
- package/dist/client/assets/agent-hosting-DmUbTOe2.js +0 -1
- package/dist/client/assets/agent-icon-BwEytdmh.js +0 -1
- package/dist/client/assets/agent-library-BhTWSN-a.js +0 -1
- package/dist/client/assets/agent-library-file-C9nXPWjk.js +0 -1
- package/dist/client/assets/agent-overview-gQqe-_Zq.js +0 -1
- package/dist/client/assets/agent-settings-BZlQcdRN.js +0 -1
- package/dist/client/assets/agent-site-editor-code-D3XwSBBo.js +0 -2
- package/dist/client/assets/agent-site-editor-content-5EK8c-yC.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DtbJe_5m.js +0 -1
- package/dist/client/assets/agent-view-DJh235b7.js +0 -1
- package/dist/client/assets/api-keys-PaXWWj2O.js +0 -1
- package/dist/client/assets/library-sYbbN7ux.js +0 -1
- package/dist/client/assets/plan-1pM1JHac.js +0 -1
- package/dist/client/assets/project-reports-Bsj_xvMI.js +0 -1
- package/dist/client/assets/project-tasks-BGrqP4mL.js +0 -1
- package/dist/client/assets/reports-D5qXQXTJ.js +0 -1
- package/dist/client/assets/repositories-Cb1lXF50.js +0 -1
- package/dist/client/assets/review-settings-Ulx4CyPZ.js +0 -1
- package/dist/client/assets/route-CNldsqd_.js +0 -1
- package/dist/client/assets/settings-tab-CDHhpvzE.js +0 -1
- package/dist/client/assets/site-editor-C927WhHx.js +0 -1
- package/dist/client/assets/site-editor-toast-BLqoqKy_.js +0 -1
- package/dist/client/assets/tasks-hZ3cVL1W.js +0 -1
- package/dist/client/assets/use-ask-in-chat-C5w0G3Ru.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-BTQz7erp.js +0 -1
- package/dist/client/assets/useInfiniteQuery-njPYFTao.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CSPS7F0z.js +0 -1
package/dist/client/assets/{analytics-sections-DEuK9yNO.js → analytics-sections-aJEg6Lrj.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,j as s,b as B,gT as Y,m as D,F as fe,r as Z,d as xe,hD as q,ax as pe}from"./index-CWKxkTwy.js";import{c as J,b as G,B as U,C as ee}from"./chart-DPgJVmAl.js";import{e as he,a as ge,b as W,T as je,d as be,c as ye}from"./table-xCmpwB0s.js";import{i as ve}from"./AlertCircle-Bj2NuHQY.js";import{i as ke,n as Ne}from"./ArrowUp-AwRcCsuH.js";import{r as Se,Q as we,aE as Ce,ab as Te}from"./agent-icon-BwEytdmh.js";import{a as te,T as se}from"./toggle-group-BPubP3Pi.js";import{B as X}from"./badge-DbKUf3vA.js";import{l as ne,T as $e,P as De,S as Oe}from"./config-DqdBgCnO.js";import{C as H,X as P,Y as Q}from"./CartesianChart-B6p3i5Ce.js";import{A as Ie,a as Be}from"./AreaChart-wF798x8i.js";function le(a){const e=C.c(8),{href:t,className:d,children:o}=a,c=xe();let r;e[0]!==t||e[1]!==c?(r=n=>{!t||n.button!==0||n.metaKey||n.ctrlKey||n.shiftKey||(n.preventDefault(),c({href:t}))},e[0]=t,e[1]=c,e[2]=r):r=e[2];let l;return e[3]!==o||e[4]!==d||e[5]!==t||e[6]!==r?(l=s.jsx("a",{href:t,className:d,onClick:r,children:o}),e[3]=o,e[4]=d,e[5]=t,e[6]=r,e[7]=l):l=e[7],l}const L=(a,e,t)=>a&&e?()=>a({drill:e,label:t}):void 0,F="cursor-pointer text-left transition-colors hover:bg-accent focus-ring",E=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"],A={fontSize:11,fill:"var(--muted-foreground)",opacity:.7};function ae(a){const e=Math.abs(a);return e<60?`${Math.round(a)}s`:e<3600?`${Math.round(a/60)}m`:e<86400?`${(a/3600).toFixed(1)}h`:`${(a/86400).toFixed(1)}d`}function M(a,e){return a===null||Number.isNaN(a)?"—":e==="s"?ae(a):e==="%"?`${Math.round(a*10)/10}%`:e==="USD"?`$${a.toFixed(2)}`:a.toLocaleString()}function V(a,e){return e==="s"?ae(a):e==="%"?`${a}%`:e==="USD"?`$${a}`:a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}const re=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/,Le=/^\d{4}-\d{2}-\d{2}$/;function Me(a,e){return typeof a=="number"?M(a,e):Le.test(a)?new Date(`${a}T12:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric"}):re.test(a)?q(a):a}function _(a){const e=C.c(20),{title:t,value:d,caption:o,aside:c,children:r,onClick:l}=a,n=l?"button":"section",i=l?"button":void 0,u=l&&F;let m;e[0]!==u?(m=D("surface @container flex h-full w-full min-w-0 flex-col gap-6 px-4 pt-4 pb-5",u),e[0]=u,e[1]=m):m=e[1];let x;e[2]!==t?(x=s.jsx("h3",{className:"text-sm text-foreground/70",children:t}),e[2]=t,e[3]=x):x=e[3];let f;e[4]!==d?(f=d!==void 0&&s.jsx("span",{className:"tnum whitespace-nowrap text-4xl font-normal text-foreground @max-xs:text-3xl @max-3xs:text-2xl",children:d}),e[4]=d,e[5]=f):f=e[5];let h;e[6]!==o||e[7]!==x||e[8]!==f?(h=s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[x,f,o]}),e[6]=o,e[7]=x,e[8]=f,e[9]=h):h=e[9];let p;e[10]!==c||e[11]!==h?(p=s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h,c]}),e[10]=c,e[11]=h,e[12]=p):p=e[12];let j;return e[13]!==n||e[14]!==r||e[15]!==l||e[16]!==i||e[17]!==m||e[18]!==p?(j=s.jsxs(n,{type:i,onClick:l,className:m,children:[p,r]}),e[13]=n,e[14]=r,e[15]=l,e[16]=i,e[17]=m,e[18]=p,e[19]=j):j=e[19],j}function ie(a){const e=C.c(9),{lane:t}=a,d=B();let o;e[0]!==t||e[1]!==d?(o=ne(t,d),e[0]=t,e[1]=d,e[2]=o):o=e[2];const{label:c,visual:r}=o,l=r.icon;let n;e[3]!==l||e[4]!==r.iconClassName?(n=s.jsx(l,{className:r.iconClassName}),e[3]=l,e[4]=r.iconClassName,e[5]=n):n=e[5];let i;return e[6]!==c||e[7]!==n?(i=s.jsxs(X,{variant:"muted",children:[n,c]}),e[6]=c,e[7]=n,e[8]=i):i=e[8],i}function R(a){const e=C.c(2),{children:t}=a;let d;return e[0]!==t?(d=s.jsx("div",{className:"flex h-20 items-center justify-center text-sm text-muted-foreground",children:t}),e[0]=t,e[1]=d):d=e[1],d}function _e(a){const e=C.c(21),{value:t,previous:d,unit:o,better:c}=a,r=B();if(t===null||d===null||d===void 0){let p;e[0]!==r?(p=r("taskBoard.analytics.noPrior"),e[0]=r,e[1]=p):p=e[1];let j;return e[2]!==p?(j=s.jsx("span",{className:"text-meta",children:p}),e[2]=p,e[3]=j):j=e[3],j}const l=Math.round((t-d)*10)/10,n=c==="down"?l<0:l>0;let i;e[4]!==l||e[5]!==r||e[6]!==o?(i=o==="%"?r("taskBoard.analytics.points",{n:String(Math.abs(l))}):M(Math.abs(l),o),e[4]=l,e[5]=r,e[6]=o,e[7]=i):i=e[7];const u=i;let m;e[8]!==u||e[9]!==c||e[10]!==l||e[11]!==n||e[12]!==r?(m=l===0?r("taskBoard.analytics.unchanged"):s.jsxs("span",{className:D("inline-flex items-center gap-0.5 font-medium",c&&(n?"text-success":"text-destructive")),children:[l>0?s.jsx(ke,{size:12}):s.jsx(Ne,{size:12}),u]}),e[8]=u,e[9]=c,e[10]=l,e[11]=n,e[12]=r,e[13]=m):m=e[13];let x;e[14]!==r?(x=r("taskBoard.analytics.vsPrevious"),e[14]=r,e[15]=x):x=e[15];let f;e[16]!==x?(f=s.jsx("span",{children:x}),e[16]=x,e[17]=f):f=e[17];let h;return e[18]!==m||e[19]!==f?(h=s.jsxs("span",{className:"text-meta inline-flex items-center gap-1",children:[m,f]}),e[18]=m,e[19]=f,e[20]=h):h=e[20],h}const Re={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",5:"lg:grid-cols-5",6:"lg:grid-cols-3",9:"lg:grid-cols-3"};function Ae(a){const e=C.c(10),{section:t,onDrill:d}=a,o=Re[t.values.length]??"lg:grid-cols-4";let c;e[0]!==o?(c=D("grid grid-cols-2 gap-4",o),e[0]=o,e[1]=c):c=e[1];let r;if(e[2]!==d||e[3]!==t.values){let n;e[5]!==d?(n=i=>s.jsx(_,{title:i.label,value:M(i.value,i.unit),onClick:L(d,i.drill,i.label),caption:s.jsxs(s.Fragment,{children:[i.detail&&s.jsx("span",{className:"text-sm text-muted-foreground",children:i.detail}),i.previous!==void 0&&s.jsx(_e,{value:i.value,previous:i.previous,unit:i.unit,better:i.better})]})},i.label),e[5]=d,e[6]=n):n=e[6],r=t.values.map(n),e[2]=d,e[3]=t.values,e[4]=r}else r=e[4];let l;return e[7]!==c||e[8]!==r?(l=s.jsx("div",{className:c,children:r}),e[7]=c,e[8]=r,e[9]=l):l=e[9],l}function Ke(a){return Array.from(new Set(a.flatMap(e=>Object.keys(e)))).filter(e=>e!=="t").sort()}function Ee(a,e){const t=e.filter(d=>a.some(o=>typeof o[d]=="number"&&o[d]!==0));return t.length>0?t:e}function Fe(a,e,t){const d=new Map(a.map(l=>[String(l.t??"").slice(0,10),l])),o=new Date(`${t.from.slice(0,10)}T00:00:00.000Z`),c=t.to.slice(0,10),r=[];for(;o.toISOString().slice(0,10)<=c;){const l=o.toISOString().slice(0,10);r.push(d.get(l)??{t:o.toISOString(),...Object.fromEntries(e.map(n=>[n,0]))}),o.setUTCDate(o.getUTCDate()+1)}return r}function oe(a){const e=C.c(17),{active:t,payload:d,unit:o,nameOf:c}=a,r=c===void 0?String:c;if(!t||!d?.length)return null;const l=d[0]?.payload,n=l?.t;let i;e[0]!==l?.label||e[1]!==n?(i=typeof n=="string"?new Date(n).toLocaleDateString(void 0,{month:"short",day:"numeric"}):String(l?.label??""),e[0]=l?.label,e[1]=n,e[2]=i):i=e[2];let u;e[3]!==i?(u=s.jsx("div",{className:"mb-1 text-xs text-muted-foreground",children:i}),e[3]=i,e[4]=u):u=e[4];let m;if(e[5]!==r||e[6]!==d||e[7]!==o){let h;e[9]!==r||e[10]!==o?(h=p=>s.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:p.color}}),s.jsx("span",{className:"text-muted-foreground",children:r(String(p.dataKey))}),s.jsx("span",{className:"tnum ml-auto pl-3 font-medium",children:M(typeof p.value=="number"?p.value:null,o)})]},String(p.dataKey)),e[9]=r,e[10]=o,e[11]=h):h=e[11],m=d.map(h),e[5]=r,e[6]=d,e[7]=o,e[8]=m}else m=e[8];let x;e[12]!==m?(x=s.jsx("div",{className:"flex flex-col gap-1",children:m}),e[12]=m,e[13]=x):x=e[13];let f;return e[14]!==u||e[15]!==x?(f=s.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",children:[u,x]}),e[14]=u,e[15]=x,e[16]=f):f=e[16],f}function ze(a){const e=C.c(27),{section:t,range:d}=a,o=B(),c=t.unit??void 0,r=c!=="%"&&c!=="s";let l;if(e[0]!==r||e[1]!==d||e[2]!==t.points||e[3]!==t.title||e[4]!==o||e[5]!==c){const n=Ke(t.points),i=r?Ee(t.points,n):n,u=y=>E[n.indexOf(y)%E.length],m=Object.fromEntries(i.map(y=>[y,{label:y,color:u(y)}])),f=(r&&d?Fe(t.points,n,d):t.points).map(Ge);let h;if(e[7]!==t.title){let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=/\W+/g,e[9]=y):y=e[9],h=t.title.replace(y,"-"),e[7]=t.title,e[8]=h}else h=e[8];const p=`analytics-${h}`;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[10]=j):j=e[10];const v=j;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(P,{dataKey:"label",axisLine:!1,tickLine:!1,tick:A,minTickGap:24,tickMargin:8}),e[11]=k):k=e[11];const b=k;let T;e[12]!==c?(T=c==="%"?[0,100]:[0,"auto"],e[12]=c,e[13]=T):T=e[13];const S=c!==void 0;let g;e[14]!==c?(g=y=>V(y,c),e[14]=c,e[15]=g):g=e[15];let w;e[16]!==T||e[17]!==S||e[18]!==g?(w=s.jsx(Q,{orientation:"right",axisLine:!1,tickLine:!1,tick:A,domain:T,allowDecimals:S,tickFormatter:g,width:48,tickCount:5}),e[16]=T,e[17]=S,e[18]=g,e[19]=w):w=e[19];const O=w;let $;e[20]!==r?($=r?{fill:"var(--muted)",opacity:.4}:{stroke:"var(--border)",strokeDasharray:"4 4"},e[20]=r,e[21]=$):$=e[21];let I;e[22]!==c?(I=y=>{const{active:z,payload:me}=y;return s.jsx(oe,{active:z,payload:me,unit:c})},e[22]=c,e[23]=I):I=e[23];let N;e[24]!==I||e[25]!==$?(N=s.jsx(ee,{cursor:$,content:I}),e[24]=I,e[25]=$,e[26]=N):N=e[26];const K=N;l=s.jsx(_,{title:t.title,aside:i.length>1&&s.jsx("ul",{className:"flex flex-wrap justify-end gap-x-3 gap-y-1",children:i.map(y=>s.jsxs("li",{className:"text-meta flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:u(y)}}),y]},y))}),children:f.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx(J,{role:"img","aria-label":t.title,className:"h-[140px] w-full md:h-[180px]",config:m,children:r?s.jsxs(G,{data:f,margin:{left:0,right:0,top:8},children:[v,b,O,K,i.map((y,z)=>s.jsx(U,{dataKey:y,stackId:"day",fill:u(y),maxBarSize:24,radius:z===i.length-1?[4,4,0,0]:0,animationDuration:300},y))]}):s.jsxs(Ie,{data:f,margin:{left:0,right:0,top:8},children:[i.length===1&&s.jsx("defs",{children:s.jsxs("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:u(i[0]??""),stopOpacity:.2}),s.jsx("stop",{offset:"100%",stopColor:u(i[0]??""),stopOpacity:0})]})}),v,b,O,K,i.map(y=>s.jsx(Be,{type:"linear",dataKey:y,stroke:u(y),strokeWidth:2,fill:i.length===1?`url(#${p})`:"none",dot:f.length===1?{r:4}:!1,activeDot:{r:4,stroke:"var(--background)",strokeWidth:2},connectNulls:!0,animationDuration:300},y))]})})}),e[0]=r,e[1]=d,e[2]=t.points,e[3]=t.title,e[4]=o,e[5]=c,e[6]=l}else l=e[6];return l}function Ge(a){return{...a,label:new Date(String(a.t??"")).toLocaleDateString(void 0,{month:"short",day:"numeric"})}}function ce(a){const e=C.c(25),{label:t,note:d,share:o,value:c,fill:r,color:l,onClick:n}=a,i=n?"button":"div",u=n?"button":void 0;let m;e[0]!==n?(m=n&&D(F,"-mx-2 w-[calc(100%+1rem)] rounded-md px-2"),e[0]=n,e[1]=m):m=e[1];let x;e[2]!==m?(x=D("flex h-10 w-full items-center gap-3",m),e[2]=m,e[3]=x):x=e[3];let f;e[4]!==d?(f=d&&s.jsx("span",{className:"text-meta ml-2",children:d}),e[4]=d,e[5]=f):f=e[5];let h;e[6]!==t||e[7]!==f?(h=s.jsxs("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:[t,f]}),e[6]=t,e[7]=f,e[8]=h):h=e[8];const p=`${Math.max(0,Math.min(100,r))}%`;let j;e[9]!==l||e[10]!==p?(j=s.jsx("span",{className:"h-1.5 w-20 shrink-0 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full",style:{width:p,backgroundColor:l}})}),e[9]=l,e[10]=p,e[11]=j):j=e[11];let v;e[12]!==o?(v=o!==void 0&&s.jsx("span",{className:"tnum w-16 shrink-0 text-right text-sm text-foreground/40",children:o}),e[12]=o,e[13]=v):v=e[13];let k;e[14]!==c?(k=s.jsx("span",{className:"tnum w-8 shrink-0 text-right text-sm text-foreground",children:c}),e[14]=c,e[15]=k):k=e[15];let b;return e[16]!==i||e[17]!==n||e[18]!==u||e[19]!==x||e[20]!==h||e[21]!==j||e[22]!==v||e[23]!==k?(b=s.jsx("li",{className:"border-b border-border/50 last:border-b-0",children:s.jsxs(i,{type:u,onClick:n,className:x,children:[h,j,v,k]})}),e[16]=i,e[17]=n,e[18]=u,e[19]=x,e[20]=h,e[21]=j,e[22]=v,e[23]=k,e[24]=b):b=e[24],b}function Ue(a){const e=C.c(17),{section:t,onDrill:d}=a,o=B(),c=t.stages[0]?.value??0,r=t.stages.at(-1)?.value??0;let l;e[0]!==r||e[1]!==c?(l=c?`${Math.round(100*r/c)}%`:"—",e[0]=r,e[1]=c,e[2]=l):l=e[2];let n;e[3]!==r||e[4]!==c||e[5]!==o?(n=c>0&&s.jsx("span",{className:"text-meta",children:o("taskBoard.analytics.funnelCaption",{end:String(r),start:String(c)})}),e[3]=r,e[4]=c,e[5]=o,e[6]=n):n=e[6];let i;e[7]!==d||e[8]!==t.stages||e[9]!==c||e[10]!==o?(i=c===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx("ol",{className:"flex flex-col",children:t.stages.map((m,x)=>{const f=t.stages[x-1]?.value,h=f===void 0?0:f-m.value;return s.jsx(ce,{label:m.label,note:h>0?o("taskBoard.analytics.dropped",{n:String(h)}):void 0,share:`${Math.round(100*m.value/c)}%`,value:m.value.toLocaleString(),fill:100*m.value/c,color:"var(--chart-2)",onClick:L(d,m.drill,m.label)},m.label)})}),e[7]=d,e[8]=t.stages,e[9]=c,e[10]=o,e[11]=i):i=e[11];let u;return e[12]!==t.title||e[13]!==l||e[14]!==n||e[15]!==i?(u=s.jsx(_,{title:t.title,value:l,caption:n,children:i}),e[12]=t.title,e[13]=l,e[14]=n,e[15]=i,e[16]=u):u=e[16],u}function He(a){const e=C.c(19),{section:t,onDrill:d}=a,o=B();let c;e[0]!==t.bars?(c=Math.max(0,...t.bars.map(Pe)),e[0]=t.bars,e[1]=c):c=e[1];const r=c;let l;e[2]!==t.total?.value?(l=t.total?.value.toLocaleString(),e[2]=t.total?.value,e[3]=l):l=e[3];let n;e[4]!==t.total?(n=t.total&&s.jsx("span",{className:"text-meta",children:t.total.label}),e[4]=t.total,e[5]=n):n=e[5];let i;e[6]!==t.unit?(i=t.unit&&s.jsx("span",{className:"text-meta",children:t.unit}),e[6]=t.unit,e[7]=i):i=e[7];let u;e[8]!==r||e[9]!==d||e[10]!==t.bars||e[11]!==o?(u=t.bars.length===0?s.jsx(R,{children:o("taskBoard.analytics.nobodyStepped")}):s.jsx("ul",{className:"flex flex-col",children:t.bars.map(x=>s.jsx(ce,{label:x.label,note:x.note,share:x.detail,value:x.value.toLocaleString(),fill:r?100*x.value/r:0,color:"var(--chart-1)",onClick:L(d,x.drill,x.label)},x.label))}),e[8]=r,e[9]=d,e[10]=t.bars,e[11]=o,e[12]=u):u=e[12];let m;return e[13]!==t.title||e[14]!==l||e[15]!==n||e[16]!==i||e[17]!==u?(m=s.jsx(_,{title:t.title,value:l,caption:n,aside:i,children:u}),e[13]=t.title,e[14]=l,e[15]=n,e[16]=i,e[17]=u,e[18]=m):m=e[18],m}function Pe(a){return a.value}function Qe(a,e){return`/${encodeURIComponent(a)}/${encodeURIComponent(e)}`}const Ve=new Set(["Org ID","Task ID"]),Xe=new Set(["Run outcome","Failure kind","Moved in by","State"]),Ye=new Set(["Error","Signature"]),We=new Set(["Org","Orgs"]);function Ze(a){const e=C.c(32),{section:t,threadLinks:d,showOrg:o,taskHref:c,onDrill:r}=a,l=B(),n=t.columns.indexOf("Org");let i;e[0]!==n||e[1]!==t.columns||e[2]!==d?(i=d&&n>=0?t.columns.indexOf("Thread"):-1,e[0]=n,e[1]=t.columns,e[2]=d,e[3]=i):i=e[3];const u=i,m=t.columns.indexOf("Task ID");let x;e[4]!==t.columns||e[5]!==c||e[6]!==m?(x=c&&m>=0?t.columns.indexOf("Task"):-1,e[4]=t.columns,e[5]=c,e[6]=m,e[7]=x):x=e[7];const f=x,h=t.columns;let p,j;if(e[8]!==r||e[9]!==n||e[10]!==t.columns||e[11]!==t.drills||e[12]!==t.rows||e[13]!==t.title||e[14]!==t.units||e[15]!==o||e[16]!==l||e[17]!==f||e[18]!==c||e[19]!==m||e[20]!==u){j=Symbol.for("react.early_return_sentinel");e:{let v;e[23]!==o?(v=S=>{const{c:g}=S;return!Ve.has(g)&&(o!==!1||!We.has(g))},e[23]=o,e[24]=v):v=e[24];const k=h.map(st).filter(v).sort(tt);let b;e[25]!==t.rows?(b=S=>{const{j:g}=S,w=t.rows.map(O=>O[g]).filter(et);return w.length>0&&w.every(Je)},e[25]=t.rows,e[26]=b):b=e[26];const T=new Set(k.filter(b).map(qe));if(t.rows.length===1&&k.every(S=>{const{c:g}=S;return T.has(g)})){let S;e[27]!==t.rows[0]?(S=t.rows[0]??[],e[27]=t.rows[0],e[28]=S):S=e[28];const g=S;let w;e[29]!==g||e[30]!==t.units?(w=O=>{const{c:$,j:I}=O,N=g[I];return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("dt",{className:"text-meta",children:$}),s.jsx("dd",{className:"tnum text-2xl text-foreground",children:typeof N=="number"?M(N,t.units?.[$]):"—"})]},$)},e[29]=g,e[30]=t.units,e[31]=w):w=e[31],j=s.jsx(Y,{title:t.title,children:s.jsx("dl",{className:"surface grid px-4 pt-4 pb-5 grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3 lg:grid-cols-[repeat(auto-fill,minmax(120px,1fr))]",children:k.map(w)})});break e}p=s.jsx(Y,{title:t.title,children:t.rows.length===0?s.jsx("p",{className:"surface px-4 py-4 text-sm text-muted-foreground",children:l("taskBoard.analytics.nothingToShow")}):s.jsx("div",{className:"surface max-h-[480px] overflow-auto",children:s.jsxs(he,{variant:"flush",children:[s.jsx(ge,{children:s.jsx(W,{children:k.map(S=>{const{c:g}=S;return s.jsx(je,{className:D("whitespace-nowrap first:pl-4 last:pr-4",T.has(g)&&"text-right"),children:g==="Thread"?"":g},g)})})}),s.jsx(be,{children:t.rows.map((S,g)=>s.jsx(W,{children:k.map((w,O)=>{const{c:$,j:I}=w,N=S[I],K=f===I?S[m]:null,y=O===0?L(r,t.drills?.[g]??void 0,String(N??"")):void 0;return s.jsx(ye,{className:D("max-w-md truncate text-sm first:pl-4 last:pr-4",T.has($)&&"text-right"),children:N==null?s.jsx("span",{className:"text-muted-foreground",children:"—"}):I===u?s.jsxs("a",{href:Qe(String(S[n]),String(N)),target:"_blank",rel:"noreferrer",className:"focus-ring inline-flex items-center gap-1 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:[l("taskBoard.analytics.openChat"),s.jsx(fe,{size:12})]}):y?s.jsx("button",{type:"button",onClick:y,className:"focus-ring text-left text-foreground underline-offset-2 hover:underline",children:String(N)}):K?s.jsx(le,{href:c?.(String(K)),className:"focus-ring text-foreground underline-offset-2 hover:underline",children:String(N)}):$==="Lane"&&typeof N=="string"?s.jsx(ie,{lane:N}):$==="Priority"&&typeof N=="string"?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(de,{drill:`priority:${N.toLowerCase()}`}),N]}):Xe.has($)?s.jsx(X,{variant:"muted",children:String(N)}):Ye.has($)?s.jsx("span",{title:String(N),className:"font-mono text-xs text-muted-foreground",children:String(N)}):s.jsx("span",{className:D("tnum",typeof N=="string"&&re.test(N)&&"text-muted-foreground"),children:Me(N,t.units?.[$])})},$)})},`${t.title}-${g}`))})]})})})}e[8]=r,e[9]=n,e[10]=t.columns,e[11]=t.drills,e[12]=t.rows,e[13]=t.title,e[14]=t.units,e[15]=o,e[16]=l,e[17]=f,e[18]=c,e[19]=m,e[20]=u,e[21]=p,e[22]=j}else p=e[21],j=e[22];return j!==Symbol.for("react.early_return_sentinel")?j:p}function qe(a){const{c:e}=a;return e}function Je(a){return typeof a=="number"}function et(a){return a!==null}function tt(a,e){return+(e.c==="Task")-+(a.c==="Task")}function st(a,e){return{c:a,j:e}}function Tt(a){const e=C.c(17),{section:t,taskHref:d}=a,o=B();let c;e[0]!==t.columns?(c=i=>t.columns.indexOf(i),e[0]=t.columns,e[1]=c):c=e[1];const r=c;if(t.rows.length===0){let i;e[2]!==o?(i=o("taskBoard.analytics.nothingToShow"),e[2]=o,e[3]=i):i=e[3];let u;return e[4]!==i?(u=s.jsx(R,{children:i}),e[4]=i,e[5]=u):u=e[5],u}let l;if(e[6]!==r||e[7]!==t.rows||e[8]!==o||e[9]!==d){let i;e[11]!==r||e[12]!==o||e[13]!==d?(i=u=>{const m=String(u[r("Task ID")]??""),x=u[r("Lane")],f=u[r("Picked up")],h=Number(u[r("Actions by people")]??0),p=Number(u[r("Failed QA")]??0),j=[typeof f=="string"?q(f):null,h>0&&o(h===1?"taskBoard.analytics.humanActionsOne":"taskBoard.analytics.humanActions",{n:String(h)})].filter(Boolean),v=s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx("span",{className:"truncate text-sm text-foreground",children:String(u[r("Task")]??"")}),s.jsx("span",{className:"text-meta truncate",children:j.join(" · ")})]}),p>0&&s.jsxs(X,{variant:"muted",children:[s.jsx(ve,{className:"text-destructive"}),p===1?o("taskBoard.analytics.failedQa"):o("taskBoard.analytics.failedQaTimes",{n:String(p)})]}),typeof x=="string"&&s.jsx(ie,{lane:x})]});return s.jsx("li",{className:"border-b border-border/50 last:border-b-0",children:d?s.jsx(le,{href:d(m),className:D(F,"flex items-center gap-3 rounded-md p-2"),children:v}):s.jsx("div",{className:"flex items-center gap-3 p-2",children:v})},m)},e[11]=r,e[12]=o,e[13]=d,e[14]=i):i=e[14],l=t.rows.map(i),e[6]=r,e[7]=t.rows,e[8]=o,e[9]=d,e[10]=l}else l=e[10];let n;return e[15]!==l?(n=s.jsx("ul",{className:"flex flex-col",children:l}),e[15]=l,e[16]=n):n=e[16],n}const nt={Type:Te,Priority:Ce,Tag:we,Sprint:Se,"Brief by":pe};function de(a){const e=C.c(10),{drill:t}=a;let d;e[0]!==t?(d=(t??"").split("&")[0]?.split(":")??[],e[0]=t,e[1]=d):d=e[1];const[o,c]=d;let r,l,n;if(e[2]!==o||e[3]!==c){n=Symbol.for("react.early_return_sentinel");e:{const u=o==="type"?Object.entries($e).find(x=>{const[f]=x;return f===c})?.[1]:o==="priority"?Object.entries(De).find(x=>{const[f]=x;return f===c})?.[1]:void 0;if(!u){n=null;break e}r=u.icon,l=D("size-3.5 shrink-0",u.iconClassName)}e[2]=o,e[3]=c,e[4]=r,e[5]=l,e[6]=n}else r=e[4],l=e[5],n=e[6];if(n!==Symbol.for("react.early_return_sentinel"))return n;let i;return e[7]!==r||e[8]!==l?(i=s.jsx(r,{className:l}),e[7]=r,e[8]=l,e[9]=i):i=e[9],i}function lt(a){const e=C.c(11),{value:t,metric:d,color:o}=a,c=t??0,r=`${d.unit==="%"?Math.min(100,c):0}%`;let l;e[0]!==o||e[1]!==r?(l=s.jsx("span",{className:"h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full",style:{width:r,backgroundColor:o}})}),e[0]=o,e[1]=r,e[2]=l):l=e[2];const n=t??null;let i;e[3]!==d.unit||e[4]!==n?(i=M(n,d.unit),e[3]=d.unit,e[4]=n,e[5]=i):i=e[5];let u;e[6]!==i?(u=s.jsx("span",{className:"tnum w-12 shrink-0 text-right text-sm text-foreground",children:i}),e[6]=i,e[7]=u):u=e[7];let m;return e[8]!==l||e[9]!==u?(m=s.jsxs("span",{className:"flex items-center gap-2",children:[l,u]}),e[8]=l,e[9]=u,e[10]=m):m=e[10],m}function at(a){const e=C.c(16),{section:t,onDrill:d}=a,o=B(),[c,r]=Z.useState(t.dimensions[0]?.label??"");let l;e[0]!==c||e[1]!==t.dimensions?(l=t.dimensions.find(f=>f.label===c)??t.dimensions[0],e[0]=c,e[1]=t.dimensions,e[2]=l):l=e[2];const n=l,i=`minmax(0,1fr) 56px repeat(${t.metrics.length}, minmax(96px, 168px))`;let u;e[3]!==n?.label||e[4]!==t.dimensions?(u=t.dimensions.length>1&&s.jsx(te,{type:"single",variant:"segmented",size:"sm",value:n?.label??"",onValueChange:f=>f&&r(f),children:t.dimensions.map(it)}),e[3]=n?.label,e[4]=t.dimensions,e[5]=u):u=e[5];let m;e[6]!==i||e[7]!==n||e[8]!==d||e[9]!==t.metrics||e[10]!==o?(m=!n||n.rows.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"text-meta grid items-center gap-4 border-b border-border/50 pb-2",style:{gridTemplateColumns:i},children:[s.jsx("span",{children:n.label}),s.jsx("span",{className:"text-right",children:o("taskBoard.analytics.tasks")}),t.metrics.map(rt)]}),n.rows.map(f=>{const h=L(d,f.drill,f.label),p=h?"button":"div";return s.jsxs(p,{type:h?"button":void 0,onClick:h,className:D("grid h-11 items-center gap-4 border-b border-border/50 last:border-b-0",h&&D(F,"-mx-2 w-[calc(100%+1rem)] rounded-md px-2")),style:{gridTemplateColumns:i},children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-sm text-foreground",children:[s.jsx(de,{drill:f.drill}),s.jsx("span",{className:"truncate",children:f.label})]}),s.jsx("span",{className:"tnum text-right text-sm text-muted-foreground",children:f.count.toLocaleString()}),t.metrics.map(j=>s.jsx(lt,{value:f.values[j.key],metric:j,color:j.better==="up"?"var(--success)":"var(--destructive)"},j.key))]},f.label)})]}),e[6]=i,e[7]=n,e[8]=d,e[9]=t.metrics,e[10]=o,e[11]=m):m=e[11];let x;return e[12]!==t.title||e[13]!==u||e[14]!==m?(x=s.jsx(_,{title:t.title,aside:u,children:m}),e[12]=t.title,e[13]=u,e[14]=m,e[15]=x):x=e[15],x}function rt(a){return s.jsx("span",{className:"text-right",children:a.label},a.key)}function it(a){const e=nt[a.label];return s.jsxs(se,{value:a.label,children:[e&&s.jsx(e,{}),a.label]},a.label)}const ue=3;function ot(a){const e=C.c(26),{section:t,onDrill:d}=a,o=B(),[c,r]=Z.useState(t.metrics[0]?.key??"");let l;e[0]!==c||e[1]!==t.metrics?(l=t.metrics.find(b=>b.key===c)??t.metrics[0],e[0]=c,e[1]=t.metrics,e[2]=l):l=e[2];const n=l;if(!n)return null;const i=n.better==="up"?"var(--success)":"var(--destructive)";let u;e[3]!==t.cols||e[4]!==t.rows?(u=t.rows.length===t.cols.length&&t.rows.every((b,T)=>t.cols[T]===b),e[3]=t.cols,e[4]=t.rows,e[5]=u):u=e[5];const m=u,x=`minmax(96px, 1fr) repeat(${t.cols.length}, minmax(72px, 1fr))`,f=t.title;let h;e[6]!==o?(h=o("taskBoard.analytics.matrixCaption",{n:String(ue)}),e[6]=o,e[7]=h):h=e[7];let p;e[8]!==h?(p=s.jsx("span",{className:"text-meta",children:h}),e[8]=h,e[9]=p):p=e[9];let j;e[10]!==n.key||e[11]!==t.metrics?(j=t.metrics.length>1&&s.jsx(te,{type:"single",variant:"segmented",size:"sm",value:n.key,onValueChange:b=>b&&r(b),children:t.metrics.map(dt)}),e[10]=n.key,e[11]=t.metrics,e[12]=j):j=e[12];let v;e[13]!==x||e[14]!==n||e[15]!==d||e[16]!==t||e[17]!==m||e[18]!==o||e[19]!==i?(v=t.rows.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("div",{className:"grid min-w-fit gap-1",style:{gridTemplateColumns:x},children:[s.jsxs("span",{className:"text-meta self-end pb-1",children:[t.rowLabel," / ",t.colLabel]}),t.cols.map(ct),t.rows.map((b,T)=>s.jsx(ut,{row:b,section:t,metric:n,tint:i,onDrill:d,upTo:m?T:void 0},b))]})}),e[13]=x,e[14]=n,e[15]=d,e[16]=t,e[17]=m,e[18]=o,e[19]=i,e[20]=v):v=e[20];let k;return e[21]!==t.title||e[22]!==p||e[23]!==j||e[24]!==v?(k=s.jsx(_,{title:f,caption:p,aside:j,children:v}),e[21]=t.title,e[22]=p,e[23]=j,e[24]=v,e[25]=k):k=e[25],k}function ct(a){return s.jsx("span",{className:"text-meta self-end pb-1 text-center",children:a},a)}function dt(a){return s.jsx(se,{value:a.key,children:a.label},a.key)}function ut(a){const e=C.c(22),{row:t,section:d,metric:o,tint:c,onDrill:r,upTo:l}=a,n=B();let i;e[0]!==t?(i=s.jsx("span",{className:"flex items-center truncate pr-2 text-sm text-foreground",children:t}),e[0]=t,e[1]=i):i=e[1];let u;if(e[2]!==o||e[3]!==r||e[4]!==t||e[5]!==d.cells||e[6]!==d.cols||e[7]!==n||e[8]!==c||e[9]!==l){let x;e[11]!==o||e[12]!==r||e[13]!==t||e[14]!==d.cells||e[15]!==n||e[16]!==c||e[17]!==l?(x=(f,h)=>{if(l!==void 0&&h>l)return s.jsx("span",{},f);const p=d.cells.find(b=>b.row===t&&b.col===f),j=p?.values[o.key]??null;if(!p)return s.jsx("span",{className:"flex h-14 items-center justify-center rounded-md bg-muted/40 text-sm text-muted-foreground",children:"—"},f);const v=j===null?0:Math.min(100,o.unit==="%"?j:0),k=L(r,p.drill,t===f?t:`${t} · ${f}`);return s.jsxs("button",{type:"button",onClick:k,disabled:!k,className:D("flex h-14 flex-col items-center justify-center rounded-md transition-opacity focus-ring",k&&"cursor-pointer hover:opacity-80",p.count<ue&&"opacity-50"),style:{backgroundColor:`color-mix(in oklch, ${c} ${Math.round(8+v*.5)}%, var(--muted))`},children:[s.jsx("span",{className:"tnum text-sm font-medium text-foreground",children:M(j,o.unit)}),s.jsx("span",{className:"text-meta",children:p.count===1?n("taskBoard.analytics.drillCountOne"):n("taskBoard.analytics.drillCount",{n:String(p.count)})})]},f)},e[11]=o,e[12]=r,e[13]=t,e[14]=d.cells,e[15]=n,e[16]=c,e[17]=l,e[18]=x):x=e[18],u=d.cols.map(x),e[2]=o,e[3]=r,e[4]=t,e[5]=d.cells,e[6]=d.cols,e[7]=n,e[8]=c,e[9]=l,e[10]=u}else u=e[10];let m;return e[19]!==i||e[20]!==u?(m=s.jsxs(s.Fragment,{children:[i,u]}),e[19]=i,e[20]=u,e[21]=m):m=e[21],m}function mt(){const a=C.c(2),e=B();let t;return a[0]!==e?(t=d=>Object.hasOwn(Oe,d)?ne(d,e).label:d,a[0]=e,a[1]=t):t=a[1],t}function ft(a){const e=C.c(21),{section:t,onDrill:d}=a,o=B(),c=mt(),r=t.unit??void 0,l=t.layout==="stacked";let n;if(e[0]!==c||e[1]!==d||e[2]!==t.baseline||e[3]!==t.categories||e[4]!==t.keys||e[5]!==t.title||e[6]!==l||e[7]!==o||e[8]!==r){let i;e[10]!==t.baseline?(i=g=>g!==t.baseline,e[10]=t.baseline,e[11]=i):i=e[11];const u=t.keys.filter(i),m=g=>g===t.baseline?"var(--border)":E[u.indexOf(g)%E.length]??"",x=Object.fromEntries(t.keys.map(g=>[g,{label:c(g),color:m(g)}]));let f;e[12]!==t.categories?(f=t.categories.map(pt),e[12]=t.categories,e[13]=f):f=e[13];const h=f;let p;e[14]!==d||e[15]!==t.categories?(p=g=>{const w=t.categories[g];w&&L(d,w.drill,w.label)?.()},e[14]=d,e[15]=t.categories,e[16]=p):p=e[16];const j=p,v=t.categories.some(xt)&&!!d,k=l?Math.max(120,t.categories.length*44+32):220;let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b={fill:"var(--muted)",opacity:.4},e[17]=b):b=e[17];let T;e[18]!==c||e[19]!==r?(T=s.jsx(ee,{cursor:b,content:g=>{const{active:w,payload:O}=g;return s.jsx(oe,{active:w,payload:O,unit:r,nameOf:c})}}),e[18]=c,e[19]=r,e[20]=T):T=e[20];const S=T;n=s.jsx(_,{title:t.title,aside:s.jsx("ul",{className:"flex flex-wrap justify-end gap-x-3 gap-y-1",children:t.keys.map(g=>s.jsxs("li",{className:"text-meta flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:m(g)}}),c(g)]},g))}),children:h.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx(J,{role:"img","aria-label":t.title,className:"w-full",style:{height:k},config:x,children:l?s.jsxs(G,{data:h,layout:"vertical",margin:{left:0,right:8,top:0},children:[s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,horizontal:!1}),s.jsx(P,{type:"number",axisLine:!1,tickLine:!1,tick:A,tickFormatter:g=>V(g,r)}),s.jsx(Q,{type:"category",dataKey:"label",axisLine:!1,tickLine:!1,tick:A,width:72}),S,t.keys.map((g,w)=>s.jsx(U,{dataKey:g,stackId:"all",fill:m(g),maxBarSize:22,radius:w===t.keys.length-1?[0,4,4,0]:0,animationDuration:300},g))]}):s.jsxs(G,{data:h,margin:{left:0,right:0,top:8},barGap:4,barCategoryGap:"28%",children:[s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(P,{dataKey:"label",axisLine:!1,tickLine:!1,tick:A,tickMargin:8}),s.jsx(Q,{orientation:"right",axisLine:!1,tickLine:!1,tick:A,allowDecimals:r!==void 0,tickFormatter:g=>V(g,r),width:48}),S,t.keys.map(g=>s.jsx(U,{dataKey:g,fill:m(g),maxBarSize:32,radius:[4,4,0,0],animationDuration:300,className:D(v&&"cursor-pointer"),onClick:(w,O)=>j(O)},g))]})})}),e[0]=c,e[1]=d,e[2]=t.baseline,e[3]=t.categories,e[4]=t.keys,e[5]=t.title,e[6]=l,e[7]=o,e[8]=r,e[9]=n}else n=e[9];return n}function xt(a){return a.drill}function pt(a){return{label:a.label,...a.values}}function $t(a){return a.kind==="funnel"||a.kind==="bars"?"half":"full"}function Dt(a){const e=C.c(27),{section:t,threadLinks:d,showOrg:o,taskHref:c,range:r,onDrill:l}=a;switch(t.kind){case"stat":{let n;return e[0]!==l||e[1]!==t?(n=s.jsx(Ae,{section:t,onDrill:l}),e[0]=l,e[1]=t,e[2]=n):n=e[2],n}case"series":{let n;return e[3]!==r||e[4]!==t?(n=s.jsx(ze,{section:t,range:r}),e[3]=r,e[4]=t,e[5]=n):n=e[5],n}case"funnel":{let n;return e[6]!==l||e[7]!==t?(n=s.jsx(Ue,{section:t,onDrill:l}),e[6]=l,e[7]=t,e[8]=n):n=e[8],n}case"bars":{let n;return e[9]!==l||e[10]!==t?(n=s.jsx(He,{section:t,onDrill:l}),e[9]=l,e[10]=t,e[11]=n):n=e[11],n}case"breakdown":{let n;return e[12]!==l||e[13]!==t?(n=s.jsx(at,{section:t,onDrill:l}),e[12]=l,e[13]=t,e[14]=n):n=e[14],n}case"matrix":{let n;return e[15]!==l||e[16]!==t?(n=s.jsx(ot,{section:t,onDrill:l}),e[15]=l,e[16]=t,e[17]=n):n=e[17],n}case"categories":{let n;return e[18]!==l||e[19]!==t?(n=s.jsx(ft,{section:t,onDrill:l}),e[18]=l,e[19]=t,e[20]=n):n=e[20],n}case"table":{let n;return e[21]!==l||e[22]!==t||e[23]!==o||e[24]!==c||e[25]!==d?(n=s.jsx(Ze,{section:t,threadLinks:d,showOrg:o,taskHref:c,onDrill:l}),e[21]=l,e[22]=t,e[23]=o,e[24]=c,e[25]=d,e[26]=n):n=e[26],n}default:return t}}export{A,Tt as D,_ as M,Dt as S,$t as s};
|
|
1
|
+
import{c as C,j as s,b as B,gT as Y,m as D,F as fe,r as Z,d as xe,hD as q,ax as pe}from"./index-CHOxYhnv.js";import{c as J,b as G,B as U,C as ee}from"./chart-Y23GGTjZ.js";import{e as he,a as ge,b as W,T as je,d as be,c as ye}from"./table-BdoV93HO.js";import{i as ve}from"./AlertCircle-BHOdje2-.js";import{i as ke,n as Ne}from"./ArrowUp-BKp-bI0t.js";import{r as Se,Q as we,aE as Ce,ab as Te}from"./agent-icon-C-RKmmDR.js";import{a as te,T as se}from"./toggle-group-DWJu5FLK.js";import{B as X}from"./badge-lysbeP9P.js";import{l as ne,T as $e,P as De,S as Oe}from"./config-a5cd-EVs.js";import{C as H,X as P,Y as Q}from"./CartesianChart-DcsXR4up.js";import{A as Ie,a as Be}from"./AreaChart--NTdNKkN.js";function le(a){const e=C.c(8),{href:t,className:d,children:o}=a,c=xe();let r;e[0]!==t||e[1]!==c?(r=n=>{!t||n.button!==0||n.metaKey||n.ctrlKey||n.shiftKey||(n.preventDefault(),c({href:t}))},e[0]=t,e[1]=c,e[2]=r):r=e[2];let l;return e[3]!==o||e[4]!==d||e[5]!==t||e[6]!==r?(l=s.jsx("a",{href:t,className:d,onClick:r,children:o}),e[3]=o,e[4]=d,e[5]=t,e[6]=r,e[7]=l):l=e[7],l}const L=(a,e,t)=>a&&e?()=>a({drill:e,label:t}):void 0,F="cursor-pointer text-left transition-colors hover:bg-accent focus-ring",E=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"],A={fontSize:11,fill:"var(--muted-foreground)",opacity:.7};function ae(a){const e=Math.abs(a);return e<60?`${Math.round(a)}s`:e<3600?`${Math.round(a/60)}m`:e<86400?`${(a/3600).toFixed(1)}h`:`${(a/86400).toFixed(1)}d`}function M(a,e){return a===null||Number.isNaN(a)?"—":e==="s"?ae(a):e==="%"?`${Math.round(a*10)/10}%`:e==="USD"?`$${a.toFixed(2)}`:a.toLocaleString()}function V(a,e){return e==="s"?ae(a):e==="%"?`${a}%`:e==="USD"?`$${a}`:a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}const re=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/,Le=/^\d{4}-\d{2}-\d{2}$/;function Me(a,e){return typeof a=="number"?M(a,e):Le.test(a)?new Date(`${a}T12:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric"}):re.test(a)?q(a):a}function _(a){const e=C.c(20),{title:t,value:d,caption:o,aside:c,children:r,onClick:l}=a,n=l?"button":"section",i=l?"button":void 0,u=l&&F;let m;e[0]!==u?(m=D("surface @container flex h-full w-full min-w-0 flex-col gap-6 px-4 pt-4 pb-5",u),e[0]=u,e[1]=m):m=e[1];let x;e[2]!==t?(x=s.jsx("h3",{className:"text-sm text-foreground/70",children:t}),e[2]=t,e[3]=x):x=e[3];let f;e[4]!==d?(f=d!==void 0&&s.jsx("span",{className:"tnum whitespace-nowrap text-4xl font-normal text-foreground @max-xs:text-3xl @max-3xs:text-2xl",children:d}),e[4]=d,e[5]=f):f=e[5];let h;e[6]!==o||e[7]!==x||e[8]!==f?(h=s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[x,f,o]}),e[6]=o,e[7]=x,e[8]=f,e[9]=h):h=e[9];let p;e[10]!==c||e[11]!==h?(p=s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h,c]}),e[10]=c,e[11]=h,e[12]=p):p=e[12];let j;return e[13]!==n||e[14]!==r||e[15]!==l||e[16]!==i||e[17]!==m||e[18]!==p?(j=s.jsxs(n,{type:i,onClick:l,className:m,children:[p,r]}),e[13]=n,e[14]=r,e[15]=l,e[16]=i,e[17]=m,e[18]=p,e[19]=j):j=e[19],j}function ie(a){const e=C.c(9),{lane:t}=a,d=B();let o;e[0]!==t||e[1]!==d?(o=ne(t,d),e[0]=t,e[1]=d,e[2]=o):o=e[2];const{label:c,visual:r}=o,l=r.icon;let n;e[3]!==l||e[4]!==r.iconClassName?(n=s.jsx(l,{className:r.iconClassName}),e[3]=l,e[4]=r.iconClassName,e[5]=n):n=e[5];let i;return e[6]!==c||e[7]!==n?(i=s.jsxs(X,{variant:"muted",children:[n,c]}),e[6]=c,e[7]=n,e[8]=i):i=e[8],i}function R(a){const e=C.c(2),{children:t}=a;let d;return e[0]!==t?(d=s.jsx("div",{className:"flex h-20 items-center justify-center text-sm text-muted-foreground",children:t}),e[0]=t,e[1]=d):d=e[1],d}function _e(a){const e=C.c(21),{value:t,previous:d,unit:o,better:c}=a,r=B();if(t===null||d===null||d===void 0){let p;e[0]!==r?(p=r("taskBoard.analytics.noPrior"),e[0]=r,e[1]=p):p=e[1];let j;return e[2]!==p?(j=s.jsx("span",{className:"text-meta",children:p}),e[2]=p,e[3]=j):j=e[3],j}const l=Math.round((t-d)*10)/10,n=c==="down"?l<0:l>0;let i;e[4]!==l||e[5]!==r||e[6]!==o?(i=o==="%"?r("taskBoard.analytics.points",{n:String(Math.abs(l))}):M(Math.abs(l),o),e[4]=l,e[5]=r,e[6]=o,e[7]=i):i=e[7];const u=i;let m;e[8]!==u||e[9]!==c||e[10]!==l||e[11]!==n||e[12]!==r?(m=l===0?r("taskBoard.analytics.unchanged"):s.jsxs("span",{className:D("inline-flex items-center gap-0.5 font-medium",c&&(n?"text-success":"text-destructive")),children:[l>0?s.jsx(ke,{size:12}):s.jsx(Ne,{size:12}),u]}),e[8]=u,e[9]=c,e[10]=l,e[11]=n,e[12]=r,e[13]=m):m=e[13];let x;e[14]!==r?(x=r("taskBoard.analytics.vsPrevious"),e[14]=r,e[15]=x):x=e[15];let f;e[16]!==x?(f=s.jsx("span",{children:x}),e[16]=x,e[17]=f):f=e[17];let h;return e[18]!==m||e[19]!==f?(h=s.jsxs("span",{className:"text-meta inline-flex items-center gap-1",children:[m,f]}),e[18]=m,e[19]=f,e[20]=h):h=e[20],h}const Re={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",5:"lg:grid-cols-5",6:"lg:grid-cols-3",9:"lg:grid-cols-3"};function Ae(a){const e=C.c(10),{section:t,onDrill:d}=a,o=Re[t.values.length]??"lg:grid-cols-4";let c;e[0]!==o?(c=D("grid grid-cols-2 gap-4",o),e[0]=o,e[1]=c):c=e[1];let r;if(e[2]!==d||e[3]!==t.values){let n;e[5]!==d?(n=i=>s.jsx(_,{title:i.label,value:M(i.value,i.unit),onClick:L(d,i.drill,i.label),caption:s.jsxs(s.Fragment,{children:[i.detail&&s.jsx("span",{className:"text-sm text-muted-foreground",children:i.detail}),i.previous!==void 0&&s.jsx(_e,{value:i.value,previous:i.previous,unit:i.unit,better:i.better})]})},i.label),e[5]=d,e[6]=n):n=e[6],r=t.values.map(n),e[2]=d,e[3]=t.values,e[4]=r}else r=e[4];let l;return e[7]!==c||e[8]!==r?(l=s.jsx("div",{className:c,children:r}),e[7]=c,e[8]=r,e[9]=l):l=e[9],l}function Ke(a){return Array.from(new Set(a.flatMap(e=>Object.keys(e)))).filter(e=>e!=="t").sort()}function Ee(a,e){const t=e.filter(d=>a.some(o=>typeof o[d]=="number"&&o[d]!==0));return t.length>0?t:e}function Fe(a,e,t){const d=new Map(a.map(l=>[String(l.t??"").slice(0,10),l])),o=new Date(`${t.from.slice(0,10)}T00:00:00.000Z`),c=t.to.slice(0,10),r=[];for(;o.toISOString().slice(0,10)<=c;){const l=o.toISOString().slice(0,10);r.push(d.get(l)??{t:o.toISOString(),...Object.fromEntries(e.map(n=>[n,0]))}),o.setUTCDate(o.getUTCDate()+1)}return r}function oe(a){const e=C.c(17),{active:t,payload:d,unit:o,nameOf:c}=a,r=c===void 0?String:c;if(!t||!d?.length)return null;const l=d[0]?.payload,n=l?.t;let i;e[0]!==l?.label||e[1]!==n?(i=typeof n=="string"?new Date(n).toLocaleDateString(void 0,{month:"short",day:"numeric"}):String(l?.label??""),e[0]=l?.label,e[1]=n,e[2]=i):i=e[2];let u;e[3]!==i?(u=s.jsx("div",{className:"mb-1 text-xs text-muted-foreground",children:i}),e[3]=i,e[4]=u):u=e[4];let m;if(e[5]!==r||e[6]!==d||e[7]!==o){let h;e[9]!==r||e[10]!==o?(h=p=>s.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:p.color}}),s.jsx("span",{className:"text-muted-foreground",children:r(String(p.dataKey))}),s.jsx("span",{className:"tnum ml-auto pl-3 font-medium",children:M(typeof p.value=="number"?p.value:null,o)})]},String(p.dataKey)),e[9]=r,e[10]=o,e[11]=h):h=e[11],m=d.map(h),e[5]=r,e[6]=d,e[7]=o,e[8]=m}else m=e[8];let x;e[12]!==m?(x=s.jsx("div",{className:"flex flex-col gap-1",children:m}),e[12]=m,e[13]=x):x=e[13];let f;return e[14]!==u||e[15]!==x?(f=s.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",children:[u,x]}),e[14]=u,e[15]=x,e[16]=f):f=e[16],f}function ze(a){const e=C.c(27),{section:t,range:d}=a,o=B(),c=t.unit??void 0,r=c!=="%"&&c!=="s";let l;if(e[0]!==r||e[1]!==d||e[2]!==t.points||e[3]!==t.title||e[4]!==o||e[5]!==c){const n=Ke(t.points),i=r?Ee(t.points,n):n,u=y=>E[n.indexOf(y)%E.length],m=Object.fromEntries(i.map(y=>[y,{label:y,color:u(y)}])),f=(r&&d?Fe(t.points,n,d):t.points).map(Ge);let h;if(e[7]!==t.title){let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=/\W+/g,e[9]=y):y=e[9],h=t.title.replace(y,"-"),e[7]=t.title,e[8]=h}else h=e[8];const p=`analytics-${h}`;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[10]=j):j=e[10];const v=j;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(P,{dataKey:"label",axisLine:!1,tickLine:!1,tick:A,minTickGap:24,tickMargin:8}),e[11]=k):k=e[11];const b=k;let T;e[12]!==c?(T=c==="%"?[0,100]:[0,"auto"],e[12]=c,e[13]=T):T=e[13];const S=c!==void 0;let g;e[14]!==c?(g=y=>V(y,c),e[14]=c,e[15]=g):g=e[15];let w;e[16]!==T||e[17]!==S||e[18]!==g?(w=s.jsx(Q,{orientation:"right",axisLine:!1,tickLine:!1,tick:A,domain:T,allowDecimals:S,tickFormatter:g,width:48,tickCount:5}),e[16]=T,e[17]=S,e[18]=g,e[19]=w):w=e[19];const O=w;let $;e[20]!==r?($=r?{fill:"var(--muted)",opacity:.4}:{stroke:"var(--border)",strokeDasharray:"4 4"},e[20]=r,e[21]=$):$=e[21];let I;e[22]!==c?(I=y=>{const{active:z,payload:me}=y;return s.jsx(oe,{active:z,payload:me,unit:c})},e[22]=c,e[23]=I):I=e[23];let N;e[24]!==I||e[25]!==$?(N=s.jsx(ee,{cursor:$,content:I}),e[24]=I,e[25]=$,e[26]=N):N=e[26];const K=N;l=s.jsx(_,{title:t.title,aside:i.length>1&&s.jsx("ul",{className:"flex flex-wrap justify-end gap-x-3 gap-y-1",children:i.map(y=>s.jsxs("li",{className:"text-meta flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:u(y)}}),y]},y))}),children:f.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx(J,{role:"img","aria-label":t.title,className:"h-[140px] w-full md:h-[180px]",config:m,children:r?s.jsxs(G,{data:f,margin:{left:0,right:0,top:8},children:[v,b,O,K,i.map((y,z)=>s.jsx(U,{dataKey:y,stackId:"day",fill:u(y),maxBarSize:24,radius:z===i.length-1?[4,4,0,0]:0,animationDuration:300},y))]}):s.jsxs(Ie,{data:f,margin:{left:0,right:0,top:8},children:[i.length===1&&s.jsx("defs",{children:s.jsxs("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:u(i[0]??""),stopOpacity:.2}),s.jsx("stop",{offset:"100%",stopColor:u(i[0]??""),stopOpacity:0})]})}),v,b,O,K,i.map(y=>s.jsx(Be,{type:"linear",dataKey:y,stroke:u(y),strokeWidth:2,fill:i.length===1?`url(#${p})`:"none",dot:f.length===1?{r:4}:!1,activeDot:{r:4,stroke:"var(--background)",strokeWidth:2},connectNulls:!0,animationDuration:300},y))]})})}),e[0]=r,e[1]=d,e[2]=t.points,e[3]=t.title,e[4]=o,e[5]=c,e[6]=l}else l=e[6];return l}function Ge(a){return{...a,label:new Date(String(a.t??"")).toLocaleDateString(void 0,{month:"short",day:"numeric"})}}function ce(a){const e=C.c(25),{label:t,note:d,share:o,value:c,fill:r,color:l,onClick:n}=a,i=n?"button":"div",u=n?"button":void 0;let m;e[0]!==n?(m=n&&D(F,"-mx-2 w-[calc(100%+1rem)] rounded-md px-2"),e[0]=n,e[1]=m):m=e[1];let x;e[2]!==m?(x=D("flex h-10 w-full items-center gap-3",m),e[2]=m,e[3]=x):x=e[3];let f;e[4]!==d?(f=d&&s.jsx("span",{className:"text-meta ml-2",children:d}),e[4]=d,e[5]=f):f=e[5];let h;e[6]!==t||e[7]!==f?(h=s.jsxs("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:[t,f]}),e[6]=t,e[7]=f,e[8]=h):h=e[8];const p=`${Math.max(0,Math.min(100,r))}%`;let j;e[9]!==l||e[10]!==p?(j=s.jsx("span",{className:"h-1.5 w-20 shrink-0 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full",style:{width:p,backgroundColor:l}})}),e[9]=l,e[10]=p,e[11]=j):j=e[11];let v;e[12]!==o?(v=o!==void 0&&s.jsx("span",{className:"tnum w-16 shrink-0 text-right text-sm text-foreground/40",children:o}),e[12]=o,e[13]=v):v=e[13];let k;e[14]!==c?(k=s.jsx("span",{className:"tnum w-8 shrink-0 text-right text-sm text-foreground",children:c}),e[14]=c,e[15]=k):k=e[15];let b;return e[16]!==i||e[17]!==n||e[18]!==u||e[19]!==x||e[20]!==h||e[21]!==j||e[22]!==v||e[23]!==k?(b=s.jsx("li",{className:"border-b border-border/50 last:border-b-0",children:s.jsxs(i,{type:u,onClick:n,className:x,children:[h,j,v,k]})}),e[16]=i,e[17]=n,e[18]=u,e[19]=x,e[20]=h,e[21]=j,e[22]=v,e[23]=k,e[24]=b):b=e[24],b}function Ue(a){const e=C.c(17),{section:t,onDrill:d}=a,o=B(),c=t.stages[0]?.value??0,r=t.stages.at(-1)?.value??0;let l;e[0]!==r||e[1]!==c?(l=c?`${Math.round(100*r/c)}%`:"—",e[0]=r,e[1]=c,e[2]=l):l=e[2];let n;e[3]!==r||e[4]!==c||e[5]!==o?(n=c>0&&s.jsx("span",{className:"text-meta",children:o("taskBoard.analytics.funnelCaption",{end:String(r),start:String(c)})}),e[3]=r,e[4]=c,e[5]=o,e[6]=n):n=e[6];let i;e[7]!==d||e[8]!==t.stages||e[9]!==c||e[10]!==o?(i=c===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx("ol",{className:"flex flex-col",children:t.stages.map((m,x)=>{const f=t.stages[x-1]?.value,h=f===void 0?0:f-m.value;return s.jsx(ce,{label:m.label,note:h>0?o("taskBoard.analytics.dropped",{n:String(h)}):void 0,share:`${Math.round(100*m.value/c)}%`,value:m.value.toLocaleString(),fill:100*m.value/c,color:"var(--chart-2)",onClick:L(d,m.drill,m.label)},m.label)})}),e[7]=d,e[8]=t.stages,e[9]=c,e[10]=o,e[11]=i):i=e[11];let u;return e[12]!==t.title||e[13]!==l||e[14]!==n||e[15]!==i?(u=s.jsx(_,{title:t.title,value:l,caption:n,children:i}),e[12]=t.title,e[13]=l,e[14]=n,e[15]=i,e[16]=u):u=e[16],u}function He(a){const e=C.c(19),{section:t,onDrill:d}=a,o=B();let c;e[0]!==t.bars?(c=Math.max(0,...t.bars.map(Pe)),e[0]=t.bars,e[1]=c):c=e[1];const r=c;let l;e[2]!==t.total?.value?(l=t.total?.value.toLocaleString(),e[2]=t.total?.value,e[3]=l):l=e[3];let n;e[4]!==t.total?(n=t.total&&s.jsx("span",{className:"text-meta",children:t.total.label}),e[4]=t.total,e[5]=n):n=e[5];let i;e[6]!==t.unit?(i=t.unit&&s.jsx("span",{className:"text-meta",children:t.unit}),e[6]=t.unit,e[7]=i):i=e[7];let u;e[8]!==r||e[9]!==d||e[10]!==t.bars||e[11]!==o?(u=t.bars.length===0?s.jsx(R,{children:o("taskBoard.analytics.nobodyStepped")}):s.jsx("ul",{className:"flex flex-col",children:t.bars.map(x=>s.jsx(ce,{label:x.label,note:x.note,share:x.detail,value:x.value.toLocaleString(),fill:r?100*x.value/r:0,color:"var(--chart-1)",onClick:L(d,x.drill,x.label)},x.label))}),e[8]=r,e[9]=d,e[10]=t.bars,e[11]=o,e[12]=u):u=e[12];let m;return e[13]!==t.title||e[14]!==l||e[15]!==n||e[16]!==i||e[17]!==u?(m=s.jsx(_,{title:t.title,value:l,caption:n,aside:i,children:u}),e[13]=t.title,e[14]=l,e[15]=n,e[16]=i,e[17]=u,e[18]=m):m=e[18],m}function Pe(a){return a.value}function Qe(a,e){return`/${encodeURIComponent(a)}/${encodeURIComponent(e)}`}const Ve=new Set(["Org ID","Task ID"]),Xe=new Set(["Run outcome","Failure kind","Moved in by","State"]),Ye=new Set(["Error","Signature"]),We=new Set(["Org","Orgs"]);function Ze(a){const e=C.c(32),{section:t,threadLinks:d,showOrg:o,taskHref:c,onDrill:r}=a,l=B(),n=t.columns.indexOf("Org");let i;e[0]!==n||e[1]!==t.columns||e[2]!==d?(i=d&&n>=0?t.columns.indexOf("Thread"):-1,e[0]=n,e[1]=t.columns,e[2]=d,e[3]=i):i=e[3];const u=i,m=t.columns.indexOf("Task ID");let x;e[4]!==t.columns||e[5]!==c||e[6]!==m?(x=c&&m>=0?t.columns.indexOf("Task"):-1,e[4]=t.columns,e[5]=c,e[6]=m,e[7]=x):x=e[7];const f=x,h=t.columns;let p,j;if(e[8]!==r||e[9]!==n||e[10]!==t.columns||e[11]!==t.drills||e[12]!==t.rows||e[13]!==t.title||e[14]!==t.units||e[15]!==o||e[16]!==l||e[17]!==f||e[18]!==c||e[19]!==m||e[20]!==u){j=Symbol.for("react.early_return_sentinel");e:{let v;e[23]!==o?(v=S=>{const{c:g}=S;return!Ve.has(g)&&(o!==!1||!We.has(g))},e[23]=o,e[24]=v):v=e[24];const k=h.map(st).filter(v).sort(tt);let b;e[25]!==t.rows?(b=S=>{const{j:g}=S,w=t.rows.map(O=>O[g]).filter(et);return w.length>0&&w.every(Je)},e[25]=t.rows,e[26]=b):b=e[26];const T=new Set(k.filter(b).map(qe));if(t.rows.length===1&&k.every(S=>{const{c:g}=S;return T.has(g)})){let S;e[27]!==t.rows[0]?(S=t.rows[0]??[],e[27]=t.rows[0],e[28]=S):S=e[28];const g=S;let w;e[29]!==g||e[30]!==t.units?(w=O=>{const{c:$,j:I}=O,N=g[I];return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("dt",{className:"text-meta",children:$}),s.jsx("dd",{className:"tnum text-2xl text-foreground",children:typeof N=="number"?M(N,t.units?.[$]):"—"})]},$)},e[29]=g,e[30]=t.units,e[31]=w):w=e[31],j=s.jsx(Y,{title:t.title,children:s.jsx("dl",{className:"surface grid px-4 pt-4 pb-5 grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3 lg:grid-cols-[repeat(auto-fill,minmax(120px,1fr))]",children:k.map(w)})});break e}p=s.jsx(Y,{title:t.title,children:t.rows.length===0?s.jsx("p",{className:"surface px-4 py-4 text-sm text-muted-foreground",children:l("taskBoard.analytics.nothingToShow")}):s.jsx("div",{className:"surface max-h-[480px] overflow-auto",children:s.jsxs(he,{variant:"flush",children:[s.jsx(ge,{children:s.jsx(W,{children:k.map(S=>{const{c:g}=S;return s.jsx(je,{className:D("whitespace-nowrap first:pl-4 last:pr-4",T.has(g)&&"text-right"),children:g==="Thread"?"":g},g)})})}),s.jsx(be,{children:t.rows.map((S,g)=>s.jsx(W,{children:k.map((w,O)=>{const{c:$,j:I}=w,N=S[I],K=f===I?S[m]:null,y=O===0?L(r,t.drills?.[g]??void 0,String(N??"")):void 0;return s.jsx(ye,{className:D("max-w-md truncate text-sm first:pl-4 last:pr-4",T.has($)&&"text-right"),children:N==null?s.jsx("span",{className:"text-muted-foreground",children:"—"}):I===u?s.jsxs("a",{href:Qe(String(S[n]),String(N)),target:"_blank",rel:"noreferrer",className:"focus-ring inline-flex items-center gap-1 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:[l("taskBoard.analytics.openChat"),s.jsx(fe,{size:12})]}):y?s.jsx("button",{type:"button",onClick:y,className:"focus-ring text-left text-foreground underline-offset-2 hover:underline",children:String(N)}):K?s.jsx(le,{href:c?.(String(K)),className:"focus-ring text-foreground underline-offset-2 hover:underline",children:String(N)}):$==="Lane"&&typeof N=="string"?s.jsx(ie,{lane:N}):$==="Priority"&&typeof N=="string"?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(de,{drill:`priority:${N.toLowerCase()}`}),N]}):Xe.has($)?s.jsx(X,{variant:"muted",children:String(N)}):Ye.has($)?s.jsx("span",{title:String(N),className:"font-mono text-xs text-muted-foreground",children:String(N)}):s.jsx("span",{className:D("tnum",typeof N=="string"&&re.test(N)&&"text-muted-foreground"),children:Me(N,t.units?.[$])})},$)})},`${t.title}-${g}`))})]})})})}e[8]=r,e[9]=n,e[10]=t.columns,e[11]=t.drills,e[12]=t.rows,e[13]=t.title,e[14]=t.units,e[15]=o,e[16]=l,e[17]=f,e[18]=c,e[19]=m,e[20]=u,e[21]=p,e[22]=j}else p=e[21],j=e[22];return j!==Symbol.for("react.early_return_sentinel")?j:p}function qe(a){const{c:e}=a;return e}function Je(a){return typeof a=="number"}function et(a){return a!==null}function tt(a,e){return+(e.c==="Task")-+(a.c==="Task")}function st(a,e){return{c:a,j:e}}function Tt(a){const e=C.c(17),{section:t,taskHref:d}=a,o=B();let c;e[0]!==t.columns?(c=i=>t.columns.indexOf(i),e[0]=t.columns,e[1]=c):c=e[1];const r=c;if(t.rows.length===0){let i;e[2]!==o?(i=o("taskBoard.analytics.nothingToShow"),e[2]=o,e[3]=i):i=e[3];let u;return e[4]!==i?(u=s.jsx(R,{children:i}),e[4]=i,e[5]=u):u=e[5],u}let l;if(e[6]!==r||e[7]!==t.rows||e[8]!==o||e[9]!==d){let i;e[11]!==r||e[12]!==o||e[13]!==d?(i=u=>{const m=String(u[r("Task ID")]??""),x=u[r("Lane")],f=u[r("Picked up")],h=Number(u[r("Actions by people")]??0),p=Number(u[r("Failed QA")]??0),j=[typeof f=="string"?q(f):null,h>0&&o(h===1?"taskBoard.analytics.humanActionsOne":"taskBoard.analytics.humanActions",{n:String(h)})].filter(Boolean),v=s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx("span",{className:"truncate text-sm text-foreground",children:String(u[r("Task")]??"")}),s.jsx("span",{className:"text-meta truncate",children:j.join(" · ")})]}),p>0&&s.jsxs(X,{variant:"muted",children:[s.jsx(ve,{className:"text-destructive"}),p===1?o("taskBoard.analytics.failedQa"):o("taskBoard.analytics.failedQaTimes",{n:String(p)})]}),typeof x=="string"&&s.jsx(ie,{lane:x})]});return s.jsx("li",{className:"border-b border-border/50 last:border-b-0",children:d?s.jsx(le,{href:d(m),className:D(F,"flex items-center gap-3 rounded-md p-2"),children:v}):s.jsx("div",{className:"flex items-center gap-3 p-2",children:v})},m)},e[11]=r,e[12]=o,e[13]=d,e[14]=i):i=e[14],l=t.rows.map(i),e[6]=r,e[7]=t.rows,e[8]=o,e[9]=d,e[10]=l}else l=e[10];let n;return e[15]!==l?(n=s.jsx("ul",{className:"flex flex-col",children:l}),e[15]=l,e[16]=n):n=e[16],n}const nt={Type:Te,Priority:Ce,Tag:we,Sprint:Se,"Brief by":pe};function de(a){const e=C.c(10),{drill:t}=a;let d;e[0]!==t?(d=(t??"").split("&")[0]?.split(":")??[],e[0]=t,e[1]=d):d=e[1];const[o,c]=d;let r,l,n;if(e[2]!==o||e[3]!==c){n=Symbol.for("react.early_return_sentinel");e:{const u=o==="type"?Object.entries($e).find(x=>{const[f]=x;return f===c})?.[1]:o==="priority"?Object.entries(De).find(x=>{const[f]=x;return f===c})?.[1]:void 0;if(!u){n=null;break e}r=u.icon,l=D("size-3.5 shrink-0",u.iconClassName)}e[2]=o,e[3]=c,e[4]=r,e[5]=l,e[6]=n}else r=e[4],l=e[5],n=e[6];if(n!==Symbol.for("react.early_return_sentinel"))return n;let i;return e[7]!==r||e[8]!==l?(i=s.jsx(r,{className:l}),e[7]=r,e[8]=l,e[9]=i):i=e[9],i}function lt(a){const e=C.c(11),{value:t,metric:d,color:o}=a,c=t??0,r=`${d.unit==="%"?Math.min(100,c):0}%`;let l;e[0]!==o||e[1]!==r?(l=s.jsx("span",{className:"h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full",style:{width:r,backgroundColor:o}})}),e[0]=o,e[1]=r,e[2]=l):l=e[2];const n=t??null;let i;e[3]!==d.unit||e[4]!==n?(i=M(n,d.unit),e[3]=d.unit,e[4]=n,e[5]=i):i=e[5];let u;e[6]!==i?(u=s.jsx("span",{className:"tnum w-12 shrink-0 text-right text-sm text-foreground",children:i}),e[6]=i,e[7]=u):u=e[7];let m;return e[8]!==l||e[9]!==u?(m=s.jsxs("span",{className:"flex items-center gap-2",children:[l,u]}),e[8]=l,e[9]=u,e[10]=m):m=e[10],m}function at(a){const e=C.c(16),{section:t,onDrill:d}=a,o=B(),[c,r]=Z.useState(t.dimensions[0]?.label??"");let l;e[0]!==c||e[1]!==t.dimensions?(l=t.dimensions.find(f=>f.label===c)??t.dimensions[0],e[0]=c,e[1]=t.dimensions,e[2]=l):l=e[2];const n=l,i=`minmax(0,1fr) 56px repeat(${t.metrics.length}, minmax(96px, 168px))`;let u;e[3]!==n?.label||e[4]!==t.dimensions?(u=t.dimensions.length>1&&s.jsx(te,{type:"single",variant:"segmented",size:"sm",value:n?.label??"",onValueChange:f=>f&&r(f),children:t.dimensions.map(it)}),e[3]=n?.label,e[4]=t.dimensions,e[5]=u):u=e[5];let m;e[6]!==i||e[7]!==n||e[8]!==d||e[9]!==t.metrics||e[10]!==o?(m=!n||n.rows.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"text-meta grid items-center gap-4 border-b border-border/50 pb-2",style:{gridTemplateColumns:i},children:[s.jsx("span",{children:n.label}),s.jsx("span",{className:"text-right",children:o("taskBoard.analytics.tasks")}),t.metrics.map(rt)]}),n.rows.map(f=>{const h=L(d,f.drill,f.label),p=h?"button":"div";return s.jsxs(p,{type:h?"button":void 0,onClick:h,className:D("grid h-11 items-center gap-4 border-b border-border/50 last:border-b-0",h&&D(F,"-mx-2 w-[calc(100%+1rem)] rounded-md px-2")),style:{gridTemplateColumns:i},children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-sm text-foreground",children:[s.jsx(de,{drill:f.drill}),s.jsx("span",{className:"truncate",children:f.label})]}),s.jsx("span",{className:"tnum text-right text-sm text-muted-foreground",children:f.count.toLocaleString()}),t.metrics.map(j=>s.jsx(lt,{value:f.values[j.key],metric:j,color:j.better==="up"?"var(--success)":"var(--destructive)"},j.key))]},f.label)})]}),e[6]=i,e[7]=n,e[8]=d,e[9]=t.metrics,e[10]=o,e[11]=m):m=e[11];let x;return e[12]!==t.title||e[13]!==u||e[14]!==m?(x=s.jsx(_,{title:t.title,aside:u,children:m}),e[12]=t.title,e[13]=u,e[14]=m,e[15]=x):x=e[15],x}function rt(a){return s.jsx("span",{className:"text-right",children:a.label},a.key)}function it(a){const e=nt[a.label];return s.jsxs(se,{value:a.label,children:[e&&s.jsx(e,{}),a.label]},a.label)}const ue=3;function ot(a){const e=C.c(26),{section:t,onDrill:d}=a,o=B(),[c,r]=Z.useState(t.metrics[0]?.key??"");let l;e[0]!==c||e[1]!==t.metrics?(l=t.metrics.find(b=>b.key===c)??t.metrics[0],e[0]=c,e[1]=t.metrics,e[2]=l):l=e[2];const n=l;if(!n)return null;const i=n.better==="up"?"var(--success)":"var(--destructive)";let u;e[3]!==t.cols||e[4]!==t.rows?(u=t.rows.length===t.cols.length&&t.rows.every((b,T)=>t.cols[T]===b),e[3]=t.cols,e[4]=t.rows,e[5]=u):u=e[5];const m=u,x=`minmax(96px, 1fr) repeat(${t.cols.length}, minmax(72px, 1fr))`,f=t.title;let h;e[6]!==o?(h=o("taskBoard.analytics.matrixCaption",{n:String(ue)}),e[6]=o,e[7]=h):h=e[7];let p;e[8]!==h?(p=s.jsx("span",{className:"text-meta",children:h}),e[8]=h,e[9]=p):p=e[9];let j;e[10]!==n.key||e[11]!==t.metrics?(j=t.metrics.length>1&&s.jsx(te,{type:"single",variant:"segmented",size:"sm",value:n.key,onValueChange:b=>b&&r(b),children:t.metrics.map(dt)}),e[10]=n.key,e[11]=t.metrics,e[12]=j):j=e[12];let v;e[13]!==x||e[14]!==n||e[15]!==d||e[16]!==t||e[17]!==m||e[18]!==o||e[19]!==i?(v=t.rows.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("div",{className:"grid min-w-fit gap-1",style:{gridTemplateColumns:x},children:[s.jsxs("span",{className:"text-meta self-end pb-1",children:[t.rowLabel," / ",t.colLabel]}),t.cols.map(ct),t.rows.map((b,T)=>s.jsx(ut,{row:b,section:t,metric:n,tint:i,onDrill:d,upTo:m?T:void 0},b))]})}),e[13]=x,e[14]=n,e[15]=d,e[16]=t,e[17]=m,e[18]=o,e[19]=i,e[20]=v):v=e[20];let k;return e[21]!==t.title||e[22]!==p||e[23]!==j||e[24]!==v?(k=s.jsx(_,{title:f,caption:p,aside:j,children:v}),e[21]=t.title,e[22]=p,e[23]=j,e[24]=v,e[25]=k):k=e[25],k}function ct(a){return s.jsx("span",{className:"text-meta self-end pb-1 text-center",children:a},a)}function dt(a){return s.jsx(se,{value:a.key,children:a.label},a.key)}function ut(a){const e=C.c(22),{row:t,section:d,metric:o,tint:c,onDrill:r,upTo:l}=a,n=B();let i;e[0]!==t?(i=s.jsx("span",{className:"flex items-center truncate pr-2 text-sm text-foreground",children:t}),e[0]=t,e[1]=i):i=e[1];let u;if(e[2]!==o||e[3]!==r||e[4]!==t||e[5]!==d.cells||e[6]!==d.cols||e[7]!==n||e[8]!==c||e[9]!==l){let x;e[11]!==o||e[12]!==r||e[13]!==t||e[14]!==d.cells||e[15]!==n||e[16]!==c||e[17]!==l?(x=(f,h)=>{if(l!==void 0&&h>l)return s.jsx("span",{},f);const p=d.cells.find(b=>b.row===t&&b.col===f),j=p?.values[o.key]??null;if(!p)return s.jsx("span",{className:"flex h-14 items-center justify-center rounded-md bg-muted/40 text-sm text-muted-foreground",children:"—"},f);const v=j===null?0:Math.min(100,o.unit==="%"?j:0),k=L(r,p.drill,t===f?t:`${t} · ${f}`);return s.jsxs("button",{type:"button",onClick:k,disabled:!k,className:D("flex h-14 flex-col items-center justify-center rounded-md transition-opacity focus-ring",k&&"cursor-pointer hover:opacity-80",p.count<ue&&"opacity-50"),style:{backgroundColor:`color-mix(in oklch, ${c} ${Math.round(8+v*.5)}%, var(--muted))`},children:[s.jsx("span",{className:"tnum text-sm font-medium text-foreground",children:M(j,o.unit)}),s.jsx("span",{className:"text-meta",children:p.count===1?n("taskBoard.analytics.drillCountOne"):n("taskBoard.analytics.drillCount",{n:String(p.count)})})]},f)},e[11]=o,e[12]=r,e[13]=t,e[14]=d.cells,e[15]=n,e[16]=c,e[17]=l,e[18]=x):x=e[18],u=d.cols.map(x),e[2]=o,e[3]=r,e[4]=t,e[5]=d.cells,e[6]=d.cols,e[7]=n,e[8]=c,e[9]=l,e[10]=u}else u=e[10];let m;return e[19]!==i||e[20]!==u?(m=s.jsxs(s.Fragment,{children:[i,u]}),e[19]=i,e[20]=u,e[21]=m):m=e[21],m}function mt(){const a=C.c(2),e=B();let t;return a[0]!==e?(t=d=>Object.hasOwn(Oe,d)?ne(d,e).label:d,a[0]=e,a[1]=t):t=a[1],t}function ft(a){const e=C.c(21),{section:t,onDrill:d}=a,o=B(),c=mt(),r=t.unit??void 0,l=t.layout==="stacked";let n;if(e[0]!==c||e[1]!==d||e[2]!==t.baseline||e[3]!==t.categories||e[4]!==t.keys||e[5]!==t.title||e[6]!==l||e[7]!==o||e[8]!==r){let i;e[10]!==t.baseline?(i=g=>g!==t.baseline,e[10]=t.baseline,e[11]=i):i=e[11];const u=t.keys.filter(i),m=g=>g===t.baseline?"var(--border)":E[u.indexOf(g)%E.length]??"",x=Object.fromEntries(t.keys.map(g=>[g,{label:c(g),color:m(g)}]));let f;e[12]!==t.categories?(f=t.categories.map(pt),e[12]=t.categories,e[13]=f):f=e[13];const h=f;let p;e[14]!==d||e[15]!==t.categories?(p=g=>{const w=t.categories[g];w&&L(d,w.drill,w.label)?.()},e[14]=d,e[15]=t.categories,e[16]=p):p=e[16];const j=p,v=t.categories.some(xt)&&!!d,k=l?Math.max(120,t.categories.length*44+32):220;let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b={fill:"var(--muted)",opacity:.4},e[17]=b):b=e[17];let T;e[18]!==c||e[19]!==r?(T=s.jsx(ee,{cursor:b,content:g=>{const{active:w,payload:O}=g;return s.jsx(oe,{active:w,payload:O,unit:r,nameOf:c})}}),e[18]=c,e[19]=r,e[20]=T):T=e[20];const S=T;n=s.jsx(_,{title:t.title,aside:s.jsx("ul",{className:"flex flex-wrap justify-end gap-x-3 gap-y-1",children:t.keys.map(g=>s.jsxs("li",{className:"text-meta flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:m(g)}}),c(g)]},g))}),children:h.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx(J,{role:"img","aria-label":t.title,className:"w-full",style:{height:k},config:x,children:l?s.jsxs(G,{data:h,layout:"vertical",margin:{left:0,right:8,top:0},children:[s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,horizontal:!1}),s.jsx(P,{type:"number",axisLine:!1,tickLine:!1,tick:A,tickFormatter:g=>V(g,r)}),s.jsx(Q,{type:"category",dataKey:"label",axisLine:!1,tickLine:!1,tick:A,width:72}),S,t.keys.map((g,w)=>s.jsx(U,{dataKey:g,stackId:"all",fill:m(g),maxBarSize:22,radius:w===t.keys.length-1?[0,4,4,0]:0,animationDuration:300},g))]}):s.jsxs(G,{data:h,margin:{left:0,right:0,top:8},barGap:4,barCategoryGap:"28%",children:[s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(P,{dataKey:"label",axisLine:!1,tickLine:!1,tick:A,tickMargin:8}),s.jsx(Q,{orientation:"right",axisLine:!1,tickLine:!1,tick:A,allowDecimals:r!==void 0,tickFormatter:g=>V(g,r),width:48}),S,t.keys.map(g=>s.jsx(U,{dataKey:g,fill:m(g),maxBarSize:32,radius:[4,4,0,0],animationDuration:300,className:D(v&&"cursor-pointer"),onClick:(w,O)=>j(O)},g))]})})}),e[0]=c,e[1]=d,e[2]=t.baseline,e[3]=t.categories,e[4]=t.keys,e[5]=t.title,e[6]=l,e[7]=o,e[8]=r,e[9]=n}else n=e[9];return n}function xt(a){return a.drill}function pt(a){return{label:a.label,...a.values}}function $t(a){return a.kind==="funnel"||a.kind==="bars"?"half":"full"}function Dt(a){const e=C.c(27),{section:t,threadLinks:d,showOrg:o,taskHref:c,range:r,onDrill:l}=a;switch(t.kind){case"stat":{let n;return e[0]!==l||e[1]!==t?(n=s.jsx(Ae,{section:t,onDrill:l}),e[0]=l,e[1]=t,e[2]=n):n=e[2],n}case"series":{let n;return e[3]!==r||e[4]!==t?(n=s.jsx(ze,{section:t,range:r}),e[3]=r,e[4]=t,e[5]=n):n=e[5],n}case"funnel":{let n;return e[6]!==l||e[7]!==t?(n=s.jsx(Ue,{section:t,onDrill:l}),e[6]=l,e[7]=t,e[8]=n):n=e[8],n}case"bars":{let n;return e[9]!==l||e[10]!==t?(n=s.jsx(He,{section:t,onDrill:l}),e[9]=l,e[10]=t,e[11]=n):n=e[11],n}case"breakdown":{let n;return e[12]!==l||e[13]!==t?(n=s.jsx(at,{section:t,onDrill:l}),e[12]=l,e[13]=t,e[14]=n):n=e[14],n}case"matrix":{let n;return e[15]!==l||e[16]!==t?(n=s.jsx(ot,{section:t,onDrill:l}),e[15]=l,e[16]=t,e[17]=n):n=e[17],n}case"categories":{let n;return e[18]!==l||e[19]!==t?(n=s.jsx(ft,{section:t,onDrill:l}),e[18]=l,e[19]=t,e[20]=n):n=e[20],n}case"table":{let n;return e[21]!==l||e[22]!==t||e[23]!==o||e[24]!==c||e[25]!==d?(n=s.jsx(Ze,{section:t,threadLinks:d,showOrg:o,taskHref:c,onDrill:l}),e[21]=l,e[22]=t,e[23]=o,e[24]=c,e[25]=d,e[26]=n):n=e[26],n}default:return t}}export{A,Tt as D,_ as M,Dt as S,$t as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o,j as r}from"./index-CHOxYhnv.js";import{O as m}from"./api-keys-CtF2T7md.js";import{R as p}from"./require-capability-DR3oejOb.js";import"./AlertCircle-BHOdje2-.js";import"./agent-icon-C-RKmmDR.js";import"./Tool01-C_vFDQiZ.js";import"./ArrowUp-BKp-bI0t.js";import"./ArrowLeft-DwK9IQqr.js";import"./LinkBroken01-Beajkv8Y.js";import"./BookOpen01-CCzJ3iHg.js";import"./Globe04-CpMO0Sfn.js";import"./CheckCircle-CpYSXUlJ.js";import"./ChevronUp-yM6kuF7B.js";import"./ChevronSelectorVertical-BfPzQt1M.js";import"./UserSquare-DomA7Npc.js";import"./CreditCard01-ClPhtnpy.js";import"./SwitchHorizontal01-Be5wnM3M.js";import"./Key01-BUefgO6r.js";import"./Minus-CkHBDYFP.js";import"./Monitor01-6Z9BL4ul.js";import"./Sun-CBa0lZzX.js";import"./Play-QQIqJKj8.js";import"./Plus-jqQtsDrV.js";import"./SearchMd--9oaPr0p.js";import"./ShoppingBag01-DWT7jnvZ.js";import"./Trash01-D4h16nnS.js";import"./Upload01-DLWP4rJI.js";import"./Users01-DQk985Hj.js";import"./XClose-DsOcImLD.js";import"./Zap-CXSu8byh.js";import"./empty-state-BwFbOlsH.js";import"./label-B6kbb_qI.js";import"./badge-lysbeP9P.js";import"./index-Dk-oU4JL.js";import"./select-oOpcW8y8.js";import"./index-BdQq_4o_.js";import"./index-BZdAVrUU.js";import"./use-mcp-client-CAI0PiRc.js";import"./auth-DQhl82rC.js";import"./use-mcp-tools-DTs06gsh.js";import"./checkbox-BgJ_rDKP.js";import"./search-input-CxzHzt1i.js";import"./integration-icon-CM5LyK_z.js";import"./tool-set-selector-BA1yDuio.js";import"./use-infinite-scroll-6BCwcRG9.js";import"./useSuspenseInfiniteQuery-BEaEPCKW.js";import"./infiniteQueryObserver-Sb4-Zoh0.js";import"./collection-search-Cr2_Tgzy.js";import"./connection-CV7VyK2j.js";import"./url-slug-C5-8vP9h.js";import"./use-connection-D0bmffUK.js";import"./access-gate-COWmI5bk.js";import"./capability-load-error-zDoTf-tr.js";function pi(){const t=o.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(p,{capability:"api-keys:manage",area:"api-keys",children:r.jsx(m,{})}),t[0]=i):i=t[0],i}export{pi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T,a4 as Ne,T as De,K as Le,i as Ge,q as Ye,e as Qe,m as $e,j as i,b as B,r as L,h as Me,W as at,as as ot,dN as rt,i2 as ct,gT as dt,gD as qe,aN as ut,aM as ft,aJ as mt,aH as pt,aI as gt,aL as xt,aK as yt,b5 as ht,B as Q,t as Ee,ge as jt,x as He,aT as Ve,w as Ue,I as We,y as Je,v as Xe,D as Ze}from"./index-CWKxkTwy.js";import{i as Kt}from"./AlertCircle-Bj2NuHQY.js";import{e as vt}from"./agent-icon-BwEytdmh.js";import{i as et}from"./Key01-BTIXWKkS.js";import{s as tt}from"./Plus-Bq5KiXqn.js";import{s as Ct}from"./Trash01-Dt7pyOwE.js";import{E as bt}from"./empty-state-DMtSEEQ1.js";import{L as ze}from"./label-BXSXPHWU.js";import{B as Ie}from"./badge-DbKUf3vA.js";import{I as St,R as Nt}from"./index-BLdRRqFU.js";import{c as _t,b as Dt,a as wt,d as At,S as Tt}from"./select-CWL8C0Pw.js";import{u as we}from"./use-mcp-client-CmWEhN6T.js";import{u as kt}from"./use-mcp-tools-Bfew76Ae.js";import{t as It}from"./ChevronUp-JSFuaLqF.js";import{C as Et}from"./checkbox-CCw3an34.js";import{S as Ot}from"./search-input-Dc1w2xyv.js";import{I as Pt}from"./integration-icon-C1bpkd7s.js";import{T as zt}from"./tool-set-selector-qnchAzSg.js";import{b as Lt}from"./use-connection-CLoaxXGr.js";function Fe(s,e){if(s?.isError)throw new Error(s.content?.[0]?.text??e);if(!s.structuredContent)throw new Error(e);return s.structuredContent}function $t(s){const e=T.c(11),{org:l}=Ne();let n;e[0]!==l.id||e[1]!==l.slug?(n={connectionId:De,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=n):n=e[2];const t=we(n);let o;e[3]!==l.id?(o=Le.apiKeysList(l.id),e[3]=l.id,e[4]=o):o=e[4];let a;e[5]!==t?(a=async()=>{const r=await t.callTool({name:"API_KEY_LIST",arguments:{}});return Fe(r,"Failed to list API keys").items},e[5]=t,e[6]=a):a=e[6];const d=s?.enabled??!0;let c;return e[7]!==o||e[8]!==a||e[9]!==d?(c={queryKey:o,queryFn:a,staleTime:3e4,enabled:d},e[7]=o,e[8]=a,e[9]=d,e[10]=c):c=e[10],Ge(c)}function Ft(){const s=T.c(11),{org:e}=Ne();let l;s[0]!==e.id||s[1]!==e.slug?(l={connectionId:De,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=l):l=s[2];const n=we(l),t=Ye();let o;s[3]!==n?(o=async c=>{const r=await n.callTool({name:"API_KEY_CREATE",arguments:c});return Fe(r,"Failed to create API key")},s[3]=n,s[4]=o):o=s[4];let a;s[5]!==e.id||s[6]!==t?(a=()=>{t.invalidateQueries({queryKey:Le.apiKeysList(e.id)})},s[5]=e.id,s[6]=t,s[7]=a):a=s[7];let d;return s[8]!==o||s[9]!==a?(d={mutationFn:o,onSuccess:a},s[8]=o,s[9]=a,s[10]=d):d=s[10],Qe(d)}function Rt(){const s=T.c(11),{org:e}=Ne();let l;s[0]!==e.id||s[1]!==e.slug?(l={connectionId:De,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=l):l=s[2];const n=we(l),t=Ye();let o;s[3]!==n?(o=async c=>{const r=await n.callTool({name:"API_KEY_DELETE",arguments:{keyId:c}});return Fe(r,"Failed to delete API key")},s[3]=n,s[4]=o):o=s[4];let a;s[5]!==e.id||s[6]!==t?(a=()=>{t.invalidateQueries({queryKey:Le.apiKeysList(e.id)})},s[5]=e.id,s[6]=t,s[7]=a):a=s[7];let d;return s[8]!==o||s[9]!==a?(d={mutationFn:o,onSuccess:a},s[8]=o,s[9]=a,s[10]=d):d=s[10],Qe(d)}function qt(s){const e=T.c(8);let l,n;e[0]!==s?({className:l,...n}=s,e[0]=s,e[1]=l,e[2]=n):(l=e[1],n=e[2]);let t;e[3]!==l?(t=$e("grid gap-3",l),e[3]=l,e[4]=t):t=e[4];let o;return e[5]!==n||e[6]!==t?(o=i.jsx(Nt,{"data-slot":"radio-group",className:t,...n}),e[5]=n,e[6]=t,e[7]=o):o=e[7],o}function Bt(s){const e=T.c(9);let l,n;e[0]!==s?({className:l,...n}=s,e[0]=s,e[1]=l,e[2]=n):(l=e[1],n=e[2]);let t;e[3]!==l?(t=$e("group relative inline-flex size-4 shrink-0 items-center justify-center rounded-full shadow-[inset_0_0_0_1.5px_var(--input)] transition-[background-color,box-shadow] duration-150 hover:shadow-[inset_0_0_0_1.5px_color-mix(in_oklch,var(--foreground)_30%,var(--input))] data-[state=checked]:bg-primary data-[state=checked]:shadow-[inset_0_0_0_1.5px_var(--primary)] aria-invalid:shadow-[inset_0_0_0_1.5px_var(--destructive)] focus-ring disabled:opacity-50 motion-reduce:transition-none",l),e[3]=l,e[4]=t):t=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("span",{className:"bg-primary-foreground size-1.5 scale-0 rounded-full transition-transform duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-data-[state=checked]:scale-100 motion-reduce:transition-none"}),e[5]=o):o=e[5];let a;return e[6]!==n||e[7]!==t?(a=i.jsx(St,{"data-slot":"radio-group-item",className:t,...n,children:o}),e[6]=n,e[7]=t,e[8]=a):a=e[8],a}const Be=["7","30","90","365","never"],Gt=86400;function Yt(s){return s.filter(e=>e.annotations?.readOnlyHint===!0).map(e=>e.name)}const _e="self";function Qt(s,e,l){return s==="full"?{"*":["*"]}:s==="read-only"?{[_e]:e}:Object.fromEntries(Object.entries(l).filter(([,n])=>n.length>0))}function st(s){return Object.values(s).reduce((e,l)=>e+l.length,0)}function Mt(s){return s==="never"?void 0:Number(s)*Gt}function Ht(s){const e=n=>{const t=s[n];return Array.isArray(t)?t:[]};if(e("*").includes("*")||e("self").includes("*"))return{kind:"full"};const l=new Set;for(const n of Object.keys(s))for(const t of e(n))t.startsWith("!")||l.add(`${n}:${t}`);return{kind:"tools",count:l.size}}function Vt(s,e){return s.name.toLowerCase().includes(e)||(s.description?.toLowerCase().includes(e)??!1)}function it(s){const e=T.c(56),{resource:l,title:n,icon:t,tools:o,selected:a,onChange:d,query:c,onExpand:r}=s,u=B(),[p,g]=L.useState(!1);let f;e[0]!==c||e[1]!==n?(f=!c||n.toLowerCase().includes(c),e[0]=c,e[1]=n,e[2]=f):f=e[2];const m=f;let j;e[3]!==c||e[4]!==m||e[5]!==o?(j=o===null?null:m?o:o.filter(A=>Vt(A,c)),e[3]=c,e[4]=m,e[5]=o,e[6]=j):j=e[6];const y=j,x=p||!!c&&(y?.length??0)>0,S=!m&&!y?.length;let K;e[7]!==a?(K=new Set(a),e[7]=a,e[8]=K):K=e[8];const h=K,C=o!==null&&o.length>0&&a.length>=o.length;let v;e[9]!==r||e[10]!==p?(v=()=>{p||r?.(),g(!p)},e[9]=r,e[10]=p,e[11]=v):v=e[11];const b=v;let N;e[12]!==d||e[13]!==r||e[14]!==a.length||e[15]!==o?(N=()=>{if(a.length>0){d([]);return}if(o===null){r?.(),g(!0);return}d(o.map(Ut))},e[12]=d,e[13]=r,e[14]=a.length,e[15]=o,e[16]=N):N=e[16];const _=N;if(S)return null;let w;e[17]!==x?(w=x?i.jsx(It,{size:16,className:"shrink-0 text-muted-foreground"}):i.jsx(ot,{size:16,className:"shrink-0 text-muted-foreground"}),e[17]=x,e[18]=w):w=e[18];let D;e[19]!==t||e[20]!==n?(D=i.jsx(Pt,{icon:t,name:n,size:"xs"}),e[19]=t,e[20]=n,e[21]=D):D=e[21];let k;e[22]!==n?(k=i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n}),e[22]=n,e[23]=k):k=e[23];let I;e[24]!==a.length||e[25]!==u||e[26]!==o?(I=(o!==null||a.length>0)&&i.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:o===null?a.length:u("settings.apiKeys.toolsGroupCount",{count:a.length,total:o.length})}),e[24]=a.length,e[25]=u,e[26]=o,e[27]=I):I=e[27];let F;e[28]!==x||e[29]!==w||e[30]!==D||e[31]!==k||e[32]!==I||e[33]!==b?(F=i.jsxs("button",{type:"button",onClick:b,"aria-expanded":x,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-3 py-2.5 pl-3 text-left",children:[w,D,k,I]}),e[28]=x,e[29]=w,e[30]=D,e[31]=k,e[32]=I,e[33]=b,e[34]=F):F=e[34];const R=C?!0:a.length>0?"indeterminate":!1;let E;e[35]!==u||e[36]!==n?(E=u("settings.apiKeys.toolsSelectGroup",{name:n}),e[35]=u,e[36]=n,e[37]=E):E=e[37];let O;e[38]!==R||e[39]!==E||e[40]!==_?(O=i.jsx(Et,{checked:R,onCheckedChange:_,"aria-label":E}),e[38]=R,e[39]=E,e[40]=_,e[41]=O):O=e[41];let P;e[42]!==F||e[43]!==O?(P=i.jsxs("div",{className:"flex items-center gap-3 pr-4 hover:bg-accent",children:[F,O]}),e[42]=F,e[43]=O,e[44]=P):P=e[44];let z;e[45]!==x||e[46]!==d||e[47]!==l||e[48]!==a||e[49]!==h||e[50]!==u||e[51]!==y?(z=x&&i.jsx("div",{className:"space-y-1 border-t border-border p-1",children:y===null?i.jsx("div",{className:"flex justify-center py-4",children:i.jsx(Me,{className:"size-4 text-muted-foreground"})}):y.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:u("settings.apiKeys.toolsNone")}):y.map(A=>i.jsx(zt,{connectionId:l,tool:A,isSelected:h.has(A.name),onToggle:()=>d(h.has(A.name)?a.filter(M=>M!==A.name):[...a,A.name]),badge:A.annotations?.readOnlyHint===!0&&i.jsx(Ie,{variant:"muted",size:"sm",children:u("settings.apiKeys.readOnlyBadge")})},A.name))}),e[45]=x,e[46]=d,e[47]=l,e[48]=a,e[49]=h,e[50]=u,e[51]=y,e[52]=z):z=e[52];let $;return e[53]!==P||e[54]!==z?($=i.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-card",children:[P,z]}),e[53]=P,e[54]=z,e[55]=$):$=e[55],$}function Ut(s){return s.name}function Wt(s){const e=T.c(21),{connection:l,selected:n,onChange:t,query:o}=s,{org:a}=Ne();let d;e[0]!==a.id||e[1]!==a.slug?(d={connectionId:De,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=d):d=e[2];const c=we(d),[r,u]=L.useState(!1);let p;e[3]!==c||e[4]!==l.id||e[5]!==a.id?(p=rt(a.id,"CONNECTIONS",l.id,c),e[3]=c,e[4]=l.id,e[5]=a.id,e[6]=p):p=e[6];let g;e[7]!==r||e[8]!==p?(g={...p,enabled:r},e[7]=r,e[8]=p,e[9]=g):g=e[9];const{data:f}=Ge(g);let m;e[10]!==f?(m=f?f.item?.tools??[]:null,e[10]=f,e[11]=m):m=e[11];const j=m;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=()=>u(!0),e[12]=y):y=e[12];let x;return e[13]!==l.icon||e[14]!==l.id||e[15]!==l.title||e[16]!==t||e[17]!==o||e[18]!==n||e[19]!==j?(x=i.jsx(it,{resource:l.id,title:l.title,icon:l.icon,tools:j,selected:n,onChange:t,query:o,onExpand:y}),e[13]=l.icon,e[14]=l.id,e[15]=l.title,e[16]=t,e[17]=o,e[18]=n,e[19]=j,e[20]=x):x=e[20],x}function Jt(s){const e=T.c(14),{toolSet:l,onChange:n,query:t}=s,{org:o}=Ne();let a;e[0]!==o.id?(a=at.SELF(o.id),e[0]=o.id,e[1]=a):a=e[1];const d=a,c=Lt();let r;if(e[2]!==n||e[3]!==t||e[4]!==d||e[5]!==c||e[6]!==l){let u;e[8]!==d?(u=f=>f.id!==d,e[8]=d,e[9]=u):u=e[9];const p=c.filter(u);let g;e[10]!==n||e[11]!==t||e[12]!==l?(g=f=>i.jsx(Wt,{connection:f,selected:l[f.id]??[],onChange:m=>n(f.id,m),query:t},f.id),e[10]=n,e[11]=t,e[12]=l,e[13]=g):g=e[13],r=p.map(g),e[2]=n,e[3]=t,e[4]=d,e[5]=c,e[6]=l,e[7]=r}else r=e[7];return r}function Xt(s){const e=T.c(41),{studioTools:l,toolSet:n,onChange:t}=s,o=B(),[a,d]=L.useState("");let c;e[0]!==a?(c=a.trim().toLowerCase(),e[0]=a,e[1]=c):c=e[1];const r=L.useDeferredValue(c);let u;e[2]!==t||e[3]!==n?(u=(_,w)=>t({...n,[_]:w}),e[2]=t,e[3]=n,e[4]=u):u=e[4];const p=u;let g;e[5]!==o?(g=o("settings.apiKeys.toolsSearch"),e[5]=o,e[6]=g):g=e[6];let f;e[7]!==a||e[8]!==g?(f=i.jsx(Ot,{value:a,onChange:d,placeholder:g,className:"flex-1"}),e[7]=a,e[8]=g,e[9]=f):f=e[9];let m;e[10]!==o||e[11]!==n?(m=o("settings.apiKeys.toolsSelected",{count:st(n)}),e[10]=o,e[11]=n,e[12]=m):m=e[12];let j;e[13]!==m?(j=i.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:m}),e[13]=m,e[14]=j):j=e[14];let y;e[15]!==f||e[16]!==j?(y=i.jsxs("div",{className:"flex items-center gap-3",children:[f,j]}),e[15]=f,e[16]=j,e[17]=y):y=e[17];let x;e[18]!==o?(x=o("settings.apiKeys.studioTools"),e[18]=o,e[19]=x):x=e[19];let S;e[20]!==n?(S=n[_e]??[],e[20]=n,e[21]=S):S=e[21];let K;e[22]!==p?(K=_=>p(_e,_),e[22]=p,e[23]=K):K=e[23];let h;e[24]!==r||e[25]!==l||e[26]!==K||e[27]!==x||e[28]!==S?(h=i.jsx(it,{resource:_e,title:x,icon:"/favicon.svg",tools:l,selected:S,onChange:K,query:r}),e[24]=r,e[25]=l,e[26]=K,e[27]=x,e[28]=S,e[29]=h):h=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx("div",{className:"flex justify-center py-3",children:i.jsx(Me,{className:"size-4 text-muted-foreground"})}),e[30]=C):C=e[30];let v;e[31]!==r||e[32]!==p||e[33]!==n?(v=i.jsx(L.Suspense,{fallback:C,children:i.jsx(Jt,{toolSet:n,onChange:p,query:r})}),e[31]=r,e[32]=p,e[33]=n,e[34]=v):v=e[34];let b;e[35]!==h||e[36]!==v?(b=i.jsxs("div",{className:"max-h-80 space-y-2 overflow-y-auto",children:[h,v]}),e[35]=h,e[36]=v,e[37]=b):b=e[37];let N;return e[38]!==b||e[39]!==y?(N=i.jsxs("div",{className:"space-y-2",children:[y,b]}),e[38]=b,e[39]=y,e[40]=N):N=e[40],N}function nt(s){const e=T.c(6),{error:l}=s,n=B();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Kt,{size:16}),e[0]=t):t=e[0];let o;e[1]!==l.message||e[2]!==n?(o=n("settings.apiKeys.failedToLoadError",{error:l.message}),e[1]=l.message,e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==o?(a=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[t,i.jsx("span",{className:"text-sm font-medium",children:o})]}),e[4]=o,e[5]=a):a=e[5],a}function Zt(s){const e=T.c(31),{apiKey:l,onDelete:n}=s,t=B(),o=Ht(l.permissions),a=l.expiresAt?new Date(l.expiresAt):null,[d]=L.useState(es),c=a!==null&&a.getTime()<=d,r=a?.toLocaleDateString()??"",u="flex items-center justify-between gap-4 px-4 py-3",p="flex items-center gap-3 min-w-0";let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(et,{size:16,className:"text-muted-foreground"})}),e[0]=g):g=e[0];const f="min-w-0";let m;e[1]!==l.name?(m=i.jsx("span",{className:"font-medium text-sm truncate",children:l.name}),e[1]=l.name,e[2]=m):m=e[2];const j=o.kind==="full"?i.jsx(Ie,{variant:"warning",size:"sm",children:t("settings.apiKeys.accessFull")}):i.jsx(Ie,{variant:"muted",size:"sm",children:t("settings.apiKeys.toolCount",{count:o.count})});let y;e[3]!==c||e[4]!==t?(y=c&&i.jsx(Ie,{variant:"destructive",size:"sm",children:t("settings.apiKeys.expired")}),e[3]=c,e[4]=t,e[5]=y):y=e[5];let x;e[6]!==m||e[7]!==j||e[8]!==y?(x=i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m,j,y]}),e[6]=m,e[7]=j,e[8]=y,e[9]=x):x=e[9];const S="text-xs text-muted-foreground mt-0.5";let K;e[10]!==l.createdAt||e[11]!==t?(K=t("settings.apiKeys.createdAt",{date:new Date(l.createdAt).toLocaleDateString()}),e[10]=l.createdAt,e[11]=t,e[12]=K):K=e[12];const h=" · ",C=l.expiresAt?c?t("settings.apiKeys.expiredOn",{date:r}):t("settings.apiKeys.expiresOn",{date:r}):t("settings.apiKeys.neverExpires");let v;e[13]!==K||e[14]!==C?(v=i.jsxs("p",{className:S,children:[K,h,C]}),e[13]=K,e[14]=C,e[15]=v):v=e[15];let b;e[16]!==v||e[17]!==x?(b=i.jsxs("div",{className:f,children:[x,v]}),e[16]=v,e[17]=x,e[18]=b):b=e[18];let N;e[19]!==b||e[20]!==g?(N=i.jsxs("div",{className:p,children:[g,b]}),e[19]=b,e[20]=g,e[21]=N):N=e[21];let _;e[22]!==t?(_=t("settings.apiKeys.deleteKey"),e[22]=t,e[23]=_):_=e[23];let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx(Ct,{size:14}),e[24]=w):w=e[24];let D;e[25]!==n||e[26]!==_?(D=i.jsx(Q,{variant:"ghost-destructive",size:"icon",className:"shrink-0",onClick:n,"aria-label":_,children:w}),e[25]=n,e[26]=_,e[27]=D):D=e[27];let k;return e[28]!==N||e[29]!==D?(k=i.jsxs("li",{className:u,children:[N,D]}),e[28]=N,e[29]=D,e[30]=k):k=e[30],k}function es(){return Date.now()}function ts(s){const e=T.c(15),{onCreate:l}=s,n=B();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(et,{}),e[0]=t):t=e[0];let o;e[1]!==n?(o=n("settings.apiKeys.emptyTitle"),e[1]=n,e[2]=o):o=e[2];let a;e[3]!==n?(a=n("settings.apiKeys.emptyDescription"),e[3]=n,e[4]=a):a=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(tt,{size:14}),e[5]=d):d=e[5];let c;e[6]!==n?(c=n("settings.apiKeys.newKey"),e[6]=n,e[7]=c):c=e[7];let r;e[8]!==l||e[9]!==c?(r=i.jsxs(Q,{onClick:l,size:"sm",children:[d,c]}),e[8]=l,e[9]=c,e[10]=r):r=e[10];let u;return e[11]!==o||e[12]!==a||e[13]!==r?(u=i.jsx(jt,{children:i.jsx(bt,{size:"inline",icon:t,title:o,description:a,children:r})}),e[11]=o,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function ss(s){const e=T.c(40),{createdKey:l,onClose:n}=s,t=B(),o=l!==null;let a;e[0]!==n?(a=b=>!b&&n(),e[0]=n,e[1]=a):a=e[1];let d;e[2]!==t?(d=t("settings.apiKeys.createdTitle"),e[2]=t,e[3]=d):d=e[3];let c;e[4]!==d?(c=i.jsx(He,{children:d}),e[4]=d,e[5]=c):c=e[5];let r;e[6]!==t?(r=t("settings.apiKeys.createdDescription"),e[6]=t,e[7]=r):r=e[7];let u;e[8]!==r?(u=i.jsx(Ve,{children:r}),e[8]=r,e[9]=u):u=e[9];let p;e[10]!==c||e[11]!==u?(p=i.jsxs(Ue,{children:[c,u]}),e[10]=c,e[11]=u,e[12]=p):p=e[12];const g=l?.key??"";let f;e[13]!==g?(f=i.jsx(We,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let m;e[15]!==l||e[16]!==t?(m=()=>{l&&(navigator.clipboard?.writeText(l.key),Ee.success(t("settings.apiKeys.copied")))},e[15]=l,e[16]=t,e[17]=m):m=e[17];let j;e[18]!==t?(j=t("settings.apiKeys.copyKey"),e[18]=t,e[19]=j):j=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx(vt,{size:14}),e[20]=y):y=e[20];let x;e[21]!==m||e[22]!==j?(x=i.jsx(Q,{type:"button",variant:"outline",size:"icon",onClick:m,"aria-label":j,children:y}),e[21]=m,e[22]=j,e[23]=x):x=e[23];let S;e[24]!==x||e[25]!==f?(S=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,e[25]=f,e[26]=S):S=e[26];let K;e[27]!==t?(K=t("settings.apiKeys.done"),e[27]=t,e[28]=K):K=e[28];let h;e[29]!==n||e[30]!==K?(h=i.jsx(Je,{children:i.jsx(Q,{onClick:n,children:K})}),e[29]=n,e[30]=K,e[31]=h):h=e[31];let C;e[32]!==S||e[33]!==h||e[34]!==p?(C=i.jsxs(Xe,{className:"sm:max-w-lg",children:[p,S,h]}),e[32]=S,e[33]=h,e[34]=p,e[35]=C):C=e[35];let v;return e[36]!==o||e[37]!==C||e[38]!==a?(v=i.jsx(Ze,{open:o,onOpenChange:a,children:C}),e[36]=o,e[37]=C,e[38]=a,e[39]=v):v=e[39],v}function is(s){const e=T.c(131),{onClose:l,onCreated:n}=s,t=B(),{org:o}=Ne();let a;e[0]!==o.id||e[1]!==o.slug?(a={connectionId:De,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=a):a=e[2];const d=we(a);let c;e[3]!==d?(c={client:d},e[3]=d,e[4]=c):c=e[4];const r=kt(c),u=[...r.data?.tools??[]].sort(ls),p=Yt(u),[g,f]=L.useState(""),[m,j]=L.useState("read-only"),[y,x]=L.useState(null),[S,K]=L.useState("90"),h=Ft(),C=y??{[_e]:p},v=m!=="full",b=!v||r.isSuccess,N=m==="full"||(m==="read-only"?p.length:st(C))>0;let _;e[5]!==h.isPending||e[6]!==N||e[7]!==g||e[8]!==b?(_=!!g.trim()&&b&&N&&!h.isPending,e[5]=h.isPending,e[6]=N,e[7]=g,e[8]=b,e[9]=_):_=e[9];const w=_,D=async function(G){if(G.preventDefault(),!!w)try{const Y=await h.mutateAsync({name:g.trim(),permissions:Qt(m,p,C),expiresIn:Mt(S)});l(),n(Y)}catch(Y){const Re=Y;Ee.error(Re instanceof Error?Re.message:t("settings.apiKeys.failedToCreateKey"))}},k="read-only";let I;e[10]!==t?(I=t("settings.apiKeys.accessReadOnly"),e[10]=t,e[11]=I):I=e[11];const F=t("settings.apiKeys.accessReadOnlyDescription",{count:p.length});let R;e[12]!==I||e[13]!==F?(R={value:k,label:I,description:F},e[12]=I,e[13]=F,e[14]=R):R=e[14];let E;e[15]!==t?(E=t("settings.apiKeys.accessCustom"),e[15]=t,e[16]=E):E=e[16];let O;e[17]!==t?(O=t("settings.apiKeys.accessCustomDescription"),e[17]=t,e[18]=O):O=e[18];let P;e[19]!==O||e[20]!==E?(P={value:"custom",label:E,description:O},e[19]=O,e[20]=E,e[21]=P):P=e[21];let z;e[22]!==t?(z=t("settings.apiKeys.accessFull"),e[22]=t,e[23]=z):z=e[23];let $;e[24]!==t?($=t("settings.apiKeys.accessFullDescription"),e[24]=t,e[25]=$):$=e[25];let A;e[26]!==z||e[27]!==$?(A={value:"full",label:z,description:$},e[26]=z,e[27]=$,e[28]=A):A=e[28];let M;e[29]!==P||e[30]!==A||e[31]!==R?(M=[R,P,A],e[29]=P,e[30]=A,e[31]=R,e[32]=M):M=e[32];const H=M;let V;e[33]!==t?(V=t("settings.apiKeys.expiryDays",{days:7}),e[33]=t,e[34]=V):V=e[34];let U;e[35]!==t?(U=t("settings.apiKeys.expiryDays",{days:30}),e[35]=t,e[36]=U):U=e[36];let W;e[37]!==t?(W=t("settings.apiKeys.expiryDays",{days:90}),e[37]=t,e[38]=W):W=e[38];let J;e[39]!==t?(J=t("settings.apiKeys.expiryYear"),e[39]=t,e[40]=J):J=e[40];let X;e[41]!==t?(X=t("settings.apiKeys.expiryNever"),e[41]=t,e[42]=X):X=e[42];let Ae;e[43]!==V||e[44]!==U||e[45]!==W||e[46]!==J||e[47]!==X?(Ae={7:V,30:U,90:W,365:J,never:X},e[43]=V,e[44]=U,e[45]=W,e[46]=J,e[47]=X,e[48]=Ae):Ae=e[48];const Oe=Ae;let Z;e[49]!==t?(Z=t("settings.apiKeys.nameLabel"),e[49]=t,e[50]=Z):Z=e[50];let ee;e[51]!==Z?(ee=i.jsx(ze,{htmlFor:"api-key-name",children:Z}),e[51]=Z,e[52]=ee):ee=e[52];let te;e[53]!==f?(te=q=>f(q.target.value),e[53]=f,e[54]=te):te=e[54];let se;e[55]!==t?(se=t("settings.apiKeys.namePlaceholder"),e[55]=t,e[56]=se):se=e[56];let ie;e[57]!==g||e[58]!==te||e[59]!==se?(ie=i.jsx(We,{id:"api-key-name",value:g,onChange:te,placeholder:se,autoComplete:"off",required:!0}),e[57]=g,e[58]=te,e[59]=se,e[60]=ie):ie=e[60];let ne;e[61]!==ee||e[62]!==ie?(ne=i.jsxs("div",{className:"space-y-1.5",children:[ee,ie]}),e[61]=ee,e[62]=ie,e[63]=ne):ne=e[63];let le;e[64]!==t?(le=t("settings.apiKeys.accessLabel"),e[64]=t,e[65]=le):le=e[65];let ae;e[66]!==le?(ae=i.jsx(ze,{children:le}),e[66]=le,e[67]=ae):ae=e[67];let oe;e[68]!==H||e[69]!==j?(oe=q=>{const G=H.find(Y=>Y.value===q);G&&j(G.value)},e[68]=H,e[69]=j,e[70]=oe):oe=e[70];let re;e[71]!==H?(re=H.map(ns),e[71]=H,e[72]=re):re=e[72];let ce;e[73]!==m||e[74]!==oe||e[75]!==re?(ce=i.jsx(qt,{value:m,onValueChange:oe,className:"gap-2",children:re}),e[73]=m,e[74]=oe,e[75]=re,e[76]=ce):ce=e[76];let de;e[77]!==ae||e[78]!==ce?(de=i.jsxs("div",{className:"space-y-1.5",children:[ae,ce]}),e[77]=ae,e[78]=ce,e[79]=de):de=e[79];let ue;e[80]!==v||e[81]!==t||e[82]!==r.isError?(ue=v&&r.isError&&i.jsx("p",{className:"text-xs text-destructive",children:t("settings.apiKeys.toolsLoadFailed")}),e[80]=v,e[81]=t,e[82]=r.isError,e[83]=ue):ue=e[83];let fe;e[84]!==m||e[85]!==C||e[86]!==x||e[87]!==u||e[88]!==r.isSuccess?(fe=m==="custom"&&r.isSuccess&&i.jsx(Xt,{studioTools:u,toolSet:C,onChange:x}),e[84]=m,e[85]=C,e[86]=x,e[87]=u,e[88]=r.isSuccess,e[89]=fe):fe=e[89];let me;e[90]!==t?(me=t("settings.apiKeys.expiryLabel"),e[90]=t,e[91]=me):me=e[91];let pe;e[92]!==me?(pe=i.jsx(ze,{htmlFor:"api-key-expiry",children:me}),e[92]=me,e[93]=pe):pe=e[93];let ge;e[94]!==K?(ge=q=>{const G=Be.find(Y=>Y===q);G&&K(G)},e[94]=K,e[95]=ge):ge=e[95];let Te;e[96]===Symbol.for("react.memo_cache_sentinel")?(Te=i.jsx(Dt,{id:"api-key-expiry",className:"w-full",children:i.jsx(wt,{})}),e[96]=Te):Te=e[96];let xe;e[97]!==Oe?(xe=Be.map(q=>i.jsx(_t,{value:q,children:Oe[q]},q)),e[97]=Oe,e[98]=xe):xe=e[98];let ye;e[99]!==xe?(ye=i.jsx(At,{children:xe}),e[99]=xe,e[100]=ye):ye=e[100];let he;e[101]!==S||e[102]!==ge||e[103]!==ye?(he=i.jsxs(Tt,{value:S,onValueChange:ge,children:[Te,ye]}),e[101]=S,e[102]=ge,e[103]=ye,e[104]=he):he=e[104];let je;e[105]!==pe||e[106]!==he?(je=i.jsxs("div",{className:"space-y-1.5",children:[pe,he]}),e[105]=pe,e[106]=he,e[107]=je):je=e[107];const lt=h.isPending;let Ke;e[108]!==t?(Ke=t("settings.apiKeys.cancelButton"),e[108]=t,e[109]=Ke):Ke=e[109];let ve;e[110]!==h.isPending||e[111]!==l||e[112]!==Ke?(ve=i.jsx(Q,{type:"button",variant:"outline",onClick:l,disabled:lt,children:Ke}),e[110]=h.isPending,e[111]=l,e[112]=Ke,e[113]=ve):ve=e[113];const Pe=!w;let Ce;e[114]!==h.isPending||e[115]!==t?(Ce=h.isPending?t("settings.apiKeys.creatingButton"):t("settings.apiKeys.createButton"),e[114]=h.isPending,e[115]=t,e[116]=Ce):Ce=e[116];let be;e[117]!==Pe||e[118]!==Ce?(be=i.jsx(Q,{type:"submit",disabled:Pe,children:Ce}),e[117]=Pe,e[118]=Ce,e[119]=be):be=e[119];let Se;e[120]!==ve||e[121]!==be?(Se=i.jsxs(Je,{children:[ve,be]}),e[120]=ve,e[121]=be,e[122]=Se):Se=e[122];let ke;return e[123]!==D||e[124]!==ne||e[125]!==de||e[126]!==ue||e[127]!==fe||e[128]!==je||e[129]!==Se?(ke=i.jsxs("form",{onSubmit:D,className:"space-y-4",children:[ne,de,ue,fe,je,Se]}),e[123]=D,e[124]=ne,e[125]=de,e[126]=ue,e[127]=fe,e[128]=je,e[129]=Se,e[130]=ke):ke=e[130],ke}function ns(s){return i.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-md border border-border px-3 py-2.5 hover:bg-accent has-[[data-state=checked]]:border-primary",children:[i.jsx(Bt,{value:s.value,className:"mt-0.5"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"block text-sm font-medium",children:s.label}),i.jsx("span",{className:$e("block text-xs",s.value==="full"?"text-warning":"text-muted-foreground"),children:s.description})]})]},s.value)}function ls(s,e){return s.name.localeCompare(e.name)}function as(s){const e=T.c(23),{open:l,onOpenChange:n,onCreated:t}=s,o=B();let a;e[0]!==o?(a=o("settings.apiKeys.newKeyTitle"),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=i.jsx(He,{children:a}),e[2]=a,e[3]=d):d=e[3];let c;e[4]!==o?(c=o("settings.apiKeys.newKeyDescription"),e[4]=o,e[5]=c):c=e[5];let r;e[6]!==c?(r=i.jsx(Ve,{children:c}),e[6]=c,e[7]=r):r=e[7];let u;e[8]!==d||e[9]!==r?(u=i.jsxs(Ue,{children:[d,r]}),e[8]=d,e[9]=r,e[10]=u):u=e[10];let p;e[11]!==n?(p=()=>n(!1),e[11]=n,e[12]=p):p=e[12];let g;e[13]!==t||e[14]!==p?(g=i.jsx(is,{onClose:p,onCreated:t}),e[13]=t,e[14]=p,e[15]=g):g=e[15];let f;e[16]!==u||e[17]!==g?(f=i.jsxs(Xe,{className:"sm:max-w-xl",children:[u,g]}),e[16]=u,e[17]=g,e[18]=f):f=e[18];let m;return e[19]!==n||e[20]!==l||e[21]!==f?(m=i.jsx(Ze,{open:l,onOpenChange:n,children:f}),e[19]=n,e[20]=l,e[21]=f,e[22]=m):m=e[22],m}function os(){const s=B(),{data:e,isLoading:l,error:n}=$t(),t=Rt(),[o,a]=L.useState(!1),[d,c]=L.useState(null),[r,u]=L.useState(null),p=e??[];async function g(){if(r)try{await t.mutateAsync(r.id),Ee.success(s("settings.apiKeys.keyDeleted",{name:r.name}))}catch(f){Ee.error(f instanceof Error?f.message:s("settings.apiKeys.failedToDeleteKey"))}finally{u(null)}}return i.jsxs(dt,{title:s("settings.apiKeys.sectionTitle"),description:s("settings.apiKeys.sectionDescription"),actions:p.length>0?i.jsxs(Q,{onClick:()=>a(!0),size:"sm",children:[i.jsx(tt,{size:14}),s("settings.apiKeys.newKey")]}):void 0,children:[l?i.jsx(qe,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:s("settings.apiKeys.loading")})}):n&&p.length===0?i.jsx(nt,{error:n}):p.length===0?i.jsx(ts,{onCreate:()=>a(!0)}):i.jsx(qe,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:p.map(f=>i.jsx(Zt,{apiKey:f,onDelete:()=>u(f)},f.id))})}),i.jsx(as,{open:o,onOpenChange:a,onCreated:c}),i.jsx(ss,{createdKey:d,onClose:()=>c(null)}),i.jsx(ut,{open:r!==null,onOpenChange:f=>{f||u(null)},children:i.jsxs(ft,{children:[i.jsxs(mt,{children:[i.jsx(pt,{children:s("settings.apiKeys.deleteTitle",{name:r?.name??""})}),i.jsx(gt,{children:s("settings.apiKeys.deleteDescription")})]}),i.jsxs(xt,{children:[i.jsx(yt,{children:s("settings.apiKeys.cancelButton")}),i.jsx(ht,{onClick:g,children:s("settings.apiKeys.deleteKey")})]})]})})]})}function ws(){const s=T.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(ct,{group:"connect",errorFallback:rs,children:i.jsx(os,{})}),s[0]=e):e=s[0],e}function rs(s){const{error:e}=s;return i.jsx(nt,{error:e??new Error("Failed to load API keys")})}export{os as A,ws as O,$t as a,Ft as u};
|
|
1
|
+
import{c as T,a4 as Ne,T as De,K as Le,i as Ge,q as Ye,e as Qe,m as $e,j as i,b as B,r as L,h as Me,W as at,as as ot,dN as rt,i2 as ct,gT as dt,gD as qe,aN as ut,aM as ft,aJ as mt,aH as pt,aI as gt,aL as xt,aK as yt,b5 as ht,B as Q,t as Ee,ge as jt,x as He,aT as Ve,w as Ue,I as We,y as Je,v as Xe,D as Ze}from"./index-CHOxYhnv.js";import{i as Kt}from"./AlertCircle-BHOdje2-.js";import{e as vt}from"./agent-icon-C-RKmmDR.js";import{i as et}from"./Key01-BUefgO6r.js";import{s as tt}from"./Plus-jqQtsDrV.js";import{s as Ct}from"./Trash01-D4h16nnS.js";import{E as bt}from"./empty-state-BwFbOlsH.js";import{L as ze}from"./label-B6kbb_qI.js";import{B as Ie}from"./badge-lysbeP9P.js";import{I as St,R as Nt}from"./index-Dk-oU4JL.js";import{c as _t,b as Dt,a as wt,d as At,S as Tt}from"./select-oOpcW8y8.js";import{u as we}from"./use-mcp-client-CAI0PiRc.js";import{u as kt}from"./use-mcp-tools-DTs06gsh.js";import{t as It}from"./ChevronUp-yM6kuF7B.js";import{C as Et}from"./checkbox-BgJ_rDKP.js";import{S as Ot}from"./search-input-CxzHzt1i.js";import{I as Pt}from"./integration-icon-CM5LyK_z.js";import{T as zt}from"./tool-set-selector-BA1yDuio.js";import{b as Lt}from"./use-connection-D0bmffUK.js";function Fe(s,e){if(s?.isError)throw new Error(s.content?.[0]?.text??e);if(!s.structuredContent)throw new Error(e);return s.structuredContent}function $t(s){const e=T.c(11),{org:l}=Ne();let n;e[0]!==l.id||e[1]!==l.slug?(n={connectionId:De,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=n):n=e[2];const t=we(n);let o;e[3]!==l.id?(o=Le.apiKeysList(l.id),e[3]=l.id,e[4]=o):o=e[4];let a;e[5]!==t?(a=async()=>{const r=await t.callTool({name:"API_KEY_LIST",arguments:{}});return Fe(r,"Failed to list API keys").items},e[5]=t,e[6]=a):a=e[6];const d=s?.enabled??!0;let c;return e[7]!==o||e[8]!==a||e[9]!==d?(c={queryKey:o,queryFn:a,staleTime:3e4,enabled:d},e[7]=o,e[8]=a,e[9]=d,e[10]=c):c=e[10],Ge(c)}function Ft(){const s=T.c(11),{org:e}=Ne();let l;s[0]!==e.id||s[1]!==e.slug?(l={connectionId:De,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=l):l=s[2];const n=we(l),t=Ye();let o;s[3]!==n?(o=async c=>{const r=await n.callTool({name:"API_KEY_CREATE",arguments:c});return Fe(r,"Failed to create API key")},s[3]=n,s[4]=o):o=s[4];let a;s[5]!==e.id||s[6]!==t?(a=()=>{t.invalidateQueries({queryKey:Le.apiKeysList(e.id)})},s[5]=e.id,s[6]=t,s[7]=a):a=s[7];let d;return s[8]!==o||s[9]!==a?(d={mutationFn:o,onSuccess:a},s[8]=o,s[9]=a,s[10]=d):d=s[10],Qe(d)}function Rt(){const s=T.c(11),{org:e}=Ne();let l;s[0]!==e.id||s[1]!==e.slug?(l={connectionId:De,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=l):l=s[2];const n=we(l),t=Ye();let o;s[3]!==n?(o=async c=>{const r=await n.callTool({name:"API_KEY_DELETE",arguments:{keyId:c}});return Fe(r,"Failed to delete API key")},s[3]=n,s[4]=o):o=s[4];let a;s[5]!==e.id||s[6]!==t?(a=()=>{t.invalidateQueries({queryKey:Le.apiKeysList(e.id)})},s[5]=e.id,s[6]=t,s[7]=a):a=s[7];let d;return s[8]!==o||s[9]!==a?(d={mutationFn:o,onSuccess:a},s[8]=o,s[9]=a,s[10]=d):d=s[10],Qe(d)}function qt(s){const e=T.c(8);let l,n;e[0]!==s?({className:l,...n}=s,e[0]=s,e[1]=l,e[2]=n):(l=e[1],n=e[2]);let t;e[3]!==l?(t=$e("grid gap-3",l),e[3]=l,e[4]=t):t=e[4];let o;return e[5]!==n||e[6]!==t?(o=i.jsx(Nt,{"data-slot":"radio-group",className:t,...n}),e[5]=n,e[6]=t,e[7]=o):o=e[7],o}function Bt(s){const e=T.c(9);let l,n;e[0]!==s?({className:l,...n}=s,e[0]=s,e[1]=l,e[2]=n):(l=e[1],n=e[2]);let t;e[3]!==l?(t=$e("group relative inline-flex size-4 shrink-0 items-center justify-center rounded-full shadow-[inset_0_0_0_1.5px_var(--input)] transition-[background-color,box-shadow] duration-150 hover:shadow-[inset_0_0_0_1.5px_color-mix(in_oklch,var(--foreground)_30%,var(--input))] data-[state=checked]:bg-primary data-[state=checked]:shadow-[inset_0_0_0_1.5px_var(--primary)] aria-invalid:shadow-[inset_0_0_0_1.5px_var(--destructive)] focus-ring disabled:opacity-50 motion-reduce:transition-none",l),e[3]=l,e[4]=t):t=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("span",{className:"bg-primary-foreground size-1.5 scale-0 rounded-full transition-transform duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-data-[state=checked]:scale-100 motion-reduce:transition-none"}),e[5]=o):o=e[5];let a;return e[6]!==n||e[7]!==t?(a=i.jsx(St,{"data-slot":"radio-group-item",className:t,...n,children:o}),e[6]=n,e[7]=t,e[8]=a):a=e[8],a}const Be=["7","30","90","365","never"],Gt=86400;function Yt(s){return s.filter(e=>e.annotations?.readOnlyHint===!0).map(e=>e.name)}const _e="self";function Qt(s,e,l){return s==="full"?{"*":["*"]}:s==="read-only"?{[_e]:e}:Object.fromEntries(Object.entries(l).filter(([,n])=>n.length>0))}function st(s){return Object.values(s).reduce((e,l)=>e+l.length,0)}function Mt(s){return s==="never"?void 0:Number(s)*Gt}function Ht(s){const e=n=>{const t=s[n];return Array.isArray(t)?t:[]};if(e("*").includes("*")||e("self").includes("*"))return{kind:"full"};const l=new Set;for(const n of Object.keys(s))for(const t of e(n))t.startsWith("!")||l.add(`${n}:${t}`);return{kind:"tools",count:l.size}}function Vt(s,e){return s.name.toLowerCase().includes(e)||(s.description?.toLowerCase().includes(e)??!1)}function it(s){const e=T.c(56),{resource:l,title:n,icon:t,tools:o,selected:a,onChange:d,query:c,onExpand:r}=s,u=B(),[p,g]=L.useState(!1);let f;e[0]!==c||e[1]!==n?(f=!c||n.toLowerCase().includes(c),e[0]=c,e[1]=n,e[2]=f):f=e[2];const m=f;let j;e[3]!==c||e[4]!==m||e[5]!==o?(j=o===null?null:m?o:o.filter(A=>Vt(A,c)),e[3]=c,e[4]=m,e[5]=o,e[6]=j):j=e[6];const y=j,x=p||!!c&&(y?.length??0)>0,S=!m&&!y?.length;let K;e[7]!==a?(K=new Set(a),e[7]=a,e[8]=K):K=e[8];const h=K,C=o!==null&&o.length>0&&a.length>=o.length;let v;e[9]!==r||e[10]!==p?(v=()=>{p||r?.(),g(!p)},e[9]=r,e[10]=p,e[11]=v):v=e[11];const b=v;let N;e[12]!==d||e[13]!==r||e[14]!==a.length||e[15]!==o?(N=()=>{if(a.length>0){d([]);return}if(o===null){r?.(),g(!0);return}d(o.map(Ut))},e[12]=d,e[13]=r,e[14]=a.length,e[15]=o,e[16]=N):N=e[16];const _=N;if(S)return null;let w;e[17]!==x?(w=x?i.jsx(It,{size:16,className:"shrink-0 text-muted-foreground"}):i.jsx(ot,{size:16,className:"shrink-0 text-muted-foreground"}),e[17]=x,e[18]=w):w=e[18];let D;e[19]!==t||e[20]!==n?(D=i.jsx(Pt,{icon:t,name:n,size:"xs"}),e[19]=t,e[20]=n,e[21]=D):D=e[21];let k;e[22]!==n?(k=i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n}),e[22]=n,e[23]=k):k=e[23];let I;e[24]!==a.length||e[25]!==u||e[26]!==o?(I=(o!==null||a.length>0)&&i.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:o===null?a.length:u("settings.apiKeys.toolsGroupCount",{count:a.length,total:o.length})}),e[24]=a.length,e[25]=u,e[26]=o,e[27]=I):I=e[27];let F;e[28]!==x||e[29]!==w||e[30]!==D||e[31]!==k||e[32]!==I||e[33]!==b?(F=i.jsxs("button",{type:"button",onClick:b,"aria-expanded":x,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-3 py-2.5 pl-3 text-left",children:[w,D,k,I]}),e[28]=x,e[29]=w,e[30]=D,e[31]=k,e[32]=I,e[33]=b,e[34]=F):F=e[34];const R=C?!0:a.length>0?"indeterminate":!1;let E;e[35]!==u||e[36]!==n?(E=u("settings.apiKeys.toolsSelectGroup",{name:n}),e[35]=u,e[36]=n,e[37]=E):E=e[37];let O;e[38]!==R||e[39]!==E||e[40]!==_?(O=i.jsx(Et,{checked:R,onCheckedChange:_,"aria-label":E}),e[38]=R,e[39]=E,e[40]=_,e[41]=O):O=e[41];let P;e[42]!==F||e[43]!==O?(P=i.jsxs("div",{className:"flex items-center gap-3 pr-4 hover:bg-accent",children:[F,O]}),e[42]=F,e[43]=O,e[44]=P):P=e[44];let z;e[45]!==x||e[46]!==d||e[47]!==l||e[48]!==a||e[49]!==h||e[50]!==u||e[51]!==y?(z=x&&i.jsx("div",{className:"space-y-1 border-t border-border p-1",children:y===null?i.jsx("div",{className:"flex justify-center py-4",children:i.jsx(Me,{className:"size-4 text-muted-foreground"})}):y.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:u("settings.apiKeys.toolsNone")}):y.map(A=>i.jsx(zt,{connectionId:l,tool:A,isSelected:h.has(A.name),onToggle:()=>d(h.has(A.name)?a.filter(M=>M!==A.name):[...a,A.name]),badge:A.annotations?.readOnlyHint===!0&&i.jsx(Ie,{variant:"muted",size:"sm",children:u("settings.apiKeys.readOnlyBadge")})},A.name))}),e[45]=x,e[46]=d,e[47]=l,e[48]=a,e[49]=h,e[50]=u,e[51]=y,e[52]=z):z=e[52];let $;return e[53]!==P||e[54]!==z?($=i.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-card",children:[P,z]}),e[53]=P,e[54]=z,e[55]=$):$=e[55],$}function Ut(s){return s.name}function Wt(s){const e=T.c(21),{connection:l,selected:n,onChange:t,query:o}=s,{org:a}=Ne();let d;e[0]!==a.id||e[1]!==a.slug?(d={connectionId:De,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=d):d=e[2];const c=we(d),[r,u]=L.useState(!1);let p;e[3]!==c||e[4]!==l.id||e[5]!==a.id?(p=rt(a.id,"CONNECTIONS",l.id,c),e[3]=c,e[4]=l.id,e[5]=a.id,e[6]=p):p=e[6];let g;e[7]!==r||e[8]!==p?(g={...p,enabled:r},e[7]=r,e[8]=p,e[9]=g):g=e[9];const{data:f}=Ge(g);let m;e[10]!==f?(m=f?f.item?.tools??[]:null,e[10]=f,e[11]=m):m=e[11];const j=m;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=()=>u(!0),e[12]=y):y=e[12];let x;return e[13]!==l.icon||e[14]!==l.id||e[15]!==l.title||e[16]!==t||e[17]!==o||e[18]!==n||e[19]!==j?(x=i.jsx(it,{resource:l.id,title:l.title,icon:l.icon,tools:j,selected:n,onChange:t,query:o,onExpand:y}),e[13]=l.icon,e[14]=l.id,e[15]=l.title,e[16]=t,e[17]=o,e[18]=n,e[19]=j,e[20]=x):x=e[20],x}function Jt(s){const e=T.c(14),{toolSet:l,onChange:n,query:t}=s,{org:o}=Ne();let a;e[0]!==o.id?(a=at.SELF(o.id),e[0]=o.id,e[1]=a):a=e[1];const d=a,c=Lt();let r;if(e[2]!==n||e[3]!==t||e[4]!==d||e[5]!==c||e[6]!==l){let u;e[8]!==d?(u=f=>f.id!==d,e[8]=d,e[9]=u):u=e[9];const p=c.filter(u);let g;e[10]!==n||e[11]!==t||e[12]!==l?(g=f=>i.jsx(Wt,{connection:f,selected:l[f.id]??[],onChange:m=>n(f.id,m),query:t},f.id),e[10]=n,e[11]=t,e[12]=l,e[13]=g):g=e[13],r=p.map(g),e[2]=n,e[3]=t,e[4]=d,e[5]=c,e[6]=l,e[7]=r}else r=e[7];return r}function Xt(s){const e=T.c(41),{studioTools:l,toolSet:n,onChange:t}=s,o=B(),[a,d]=L.useState("");let c;e[0]!==a?(c=a.trim().toLowerCase(),e[0]=a,e[1]=c):c=e[1];const r=L.useDeferredValue(c);let u;e[2]!==t||e[3]!==n?(u=(_,w)=>t({...n,[_]:w}),e[2]=t,e[3]=n,e[4]=u):u=e[4];const p=u;let g;e[5]!==o?(g=o("settings.apiKeys.toolsSearch"),e[5]=o,e[6]=g):g=e[6];let f;e[7]!==a||e[8]!==g?(f=i.jsx(Ot,{value:a,onChange:d,placeholder:g,className:"flex-1"}),e[7]=a,e[8]=g,e[9]=f):f=e[9];let m;e[10]!==o||e[11]!==n?(m=o("settings.apiKeys.toolsSelected",{count:st(n)}),e[10]=o,e[11]=n,e[12]=m):m=e[12];let j;e[13]!==m?(j=i.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:m}),e[13]=m,e[14]=j):j=e[14];let y;e[15]!==f||e[16]!==j?(y=i.jsxs("div",{className:"flex items-center gap-3",children:[f,j]}),e[15]=f,e[16]=j,e[17]=y):y=e[17];let x;e[18]!==o?(x=o("settings.apiKeys.studioTools"),e[18]=o,e[19]=x):x=e[19];let S;e[20]!==n?(S=n[_e]??[],e[20]=n,e[21]=S):S=e[21];let K;e[22]!==p?(K=_=>p(_e,_),e[22]=p,e[23]=K):K=e[23];let h;e[24]!==r||e[25]!==l||e[26]!==K||e[27]!==x||e[28]!==S?(h=i.jsx(it,{resource:_e,title:x,icon:"/favicon.svg",tools:l,selected:S,onChange:K,query:r}),e[24]=r,e[25]=l,e[26]=K,e[27]=x,e[28]=S,e[29]=h):h=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx("div",{className:"flex justify-center py-3",children:i.jsx(Me,{className:"size-4 text-muted-foreground"})}),e[30]=C):C=e[30];let v;e[31]!==r||e[32]!==p||e[33]!==n?(v=i.jsx(L.Suspense,{fallback:C,children:i.jsx(Jt,{toolSet:n,onChange:p,query:r})}),e[31]=r,e[32]=p,e[33]=n,e[34]=v):v=e[34];let b;e[35]!==h||e[36]!==v?(b=i.jsxs("div",{className:"max-h-80 space-y-2 overflow-y-auto",children:[h,v]}),e[35]=h,e[36]=v,e[37]=b):b=e[37];let N;return e[38]!==b||e[39]!==y?(N=i.jsxs("div",{className:"space-y-2",children:[y,b]}),e[38]=b,e[39]=y,e[40]=N):N=e[40],N}function nt(s){const e=T.c(6),{error:l}=s,n=B();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Kt,{size:16}),e[0]=t):t=e[0];let o;e[1]!==l.message||e[2]!==n?(o=n("settings.apiKeys.failedToLoadError",{error:l.message}),e[1]=l.message,e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==o?(a=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[t,i.jsx("span",{className:"text-sm font-medium",children:o})]}),e[4]=o,e[5]=a):a=e[5],a}function Zt(s){const e=T.c(31),{apiKey:l,onDelete:n}=s,t=B(),o=Ht(l.permissions),a=l.expiresAt?new Date(l.expiresAt):null,[d]=L.useState(es),c=a!==null&&a.getTime()<=d,r=a?.toLocaleDateString()??"",u="flex items-center justify-between gap-4 px-4 py-3",p="flex items-center gap-3 min-w-0";let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(et,{size:16,className:"text-muted-foreground"})}),e[0]=g):g=e[0];const f="min-w-0";let m;e[1]!==l.name?(m=i.jsx("span",{className:"font-medium text-sm truncate",children:l.name}),e[1]=l.name,e[2]=m):m=e[2];const j=o.kind==="full"?i.jsx(Ie,{variant:"warning",size:"sm",children:t("settings.apiKeys.accessFull")}):i.jsx(Ie,{variant:"muted",size:"sm",children:t("settings.apiKeys.toolCount",{count:o.count})});let y;e[3]!==c||e[4]!==t?(y=c&&i.jsx(Ie,{variant:"destructive",size:"sm",children:t("settings.apiKeys.expired")}),e[3]=c,e[4]=t,e[5]=y):y=e[5];let x;e[6]!==m||e[7]!==j||e[8]!==y?(x=i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m,j,y]}),e[6]=m,e[7]=j,e[8]=y,e[9]=x):x=e[9];const S="text-xs text-muted-foreground mt-0.5";let K;e[10]!==l.createdAt||e[11]!==t?(K=t("settings.apiKeys.createdAt",{date:new Date(l.createdAt).toLocaleDateString()}),e[10]=l.createdAt,e[11]=t,e[12]=K):K=e[12];const h=" · ",C=l.expiresAt?c?t("settings.apiKeys.expiredOn",{date:r}):t("settings.apiKeys.expiresOn",{date:r}):t("settings.apiKeys.neverExpires");let v;e[13]!==K||e[14]!==C?(v=i.jsxs("p",{className:S,children:[K,h,C]}),e[13]=K,e[14]=C,e[15]=v):v=e[15];let b;e[16]!==v||e[17]!==x?(b=i.jsxs("div",{className:f,children:[x,v]}),e[16]=v,e[17]=x,e[18]=b):b=e[18];let N;e[19]!==b||e[20]!==g?(N=i.jsxs("div",{className:p,children:[g,b]}),e[19]=b,e[20]=g,e[21]=N):N=e[21];let _;e[22]!==t?(_=t("settings.apiKeys.deleteKey"),e[22]=t,e[23]=_):_=e[23];let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx(Ct,{size:14}),e[24]=w):w=e[24];let D;e[25]!==n||e[26]!==_?(D=i.jsx(Q,{variant:"ghost-destructive",size:"icon",className:"shrink-0",onClick:n,"aria-label":_,children:w}),e[25]=n,e[26]=_,e[27]=D):D=e[27];let k;return e[28]!==N||e[29]!==D?(k=i.jsxs("li",{className:u,children:[N,D]}),e[28]=N,e[29]=D,e[30]=k):k=e[30],k}function es(){return Date.now()}function ts(s){const e=T.c(15),{onCreate:l}=s,n=B();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(et,{}),e[0]=t):t=e[0];let o;e[1]!==n?(o=n("settings.apiKeys.emptyTitle"),e[1]=n,e[2]=o):o=e[2];let a;e[3]!==n?(a=n("settings.apiKeys.emptyDescription"),e[3]=n,e[4]=a):a=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(tt,{size:14}),e[5]=d):d=e[5];let c;e[6]!==n?(c=n("settings.apiKeys.newKey"),e[6]=n,e[7]=c):c=e[7];let r;e[8]!==l||e[9]!==c?(r=i.jsxs(Q,{onClick:l,size:"sm",children:[d,c]}),e[8]=l,e[9]=c,e[10]=r):r=e[10];let u;return e[11]!==o||e[12]!==a||e[13]!==r?(u=i.jsx(jt,{children:i.jsx(bt,{size:"inline",icon:t,title:o,description:a,children:r})}),e[11]=o,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function ss(s){const e=T.c(40),{createdKey:l,onClose:n}=s,t=B(),o=l!==null;let a;e[0]!==n?(a=b=>!b&&n(),e[0]=n,e[1]=a):a=e[1];let d;e[2]!==t?(d=t("settings.apiKeys.createdTitle"),e[2]=t,e[3]=d):d=e[3];let c;e[4]!==d?(c=i.jsx(He,{children:d}),e[4]=d,e[5]=c):c=e[5];let r;e[6]!==t?(r=t("settings.apiKeys.createdDescription"),e[6]=t,e[7]=r):r=e[7];let u;e[8]!==r?(u=i.jsx(Ve,{children:r}),e[8]=r,e[9]=u):u=e[9];let p;e[10]!==c||e[11]!==u?(p=i.jsxs(Ue,{children:[c,u]}),e[10]=c,e[11]=u,e[12]=p):p=e[12];const g=l?.key??"";let f;e[13]!==g?(f=i.jsx(We,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let m;e[15]!==l||e[16]!==t?(m=()=>{l&&(navigator.clipboard?.writeText(l.key),Ee.success(t("settings.apiKeys.copied")))},e[15]=l,e[16]=t,e[17]=m):m=e[17];let j;e[18]!==t?(j=t("settings.apiKeys.copyKey"),e[18]=t,e[19]=j):j=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx(vt,{size:14}),e[20]=y):y=e[20];let x;e[21]!==m||e[22]!==j?(x=i.jsx(Q,{type:"button",variant:"outline",size:"icon",onClick:m,"aria-label":j,children:y}),e[21]=m,e[22]=j,e[23]=x):x=e[23];let S;e[24]!==x||e[25]!==f?(S=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,e[25]=f,e[26]=S):S=e[26];let K;e[27]!==t?(K=t("settings.apiKeys.done"),e[27]=t,e[28]=K):K=e[28];let h;e[29]!==n||e[30]!==K?(h=i.jsx(Je,{children:i.jsx(Q,{onClick:n,children:K})}),e[29]=n,e[30]=K,e[31]=h):h=e[31];let C;e[32]!==S||e[33]!==h||e[34]!==p?(C=i.jsxs(Xe,{className:"sm:max-w-lg",children:[p,S,h]}),e[32]=S,e[33]=h,e[34]=p,e[35]=C):C=e[35];let v;return e[36]!==o||e[37]!==C||e[38]!==a?(v=i.jsx(Ze,{open:o,onOpenChange:a,children:C}),e[36]=o,e[37]=C,e[38]=a,e[39]=v):v=e[39],v}function is(s){const e=T.c(131),{onClose:l,onCreated:n}=s,t=B(),{org:o}=Ne();let a;e[0]!==o.id||e[1]!==o.slug?(a={connectionId:De,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=a):a=e[2];const d=we(a);let c;e[3]!==d?(c={client:d},e[3]=d,e[4]=c):c=e[4];const r=kt(c),u=[...r.data?.tools??[]].sort(ls),p=Yt(u),[g,f]=L.useState(""),[m,j]=L.useState("read-only"),[y,x]=L.useState(null),[S,K]=L.useState("90"),h=Ft(),C=y??{[_e]:p},v=m!=="full",b=!v||r.isSuccess,N=m==="full"||(m==="read-only"?p.length:st(C))>0;let _;e[5]!==h.isPending||e[6]!==N||e[7]!==g||e[8]!==b?(_=!!g.trim()&&b&&N&&!h.isPending,e[5]=h.isPending,e[6]=N,e[7]=g,e[8]=b,e[9]=_):_=e[9];const w=_,D=async function(G){if(G.preventDefault(),!!w)try{const Y=await h.mutateAsync({name:g.trim(),permissions:Qt(m,p,C),expiresIn:Mt(S)});l(),n(Y)}catch(Y){const Re=Y;Ee.error(Re instanceof Error?Re.message:t("settings.apiKeys.failedToCreateKey"))}},k="read-only";let I;e[10]!==t?(I=t("settings.apiKeys.accessReadOnly"),e[10]=t,e[11]=I):I=e[11];const F=t("settings.apiKeys.accessReadOnlyDescription",{count:p.length});let R;e[12]!==I||e[13]!==F?(R={value:k,label:I,description:F},e[12]=I,e[13]=F,e[14]=R):R=e[14];let E;e[15]!==t?(E=t("settings.apiKeys.accessCustom"),e[15]=t,e[16]=E):E=e[16];let O;e[17]!==t?(O=t("settings.apiKeys.accessCustomDescription"),e[17]=t,e[18]=O):O=e[18];let P;e[19]!==O||e[20]!==E?(P={value:"custom",label:E,description:O},e[19]=O,e[20]=E,e[21]=P):P=e[21];let z;e[22]!==t?(z=t("settings.apiKeys.accessFull"),e[22]=t,e[23]=z):z=e[23];let $;e[24]!==t?($=t("settings.apiKeys.accessFullDescription"),e[24]=t,e[25]=$):$=e[25];let A;e[26]!==z||e[27]!==$?(A={value:"full",label:z,description:$},e[26]=z,e[27]=$,e[28]=A):A=e[28];let M;e[29]!==P||e[30]!==A||e[31]!==R?(M=[R,P,A],e[29]=P,e[30]=A,e[31]=R,e[32]=M):M=e[32];const H=M;let V;e[33]!==t?(V=t("settings.apiKeys.expiryDays",{days:7}),e[33]=t,e[34]=V):V=e[34];let U;e[35]!==t?(U=t("settings.apiKeys.expiryDays",{days:30}),e[35]=t,e[36]=U):U=e[36];let W;e[37]!==t?(W=t("settings.apiKeys.expiryDays",{days:90}),e[37]=t,e[38]=W):W=e[38];let J;e[39]!==t?(J=t("settings.apiKeys.expiryYear"),e[39]=t,e[40]=J):J=e[40];let X;e[41]!==t?(X=t("settings.apiKeys.expiryNever"),e[41]=t,e[42]=X):X=e[42];let Ae;e[43]!==V||e[44]!==U||e[45]!==W||e[46]!==J||e[47]!==X?(Ae={7:V,30:U,90:W,365:J,never:X},e[43]=V,e[44]=U,e[45]=W,e[46]=J,e[47]=X,e[48]=Ae):Ae=e[48];const Oe=Ae;let Z;e[49]!==t?(Z=t("settings.apiKeys.nameLabel"),e[49]=t,e[50]=Z):Z=e[50];let ee;e[51]!==Z?(ee=i.jsx(ze,{htmlFor:"api-key-name",children:Z}),e[51]=Z,e[52]=ee):ee=e[52];let te;e[53]!==f?(te=q=>f(q.target.value),e[53]=f,e[54]=te):te=e[54];let se;e[55]!==t?(se=t("settings.apiKeys.namePlaceholder"),e[55]=t,e[56]=se):se=e[56];let ie;e[57]!==g||e[58]!==te||e[59]!==se?(ie=i.jsx(We,{id:"api-key-name",value:g,onChange:te,placeholder:se,autoComplete:"off",required:!0}),e[57]=g,e[58]=te,e[59]=se,e[60]=ie):ie=e[60];let ne;e[61]!==ee||e[62]!==ie?(ne=i.jsxs("div",{className:"space-y-1.5",children:[ee,ie]}),e[61]=ee,e[62]=ie,e[63]=ne):ne=e[63];let le;e[64]!==t?(le=t("settings.apiKeys.accessLabel"),e[64]=t,e[65]=le):le=e[65];let ae;e[66]!==le?(ae=i.jsx(ze,{children:le}),e[66]=le,e[67]=ae):ae=e[67];let oe;e[68]!==H||e[69]!==j?(oe=q=>{const G=H.find(Y=>Y.value===q);G&&j(G.value)},e[68]=H,e[69]=j,e[70]=oe):oe=e[70];let re;e[71]!==H?(re=H.map(ns),e[71]=H,e[72]=re):re=e[72];let ce;e[73]!==m||e[74]!==oe||e[75]!==re?(ce=i.jsx(qt,{value:m,onValueChange:oe,className:"gap-2",children:re}),e[73]=m,e[74]=oe,e[75]=re,e[76]=ce):ce=e[76];let de;e[77]!==ae||e[78]!==ce?(de=i.jsxs("div",{className:"space-y-1.5",children:[ae,ce]}),e[77]=ae,e[78]=ce,e[79]=de):de=e[79];let ue;e[80]!==v||e[81]!==t||e[82]!==r.isError?(ue=v&&r.isError&&i.jsx("p",{className:"text-xs text-destructive",children:t("settings.apiKeys.toolsLoadFailed")}),e[80]=v,e[81]=t,e[82]=r.isError,e[83]=ue):ue=e[83];let fe;e[84]!==m||e[85]!==C||e[86]!==x||e[87]!==u||e[88]!==r.isSuccess?(fe=m==="custom"&&r.isSuccess&&i.jsx(Xt,{studioTools:u,toolSet:C,onChange:x}),e[84]=m,e[85]=C,e[86]=x,e[87]=u,e[88]=r.isSuccess,e[89]=fe):fe=e[89];let me;e[90]!==t?(me=t("settings.apiKeys.expiryLabel"),e[90]=t,e[91]=me):me=e[91];let pe;e[92]!==me?(pe=i.jsx(ze,{htmlFor:"api-key-expiry",children:me}),e[92]=me,e[93]=pe):pe=e[93];let ge;e[94]!==K?(ge=q=>{const G=Be.find(Y=>Y===q);G&&K(G)},e[94]=K,e[95]=ge):ge=e[95];let Te;e[96]===Symbol.for("react.memo_cache_sentinel")?(Te=i.jsx(Dt,{id:"api-key-expiry",className:"w-full",children:i.jsx(wt,{})}),e[96]=Te):Te=e[96];let xe;e[97]!==Oe?(xe=Be.map(q=>i.jsx(_t,{value:q,children:Oe[q]},q)),e[97]=Oe,e[98]=xe):xe=e[98];let ye;e[99]!==xe?(ye=i.jsx(At,{children:xe}),e[99]=xe,e[100]=ye):ye=e[100];let he;e[101]!==S||e[102]!==ge||e[103]!==ye?(he=i.jsxs(Tt,{value:S,onValueChange:ge,children:[Te,ye]}),e[101]=S,e[102]=ge,e[103]=ye,e[104]=he):he=e[104];let je;e[105]!==pe||e[106]!==he?(je=i.jsxs("div",{className:"space-y-1.5",children:[pe,he]}),e[105]=pe,e[106]=he,e[107]=je):je=e[107];const lt=h.isPending;let Ke;e[108]!==t?(Ke=t("settings.apiKeys.cancelButton"),e[108]=t,e[109]=Ke):Ke=e[109];let ve;e[110]!==h.isPending||e[111]!==l||e[112]!==Ke?(ve=i.jsx(Q,{type:"button",variant:"outline",onClick:l,disabled:lt,children:Ke}),e[110]=h.isPending,e[111]=l,e[112]=Ke,e[113]=ve):ve=e[113];const Pe=!w;let Ce;e[114]!==h.isPending||e[115]!==t?(Ce=h.isPending?t("settings.apiKeys.creatingButton"):t("settings.apiKeys.createButton"),e[114]=h.isPending,e[115]=t,e[116]=Ce):Ce=e[116];let be;e[117]!==Pe||e[118]!==Ce?(be=i.jsx(Q,{type:"submit",disabled:Pe,children:Ce}),e[117]=Pe,e[118]=Ce,e[119]=be):be=e[119];let Se;e[120]!==ve||e[121]!==be?(Se=i.jsxs(Je,{children:[ve,be]}),e[120]=ve,e[121]=be,e[122]=Se):Se=e[122];let ke;return e[123]!==D||e[124]!==ne||e[125]!==de||e[126]!==ue||e[127]!==fe||e[128]!==je||e[129]!==Se?(ke=i.jsxs("form",{onSubmit:D,className:"space-y-4",children:[ne,de,ue,fe,je,Se]}),e[123]=D,e[124]=ne,e[125]=de,e[126]=ue,e[127]=fe,e[128]=je,e[129]=Se,e[130]=ke):ke=e[130],ke}function ns(s){return i.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-md border border-border px-3 py-2.5 hover:bg-accent has-[[data-state=checked]]:border-primary",children:[i.jsx(Bt,{value:s.value,className:"mt-0.5"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"block text-sm font-medium",children:s.label}),i.jsx("span",{className:$e("block text-xs",s.value==="full"?"text-warning":"text-muted-foreground"),children:s.description})]})]},s.value)}function ls(s,e){return s.name.localeCompare(e.name)}function as(s){const e=T.c(23),{open:l,onOpenChange:n,onCreated:t}=s,o=B();let a;e[0]!==o?(a=o("settings.apiKeys.newKeyTitle"),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=i.jsx(He,{children:a}),e[2]=a,e[3]=d):d=e[3];let c;e[4]!==o?(c=o("settings.apiKeys.newKeyDescription"),e[4]=o,e[5]=c):c=e[5];let r;e[6]!==c?(r=i.jsx(Ve,{children:c}),e[6]=c,e[7]=r):r=e[7];let u;e[8]!==d||e[9]!==r?(u=i.jsxs(Ue,{children:[d,r]}),e[8]=d,e[9]=r,e[10]=u):u=e[10];let p;e[11]!==n?(p=()=>n(!1),e[11]=n,e[12]=p):p=e[12];let g;e[13]!==t||e[14]!==p?(g=i.jsx(is,{onClose:p,onCreated:t}),e[13]=t,e[14]=p,e[15]=g):g=e[15];let f;e[16]!==u||e[17]!==g?(f=i.jsxs(Xe,{className:"sm:max-w-xl",children:[u,g]}),e[16]=u,e[17]=g,e[18]=f):f=e[18];let m;return e[19]!==n||e[20]!==l||e[21]!==f?(m=i.jsx(Ze,{open:l,onOpenChange:n,children:f}),e[19]=n,e[20]=l,e[21]=f,e[22]=m):m=e[22],m}function os(){const s=B(),{data:e,isLoading:l,error:n}=$t(),t=Rt(),[o,a]=L.useState(!1),[d,c]=L.useState(null),[r,u]=L.useState(null),p=e??[];async function g(){if(r)try{await t.mutateAsync(r.id),Ee.success(s("settings.apiKeys.keyDeleted",{name:r.name}))}catch(f){Ee.error(f instanceof Error?f.message:s("settings.apiKeys.failedToDeleteKey"))}finally{u(null)}}return i.jsxs(dt,{title:s("settings.apiKeys.sectionTitle"),description:s("settings.apiKeys.sectionDescription"),actions:p.length>0?i.jsxs(Q,{onClick:()=>a(!0),size:"sm",children:[i.jsx(tt,{size:14}),s("settings.apiKeys.newKey")]}):void 0,children:[l?i.jsx(qe,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:s("settings.apiKeys.loading")})}):n&&p.length===0?i.jsx(nt,{error:n}):p.length===0?i.jsx(ts,{onCreate:()=>a(!0)}):i.jsx(qe,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:p.map(f=>i.jsx(Zt,{apiKey:f,onDelete:()=>u(f)},f.id))})}),i.jsx(as,{open:o,onOpenChange:a,onCreated:c}),i.jsx(ss,{createdKey:d,onClose:()=>c(null)}),i.jsx(ut,{open:r!==null,onOpenChange:f=>{f||u(null)},children:i.jsxs(ft,{children:[i.jsxs(mt,{children:[i.jsx(pt,{children:s("settings.apiKeys.deleteTitle",{name:r?.name??""})}),i.jsx(gt,{children:s("settings.apiKeys.deleteDescription")})]}),i.jsxs(xt,{children:[i.jsx(yt,{children:s("settings.apiKeys.cancelButton")}),i.jsx(ht,{onClick:g,children:s("settings.apiKeys.deleteKey")})]})]})})]})}function ws(){const s=T.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(ct,{group:"connect",errorFallback:rs,children:i.jsx(os,{})}),s[0]=e):e=s[0],e}function rs(s){const{error:e}=s;return i.jsx(nt,{error:e??new Error("Failed to load API keys")})}export{os as A,ws as O,$t as a,Ft as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _t,j as m,b as Ft,r as K,as as It,m as Ot,h as Mt,t as St}from"./index-CWKxkTwy.js";import{u as Pt}from"./chat-context-D8Eje7xK.js";import{u as $t}from"./use-voice-input-vD0BpiqU.js";import{S as Ut}from"./scroll-area-EO9hsjie.js";import{u as Vt,A as zt}from"./use-section-preview-base-DxIpbqPr.js";import{y as Lt,l as qt,t as Ht}from"./blocks-tab-states-BUfMyINR.js";import{H as Dt,c as Gt,a as Wt,b as Zt,S as Jt}from"./held-block-view-DRxUlNuB.js";import{b as Qt,u as Xt,k as Yt}from"./use-never-published-Cq663vOp.js";import{n as te}from"./content-tab-BdaE3oCc.js";import{S as ee}from"./save-status-DshwUBI8.js";import"./use-view-draft-kind-BQ4N5uEB.js";import"./thread-route-BbSych2c.js";import"./use-project-scope-3ijTexFj.js";import"./repository-binding-DScgU6HN.js";import"./use-mcp-client-CmWEhN6T.js";import"./auth-DFCgioOs.js";import"./use-organization-settings-BZz5ibUN.js";import"./schema-DWYnTC39.js";import"./task-board-D7RCmGkN.js";import"./thread-intent-0TjSPqLd.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DqTWfbxM.js";import"./use-entitlements-J4XPZF2l.js";import"./use-ai-providers-Bku85sJ3.js";import"./use-decopilot-events-DhxeqkWl.js";import"./popover-CTEYICXO.js";import"./drawer-B9PFQFcy.js";import"./tooltip-mM1fQXaq.js";import"./index-8kUWDN7v.js";import"./use-mobile-BZ5I1Gts.js";import"./agent-icon-BwEytdmh.js";import"./AlertCircle-Bj2NuHQY.js";import"./Tool01-DAYJL0v-.js";import"./ArrowUp-AwRcCsuH.js";import"./ArrowLeft-DCMq103h.js";import"./LinkBroken01-DjOOxf0e.js";import"./BookOpen01-D2g_6Ti1.js";import"./Globe04-BBKBtEaK.js";import"./CheckCircle-BfCYdSA_.js";import"./ChevronUp-JSFuaLqF.js";import"./ChevronSelectorVertical-Bwduw2Hp.js";import"./UserSquare-CBWDFbi3.js";import"./CreditCard01-DsaJOWgX.js";import"./SwitchHorizontal01-CP6L8rlm.js";import"./Key01-BTIXWKkS.js";import"./Minus-BAq-AD33.js";import"./Monitor01-CqtNhdJN.js";import"./Sun-C5iV1Zpq.js";import"./Play-kmXfE4Am.js";import"./Plus-Bq5KiXqn.js";import"./SearchMd-D1P7yVqT.js";import"./ShoppingBag01-CAQ4NRTU.js";import"./Trash01-Dt7pyOwE.js";import"./Upload01-CZ2h76oj.js";import"./Users01-BZzvQda-.js";import"./XClose-D2u966Hj.js";import"./Zap-CDj8jJFt.js";import"./index-C9E0iqgh.js";import"./checkbox-CCw3an34.js";import"./select-CWL8C0Pw.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./site-editor-toast-BLqoqKy_.js";import"./sandbox-url-D3mC8qhT.js";import"./use-sandbox-events-CBP-Uwww.js";import"./use-blocks-v8-project-BTQz7erp.js";import"./utils-CkU_P8Ie.js";import"./sandbox-git-api-DcqI6XE4.js";import"./empty-state-BkAAjXrp.js";import"./calendar-5Nt9EKO9.js";import"./textarea-CvY2QE-l.js";import"./usage-stats-DT9jvl-J.js";import"./tool-namespace-c-MaHIy3.js";import"./form-8HJUl2GV.js";import"./label-BXSXPHWU.js";import"./utils-CVEq3hMx.js";import"./markdown-DiEygcQw.js";import"./use-copy-D3ELC0tX.js";import"./editor-classes-Cb5f4sl2.js";import"./switch-DBO_GrNe.js";import"./core.esm-CAA73EV4.js";import"./sortable.esm-CYzspn3s.js";import"./toggle-group-BPubP3Pi.js";import"./active-indicator-CCMhAsc_.js";import"./empty-message-CXYzekmD.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DbwVEDlq.js";import"./collapsible-CVtLl5wO.js";import"./shell-layout-DVIwCYxA.js";import"./use-deployment-admin-8guQU4GC.js";import"./admin-fetch-BhTJlAsX.js";import"./command-BOSLOC8n.js";import"./index-yzkfeOP2.js";import"./integration-icon-C1bpkd7s.js";import"./project-icon-CsM5Xu_3.js";import"./use-navigate-to-agent-CMbT8SLE.js";import"./use-debounced-value-CgYJanEq.js";import"./new-project-dialog-Cfdy4DZo.js";import"./repository-picker-BUWqEoln.js";import"./github-icon-DEvD-SlA.js";import"./useInfiniteQuery-njPYFTao.js";import"./infiniteQueryObserver-DCK-YXw1.js";import"./collection-search-CC2QUXh2.js";import"./legacy-admin-welcome-dialog-DbVWjlJ6.js";import"./required-auth-layout-BiIyXd3D.js";import"./use-org-sso-D-kGbeq_.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BbTTGmQC.js";import"./types-E9_eqrxO.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./sheet-Bqz29cSo.js";import"./use-connection-CLoaxXGr.js";import"./use-mcp-prompts-RB8yW0_L.js";import"./use-thread-outputs-DegzudvH.js";import"./file-type-icon-mKSSLPP8.js";import"./section-array-field-BFg67nYp.js";import"./named-rule-step-W9P9uG-f.js";import"./slider-GCMZAdst.js";import"./index-gX7QfQio.js";import"./tooltipContext-B2y0_sWP.js";import"./CategoricalChart-Bjq2Qe33.js";import"./index-_sPF1edR.js";import"./combobox-CB15NqGc.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-DngvlIXa.js";import"./asset-utils-DSh1-4fR.js";import"./hosted-reconcile-DH_YtUfF.js";import"./search-input-Dc1w2xyv.js";import"./tabs-rkhPwLiJ.js";import"./delete-copy-CAFEtw8Z.js";import"./category-tree-Cm0a3nBT.js";import"./use-move-blocks-a-Gpcz1Q.js";import"./index-C1fc6W9Q.js";import"./view-header-B-Vek7fH.js";import"./use-cms-publish-actions-XYKTfqt2.js";import"./use-content-sync-14ry1gRC.js";import"./use-delete-block-BJD7162e.js";import"./item-actions-kNG-BlG3.js";import"./date-utils-CrvIKg-s.js";import"./badge-DbKUf3vA.js";import"./empty-state-DMtSEEQ1.js";import"./monaco-editor-C9ZwdTpU.js";import"./editor-DZ4pzlHx.js";import"./sandbox-lifecycle-context-DY2xu0Uo.js";import"./parse-sections-CMxFIp3d.js";import"./mustache-gM754ehf.js";import"./collection-table-wrapper-DSy_nx4_.js";import"./table-xCmpwB0s.js";import"./agent-capabilities-DHVCvnvi.js";function re(e,t){if(!e||!t?.length)return e;const o=Object.fromEntries(Object.entries(e.properties??{}).filter(([r])=>!t.includes(r)));return Object.keys(o).length>0?{...e,properties:o}:e}function At(e,t,o){return typeof e!="string"?null:re(Lt(e,t),o)}function oe(e,t,o){if(!t||typeof e!="string")return!1;const r=At(e,t,o);return!!r&&Object.keys(r.properties??{}).length>0}function ie(e,t){const o=(e.title||e.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),r=/^[A-Za-z]/.test(o)&&o.length>0?o:"Section",i=te(t,r);return{blockKey:i,data:{__resolveType:e.resolveType,name:i}}}function Xo(e){const t=_t.c(10),o=e.saveGuard?void 0:e.block!==void 0;let r;t[0]!==e?(r=m.jsx(se,{...e}),t[0]=e,t[1]=r):r=t[1];let i;return t[2]!==e.blockKey||t[3]!==e.branch||t[4]!==e.decofile||t[5]!==e.orgSlug||t[6]!==e.virtualMcpId||t[7]!==o||t[8]!==r?(i=m.jsx(Dt,{listing:e.decofile,orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch,blockKey:e.blockKey,present:o,children:r}),t[2]=e.blockKey,t[3]=e.branch,t[4]=e.decofile,t[5]=e.orgSlug,t[6]=e.virtualMcpId,t[7]=o,t[8]=r,t[9]=i):i=t[9],i}function se(e){const t=_t.c(98),{orgSlug:o,virtualMcpId:r,branch:i,blockKey:p,block:x,meta:n,decofile:c,title:Kt,excludeFields:g,previewBaseUrl:yt,notice:Q,saveGuard:X,persistDefaults:Y,schemaWaiting:kt}=e,tt=yt===void 0?null:yt,et=kt===void 0?!0:kt,rt=Pt()?.taskId??null,d=Ft(),N=$t(r);let C;t[0]!==i||t[1]!==tt||t[2]!==r?(C={virtualMcpId:r,branch:i,sandboxUrl:tt},t[0]=i,t[1]=tt,t[2]=r,t[3]=C):C=t[3];const v=Vt(C),a=typeof x?.__resolveType=="string"?x.__resolveType:"";let T;t[4]!==g||t[5]!==n||t[6]!==a?(T=At(a,n,g),t[4]=g,t[5]=n,t[6]=a,t[7]=T):T=t[7];const ot=T;let F;t[8]!==g||t[9]!==n||t[10]!==a?(F=oe(a,n,g),t[8]=g,t[9]=n,t[10]=a,t[11]=F):F=t[11];const it=F;let I;t[12]!==n||t[13]!==a||t[14]!==et||t[15]!==N?(I=et&&a!==""&&!(N.resolved&&N.runtime==="cms")&&!qt(a,n),t[12]=n,t[13]=a,t[14]=et,t[15]=N,t[16]=I):I=t[16];const O=I,jt=Kt??(x?Ht(p,x,n):p);let M;t[17]!==i||t[18]!==o||t[19]!==r?(M={orgSlug:o,virtualMcpId:r,branch:i},t[17]=i,t[18]=o,t[19]=r,t[20]=M):M=t[20];let P;t[21]!==X?(P={guard:X,holdsCopy:!0},t[21]=X,t[22]=P):P=t[22];const{save:st,flush:mt,isPending:nt}=Qt(M,P);let $;t[23]!==i||t[24]!==o||t[25]!==r?($={orgSlug:o,virtualMcpId:r,branch:i},t[23]=i,t[24]=o,t[25]=r,t[26]=$):$=t[26];const u=Xt($);let S;t[27]!==u||t[28]!==d?(S=s=>u.mutate(s,{onError:l=>St.error(d("sectionsEditor.sectionsEditor.saveFailed",{error:l.message}))}),t[27]=u,t[28]=d,t[29]=S):S=t[29];let U;t[30]!==c||t[31]!==u.v8||t[32]!==S?(U=Gt(S,c,u.v8),t[30]=c,t[31]=u.v8,t[32]=S,t[33]=U):U=t[33];const lt=U,[Rt,Nt]=K.useState(p),[at,Bt]=K.useState(null),[ct,Et]=K.useState(0);let V;t[34]===Symbol.for("react.memo_cache_sentinel")?(V=[],t[34]=V):V=t[34];const[y,wt]=K.useState(V),[pt,f]=K.useState(!1),z=K.useRef(null);Rt!==p&&(Nt(p),Bt(null),Et(ne),wt([]));let L;t[35]!==x?(L=x??{},t[35]=x,t[36]=L):L=t[36];const dt=L;let k;t[37]!==at?(k=at??{},t[37]=at,t[38]=k):k=t[38];let q;t[39]!==dt||t[40]!==k?(q={...dt,...k},t[39]=dt,t[40]=k,t[41]=q):q=t[41];const ut=q;let H;t[42]!==p||t[43]!==a||t[44]!==st?(H=s=>{const l=s;Bt(l),st(p,{...l,__resolveType:a})},t[42]=p,t[43]=a,t[44]=st,t[45]=H):H=t[45];const ft=H;let D;t[46]===Symbol.for("react.memo_cache_sentinel")?(D=s=>{wt(s)},t[46]=D):D=t[46];const R=D;let G;t[47]!==c||t[48]!==mt||t[49]!==u||t[50]!==d?(G=async(s,l)=>{try{const{blockKey:h,data:b}=ie(s,c),gt=await u.mutateAsync({blockKey:h,data:b});Yt(gt)||St.success(d("sandbox.appEditor.createdSection",{name:h})),l({__resolveType:h}),mt()}catch(h){const b=h,gt=b instanceof Error?b.message:d("sandbox.appEditor.failedAddSection");throw St.error(gt),b}},t[47]=c,t[48]=mt,t[49]=u,t[50]=d,t[51]=G):G=t[51];const j=G;let W;t[52]!==f?(W=s=>{z.current=s.append,f(!0)},t[52]=f,t[53]=W):W=t[53];const ht=W;let Z;t[54]!==j||t[55]!==f?(Z=async s=>{const l=z.current;if(l)try{await j(s,h=>{l(h),f(!1),z.current=null})}catch{}},t[54]=j,t[55]=f,t[56]=Z):Z=t[56];const bt=Z,xt=y.length>0?[jt,...y]:[],Ct="flex h-full flex-col",Tt="flex h-12 shrink-0 items-center justify-between border-b px-6",vt=xt.length>0?m.jsx("nav",{"aria-label":d("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:xt.map((s,l)=>{const h=l===xt.length-1,b=Wt(s);return m.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[l>0&&m.jsx(It,{className:"size-3 shrink-0 text-muted-foreground/60"}),m.jsx("button",{type:"button",onClick:()=>{R(l===0?[]:Zt(y,l)),Et(me)},title:b,className:Ot("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors",h?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:b})]},`${b}-${l}`)})}):m.jsx("span",{className:"text-sm font-medium",children:jt});let B;t[57]!==nt?(B=m.jsx(ee,{isPending:nt,isError:!1}),t[57]=nt,t[58]=B):B=t[58];let E;t[59]!==vt||t[60]!==B?(E=m.jsxs("div",{className:Tt,children:[vt,B]}),t[59]=vt,t[60]=B,t[61]=E):E=t[61];let w;t[62]!==O||t[63]!==p||t[64]!==i||t[65]!==y||t[66]!==c||t[67]!==ut||t[68]!==ct||t[69]!==j||t[70]!==R||t[71]!==ft||t[72]!==ht||t[73]!==it||t[74]!==n||t[75]!==o||t[76]!==Y||t[77]!==lt||t[78]!==ot||t[79]!==v||t[80]!==d||t[81]!==rt||t[82]!==r?(w=it?m.jsx(Jt,{schema:ot,value:ut,onChange:ft,persistDefaults:Y,basePath:"",breadcrumbPath:y,onBreadcrumbChange:R,decofile:c,meta:n,onSaveReferencedBlock:lt,previewBaseUrl:v,onAddSectionItem:j,onRequestAddSection:ht,sandbox:{orgSlug:o,virtualMcpId:r,branch:i,threadId:rt}},`${p}:${ct}`):m.jsxs("div",{className:"flex flex-col items-center gap-3 py-6 text-center text-xs text-muted-foreground",children:[O&&m.jsx(Mt,{className:"size-4"}),m.jsx("p",{children:d(O?"sandbox.appEditor.schemaAwaitsBuild":"sandbox.appEditor.noEditableSchema")})]}),t[62]=O,t[63]=p,t[64]=i,t[65]=y,t[66]=c,t[67]=ut,t[68]=ct,t[69]=j,t[70]=R,t[71]=ft,t[72]=ht,t[73]=it,t[74]=n,t[75]=o,t[76]=Y,t[77]=lt,t[78]=ot,t[79]=v,t[80]=d,t[81]=rt,t[82]=r,t[83]=w):w=t[83];let _;t[84]!==Q||t[85]!==w?(_=m.jsx(Ut,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:m.jsx("div",{className:"px-6 py-6",children:m.jsxs("div",{className:"mx-auto max-w-xl",children:[Q,w]})})}),t[84]=Q,t[85]=w,t[86]=_):_=t[86];let A;t[87]!==pt||t[88]!==c||t[89]!==bt||t[90]!==n||t[91]!==v||t[92]!==f?(A=v&&m.jsx(zt,{open:pt,onOpenChange:s=>{f(s),s||(z.current=null)},meta:n,decofile:c,previewBaseUrl:v,onSelect:s=>{bt(s)}}),t[87]=pt,t[88]=c,t[89]=bt,t[90]=n,t[91]=v,t[92]=f,t[93]=A):A=t[93];let J;return t[94]!==E||t[95]!==_||t[96]!==A?(J=m.jsxs("div",{className:Ct,children:[E,_,A]}),t[94]=E,t[95]=_,t[96]=A,t[97]=J):J=t[97],J}function me(e){return e+1}function ne(e){return e+1}export{Xo as AppEditor};
|
|
1
|
+
import{c as _t,j as m,b as Ft,r as K,as as It,m as Ot,h as Mt,t as St}from"./index-CHOxYhnv.js";import{u as Pt}from"./chat-context-o9Pyy_rd.js";import{u as $t}from"./use-voice-input-Bt11fXlC.js";import{S as Ut}from"./scroll-area-w2Fr7CkP.js";import{u as Vt,A as zt}from"./use-section-preview-base-DiLHxC8Z.js";import{y as Lt,l as qt,t as Ht}from"./blocks-tab-states-DScRj9jB.js";import{H as Dt,c as Gt,a as Wt,b as Zt,S as Jt}from"./held-block-view-BFXBQ9fK.js";import{b as Qt,u as Xt,k as Yt}from"./use-never-published-DP-ayb_U.js";import{n as te}from"./content-tab-BGklezQM.js";import{S as ee}from"./save-status-CzYNQ6G2.js";import"./use-view-draft-kind-By-WcYfU.js";import"./thread-route-CVZs3lS7.js";import"./use-project-scope-BTU4ukSL.js";import"./repository-binding-zOZEsVNQ.js";import"./use-mcp-client-CAI0PiRc.js";import"./auth-DQhl82rC.js";import"./use-organization-settings-04SG-hKv.js";import"./schema-BB8zKrPl.js";import"./task-board--eP68xys.js";import"./thread-intent-otNmUDpT.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-Gp1E8HHl.js";import"./use-entitlements-npCYsfMp.js";import"./use-ai-providers-BJRvsFFm.js";import"./use-decopilot-events-Bvlss2N9.js";import"./popover-AfVmBiXN.js";import"./drawer-Donq2Zq_.js";import"./tooltip-D2JXB44W.js";import"./index-BZdAVrUU.js";import"./use-mobile-DlyIeamj.js";import"./agent-icon-C-RKmmDR.js";import"./AlertCircle-BHOdje2-.js";import"./Tool01-C_vFDQiZ.js";import"./ArrowUp-BKp-bI0t.js";import"./ArrowLeft-DwK9IQqr.js";import"./LinkBroken01-Beajkv8Y.js";import"./BookOpen01-CCzJ3iHg.js";import"./Globe04-CpMO0Sfn.js";import"./CheckCircle-CpYSXUlJ.js";import"./ChevronUp-yM6kuF7B.js";import"./ChevronSelectorVertical-BfPzQt1M.js";import"./UserSquare-DomA7Npc.js";import"./CreditCard01-ClPhtnpy.js";import"./SwitchHorizontal01-Be5wnM3M.js";import"./Key01-BUefgO6r.js";import"./Minus-CkHBDYFP.js";import"./Monitor01-6Z9BL4ul.js";import"./Sun-CBa0lZzX.js";import"./Play-QQIqJKj8.js";import"./Plus-jqQtsDrV.js";import"./SearchMd--9oaPr0p.js";import"./ShoppingBag01-DWT7jnvZ.js";import"./Trash01-D4h16nnS.js";import"./Upload01-DLWP4rJI.js";import"./Users01-DQk985Hj.js";import"./XClose-DsOcImLD.js";import"./Zap-CXSu8byh.js";import"./index-Ujlc9MWT.js";import"./checkbox-BgJ_rDKP.js";import"./select-oOpcW8y8.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./site-editor-toast-CPe_RO4U.js";import"./sandbox-url-D3mC8qhT.js";import"./use-sandbox-events-BgsP-jl-.js";import"./use-blocks-v8-project-D8GbwCrf.js";import"./utils-2an1bWl1.js";import"./sandbox-git-api-DcqI6XE4.js";import"./empty-state-DDTtYKkY.js";import"./calendar-RFGSgZO6.js";import"./textarea-DiKdmgZC.js";import"./usage-stats-PiJNBrSI.js";import"./tool-namespace-BOC8taOg.js";import"./form-DddGN9Yh.js";import"./label-B6kbb_qI.js";import"./utils-CVEq3hMx.js";import"./markdown-Deyw3r6u.js";import"./use-copy-BMjPWKp8.js";import"./editor-classes-8qIA7W4N.js";import"./switch-DCbfNrSN.js";import"./core.esm-AubJLKZ-.js";import"./sortable.esm-DMidKm69.js";import"./toggle-group-DWJu5FLK.js";import"./active-indicator-CCMhAsc_.js";import"./empty-message-BAHk-1bK.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BoFr4FJb.js";import"./collapsible-Ck6jFTQH.js";import"./shell-layout-C4gugWKg.js";import"./use-deployment-admin-BLMaSYC-.js";import"./admin-fetch-BhTJlAsX.js";import"./command-CnhVLB17.js";import"./index-BNwuaZhD.js";import"./integration-icon-CM5LyK_z.js";import"./project-icon-D_A1aREs.js";import"./use-navigate-to-agent-rf_XQPo1.js";import"./use-debounced-value-CoBOVCcY.js";import"./new-project-dialog-C9WcHYrC.js";import"./repository-picker-DQ8Ce_c3.js";import"./github-icon-CBn2nQtJ.js";import"./useInfiniteQuery-Cr6l3hRz.js";import"./infiniteQueryObserver-Sb4-Zoh0.js";import"./collection-search-Cr2_Tgzy.js";import"./legacy-admin-welcome-dialog-C1EB7MCq.js";import"./required-auth-layout-D8CrwDut.js";import"./use-org-sso-Bz3FXaUK.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CEhql9SF.js";import"./types-BQyA3BSs.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./sheet-B4sQvcZD.js";import"./use-connection-D0bmffUK.js";import"./use-mcp-prompts-DqQEh2Qr.js";import"./use-thread-outputs-DcXhIS9K.js";import"./file-type-icon-D4Edy8Bo.js";import"./section-array-field-D7aYRyOo.js";import"./named-rule-step-WRCKmihp.js";import"./slider-DMICv7y9.js";import"./index-DChf1qbF.js";import"./tooltipContext-DFFEsXAa.js";import"./CategoricalChart-BH2fCBYy.js";import"./index-jntxieqb.js";import"./combobox-CqgGSY4o.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-H9DeMtGB.js";import"./asset-utils-DLSL6NlD.js";import"./hosted-reconcile-CrIPblfo.js";import"./search-input-CxzHzt1i.js";import"./tabs-CGFgLwIj.js";import"./delete-copy-CdfctKz4.js";import"./category-tree-hquVl_NC.js";import"./use-move-blocks-CfkVWpoJ.js";import"./index-BmYwClLx.js";import"./view-header-DkkNDHNd.js";import"./use-cms-publish-actions-xdyGorKy.js";import"./use-content-sync-lsuVBOfK.js";import"./use-delete-block-C97xuHhI.js";import"./item-actions-Cdz0dPi_.js";import"./date-utils-CrvIKg-s.js";import"./badge-lysbeP9P.js";import"./empty-state-BwFbOlsH.js";import"./monaco-editor-CRckTkcR.js";import"./editor-BRySXv_B.js";import"./sandbox-lifecycle-context-DrAhvgSp.js";import"./parse-sections-D9GxphKG.js";import"./mustache-BGNYir1R.js";import"./collection-table-wrapper-VD4O1Z7Z.js";import"./table-BdoV93HO.js";import"./agent-capabilities-B2YgTs9t.js";function re(e,t){if(!e||!t?.length)return e;const o=Object.fromEntries(Object.entries(e.properties??{}).filter(([r])=>!t.includes(r)));return Object.keys(o).length>0?{...e,properties:o}:e}function At(e,t,o){return typeof e!="string"?null:re(Lt(e,t),o)}function oe(e,t,o){if(!t||typeof e!="string")return!1;const r=At(e,t,o);return!!r&&Object.keys(r.properties??{}).length>0}function ie(e,t){const o=(e.title||e.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),r=/^[A-Za-z]/.test(o)&&o.length>0?o:"Section",i=te(t,r);return{blockKey:i,data:{__resolveType:e.resolveType,name:i}}}function Xo(e){const t=_t.c(10),o=e.saveGuard?void 0:e.block!==void 0;let r;t[0]!==e?(r=m.jsx(se,{...e}),t[0]=e,t[1]=r):r=t[1];let i;return t[2]!==e.blockKey||t[3]!==e.branch||t[4]!==e.decofile||t[5]!==e.orgSlug||t[6]!==e.virtualMcpId||t[7]!==o||t[8]!==r?(i=m.jsx(Dt,{listing:e.decofile,orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch,blockKey:e.blockKey,present:o,children:r}),t[2]=e.blockKey,t[3]=e.branch,t[4]=e.decofile,t[5]=e.orgSlug,t[6]=e.virtualMcpId,t[7]=o,t[8]=r,t[9]=i):i=t[9],i}function se(e){const t=_t.c(98),{orgSlug:o,virtualMcpId:r,branch:i,blockKey:p,block:x,meta:n,decofile:c,title:Kt,excludeFields:g,previewBaseUrl:yt,notice:Q,saveGuard:X,persistDefaults:Y,schemaWaiting:kt}=e,tt=yt===void 0?null:yt,et=kt===void 0?!0:kt,rt=Pt()?.taskId??null,d=Ft(),N=$t(r);let C;t[0]!==i||t[1]!==tt||t[2]!==r?(C={virtualMcpId:r,branch:i,sandboxUrl:tt},t[0]=i,t[1]=tt,t[2]=r,t[3]=C):C=t[3];const v=Vt(C),a=typeof x?.__resolveType=="string"?x.__resolveType:"";let T;t[4]!==g||t[5]!==n||t[6]!==a?(T=At(a,n,g),t[4]=g,t[5]=n,t[6]=a,t[7]=T):T=t[7];const ot=T;let F;t[8]!==g||t[9]!==n||t[10]!==a?(F=oe(a,n,g),t[8]=g,t[9]=n,t[10]=a,t[11]=F):F=t[11];const it=F;let I;t[12]!==n||t[13]!==a||t[14]!==et||t[15]!==N?(I=et&&a!==""&&!(N.resolved&&N.runtime==="cms")&&!qt(a,n),t[12]=n,t[13]=a,t[14]=et,t[15]=N,t[16]=I):I=t[16];const O=I,jt=Kt??(x?Ht(p,x,n):p);let M;t[17]!==i||t[18]!==o||t[19]!==r?(M={orgSlug:o,virtualMcpId:r,branch:i},t[17]=i,t[18]=o,t[19]=r,t[20]=M):M=t[20];let P;t[21]!==X?(P={guard:X,holdsCopy:!0},t[21]=X,t[22]=P):P=t[22];const{save:st,flush:mt,isPending:nt}=Qt(M,P);let $;t[23]!==i||t[24]!==o||t[25]!==r?($={orgSlug:o,virtualMcpId:r,branch:i},t[23]=i,t[24]=o,t[25]=r,t[26]=$):$=t[26];const u=Xt($);let S;t[27]!==u||t[28]!==d?(S=s=>u.mutate(s,{onError:l=>St.error(d("sectionsEditor.sectionsEditor.saveFailed",{error:l.message}))}),t[27]=u,t[28]=d,t[29]=S):S=t[29];let U;t[30]!==c||t[31]!==u.v8||t[32]!==S?(U=Gt(S,c,u.v8),t[30]=c,t[31]=u.v8,t[32]=S,t[33]=U):U=t[33];const lt=U,[Rt,Nt]=K.useState(p),[at,Bt]=K.useState(null),[ct,Et]=K.useState(0);let V;t[34]===Symbol.for("react.memo_cache_sentinel")?(V=[],t[34]=V):V=t[34];const[y,wt]=K.useState(V),[pt,f]=K.useState(!1),z=K.useRef(null);Rt!==p&&(Nt(p),Bt(null),Et(ne),wt([]));let L;t[35]!==x?(L=x??{},t[35]=x,t[36]=L):L=t[36];const dt=L;let k;t[37]!==at?(k=at??{},t[37]=at,t[38]=k):k=t[38];let q;t[39]!==dt||t[40]!==k?(q={...dt,...k},t[39]=dt,t[40]=k,t[41]=q):q=t[41];const ut=q;let H;t[42]!==p||t[43]!==a||t[44]!==st?(H=s=>{const l=s;Bt(l),st(p,{...l,__resolveType:a})},t[42]=p,t[43]=a,t[44]=st,t[45]=H):H=t[45];const ft=H;let D;t[46]===Symbol.for("react.memo_cache_sentinel")?(D=s=>{wt(s)},t[46]=D):D=t[46];const R=D;let G;t[47]!==c||t[48]!==mt||t[49]!==u||t[50]!==d?(G=async(s,l)=>{try{const{blockKey:h,data:b}=ie(s,c),gt=await u.mutateAsync({blockKey:h,data:b});Yt(gt)||St.success(d("sandbox.appEditor.createdSection",{name:h})),l({__resolveType:h}),mt()}catch(h){const b=h,gt=b instanceof Error?b.message:d("sandbox.appEditor.failedAddSection");throw St.error(gt),b}},t[47]=c,t[48]=mt,t[49]=u,t[50]=d,t[51]=G):G=t[51];const j=G;let W;t[52]!==f?(W=s=>{z.current=s.append,f(!0)},t[52]=f,t[53]=W):W=t[53];const ht=W;let Z;t[54]!==j||t[55]!==f?(Z=async s=>{const l=z.current;if(l)try{await j(s,h=>{l(h),f(!1),z.current=null})}catch{}},t[54]=j,t[55]=f,t[56]=Z):Z=t[56];const bt=Z,xt=y.length>0?[jt,...y]:[],Ct="flex h-full flex-col",Tt="flex h-12 shrink-0 items-center justify-between border-b px-6",vt=xt.length>0?m.jsx("nav",{"aria-label":d("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:xt.map((s,l)=>{const h=l===xt.length-1,b=Wt(s);return m.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[l>0&&m.jsx(It,{className:"size-3 shrink-0 text-muted-foreground/60"}),m.jsx("button",{type:"button",onClick:()=>{R(l===0?[]:Zt(y,l)),Et(me)},title:b,className:Ot("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors",h?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:b})]},`${b}-${l}`)})}):m.jsx("span",{className:"text-sm font-medium",children:jt});let B;t[57]!==nt?(B=m.jsx(ee,{isPending:nt,isError:!1}),t[57]=nt,t[58]=B):B=t[58];let E;t[59]!==vt||t[60]!==B?(E=m.jsxs("div",{className:Tt,children:[vt,B]}),t[59]=vt,t[60]=B,t[61]=E):E=t[61];let w;t[62]!==O||t[63]!==p||t[64]!==i||t[65]!==y||t[66]!==c||t[67]!==ut||t[68]!==ct||t[69]!==j||t[70]!==R||t[71]!==ft||t[72]!==ht||t[73]!==it||t[74]!==n||t[75]!==o||t[76]!==Y||t[77]!==lt||t[78]!==ot||t[79]!==v||t[80]!==d||t[81]!==rt||t[82]!==r?(w=it?m.jsx(Jt,{schema:ot,value:ut,onChange:ft,persistDefaults:Y,basePath:"",breadcrumbPath:y,onBreadcrumbChange:R,decofile:c,meta:n,onSaveReferencedBlock:lt,previewBaseUrl:v,onAddSectionItem:j,onRequestAddSection:ht,sandbox:{orgSlug:o,virtualMcpId:r,branch:i,threadId:rt}},`${p}:${ct}`):m.jsxs("div",{className:"flex flex-col items-center gap-3 py-6 text-center text-xs text-muted-foreground",children:[O&&m.jsx(Mt,{className:"size-4"}),m.jsx("p",{children:d(O?"sandbox.appEditor.schemaAwaitsBuild":"sandbox.appEditor.noEditableSchema")})]}),t[62]=O,t[63]=p,t[64]=i,t[65]=y,t[66]=c,t[67]=ut,t[68]=ct,t[69]=j,t[70]=R,t[71]=ft,t[72]=ht,t[73]=it,t[74]=n,t[75]=o,t[76]=Y,t[77]=lt,t[78]=ot,t[79]=v,t[80]=d,t[81]=rt,t[82]=r,t[83]=w):w=t[83];let _;t[84]!==Q||t[85]!==w?(_=m.jsx(Ut,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:m.jsx("div",{className:"px-6 py-6",children:m.jsxs("div",{className:"mx-auto max-w-xl",children:[Q,w]})})}),t[84]=Q,t[85]=w,t[86]=_):_=t[86];let A;t[87]!==pt||t[88]!==c||t[89]!==bt||t[90]!==n||t[91]!==v||t[92]!==f?(A=v&&m.jsx(zt,{open:pt,onOpenChange:s=>{f(s),s||(z.current=null)},meta:n,decofile:c,previewBaseUrl:v,onSelect:s=>{bt(s)}}),t[87]=pt,t[88]=c,t[89]=bt,t[90]=n,t[91]=v,t[92]=f,t[93]=A):A=t[93];let J;return t[94]!==E||t[95]!==_||t[96]!==A?(J=m.jsxs("div",{className:Ct,children:[E,_,A]}),t[94]=E,t[95]=_,t[96]=A,t[97]=J):J=t[97],J}function me(e){return e+1}function ne(e){return e+1}export{Xo as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,a4 as d,e as g,ak as m,K as I,q as O}from"./index-
|
|
1
|
+
import{c as u,a4 as d,e as g,ak as m,K as I,q as O}from"./index-CHOxYhnv.js";import{u as $}from"./useInfiniteQuery-Cr6l3hRz.js";function T(e){const t=u.c(17),{org:s}=d(),c=m();let i,n,o,l;t[0]!==s.id||t[1]!==e.configId||t[2]!==e.imageOnly||t[3]!==e.search?(n=e.search?.trim()||void 0,i=e.imageOnly??!1,l=$,o=I.filePickerObjects(s.id,e.configId,n,i),t[0]=s.id,t[1]=e.configId,t[2]=e.imageOnly,t[3]=e.search,t[4]=i,t[5]=n,t[6]=o,t[7]=l):(i=t[4],n=t[5],o=t[6],l=t[7]);const r=e.enabled!==!1&&!!e.configId;let a;t[8]!==i||t[9]!==e.configId||t[10]!==n||t[11]!==c?(a=async y=>{const{pageParam:p}=y;return await c.call("FILE_OBJECTS_LIST",{configId:e.configId,cursor:p??void 0,search:n,imageOnly:i||void 0})},t[8]=i,t[9]=e.configId,t[10]=n,t[11]=c,t[12]=a):a=t[12];let f;return t[13]!==o||t[14]!==r||t[15]!==a?(f={queryKey:o,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:h},t[13]=o,t[14]=r,t[15]=a,t[16]=f):f=t[16],l(f)}function h(e){return e.nextCursor??void 0}function E(){const e=u.c(2),{org:t}=d();let s;return e[0]!==t?(s={mutationFn:async c=>{const i=c.file.type||"application/octet-stream",n=await fetch(`/api/${encodeURIComponent(t.slug)}/file-configs/${encodeURIComponent(c.configId)}/upload?filename=${encodeURIComponent(c.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:c.file});if(!n.ok){const o=await n.text().catch(x);let l=`${n.status} ${n.statusText}`;try{const r=JSON.parse(o);r.message&&(l=r.message)}catch{o&&(l=o.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await n.json()}},e[0]=t,e[1]=s):s=e[1],g(s)}function x(){return""}function F(){const e=u.c(8),{org:t}=d(),s=m(),c=O();let i;e[0]!==s?(i=l=>s.call("FILE_OBJECT_DELETE",l),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==t||e[3]!==c?(n=(l,r)=>{c.invalidateQueries({queryKey:I.filePickerObjectsByConfig(t.id,r.configId)})},e[2]=t,e[3]=c,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o={mutationFn:i,onSuccess:n},e[5]=i,e[6]=n,e[7]=o):o=e[7],g(o)}function w(e){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(e)}function S(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"file":e.slice(t+1).toLowerCase()}function v(e){const t=e.split("/");return t[t.length-1]??e}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{T as a,v as b,F as c,S as e,_ as f,w as i,E as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bE as v,bF as $,bG as W,bH as H,bI as D,bJ as y,bK as V,bL as x,bM as b,bN as q,bO as j,bP as N,bQ as B,bR as F,bS as Z}from"./index-CWKxkTwy.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function L(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=F[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof v||n instanceof $)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await M(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function M(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return q.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??b;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=b}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await M(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function T(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await L(u);return Z.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=T(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=T(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await L(s);return j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,M as d,me as e};
|
|
1
|
+
import{bE as v,bF as $,bG as W,bH as H,bI as D,bJ as y,bK as V,bL as x,bM as b,bN as q,bO as j,bP as N,bQ as B,bR as F,bS as Z}from"./index-CHOxYhnv.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function L(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=F[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof v||n instanceof $)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await M(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function M(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return q.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??b;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=b}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await M(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function T(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await L(u);return Z.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=T(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=T(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await L(s);return j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,M as d,me as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-
|
|
1
|
+
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-CHOxYhnv.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $,a3 as Ne,r as b,e as ae,E as W,j as t,m as x,B as X,I as G,c as Ie,b as Ce,h as Ue}from"./index-CWKxkTwy.js";import{e as qe}from"./backoff-CrEUbyZT.js";import{d as De}from"./delay-CnY5UFtP.js";class Pe extends Error{constructor(e,o){super(`Retrying exceeded the maxAttempts (${o}).`),this.name="RetryError",this.cause=e}}async function ze(i,e){const{multiplier:o=2,maxTimeout:l=6e4,maxAttempts:w=5,minTimeout:g=1e3,jitter:r=1,isRetriable:u=()=>!0,signal:d}=e??{};if(!Number.isInteger(w)||w<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${w}`);if(!Number.isFinite(o)||o<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${o}`);if(Number.isNaN(l)||l<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${l}`);if(Number.isNaN(g)||g<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${g}`);if(g>l)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${g}', 'maxTimeout=${l}'`);if(Number.isNaN(r)||r<0||r>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${r}`);let P=0;for(;;){d?.throwIfAborted();try{return await i()}catch(A){if(!u(A))throw A;if(P+1>=w)throw new Pe(A,w);const O=qe(l,g,P,o,r);await De(O,d?{signal:d}:void 0)}P++}}const Ae={submitEmailPassword:({mode:i,email:e,password:o,name:l})=>i==="sign_up"?$.signUp.email({email:e,password:o,name:l||""}):$.signIn.email({email:e,password:o}),requestPasswordReset:({email:i,redirectTo:e})=>$.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>$.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>$.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>$.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>$.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ie="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Be={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ve({redirectUrl:i,callbackUrl:e="/",title:o,subtitle:l,brand:w,copy:g,variant:r="default",allowedSocialProviders:u,allowPassword:d=!0,onAuthEvent:P,actions:A}){const{emailAndPassword:O,resetPassword:S,emailOtp:E,socialProviders:F}=Ne(),j={...Ae,...A},h=s=>{try{P?.(s)}catch{}},p=r==="compact",Z=u?F.providers.filter(s=>u.includes(s.name)):F.providers,ee=F.enabled&&Z.length>0,ne=O.enabled&&(d||!E.enabled&&!ee),te=F.enabled&&F.providers.length>0&&!ee&&!E.enabled&&!ne?F.providers:Z,I=F.enabled&&te.length>0,C=O.enabled&&(d||!E.enabled&&!I),[c,N]=b.useState(""),[_,f]=b.useState(""),[re,ge]=b.useState(""),[oe,le]=b.useState(""),[M,de]=b.useState(!1),[ce,_e]=b.useState(()=>E.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[y,U]=b.useState(""),[he,pe]=b.useState(!1),[ke,me]=b.useState(null),a={...Be,...g},Y=b.useId(),q=`${Y}-email`,D=`${Y}-email-error`,fe=`${Y}-name`,xe=`${Y}-password`,be=`${Y}-otp`,v=ce==="signUp",R=ce==="forgotPassword",k=ce==="emailOtp",J=ae({mutationFn:async({email:s,password:n,name:L})=>{try{const H=await j.submitEmailPassword({mode:v?"sign_up":"sign_in",email:s,password:n,name:L});if(H.error)throw new Error(H.error.message||(v?a.signUpFailed:a.signInFailed));return H}catch(H){throw H instanceof Error?H:new Error(a.authenticationFailed)}},onMutate:()=>{h({type:"started",method:"email_password",mode:v?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:v?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),j.onAuthenticated(i??e)},onError:s=>{h({type:"failed",method:"email_password",mode:v?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),W(v?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),K=ae({mutationFn:async({email:s})=>{const n=await j.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(n.error)throw new Error(n.error.message||a.resetEmailFailed);return n},onSuccess:()=>{W("password_reset_requested"),pe(!0)},onError:s=>{W("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),z=ae({mutationFn:async({email:s})=>{const n=await j.sendOtp({email:s});if(n.error)throw new Error(n.error.message||a.otpSendFailed);return n},onMutate:()=>{h({type:"started",method:"email_otp"})},onSuccess:()=>{h({type:"otp_sent",method:"email_otp"}),W("email_otp_sent"),de(!0)},onError:s=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),W("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),B=ae({mutationFn:async({email:s,otp:n})=>{const L=await j.submitOtp({email:s,otp:n});if(L.error)throw new Error(L.error.message||a.invalidCode);return L},onMutate:()=>{h({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{h({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),j.onAuthenticated(i??e)},onError:s=>{h({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),W("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),se=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),ue=()=>{c.trim()&&!se(c)&&U(a.invalidEmail)},Le=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail),h({type:"failed",method:"email_password",mode:v?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}J.mutate({email:c,password:_,name:re})},Oe=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail);return}K.mutate({email:c})},Re=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail),h({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}z.mutate({email:c})},Te=s=>{s.preventDefault(),B.mutate({email:c,otp:oe})},V=s=>n=>{s(n.target.value),we&&J.reset(),ve&&K.reset(),ye&&(z.reset(),B.reset()),s===N&&y&&U("")},Q=s=>{_e(s),ge(""),le(""),de(!1),U(""),pe(!1),me(null),J.reset(),K.reset(),z.reset(),B.reset()},m=J.isPending||K.isPending||z.isPending||B.isPending,we=J.error,ve=K.error,ye=z.error||B.error,T=v?c.trim()&&_.trim()&&re.trim():R?c.trim():k?M?oe.trim():c.trim():c.trim()&&_.trim(),$e=s=>{if(!s)return null;const n=s.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?a.invalidEmailOrPassword:n.includes("already exists")||n.includes("409")?a.accountExists:n.includes("network")||n.includes("fetch")?a.networkError:n.includes("rate limit")||n.includes("429")?a.tooManyAttempts:n.includes("invalid")&&n.includes("otp")?a.invalidOrExpiredCode:s.message||a.genericError},Ee=we||ve||ye||ke,We=async s=>{h({type:"started",method:"social",provider:s}),me(null);try{const n=await j.socialSignIn({provider:s,callbackURL:i??e});if(n.error)throw new Error(n.error.message||a.authenticationFailed)}catch(n){const L=n instanceof Error?n.message:String(n);h({type:"failed",method:"social",provider:s,stage:"redirect",error:L}),W("social_signin_failed",{provider:s,error:L}),me(n instanceof Error?n:new Error(L))}},Me=R?a.resetPasswordTitle:k&&M?a.verificationCodeTitle:o??a.welcomeTitle,Se=R?a.resetPasswordSubtitle:k&&M?a.codeSentTo(c):l===void 0?a.defaultSubtitle:l;return t.jsxs("div",{className:x("grid w-full",p?"gap-5":"gap-10"),children:[w??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:x("font-medium",p?"text-xl leading-7":"text-2xl leading-8"),children:Me}),Se&&t.jsx("p",{className:x("text-muted-foreground",p?"text-sm leading-5":"text-base leading-6"),children:Se})]}),Ee&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:$e(Ee)}),he&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:a.resetEmailSent}),!R&&!(k&&M)&&I&&t.jsx("div",{className:"grid gap-2",children:te.map(s=>t.jsxs(X,{type:"button",variant:"outline",size:p?"lg":"xl",disabled:m,onClick:()=>{We(s.name)},className:"w-full gap-3",children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:x("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),a.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!R&&!(k&&M)&&I&&(C||E.enabled)&&t.jsxs("div",{className:x("flex items-center gap-2.5",p?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:x("text-muted-foreground",p?"text-sm":"text-base"),children:a.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),k&&E.enabled&&t.jsx(t.Fragment,{children:M?t.jsxs("form",{onSubmit:Te,className:x("grid gap-2",p&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:be,className:x("text-sm font-medium text-foreground",p&&"sr-only"),children:a.verificationCodeLabel}),t.jsx(G,{id:be,type:"text",placeholder:a.enterCodePlaceholder,value:oe,onChange:V(le),required:!0,disabled:m,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11"})]}),t.jsx(X,{type:"submit",size:p?"lg":"xl",disabled:m||!T,className:x(p?"sm:w-auto":"w-full"),children:m?a.verifying:a.verify}),t.jsx("button",{type:"button",onClick:()=>{de(!1),le(""),z.reset(),B.reset()},disabled:m,className:x("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",p&&"sm:col-span-2"),children:a.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Re,className:x("grid gap-2",p&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:q,className:x("text-sm font-medium text-foreground",p&&"sr-only"),children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:a.emailPlaceholder,value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive",children:y})]}),t.jsx(X,{type:"submit",size:p?"lg":"xl",disabled:m||!T,className:x(p?"sm:w-auto":"w-full"),children:m?a.sending:a.sendCode})]})}),R&&C&&!he&&t.jsxs("form",{onSubmit:Oe,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:q,className:"block text-sm font-medium text-foreground mb-2",children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:"you@example.com",value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive mt-1.5",children:y})]}),t.jsx(X,{type:"submit",disabled:m||!T,className:"w-full font-semibold",size:"xl",children:m?a.sending:a.sendResetLink})]}),!R&&!k&&C&&t.jsxs("form",{onSubmit:Le,className:"grid gap-5",children:[v&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:fe,className:"block text-sm font-medium text-foreground mb-2",children:a.nameLabel}),t.jsx(G,{id:fe,type:"text",placeholder:a.namePlaceholder,value:re,onChange:V(ge),required:!0,disabled:m,autoComplete:"name",className:"h-11"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:q,className:"block text-sm font-medium text-foreground mb-2",children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:"you@example.com",value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive mt-1.5",children:y})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:xe,className:"block text-sm font-medium text-foreground",children:a.passwordLabel}),!v&&S.enabled&&t.jsx("button",{type:"button",onClick:()=>Q("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:a.forgotPassword})]}),t.jsx(G,{id:xe,type:"password",placeholder:"••••••••",value:_,onChange:V(f),required:!0,disabled:m,autoComplete:v?"new-password":"current-password",className:"h-11"})]}),t.jsx("div",{className:x("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",T?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:x("p-1",!T&&"pointer-events-none"),children:t.jsx(X,{type:"submit",disabled:m||!T,className:x("w-full font-semibold"),size:"xl","aria-hidden":!T,children:m?v?a.creatingAccount:a.signingIn:a.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:R?t.jsx("button",{type:"button",onClick:()=>Q("signIn"),disabled:m,className:ie,children:a.backToSignIn}):k&&C?t.jsx("button",{type:"button",onClick:()=>Q("signIn"),disabled:m,className:ie,children:a.signInWithPassword}):!k&&C?t.jsxs(t.Fragment,{children:[v?a.alreadyHaveAccount:a.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>Q(v?"signIn":"signUp"),disabled:m,className:ie,children:v?a.signIn:a.signUp}),E.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>Q("emailOtp"),disabled:m,className:ie,children:a.signInWithEmailCode})]})]}):null})]})}class je{constructor(e){this.response=e}response}function He(i){return i.startsWith("/")&&!i.startsWith("//")&&!i.startsWith("/\\")?i:"/"}function Ge({redirectTo:i,onAuthEvent:e}){const o=Ce(),[l,w]=b.useState(null),g=b.useEffectEvent(r=>{try{e?.(r)}catch{}});return b.useEffect(()=>{let r=!1;return(async()=>{g({type:"started",method:"local"});try{let u;try{u=await ze(async()=>{const d=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(d.status>=500)throw new je(d);return d},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(d){if(d instanceof Pe&&d.cause instanceof je)u=d.cause.response;else throw d}if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error(d?.error||o("common.authEntry.autoLoginFailed"))}r||(g({type:"succeeded",method:"local"}),window.location.href=He(i))}catch(u){r||(g({type:"failed",method:"local",stage:"authenticate",error:u instanceof Error?u.message:String(u)}),w(u instanceof Error?u.message:o("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),l?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:o("common.authEntry.autoLoginFailedWithError",{error:l})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:o("common.authEntry.tryRestartingServer")})]})}):t.jsx(Fe,{})}function Fe(){const i=Ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(Ue,{size:"lg",label:"Signing in"})}),i[0]=e):e=i[0],e}function Ye({callbackURL:i,providerId:e,ssoSignIn:o,onAuthEvent:l}){const w=b.useEffectEvent(r=>{try{l?.(r)}catch{}}),g=b.useEffectEvent(o);return b.useEffect(()=>{(async()=>{w({type:"started",method:"sso",provider:e});try{const r=await g({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){w({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(Fe,{})}function Xe(i){const e=Ie.c(25),{callbackUrl:o,redirectUrl:l,allowAutoLogin:w,title:g,subtitle:r,brand:u,copy:d,variant:P,allowedSocialProviders:A,allowPassword:O,onAuthEvent:S,onAuthenticated:E}=i,F=w===void 0?!0:w,j=Ce(),{sso:h,emailAndPassword:p,magicLink:Z,emailOtp:ee,socialProviders:ne,localMode:te}=Ne(),I=l||o;let C;e[0]!==E?(C=E?{onAuthenticated:E}:void 0,e[0]=E,e[1]=C):C=e[1];const c=C;if(te&&F){let f;return e[2]!==S||e[3]!==I?(f=t.jsx(Ge,{redirectTo:I,onAuthEvent:S}),e[2]=S,e[3]=I,e[4]=f):f=e[4],f}if(h.enabled){let f;return e[5]!==S||e[6]!==I||e[7]!==h.providerId?(f=t.jsx(Ye,{callbackURL:I,providerId:h.providerId,ssoSignIn:Ae.ssoSignIn,onAuthEvent:S}),e[5]=S,e[6]=I,e[7]=h.providerId,e[8]=f):f=e[8],f}if(p.enabled||Z.enabled||ee.enabled||ne.enabled){let f;return e[9]!==O||e[10]!==A||e[11]!==u||e[12]!==o||e[13]!==c||e[14]!==d||e[15]!==S||e[16]!==l||e[17]!==r||e[18]!==g||e[19]!==P?(f=t.jsx(Ve,{redirectUrl:l,callbackUrl:o,title:g,subtitle:r,brand:u,copy:d,variant:P,allowedSocialProviders:A,allowPassword:O,onAuthEvent:S,actions:c}),e[9]=O,e[10]=A,e[11]=u,e[12]=o,e[13]=c,e[14]=d,e[15]=S,e[16]=l,e[17]=r,e[18]=g,e[19]=P,e[20]=f):f=e[20],f}let N;e[21]!==j?(N=j("common.authEntry.noLoginOptions"),e[21]=j,e[22]=N):N=e[22];let _;return e[23]!==N?(_=t.jsx("div",{children:N}),e[23]=N,e[24]=_):_=e[24],_}export{Fe as A,Xe as a};
|
|
1
|
+
import{a as $,a3 as Ne,r as b,e as ae,E as W,j as t,m as x,B as X,I as G,c as Ie,b as Ce,h as Ue}from"./index-CHOxYhnv.js";import{e as qe}from"./backoff-CrEUbyZT.js";import{d as De}from"./delay-CnY5UFtP.js";class Pe extends Error{constructor(e,o){super(`Retrying exceeded the maxAttempts (${o}).`),this.name="RetryError",this.cause=e}}async function ze(i,e){const{multiplier:o=2,maxTimeout:l=6e4,maxAttempts:w=5,minTimeout:g=1e3,jitter:r=1,isRetriable:u=()=>!0,signal:d}=e??{};if(!Number.isInteger(w)||w<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${w}`);if(!Number.isFinite(o)||o<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${o}`);if(Number.isNaN(l)||l<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${l}`);if(Number.isNaN(g)||g<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${g}`);if(g>l)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${g}', 'maxTimeout=${l}'`);if(Number.isNaN(r)||r<0||r>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${r}`);let P=0;for(;;){d?.throwIfAborted();try{return await i()}catch(A){if(!u(A))throw A;if(P+1>=w)throw new Pe(A,w);const O=qe(l,g,P,o,r);await De(O,d?{signal:d}:void 0)}P++}}const Ae={submitEmailPassword:({mode:i,email:e,password:o,name:l})=>i==="sign_up"?$.signUp.email({email:e,password:o,name:l||""}):$.signIn.email({email:e,password:o}),requestPasswordReset:({email:i,redirectTo:e})=>$.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>$.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>$.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>$.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>$.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ie="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Be={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ve({redirectUrl:i,callbackUrl:e="/",title:o,subtitle:l,brand:w,copy:g,variant:r="default",allowedSocialProviders:u,allowPassword:d=!0,onAuthEvent:P,actions:A}){const{emailAndPassword:O,resetPassword:S,emailOtp:E,socialProviders:F}=Ne(),j={...Ae,...A},h=s=>{try{P?.(s)}catch{}},p=r==="compact",Z=u?F.providers.filter(s=>u.includes(s.name)):F.providers,ee=F.enabled&&Z.length>0,ne=O.enabled&&(d||!E.enabled&&!ee),te=F.enabled&&F.providers.length>0&&!ee&&!E.enabled&&!ne?F.providers:Z,I=F.enabled&&te.length>0,C=O.enabled&&(d||!E.enabled&&!I),[c,N]=b.useState(""),[_,f]=b.useState(""),[re,ge]=b.useState(""),[oe,le]=b.useState(""),[M,de]=b.useState(!1),[ce,_e]=b.useState(()=>E.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[y,U]=b.useState(""),[he,pe]=b.useState(!1),[ke,me]=b.useState(null),a={...Be,...g},Y=b.useId(),q=`${Y}-email`,D=`${Y}-email-error`,fe=`${Y}-name`,xe=`${Y}-password`,be=`${Y}-otp`,v=ce==="signUp",R=ce==="forgotPassword",k=ce==="emailOtp",J=ae({mutationFn:async({email:s,password:n,name:L})=>{try{const H=await j.submitEmailPassword({mode:v?"sign_up":"sign_in",email:s,password:n,name:L});if(H.error)throw new Error(H.error.message||(v?a.signUpFailed:a.signInFailed));return H}catch(H){throw H instanceof Error?H:new Error(a.authenticationFailed)}},onMutate:()=>{h({type:"started",method:"email_password",mode:v?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:v?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),j.onAuthenticated(i??e)},onError:s=>{h({type:"failed",method:"email_password",mode:v?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),W(v?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),K=ae({mutationFn:async({email:s})=>{const n=await j.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(n.error)throw new Error(n.error.message||a.resetEmailFailed);return n},onSuccess:()=>{W("password_reset_requested"),pe(!0)},onError:s=>{W("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),z=ae({mutationFn:async({email:s})=>{const n=await j.sendOtp({email:s});if(n.error)throw new Error(n.error.message||a.otpSendFailed);return n},onMutate:()=>{h({type:"started",method:"email_otp"})},onSuccess:()=>{h({type:"otp_sent",method:"email_otp"}),W("email_otp_sent"),de(!0)},onError:s=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),W("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),B=ae({mutationFn:async({email:s,otp:n})=>{const L=await j.submitOtp({email:s,otp:n});if(L.error)throw new Error(L.error.message||a.invalidCode);return L},onMutate:()=>{h({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{h({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),j.onAuthenticated(i??e)},onError:s=>{h({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),W("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),se=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),ue=()=>{c.trim()&&!se(c)&&U(a.invalidEmail)},Le=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail),h({type:"failed",method:"email_password",mode:v?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}J.mutate({email:c,password:_,name:re})},Oe=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail);return}K.mutate({email:c})},Re=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail),h({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}z.mutate({email:c})},Te=s=>{s.preventDefault(),B.mutate({email:c,otp:oe})},V=s=>n=>{s(n.target.value),we&&J.reset(),ve&&K.reset(),ye&&(z.reset(),B.reset()),s===N&&y&&U("")},Q=s=>{_e(s),ge(""),le(""),de(!1),U(""),pe(!1),me(null),J.reset(),K.reset(),z.reset(),B.reset()},m=J.isPending||K.isPending||z.isPending||B.isPending,we=J.error,ve=K.error,ye=z.error||B.error,T=v?c.trim()&&_.trim()&&re.trim():R?c.trim():k?M?oe.trim():c.trim():c.trim()&&_.trim(),$e=s=>{if(!s)return null;const n=s.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?a.invalidEmailOrPassword:n.includes("already exists")||n.includes("409")?a.accountExists:n.includes("network")||n.includes("fetch")?a.networkError:n.includes("rate limit")||n.includes("429")?a.tooManyAttempts:n.includes("invalid")&&n.includes("otp")?a.invalidOrExpiredCode:s.message||a.genericError},Ee=we||ve||ye||ke,We=async s=>{h({type:"started",method:"social",provider:s}),me(null);try{const n=await j.socialSignIn({provider:s,callbackURL:i??e});if(n.error)throw new Error(n.error.message||a.authenticationFailed)}catch(n){const L=n instanceof Error?n.message:String(n);h({type:"failed",method:"social",provider:s,stage:"redirect",error:L}),W("social_signin_failed",{provider:s,error:L}),me(n instanceof Error?n:new Error(L))}},Me=R?a.resetPasswordTitle:k&&M?a.verificationCodeTitle:o??a.welcomeTitle,Se=R?a.resetPasswordSubtitle:k&&M?a.codeSentTo(c):l===void 0?a.defaultSubtitle:l;return t.jsxs("div",{className:x("grid w-full",p?"gap-5":"gap-10"),children:[w??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:x("font-medium",p?"text-xl leading-7":"text-2xl leading-8"),children:Me}),Se&&t.jsx("p",{className:x("text-muted-foreground",p?"text-sm leading-5":"text-base leading-6"),children:Se})]}),Ee&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:$e(Ee)}),he&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:a.resetEmailSent}),!R&&!(k&&M)&&I&&t.jsx("div",{className:"grid gap-2",children:te.map(s=>t.jsxs(X,{type:"button",variant:"outline",size:p?"lg":"xl",disabled:m,onClick:()=>{We(s.name)},className:"w-full gap-3",children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:x("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),a.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!R&&!(k&&M)&&I&&(C||E.enabled)&&t.jsxs("div",{className:x("flex items-center gap-2.5",p?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:x("text-muted-foreground",p?"text-sm":"text-base"),children:a.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),k&&E.enabled&&t.jsx(t.Fragment,{children:M?t.jsxs("form",{onSubmit:Te,className:x("grid gap-2",p&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:be,className:x("text-sm font-medium text-foreground",p&&"sr-only"),children:a.verificationCodeLabel}),t.jsx(G,{id:be,type:"text",placeholder:a.enterCodePlaceholder,value:oe,onChange:V(le),required:!0,disabled:m,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11"})]}),t.jsx(X,{type:"submit",size:p?"lg":"xl",disabled:m||!T,className:x(p?"sm:w-auto":"w-full"),children:m?a.verifying:a.verify}),t.jsx("button",{type:"button",onClick:()=>{de(!1),le(""),z.reset(),B.reset()},disabled:m,className:x("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",p&&"sm:col-span-2"),children:a.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Re,className:x("grid gap-2",p&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:q,className:x("text-sm font-medium text-foreground",p&&"sr-only"),children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:a.emailPlaceholder,value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive",children:y})]}),t.jsx(X,{type:"submit",size:p?"lg":"xl",disabled:m||!T,className:x(p?"sm:w-auto":"w-full"),children:m?a.sending:a.sendCode})]})}),R&&C&&!he&&t.jsxs("form",{onSubmit:Oe,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:q,className:"block text-sm font-medium text-foreground mb-2",children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:"you@example.com",value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive mt-1.5",children:y})]}),t.jsx(X,{type:"submit",disabled:m||!T,className:"w-full font-semibold",size:"xl",children:m?a.sending:a.sendResetLink})]}),!R&&!k&&C&&t.jsxs("form",{onSubmit:Le,className:"grid gap-5",children:[v&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:fe,className:"block text-sm font-medium text-foreground mb-2",children:a.nameLabel}),t.jsx(G,{id:fe,type:"text",placeholder:a.namePlaceholder,value:re,onChange:V(ge),required:!0,disabled:m,autoComplete:"name",className:"h-11"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:q,className:"block text-sm font-medium text-foreground mb-2",children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:"you@example.com",value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive mt-1.5",children:y})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:xe,className:"block text-sm font-medium text-foreground",children:a.passwordLabel}),!v&&S.enabled&&t.jsx("button",{type:"button",onClick:()=>Q("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:a.forgotPassword})]}),t.jsx(G,{id:xe,type:"password",placeholder:"••••••••",value:_,onChange:V(f),required:!0,disabled:m,autoComplete:v?"new-password":"current-password",className:"h-11"})]}),t.jsx("div",{className:x("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",T?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:x("p-1",!T&&"pointer-events-none"),children:t.jsx(X,{type:"submit",disabled:m||!T,className:x("w-full font-semibold"),size:"xl","aria-hidden":!T,children:m?v?a.creatingAccount:a.signingIn:a.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:R?t.jsx("button",{type:"button",onClick:()=>Q("signIn"),disabled:m,className:ie,children:a.backToSignIn}):k&&C?t.jsx("button",{type:"button",onClick:()=>Q("signIn"),disabled:m,className:ie,children:a.signInWithPassword}):!k&&C?t.jsxs(t.Fragment,{children:[v?a.alreadyHaveAccount:a.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>Q(v?"signIn":"signUp"),disabled:m,className:ie,children:v?a.signIn:a.signUp}),E.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>Q("emailOtp"),disabled:m,className:ie,children:a.signInWithEmailCode})]})]}):null})]})}class je{constructor(e){this.response=e}response}function He(i){return i.startsWith("/")&&!i.startsWith("//")&&!i.startsWith("/\\")?i:"/"}function Ge({redirectTo:i,onAuthEvent:e}){const o=Ce(),[l,w]=b.useState(null),g=b.useEffectEvent(r=>{try{e?.(r)}catch{}});return b.useEffect(()=>{let r=!1;return(async()=>{g({type:"started",method:"local"});try{let u;try{u=await ze(async()=>{const d=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(d.status>=500)throw new je(d);return d},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(d){if(d instanceof Pe&&d.cause instanceof je)u=d.cause.response;else throw d}if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error(d?.error||o("common.authEntry.autoLoginFailed"))}r||(g({type:"succeeded",method:"local"}),window.location.href=He(i))}catch(u){r||(g({type:"failed",method:"local",stage:"authenticate",error:u instanceof Error?u.message:String(u)}),w(u instanceof Error?u.message:o("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),l?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:o("common.authEntry.autoLoginFailedWithError",{error:l})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:o("common.authEntry.tryRestartingServer")})]})}):t.jsx(Fe,{})}function Fe(){const i=Ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(Ue,{size:"lg",label:"Signing in"})}),i[0]=e):e=i[0],e}function Ye({callbackURL:i,providerId:e,ssoSignIn:o,onAuthEvent:l}){const w=b.useEffectEvent(r=>{try{l?.(r)}catch{}}),g=b.useEffectEvent(o);return b.useEffect(()=>{(async()=>{w({type:"started",method:"sso",provider:e});try{const r=await g({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){w({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(Fe,{})}function Xe(i){const e=Ie.c(25),{callbackUrl:o,redirectUrl:l,allowAutoLogin:w,title:g,subtitle:r,brand:u,copy:d,variant:P,allowedSocialProviders:A,allowPassword:O,onAuthEvent:S,onAuthenticated:E}=i,F=w===void 0?!0:w,j=Ce(),{sso:h,emailAndPassword:p,magicLink:Z,emailOtp:ee,socialProviders:ne,localMode:te}=Ne(),I=l||o;let C;e[0]!==E?(C=E?{onAuthenticated:E}:void 0,e[0]=E,e[1]=C):C=e[1];const c=C;if(te&&F){let f;return e[2]!==S||e[3]!==I?(f=t.jsx(Ge,{redirectTo:I,onAuthEvent:S}),e[2]=S,e[3]=I,e[4]=f):f=e[4],f}if(h.enabled){let f;return e[5]!==S||e[6]!==I||e[7]!==h.providerId?(f=t.jsx(Ye,{callbackURL:I,providerId:h.providerId,ssoSignIn:Ae.ssoSignIn,onAuthEvent:S}),e[5]=S,e[6]=I,e[7]=h.providerId,e[8]=f):f=e[8],f}if(p.enabled||Z.enabled||ee.enabled||ne.enabled){let f;return e[9]!==O||e[10]!==A||e[11]!==u||e[12]!==o||e[13]!==c||e[14]!==d||e[15]!==S||e[16]!==l||e[17]!==r||e[18]!==g||e[19]!==P?(f=t.jsx(Ve,{redirectUrl:l,callbackUrl:o,title:g,subtitle:r,brand:u,copy:d,variant:P,allowedSocialProviders:A,allowPassword:O,onAuthEvent:S,actions:c}),e[9]=O,e[10]=A,e[11]=u,e[12]=o,e[13]=c,e[14]=d,e[15]=S,e[16]=l,e[17]=r,e[18]=g,e[19]=P,e[20]=f):f=e[20],f}let N;e[21]!==j?(N=j("common.authEntry.noLoginOptions"),e[21]=j,e[22]=N):N=e[22];let _;return e[23]!==N?(_=t.jsx("div",{children:N}),e[23]=N,e[24]=_):_=e[24],_}export{Fe as A,Xe as a};
|