decocms 4.321.6 → 4.322.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-CG7tfapy.js → AlertCircle-C2NBg9mc.js} +1 -1
- package/dist/client/assets/{AreaChart-CZiIuPwc.js → AreaChart-B9xdJ5uf.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Dexv6rHk.js → ArrowLeft-CsptIIdO.js} +1 -1
- package/dist/client/assets/{ArrowUp-CxKA4POx.js → ArrowUp-ChGaXEv5.js} +1 -1
- package/dist/client/assets/{Check-Jn0qXgT0.js → Check-BX2gygbe.js} +1 -1
- package/dist/client/assets/{CheckCircle-BnpxIwzg.js → CheckCircle-DliFzmTw.js} +1 -1
- package/dist/client/assets/{ChevronRight-CKftPemQ.js → ChevronRight-DbZJ7s91.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BPOo032l.js → ChevronSelectorVertical-kHOMBDm7.js} +1 -1
- package/dist/client/assets/{ChevronUp-BCwuiyHj.js → ChevronUp-CKAKUsLZ.js} +1 -1
- package/dist/client/assets/{Copy01-jXW2eGyY.js → Copy01-C__uU62x.js} +1 -1
- package/dist/client/assets/{CreditCard01-Zn4AjX46.js → CreditCard01-BOQ6PfLv.js} +1 -1
- package/dist/client/assets/{DotsVertical-C65YDOa_.js → DotsVertical-BAzYPODX.js} +1 -1
- package/dist/client/assets/{Download01-BpcIjY9x.js → Download01-BSiLOFk1.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-3KuuNxaa.js → ErrorBarContext-C8c_W04d.js} +1 -1
- package/dist/client/assets/{Eye-DvBjB5D4.js → Eye-C8bJ0pht.js} +1 -1
- package/dist/client/assets/{GitBranch01-Bde_Ik_K.js → GitBranch01-Bab5ZdgR.js} +1 -1
- package/dist/client/assets/{Globe01-D2uoGclE.js → Globe01-CChCtZhM.js} +1 -1
- package/dist/client/assets/{HardDrive-CBqO3DS3.js → HardDrive-85baSgBa.js} +1 -1
- package/dist/client/assets/{Image01-0uExgWAI.js → Image01-ys43utN0.js} +1 -1
- package/dist/client/assets/{Key01-BiKWCM1S.js → Key01-C-1aj8U9.js} +1 -1
- package/dist/client/assets/{Link01-C7a_h6ys.js → Link01-DGUdctuw.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D_IXdPPU.js → LinkExternal01-0jxUYeWb.js} +1 -1
- package/dist/client/assets/{Monitor01-CKYtARge.js → Monitor01-84uea3LL.js} +1 -1
- package/dist/client/assets/{Package-D0PXqO6P.js → Package-B18tBkuY.js} +1 -1
- package/dist/client/assets/{Palette-CQVEzzhe.js → Palette-CV1Ch2Ua.js} +1 -1
- package/dist/client/assets/{Play-CONIoWIl.js → Play-B9Jhx-_c.js} +1 -1
- package/dist/client/assets/{Plus-D7VA57q5.js → Plus-B5hmmemV.js} +1 -1
- package/dist/client/assets/{SearchMd-C1loDEwy.js → SearchMd-C_odO2p9.js} +1 -1
- package/dist/client/assets/{Sector-DWJi3JDL.js → Sector-CrSbN2_Q.js} +1 -1
- package/dist/client/assets/{Settings02-DfFNQquZ.js → Settings02-Bu5ySj3i.js} +1 -1
- package/dist/client/assets/{Share07-8oXDBqwk.js → Share07-DwzdoQ4a.js} +1 -1
- package/dist/client/assets/{Shield01-CrPC_5gY.js → Shield01-CeyvRCTS.js} +1 -1
- package/dist/client/assets/{Stars01-BTmtR5If.js → Stars01-m2rCV73l.js} +1 -1
- package/dist/client/assets/{Sun-N_eYVUUU.js → Sun-SCvGGuZ8.js} +1 -1
- package/dist/client/assets/{Tool01-CtOHcy0Y.js → Tool01-BZqaTMXK.js} +1 -1
- package/dist/client/assets/{Tool02-DHxIusmd.js → Tool02-pfppv5IR.js} +1 -1
- package/dist/client/assets/{Trash01-CHla-FrA.js → Trash01-CmUBt3qF.js} +1 -1
- package/dist/client/assets/{TrendUp01-BctNF4vg.js → TrendUp01-CHK-OeEA.js} +1 -1
- package/dist/client/assets/{Upload01-VP9EBYtl.js → Upload01-DORj1aoY.js} +1 -1
- package/dist/client/assets/{User01-8XeMepHg.js → User01-CgCTj81P.js} +1 -1
- package/dist/client/assets/{UserSquare-BEv1iIj5.js → UserSquare-Cis5hkvt.js} +1 -1
- package/dist/client/assets/{Users01-CvPFHBcf.js → Users01-BikFpVdm.js} +1 -1
- package/dist/client/assets/{Users03-cesUeOsp.js → Users03-C3hNO4vD.js} +1 -1
- package/dist/client/assets/{XCircle-DZJkY1-f.js → XCircle-DYwdtPEj.js} +1 -1
- package/dist/client/assets/{XClose-mJWP0IZB.js → XClose-eQ0IqAwM.js} +1 -1
- package/dist/client/assets/{Zap-JQtzyV8B.js → Zap-D1wJazPI.js} +1 -1
- package/dist/client/assets/{ZoomOut-D8t79aO2.js → ZoomOut-3_5bYJZJ.js} +1 -1
- package/dist/client/assets/{access-gate-DhjnuxYh.js → access-gate-Boh4pe2s.js} +1 -1
- package/dist/client/assets/{agent-icon-Dsw04fQF.js → agent-icon-Bxsxnhg4.js} +1 -1
- package/dist/client/assets/{agents-list-BazgXeqr.js → agents-list-B1SxyPHo.js} +1 -1
- package/dist/client/assets/{ai-providers-C59crxe5.js → ai-providers-BO-hpebX.js} +1 -1
- package/dist/client/assets/{alert-CctLdkUH.js → alert-cxJ-LX7R.js} +1 -1
- package/dist/client/assets/{alert-dialog-BU3enZKF.js → alert-dialog-CPeNK-tT.js} +1 -1
- package/dist/client/assets/{analytics-tab-BAIQskOJ.js → analytics-tab-BK1czsPB.js} +1 -1
- package/dist/client/assets/{api-keys-CwZoIgmV.js → api-keys-DKb1gCJq.js} +1 -1
- package/dist/client/assets/api-keys-DUKJrttJ.js +1 -0
- package/dist/client/assets/{app-editor-Bvzl_qDB.js → app-editor-Bp-6yK5T.js} +1 -1
- package/dist/client/assets/{auth-Ctf1zdSk.js → auth-C7ghbqGi.js} +1 -1
- package/dist/client/assets/{auth-catchall-DfbKNMqE.js → auth-catchall-D8dVOxlt.js} +1 -1
- package/dist/client/assets/{auth-entry-BsXiAQoR.js → auth-entry-DrKraRDW.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BwXlZwBP.js → auth-split-layout-DiTqoIfy.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-UjkEE9k3.js → authenticate-and-persist-oauth-_W6RIHUW.js} +1 -1
- package/dist/client/assets/{automation-list-row-CakAIrvQ.js → automation-list-row-Bli88vuo.js} +1 -1
- package/dist/client/assets/{automation-runs-BP4svOKv.js → automation-runs-ebCE4-Is.js} +1 -1
- package/dist/client/assets/{automations-47G1qGwp.js → automations-B7W8ASEw.js} +1 -1
- package/dist/client/assets/{avatar-ayySA21l.js → avatar-CIaf_qwP.js} +1 -1
- package/dist/client/assets/{badge-BJg3YTbr.js → badge-C_BaeWRr.js} +1 -1
- package/dist/client/assets/{block-document-DOFjntDc.js → block-document-Dlj6PFRl.js} +1 -1
- package/dist/client/assets/{breadcrumb-B5Tcv0Uh.js → breadcrumb-DF2ZBTYn.js} +1 -1
- package/dist/client/assets/{buckets-DCKwVcGS.js → buckets-79Vh3NA0.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BWY_YPZV.js → bulk-category-panel-CfikpV9P.js} +1 -1
- package/dist/client/assets/{capability-load-error-BERy8yZe.js → capability-load-error-CiU11Kky.js} +1 -1
- package/dist/client/assets/{cards-D9Ttj2cE.js → cards-CEeLhPFB.js} +1 -1
- package/dist/client/assets/{category-editor-BPZKWEN1.js → category-editor-BXhDT606.js} +1 -1
- package/dist/client/assets/{cdn-tab-BU_7vQmo.js → cdn-tab-CRKejAe6.js} +1 -1
- package/dist/client/assets/{chart-DxN2Cs4Z.js → chart-5CmmGIaw.js} +1 -1
- package/dist/client/assets/{chat-context-ffF_r7RU.js → chat-context-UTIz_Pyn.js} +1 -1
- package/dist/client/assets/{checkbox-DmweFMZg.js → checkbox-DuSP_QEG.js} +1 -1
- package/dist/client/assets/{choose-editor-ChPKiRJQ.js → choose-editor-CZMEh5aO.js} +1 -1
- package/dist/client/assets/{cli-auth-success-3b6OvqFq.js → cli-auth-success-Bsxziq7Q.js} +1 -1
- package/dist/client/assets/{client-icons-DX-H77xu.js → client-icons-Cfw7Qv9M.js} +1 -1
- package/dist/client/assets/{collection-detail-CDYBCwYK.js → collection-detail-3sH97jF8.js} +1 -1
- package/dist/client/assets/{collection-display-button-COCZggWW.js → collection-display-button-BR4yX-1T.js} +1 -1
- package/dist/client/assets/{collection-search-DUFT-3aZ.js → collection-search-M_RRr6Xl.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CSMTQGj2.js → collection-table-wrapper-B2QBY6HJ.js} +1 -1
- package/dist/client/assets/{collection-tabs-aHnkLK94.js → collection-tabs-C8VQp3Vj.js} +1 -1
- package/dist/client/assets/{command-CEQjEkRa.js → command-YM_TkZoa.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BVWKpNBX.js → commerce-onboarding-WjJ28WVH.js} +1 -1
- package/dist/client/assets/{connect-C6lph8Iz.js → connect-CLb5V7C4.js} +1 -1
- package/dist/client/assets/{connect-layout-CS-AhNLB.js → connect-layout-D5j21U1X.js} +1 -1
- package/dist/client/assets/{connection-qt8m11-c.js → connection-CtZLzycj.js} +1 -1
- package/dist/client/assets/{connection-card-Bwgx5OMm.js → connection-card-BjwMqpRy.js} +1 -1
- package/dist/client/assets/{connection-detail-DCF5hqwD.js → connection-detail-DnO7R809.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Cs1EiOkG.js → connection-form-helpers-Dwp_oeO7.js} +1 -1
- package/dist/client/assets/{connections-C_jYcs4m.js → connections-C4EYP7S1.js} +1 -1
- package/dist/client/assets/{create-organization-dialog--WflCODd.js → create-organization-dialog-CdygCT51.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Cp5pr9Ve.js → decopilot-sse-pool-CXw15f-z.js} +1 -1
- package/dist/client/assets/{dialog-DDd8wUS7.js → dialog-MZN5GEGy.js} +1 -1
- package/dist/client/assets/{domain-settings-b-Gf934e.js → domain-settings-BLCQcKA9.js} +1 -1
- package/dist/client/assets/{drawer-CxFI5tCn.js → drawer-DcQ3SCMM.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C3Gdadki.js → dropdown-menu-g-JnC1d_.js} +1 -1
- package/dist/client/assets/{e2e-tab-9O9jlog6.js → e2e-tab-DHdWqMLc.js} +1 -1
- package/dist/client/assets/{editor-B0M9C5II.js → editor-CYkhTDNr.js} +1 -1
- package/dist/client/assets/{empty-state-Cs8gUH2e.js → empty-state-DSeNRJTF.js} +1 -1
- package/dist/client/assets/{empty-state-L8hCXC--.js → empty-state-D_K7q-Cu.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C2Ocp5Tk.js → extract-connection-data-UVgsucP8.js} +1 -1
- package/dist/client/assets/{file-explorer-DTbMKDAB.js → file-explorer-Tcq9KPqQ.js} +1 -1
- package/dist/client/assets/{file-type-icon-C5mq72Tm.js → file-type-icon-CMoqiRt4.js} +1 -1
- package/dist/client/assets/{folder-icon-Dt2zI1nQ.js → folder-icon-Di0Tlun6.js} +1 -1
- package/dist/client/assets/{form-DR4f8DO7.js → form-Dbv9rnRr.js} +1 -1
- package/dist/client/assets/{general-uVPlw24q.js → general-CPuIav3i.js} +1 -1
- package/dist/client/assets/{github-repo-picker-Dyu49H5P.js → github-repo-picker-B7FKQdS9.js} +1 -1
- package/dist/client/assets/{hooks-J2gbnuVW.js → hooks-CbjISts1.js} +1 -1
- package/dist/client/assets/{hosting-tab-StoCQBLo.js → hosting-tab-2_OiYopv.js} +1 -1
- package/dist/client/assets/{index-DH6qLcGa.js → index-7XLklGtI.js} +44 -44
- package/dist/client/assets/{index-hsED2j2G.js → index-B5kT8ivb.js} +1 -1
- package/dist/client/assets/{index--9Kt6-Xb.js → index-BEfhoxFP.js} +1 -1
- package/dist/client/assets/{index-CP6R9dTL.js → index-BzUwR_Kj.js} +1 -1
- package/dist/client/assets/{index-DU91evk-.js → index-CsgWXHyv.js} +1 -1
- package/dist/client/assets/{index-DaThHROC.js → index-CwSF-fso.js} +1 -1
- package/dist/client/assets/{index-B7iA3R9e.js → index-DGJdtgkO.js} +1 -1
- package/dist/client/assets/{index-DNghV_Kw.js → index-DptfekUv.js} +1 -1
- package/dist/client/assets/{index-CAw6g9tV.js → index-DuTFQdyn.js} +4 -4
- package/dist/client/assets/{index-DahqZ1Pw.js → index-i_ZWmEy2.js} +1 -1
- package/dist/client/assets/{index-redirect-1FO2ZwBa.js → index-redirect-XzPFIWda.js} +1 -1
- package/dist/client/assets/{infra-billing-HsGxVjhH.js → infra-billing-BisEHsWH.js} +1 -1
- package/dist/client/assets/{input-CRq9rZYf.js → input-BQBB8gcC.js} +1 -1
- package/dist/client/assets/{integration-icon-gY5UnY38.js → integration-icon-CGkU-oJS.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-RPIPoLmq.js → invite-member-dialog-CXTnbtoa.js} +1 -1
- package/dist/client/assets/{label-ByckMHtZ.js → label-DMb6nlzF.js} +1 -1
- package/dist/client/assets/{layout-C0m5fUEQ.js → layout-Cpsi8IlG.js} +1 -1
- package/dist/client/assets/{login-nfCx3aQb.js → login-C2N7_8Z7.js} +1 -1
- package/dist/client/assets/{markdown-C1VdpJ5j.js → markdown-DGD7BNRG.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DwPFIejs.js → mcp-oauth-B16lXFdS.js} +1 -1
- package/dist/client/assets/{members-BA8vVu_F.js → members-DkXuhuK4.js} +1 -1
- package/dist/client/assets/{monaco-editor-DhRI2q0D.js → monaco-editor-BEVlomxQ.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DLrfuurv.js → monitoring-stats-row-vCbaSDyL.js} +1 -1
- package/dist/client/assets/{multi-select-BFhmckl1.js → multi-select-CYmy4E9A.js} +1 -1
- package/dist/client/assets/{oauth-callback-CWLRFYZ2.js → oauth-callback-BLS2JyU4.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-RePfP1QM.js → oauth-callback-ai-provider-zGSiXcVG.js} +1 -1
- package/dist/client/assets/{onboarding-BneVgO60.js → onboarding-2ZIwSwjs.js} +1 -1
- package/dist/client/assets/org-layout-DdQI863P.js +1 -0
- package/dist/client/assets/{organization-choice-BqV4sYyS.js → organization-choice-2Zo8x27v.js} +1 -1
- package/dist/client/assets/{orgs-DEjfIaJ0.js → orgs-BSHTf-uT.js} +1 -1
- package/dist/client/assets/{page-seo-form-D-Eqo-mJ.js → page-seo-form-CEAUfpru.js} +1 -1
- package/dist/client/assets/{popover-BIPtCsqc.js → popover-DF2wTNDa.js} +1 -1
- package/dist/client/assets/{post-calendar-Chm7CCue.js → post-calendar-Clyxzkna.js} +1 -1
- package/dist/client/assets/{post-editor-vBEo0v-g.js → post-editor-uKyIPqEc.js} +1 -1
- package/dist/client/assets/{primitives-CmYrjVpf.js → primitives-BLnYeH_y.js} +1 -1
- package/dist/client/assets/{profile-Ce2FGBxd.js → profile-Dh3wznp6.js} +1 -1
- package/dist/client/assets/{project-app-view-lSJv2DSd.js → project-app-view-pw2V2AiB.js} +1 -1
- package/dist/client/assets/{prompts-Dt2G3dg0.js → prompts-roTbW28U.js} +1 -1
- package/dist/client/assets/record-editor-DTAqCBXC.js +1 -0
- package/dist/client/assets/redirect-editor-Cu9Z1A5U.js +1 -0
- package/dist/client/assets/registry-CKyAbQZL.js +2 -0
- package/dist/client/assets/{registry-layout-D1fFgR3o.js → registry-layout-bsIYkhqK.js} +1 -1
- package/dist/client/assets/{reports-DILtNiYy.js → reports-ygkEOWFw.js} +1 -1
- package/dist/client/assets/{require-capability-DMuYJppW.js → require-capability-CbuOrbcP.js} +1 -1
- package/dist/client/assets/{required-auth-layout-632Nlbdk.js → required-auth-layout-tEyIPAEG.js} +1 -1
- package/dist/client/assets/{reset-password-Dt0s206r.js → reset-password-flovEuym.js} +1 -1
- package/dist/client/assets/{review-settings-BSEiFN9m.js → review-settings-kCQ3yxbO.js} +1 -1
- package/dist/client/assets/{roles-Ca_cW6OU.js → roles-C0_uA7X4.js} +1 -1
- package/dist/client/assets/{schema-BoK0jTZh.js → schema-D_IYS8Ao.js} +1 -1
- package/dist/client/assets/{scroll-area-BI805ul_.js → scroll-area-hWU0FBJA.js} +1 -1
- package/dist/client/assets/{search-input-CFyqYOfd.js → search-input-BwssAmEt.js} +1 -1
- package/dist/client/assets/{secrets-hJRzyq6I.js → secrets-BjgFhRhz.js} +1 -1
- package/dist/client/assets/{sections-editor-CVFGArcx.js → sections-editor-BJw5TyGm.js} +1 -1
- package/dist/client/assets/{select-Bnv10Fl8.js → select-Clrs7oqv.js} +1 -1
- package/dist/client/assets/{select-model-NQ0mnVuK.js → select-model-fiPpDkFD.js} +1 -1
- package/dist/client/assets/{self-tool-result-Dc4tPK9T.js → self-tool-result-D-TDvKxu.js} +1 -1
- package/dist/client/assets/{seo-editor-DlfpOYSl.js → seo-editor-DHznYr6H.js} +1 -1
- package/dist/client/assets/settings-layout-DP8bWEHI.js +1 -0
- package/dist/client/assets/{settings-sidebar-BGOdVjou.js → settings-sidebar-dtIAxt0-.js} +1 -1
- package/dist/client/assets/{shell-controls-B8r3Mj0T.js → shell-controls-CwEfzM6F.js} +1 -1
- package/dist/client/assets/{shell-layout-X5sLDjab.js → shell-layout-1ZMT0Tc1.js} +1 -1
- package/dist/client/assets/{skill-preview-DL4gp0ne.js → skill-preview-5H-VVc0-.js} +1 -1
- package/dist/client/assets/{skills-BLjeFnB6.js → skills-C0RKS-KM.js} +1 -1
- package/dist/client/assets/{sso-DmCj3IPC.js → sso-gFZXEyk2.js} +1 -1
- package/dist/client/assets/{store-h_GKYo0A.js → store-CE3VED82.js} +1 -1
- package/dist/client/assets/store-registry-zv33DlrJ.js +2 -0
- package/dist/client/assets/{switch-DlPMc1e_.js → switch-D7TGNQH3.js} +1 -1
- package/dist/client/assets/{synced-repos-BhYGq1he.js → synced-repos-DUtFzhYN.js} +1 -1
- package/dist/client/assets/{table-D_mk2-gB.js → table-BsrbjIcJ.js} +1 -1
- package/dist/client/assets/{tabs-xquvO62b.js → tabs-DiCn1dq1.js} +1 -1
- package/dist/client/assets/{task-board-DHq8t-_N.js → task-board-h1SC3xFJ.js} +1 -1
- package/dist/client/assets/{task-route-DWU-0q6w.js → task-route-DSgSPPEW.js} +1 -1
- package/dist/client/assets/{tasks-68OUM7rF.js → tasks-gokvPc92.js} +1 -1
- package/dist/client/assets/{textarea-BClvRA4H.js → textarea-5EDWymdh.js} +1 -1
- package/dist/client/assets/{thread-intent-C3PV-LRn.js → thread-intent-mGN-1FVs.js} +1 -1
- package/dist/client/assets/{thread-route-CxY5TjeM.js → thread-route-UpxprbYB.js} +1 -1
- package/dist/client/assets/{toggle-group-d_5STaVP.js → toggle-group-B7_qFUih.js} +1 -1
- package/dist/client/assets/{toolbar-D-SXcT0t.js → toolbar-DCd5b8V9.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DSBvSnFI.js → toolbar-icon-button-C71EiiMK.js} +1 -1
- package/dist/client/assets/{track-Cc1S4yMy.js → track-C7kVOg09.js} +1 -1
- package/dist/client/assets/{types-B2KcVByH.js → types-D59wnQVu.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CiO6eVCB.js → use-ai-providers-Dpe1dK4t.js} +1 -1
- package/dist/client/assets/{use-automations-VoPscQxA.js → use-automations-CnSncj8S.js} +1 -1
- package/dist/client/assets/{use-autosave-D-iSKxnB.js → use-autosave-C4mWVfcc.js} +1 -1
- package/dist/client/assets/{use-connection-GI8Focwr.js → use-connection-CS7s7hVb.js} +1 -1
- package/dist/client/assets/{use-copy-C0nulXNR.js → use-copy-CYJxwj1_.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D-L0PRaI.js → use-create-virtual-mcp-BS2Eranu.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DJCeP_ec.js → use-debounced-autosave-C_9hcG96.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CozflcUh.js → use-debounced-value-DQ0AhwnQ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Bs4lGo6F.js → use-decopilot-events-ya7dVgqN.js} +1 -1
- package/dist/client/assets/{use-delete-connection-T3Xjf9fU.js → use-delete-connection-AvH2v8uO.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-R-YLZcXi.js → use-deployment-admin-BwCASXu3.js} +1 -1
- package/dist/client/assets/{use-destination-route-C5lOfatk.js → use-destination-route-BNo7ZUVL.js} +1 -1
- package/dist/client/assets/{use-file-configs-CjjmtK39.js → use-file-configs-D7OlLpN6.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DHeLsiAD.js → use-infinite-scroll-Dt4fLfGW.js} +1 -1
- package/dist/client/assets/{use-join-requests-DP9WJAb0.js → use-join-requests-D9h8V8EK.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Dj0-A5Wa.js → use-mcp-auth-status-SA0Rp9TT.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BJohqqSd.js → use-mcp-client-BUvHJAtF.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DW-tAvJg.js → use-mcp-prompts-RQzihIv5.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-vt3UNphZ.js → use-mcp-tools-SGGGVKN4.js} +1 -1
- package/dist/client/assets/{use-members-C7ip6O59.js → use-members-eE2uqhkh.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-wxTo_2Wv.js → use-navigate-to-agent-CgD7hYim.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DVDqxM9c.js → use-org-auth-client-CI8Gk_jN.js} +1 -1
- package/dist/client/assets/{use-org-sso-3md051eT.js → use-org-sso-D2b1mjdF.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C7--at-2.js → use-organization-roles-9G-aBBDq.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Dh58cpUx.js → use-organization-settings-BAFA--7u.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-9qdFpFC-.js → use-panel-navigate-CMHHm8JL.js} +1 -1
- package/dist/client/assets/{use-project-scope-NvD131m4.js → use-project-scope-CCn_7fuY.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DtpIh4N8.js → use-registry-connections-BbH5e5HY.js} +1 -1
- package/dist/client/assets/{use-secrets-N0I1WQgn.js → use-secrets-CySbZOGu.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DWl2Cfr4.js → use-section-preview-base-Di9BUx8I.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BpKA8nWD.js → use-status-sounds-DVdbgg-T.js} +1 -1
- package/dist/client/assets/{use-tags-EBwNPMg8.js → use-tags-BF1RK1hn.js} +1 -1
- package/dist/client/assets/{use-view-mode-CGTPphEX.js → use-view-mode-BM9KzSHZ.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-B2TPjUHz.js → use-virtual-mcp-nLa9DgC8.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DDm1RvPA.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-yiEBUT8w.js +1 -0
- package/dist/client/assets/{users-BPvwZmZl.js → users-D_EP1m-H.js} +1 -1
- package/dist/client/assets/{variant-calendar-CodpU1lu.js → variant-calendar-DE_JCwgE.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Ct7J-xLH.js → view-mode-toggle-DHzh7xSx.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/api-keys-8w-9P3dp.js +0 -1
- package/dist/client/assets/org-layout-CpgEGfxv.js +0 -1
- package/dist/client/assets/record-editor-BC2iQPGE.js +0 -1
- package/dist/client/assets/redirect-editor-C7uuK_jN.js +0 -1
- package/dist/client/assets/registry-DwUHQ8Lv.js +0 -2
- package/dist/client/assets/settings-layout-CypSCfpP.js +0 -1
- package/dist/client/assets/store-registry-Cre8_0ZD.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Nq5i14p1.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ByY64uZl.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bW as ws,c as R,l as X,j as s,h as He,r as z,I as Gt,G as As,o as Z,b as Q,b6 as Is,W as ge,d as qt,a6 as Qt,_ as Wt,L as Ts,a1 as $e,a2 as Oe,a4 as Re,a as Ct,F as Bs,ar as Fs,as as Ps,B as be,t as oe,H as Es,J as Ms,K as ye,n as vt,a7 as kt,m as Yt,e as Le,bm as Ls,ap as $s}from"./index-CAw6g9tV.js";import{c as Xt,u as Os,d as Jt}from"./thread-route-CxY5TjeM.js";import{t as Ve}from"./ChevronUp-BCwuiyHj.js";import{A as Zt,N as Rs,s as dt,aL as Ks,aM as zs,aN as Ft,aO as Vs,t as Us,aP as Hs,a6 as Gs,aQ as qs,o as Qs,aR as Ws,a4 as ut,a3 as Ys,aa as Xs}from"./agent-icon-Dsw04fQF.js";import{a as es,i as Js,e as Zs,S as en,f as tn}from"./constants-DNuUCxmW.js";import{b as Nt,u as sn}from"./use-virtual-mcp-B2TPjUHz.js";import{g as nn}from"./github-repo-BpKUwJal.js";import{T as ts}from"./toolbar-icon-button-DSBvSnFI.js";import{P as nt,a as ze,b as ot}from"./popover-BIPtCsqc.js";import{D as _t,a as St,b as Dt,c as on,e as an,f as ss,g as ns,d as ln}from"./drawer-CxFI5tCn.js";import{i as rn}from"./SearchMd-C1loDEwy.js";import{i as Ge}from"./Check-Jn0qXgT0.js";import{s as Qe}from"./Plus-D7VA57q5.js";import{G as ht,a as cn}from"./github-repo-picker-Dyu49H5P.js";import{g as dn,u as un,b as os}from"./hooks-J2gbnuVW.js";import{g as fn,b as as}from"./use-project-scope-NvD131m4.js";import{u as ls}from"./shell-layout-X5sLDjab.js";import{a as mn}from"./use-navigate-to-agent-wxTo_2Wv.js";import{d as gn}from"./thread-intent-C3PV-LRn.js";import{C as pn}from"./collection-search-DUFT-3aZ.js";import{g as hn,b as xn,a as jn,e as bn}from"./extract-connection-data-C2Ocp5Tk.js";import{u as is,a as rs,g as yn,C as ft}from"./connection-card-Bwgx5OMm.js";import{D as cs,b as ds,c as us,d as fs,h as Cn,e as vn}from"./dialog-DDd8wUS7.js";import{d as ce,a as de,e as ue,b as fe,c as me,F as Pt}from"./form-DR4f8DO7.js";import{I as _e}from"./input-CRq9rZYf.js";import{S as kn,a as Nn,b as _n,c as Sn,d as Ue}from"./select-Bnv10Fl8.js";import{T as Dn}from"./textarea-BClvRA4H.js";import{b as ms}from"./use-connection-GI8Focwr.js";import{n as et,a as mt,i as gs}from"./Tool02-DHxIusmd.js";import{b as wn,d as An}from"./UserSquare-BEv1iIj5.js";import{s as In}from"./XClose-mJWP0IZB.js";import{c as Tn,i as Xe,a as Et,E as Bn,p as Fn,b as Pn,d as En}from"./connection-form-helpers-Cs1EiOkG.js";import{a as gt}from"./authenticate-and-persist-oauth-UjkEE9k3.js";import{g as Mn}from"./connection-slug-CITJ0kGN.js";import{C as Ln}from"./collection-tabs-aHnkLK94.js";import{u as Mt}from"./use-infinite-scroll-DHeLsiAD.js";import{B as Je}from"./badge-BJg3YTbr.js";import{u as $n}from"./useSuspenseInfiniteQuery-ByY64uZl.js";import{u as On}from"./use-mcp-client-BJohqqSd.js";import{g as tt}from"./metadata-dUsYcpuu.js";import{u as Rn}from"./use-ai-providers-CiO6eVCB.js";import{T as Kn,C as wt,c as zn,d as Vn,S as xt}from"./task-board-DHq8t-_N.js";import{t as Un}from"./decopilot-sse-pool-Cp5pr9Ve.js";import{u as Hn}from"./use-decopilot-events-Bs4lGo6F.js";import{A as Lt}from"./avatar-ayySA21l.js";import{h as st,D as ps,b as hs,g as xs,c as js}from"./dropdown-menu-C3Gdadki.js";import{a as At,c as It,d as ve,e as qe,b as Tt,C as Bt}from"./command-CEQjEkRa.js";import{s as Gn}from"./TrendUp01-BctNF4vg.js";import{a as qn}from"./Settings02-DfFNQquZ.js";import{s as $t}from"./User01-8XeMepHg.js";import{g as Ot}from"./get-initials-D-f_fDFw.js";import{i as Qn}from"./AlertCircle-CG7tfapy.js";import{i as Wn}from"./CheckCircle-BnpxIwzg.js";import{a as bs}from"./DotsVertical-C65YDOa_.js";import{s as Yn}from"./Eye-DvBjB5D4.js";import{i as Xn}from"./Shield01-CrPC_5gY.js";const Jn=ws("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function Zn(t){const e=R.c(21),{value:n,onChange:a,placeholder:i,onKeyDown:l,className:o,isSearching:d,disabled:c}=t,u=i===void 0?"Search...":i;let f;e[0]!==o?(f=X("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=f):f=e[1];const p=c?"cursor-not-allowed opacity-50":"cursor-text";let r;e[2]!==p?(r=X("flex items-center gap-2.5 h-12 px-4",p),e[2]=p,e[3]=r):r=e[3];let m;e[4]!==d?(m=d?s.jsx(He,{className:"size-4 text-muted-foreground shrink-0"}):s.jsx(rn,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=d,e[5]=m):m=e[5];let g;e[6]!==a?(g=S=>a(S.target.value),e[6]=a,e[7]=g):g=e[7];let h;e[8]!==c||e[9]!==l||e[10]!==u||e[11]!==g||e[12]!==n?(h=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:l,placeholder:u,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=l,e[10]=u,e[11]=g,e[12]=n,e[13]=h):h=e[13];let x;e[14]!==r||e[15]!==m||e[16]!==h?(x=s.jsxs("label",{className:r,children:[m,h]}),e[14]=r,e[15]=m,e[16]=h,e[17]=x):x=e[17];let b;return e[18]!==f||e[19]!==x?(b=s.jsx("div",{className:f,children:x}),e[18]=f,e[19]=x,e[20]=b):b=e[20],b}function eo(t,e,n){if(!n)return null;const a=dn(t,e);return a?a.threads.get().find(l=>l.id===n)?.branch??null:null}const ys=z.createContext(null);function ml(t){const e=R.c(5),{children:n}=t,[a,i]=z.useState(!1);let l;e[0]!==a?(l={empty:a,setEmpty:i},e[0]=a,e[1]=l):l=e[1];let o;return e[2]!==n||e[3]!==l?(o=s.jsx(ys.Provider,{value:l,children:n}),e[2]=n,e[3]=l,e[4]=o):o=e[4],o}function to(){return z.useContext(ys)?.empty??!1}function so(t){const e=R.c(6),{value:n,onChange:a}=t,i=Q();let l;e[0]!==i?(l=i("sidebar.agentsSection.searchAgents"),e[0]=i,e[1]=l):l=e[1];let o;return e[2]!==a||e[3]!==l||e[4]!==n?(o=s.jsx(Zn,{value:n,onChange:a,placeholder:l}),e[2]=a,e[3]=l,e[4]=n,e[5]=o):o=e[5],o}function no(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.noAgentsFound"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:n}),t[2]=n,t[3]=a):a=t[3],a}function oo(t){const e=R.c(10),{org:n,onClose:a}=t,i=Q();let l;e[0]!==n.slug?(l={org:n.slug},e[0]=n.slug,e[1]=l):l=e[1];let o;e[2]!==a?(o=()=>a(),e[2]=a,e[3]=o):o=e[3];let d;e[4]!==i?(d=i("sidebar.agentsSection.seeAllAgents"),e[4]=i,e[5]=d):d=e[5];let c;return e[6]!==l||e[7]!==o||e[8]!==d?(c=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ts,{to:"/$org/settings/agents",params:l,onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:d})}),e[6]=l,e[7]=o,e[8]=d,e[9]=c):c=e[9],c}function ao(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.agents"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx(Cs,{children:n}),t[2]=n,t[3]=a):a=t[3],a}function lo(t){const e=R.c(11),{onImportFromGithub:n}=t,a=Q();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ht,{className:"size-3.5"}),e[0]=i):i=e[0];let l;e[1]!==a?(l=a("sidebar.agentsSection.import"),e[1]=a,e[2]=l):l=e[2];let o;e[3]!==n||e[4]!==l?(o=s.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[i,l]}),e[3]=n,e[4]=l,e[5]=o):o=e[5];let d;e[6]!==a?(d=a("sidebar.agentsSection.codeAgents"),e[6]=a,e[7]=d):d=e[7];let c;return e[8]!==o||e[9]!==d?(c=s.jsx(Cs,{action:o,children:d}),e[8]=o,e[9]=d,e[10]=c):c=e[10],c}function io(t){const e=R.c(11),{setOpen:n,emptyCtaClass:a}=t,i=Q();let l;e[0]!==i?(l=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=l):l=e[1];let o;e[2]!==a?(o=X(a),e[2]=a,e[3]=o):o=e[3];let d;e[4]!==n?(d=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[4]=n,e[5]=d):d=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qe,{className:"size-4"}),e[6]=c):c=e[6];let u;return e[7]!==l||e[8]!==o||e[9]!==d?(u=s.jsx(ts,{"aria-label":l,className:o,onClick:d,children:c}),e[7]=l,e[8]=o,e[9]=d,e[10]=u):u=e[10],u}function ro(t){const e=R.c(17),{setOpen:n,highlightEmpty:a,emptyCtaClass:i}=t,l=Q();let o;e[0]!==a||e[1]!==l?(o=a?void 0:l("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=l,e[2]=o):o=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]!==n?(c=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[5]=n,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Qe,{}),e[7]=u):u=e[7];let f;e[8]!==l?(f=l("sidebar.agentsSection.newAgent"),e[8]=l,e[9]=f):f=e[9];let p;e[10]!==f?(p=s.jsx("span",{children:f}),e[10]=f,e[11]=p):p=e[11];let r;return e[12]!==o||e[13]!==d||e[14]!==c||e[15]!==p?(r=s.jsx(Qt,{children:s.jsxs(Wt,{tooltip:o,className:d,onClick:c,children:[u,p]})}),e[12]=o,e[13]=d,e[14]=c,e[15]=p,e[16]=r):r=e[16],r}function co(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.browseAgents"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx(Dt,{className:"sr-only",children:n}),t[2]=n,t[3]=a):a=t[3],a}function uo(t){const e=R.c(8),{emptyCtaClass:n}=t,a=Q();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==n?(l=X(n),e[2]=n,e[3]=l):l=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Qe,{className:"size-4"}),e[4]=o):o=e[4];let d;return e[5]!==i||e[6]!==l?(d=s.jsx(ts,{"aria-label":i,className:l,children:o}),e[5]=i,e[6]=l,e[7]=d):d=e[7],d}function fo(t){const e=R.c(19),{wrapEmptyHint:n,highlightEmpty:a,emptyCtaClass:i}=t,l=Q();let o;e[0]!==a||e[1]!==l?(o=a?void 0:l("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=l,e[2]=o):o=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qe,{}),e[5]=c):c=e[5];let u;e[6]!==l?(u=l("sidebar.agentsSection.newAgent"),e[6]=l,e[7]=u):u=e[7];let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let p;e[10]!==o||e[11]!==d||e[12]!==f?(p=s.jsx(ze,{asChild:!0,children:s.jsxs(Wt,{tooltip:o,className:d,children:[c,f]})}),e[10]=o,e[11]=d,e[12]=f,e[13]=p):p=e[13];let r;e[14]!==p||e[15]!==n?(r=n(p),e[14]=p,e[15]=n,e[16]=r):r=e[16];let m;return e[17]!==r?(m=s.jsx(Qt,{children:r}),e[17]=r,e[18]=m):m=e[18],m}function mo(t){const e=R.c(9),{children:n}=t,a=Q();let i;e[0]!==n?(i=s.jsx($e,{asChild:!0,children:n}),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==a?(l=a("sidebar.agentsSection.selectAnExistingAgent"),e[2]=a,e[3]=l):l=e[3];let o;e[4]!==l?(o=s.jsx(Oe,{side:"right",sideOffset:8,children:l}),e[4]=l,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs(Re,{defaultOpen:!0,delayDuration:0,children:[i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function go(t){const e=qt(),{create:n}=un(),{locator:a}=ge(),i=Xt(),l=Os();return async o=>{const d=crypto.randomUUID(),c=o===l?eo(t,a,i??""):null;try{await n({id:d,virtual_mcp_id:o,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:d},search:{virtualmcpid:o}})}}function pt(t){const e=R.c(20),{agent:n,selected:a,onClick:i}=t,l=a?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==l?(o=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",l),e[0]=l,e[1]=o):o=e[1];let d;e[2]!==n.icon||e[3]!==n.title?(d=s.jsx(Zt,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=d):d=e[4];let c;e[5]!==n.title?(c=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=c):c=e[6];let u;e[7]!==n.description?(u=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=u):u=e[8];let f;e[9]!==c||e[10]!==u?(f=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,u]}),e[9]=c,e[10]=u,e[11]=f):f=e[11];let p;e[12]!==a?(p=a&&s.jsx(Ge,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=a,e[13]=p):p=e[13];let r;return e[14]!==i||e[15]!==o||e[16]!==d||e[17]!==f||e[18]!==p?(r=s.jsxs("button",{type:"button",onClick:i,className:o,children:[d,f,p]}),e[14]=i,e[15]=o,e[16]=d,e[17]=f,e[18]=p,e[19]=r):r=e[19],r}function Cs(t){const e=R.c(5),{children:n,action:a}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==a||e[3]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,a]}),e[2]=a,e[3]=i,e[4]=l):l=e[4],l}function po(t){const e=R.c(43),{onClose:n,onSelectAgent:a,selectedAgentId:i,onImportFromGithub:l}=t,[o,d]=z.useState(""),c=z.useDeferredValue(o),u=c||void 0;let f;e[0]!==u?(f={searchTerm:u},e[0]=u,e[1]=f):f=e[1];const p=Nt(f),r=p??[],{org:m}=ge(),g=go(m.slug),h=fn(p),x=c.toLowerCase(),b=r.filter(bo).filter(V=>!h.has(V.id)).filter(jo),S=b.filter(xo),y=b.filter(ho),v=es(m.id),k=!c||v.title.toLowerCase().includes(x),C=!!(a&&k);let w;e[2]!==n||e[3]!==a?(w=()=>{a?.(null),n(),d("")},e[2]=n,e[3]=a,e[4]=w):w=e[4];const j=w;let _;e[5]!==g||e[6]!==n||e[7]!==a?(_=V=>{if(a){a(V.id),n(),d("");return}n(),d(""),g(V.id)},e[5]=g,e[6]=n,e[7]=a,e[8]=_):_=e[8];const D=_,I="flex flex-col max-h-[min(640px,80dvh)]";let E;e[9]!==o?(E=s.jsx(so,{value:o,onChange:d}),e[9]=o,e[10]=E):E=e[10];const N="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5";let A;e[11]!==v||e[12]!==a||e[13]!==j||e[14]!==i||e[15]!==k?(A=a&&k&&v&&s.jsx(pt,{agent:v,selected:!i||i===v.id,onClick:j}),e[11]=v,e[12]=a,e[13]=j,e[14]=i,e[15]=k,e[16]=A):A=e[16];const T=(S.length>0||!c)&&s.jsx(lo,{onImportFromGithub:l});let O;e[17]!==D||e[18]!==a||e[19]!==i?(O=V=>s.jsx(pt,{agent:V,selected:a?i===V.id:void 0,onClick:()=>D(V)},V.id),e[17]=D,e[18]=a,e[19]=i,e[20]=O):O=e[20];const B=S.map(O),F=y.length>0&&s.jsx(ao,{});let $;e[21]!==D||e[22]!==a||e[23]!==i?($=V=>s.jsx(pt,{agent:V,selected:a?i===V.id:void 0,onClick:()=>D(V)},V.id),e[21]=D,e[22]=a,e[23]=i,e[24]=$):$=e[24];const G=y.map($);let P;e[25]!==C||e[26]!==c||e[27]!==b.length?(P=b.length===0&&!C&&c&&s.jsx(no,{}),e[25]=C,e[26]=c,e[27]=b.length,e[28]=P):P=e[28];let K;e[29]!==B||e[30]!==F||e[31]!==G||e[32]!==P||e[33]!==A||e[34]!==T?(K=s.jsxs("div",{className:N,children:[A,T,B,F,G,P]}),e[29]=B,e[30]=F,e[31]=G,e[32]=P,e[33]=A,e[34]=T,e[35]=K):K=e[35];let L;e[36]!==n||e[37]!==m?(L=s.jsx(oo,{org:m,onClose:n}),e[36]=n,e[37]=m,e[38]=L):L=e[38];let U;return e[39]!==K||e[40]!==L||e[41]!==E?(U=s.jsxs("div",{className:I,children:[E,K,L]}),e[39]=K,e[40]=L,e[41]=E,e[42]=U):U=e[42],U}function ho(t){return!as(t.metadata)}function xo(t){return as(t.metadata)}function jo(t){return!Zs(t.id)}function bo(t){return!Js(t.id)}function yo(t){const e=R.c(14),{compact:n,trigger:a,onSelectAgent:i,selectedAgentId:l,side:o,align:d}=t===void 0?{}:t,c=n===void 0?!1:n,u=o===void 0?"right":o,f=d===void 0?"start":d,[p,r]=z.useState(!1),[m,g]=z.useState(!1),h=Gt(),{setOpenMobile:x}=As(),b=to(),S=b?"border border-border":void 0;let y;e[0]!==b?(y=N=>b?s.jsx(mo,{children:N}):N,e[0]=b,e[1]=y):y=e[1];const v=y;let k;e[2]!==h||e[3]!==x?(k=()=>{r(!1),h&&x(!1)},e[2]=h,e[3]=x,e[4]=k):k=e[4];const C=k;let w;e[5]!==C||e[6]!==g?(w=()=>{C(),g(!0)},e[5]=C,e[6]=g,e[7]=w):w=e[7];const j=w,_=p&&s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Is,{className:"h-4 w-24"})}),children:s.jsx(po,{onClose:C,onSelectAgent:i,selectedAgentId:l,onImportFromGithub:j})}),D=h?s.jsxs(s.Fragment,{children:[a?z.cloneElement(a,{onClick:N=>{a.props.onClick?.(N),r(!0)}}):c?v(s.jsx(io,{setOpen:r,emptyCtaClass:S})):s.jsx(ro,{setOpen:r,highlightEmpty:b,emptyCtaClass:S}),s.jsx(_t,{open:p,onOpenChange:r,direction:"bottom",children:s.jsxs(St,{className:"max-h-[85dvh] p-0",children:[s.jsx(co,{}),_]})})]}):s.jsxs(nt,{open:p,onOpenChange:N=>{N&&!p&&Z("agent_browser_opened",{surface:"desktop_popover"}),r(N)},children:[a?s.jsx(ze,{asChild:!0,children:a}):c?v(s.jsx(ze,{asChild:!0,children:s.jsx(uo,{emptyCtaClass:S})})):s.jsx(fo,{wrapEmptyHint:v,highlightEmpty:b,emptyCtaClass:S}),s.jsx(ot,{className:"w-[380px] p-0 overflow-hidden",side:u,align:f,children:_})]});let I;e[8]!==m||e[9]!==g?(I=s.jsx(cn,{open:m,onOpenChange:g,mode:"agent"}),e[8]=m,e[9]=g,e[10]=I):I=e[10];let E;return e[11]!==D||e[12]!==I?(E=s.jsxs(s.Fragment,{children:[D,I]}),e[11]=D,e[12]=I,e[13]=E):E=e[13],E}function Co(){const t=R.c(2),e=Nt()??[];let n;return t[0]!==e?(n=a=>{if(!a)return;const i=e.find(l=>l.id===a);return i?gn(i.metadata):void 0},t[0]=e,t[1]=n):n=t[1],n}const vo="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function ko(t){const e=R.c(29),{agentId:n,fallback:a,onOpenHome:i,onPick:l}=t,o=Q(),d=sn(n)??a??null;let c,u,f,p,r;e[0]!==d?.title||e[1]!==i||e[2]!==o?(r=d?.title??o("header.shellBreadcrumb.superAgentDefaultName"),p="flex min-w-0 items-center gap-0",c="button",u=i,f=o("header.shellBreadcrumb.openAgentHome",{name:r}),e[0]=d?.title,e[1]=i,e[2]=o,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=r):(c=e[3],u=e[4],f=e[5],p=e[6],r=e[7]);const m=d?.icon??null;let g;e[8]!==m||e[9]!==r?(g=s.jsx(Zt,{icon:m,name:r,size:"xs"}),e[8]=m,e[9]=r,e[10]=g):g=e[10];let h;e[11]!==c||e[12]!==u||e[13]!==f||e[14]!==g?(h=s.jsx("button",{type:c,onClick:u,"aria-label":f,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:g}),e[11]=c,e[12]=u,e[13]=f,e[14]=g,e[15]=h):h=e[15];let x;e[16]!==r?(x=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:r}),e[16]=r,e[17]=x):x=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ve,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=b):b=e[18];let S;e[19]!==x?(S=s.jsxs("button",{type:"button",className:vo,children:[x,b]}),e[19]=x,e[20]=S):S=e[20];let y;e[21]!==n||e[22]!==l||e[23]!==S?(y=s.jsx(yo,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:l,trigger:S}),e[21]=n,e[22]=l,e[23]=S,e[24]=y):y=e[24];let v;return e[25]!==y||e[26]!==p||e[27]!==h?(v=s.jsxs("div",{className:p,children:[h,y]}),e[25]=y,e[26]=p,e[27]=h,e[28]=v):v=e[28],v}function gl(t){const e=R.c(22);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:a}=n,{org:i}=ge(),{threads:l}=os(),o=Nt(),{data:d}=Ct.useSession(),{setTaskId:c,createNewTask:u}=ls(),f=Co();let p;e[2]!==i.id?(p=es(i.id),e[2]=i.id,e[3]=p):p=e[3];const r=p,m=r.id,g=Jt();let h;e[4]!==o||e[5]!==u||e[6]!==m||e[7]!==a||e[8]!==f||e[9]!==d?.user?.id||e[10]!==c||e[11]!==l?(h=k=>{const C=k??m,w=(o??[]).find(_=>_.id===C),j=mn(l,C,d?.user?.id,f(C),!!(w&&nn(w)));j?c(j.id,C):u(C),a?.()},e[4]=o,e[5]=u,e[6]=m,e[7]=a,e[8]=f,e[9]=d?.user?.id,e[10]=c,e[11]=l,e[12]=h):h=e[12];const x=h;let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=b):b=e[13];const S=g===m?r:void 0;let y;e[14]!==g||e[15]!==x?(y=()=>x(g),e[14]=g,e[15]=x,e[16]=y):y=e[16];let v;return e[17]!==g||e[18]!==x||e[19]!==S||e[20]!==y?(v=s.jsx(z.Suspense,{fallback:b,children:s.jsx(ko,{agentId:g,fallback:S,onOpenHome:y,onPick:x})}),e[17]=g,e[18]=x,e[19]=S,e[20]=y,e[21]=v):v=e[21],v}function pl(){const t=R.c(20),e=Q(),{threads:n}=os(),{createNewTask:a}=ls(),i=Jt(),l=Xt();let o;t[0]!==l||t[1]!==n?(o=n.find(x=>x.id===l)?.branch??null,t[0]=l,t[1]=n,t[2]=o):o=t[2];const d=o;let c;t[3]!==i||t[4]!==a||t[5]!==d?(c=()=>{a(i,d)},t[3]=i,t[4]=a,t[5]=d,t[6]=c):c=t[6];const u=c;let f;t[7]!==e?(f=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=f):f=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Rs,{size:16}),t[9]=p):p=t[9];let r;t[10]!==u||t[11]!==f?(r=s.jsx($e,{asChild:!0,children:s.jsx("button",{type:"button",onClick:u,"aria-label":f,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:p})}),t[10]=u,t[11]=f,t[12]=r):r=t[12];let m;t[13]!==e?(m=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=m):m=t[14];let g;t[15]!==m?(g=s.jsx(Oe,{side:"bottom",children:m}),t[15]=m,t[16]=g):g=t[16];let h;return t[17]!==r||t[18]!==g?(h=s.jsxs(Re,{children:[r,g]}),t[17]=r,t[18]=g,t[19]=h):h=t[19],h}function No({open:t,onOpenChange:e,onCreated:n}){const a=Q(),{org:i}=ge(),{data:l}=Ct.useSession(),{stdioEnabled:o}=Bs(),d=Gt(),c=ms(),u=is(),p=rs(u,"").items,r=Fs({resolver:Ps(Tn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),m=r.watch("ui_type"),g=r.watch("connection_url"),h=r.watch("npx_package"),x=Xe({uiType:m,connectionUrl:g??"",npxPackage:h??""})??Et({uiType:m,connectionUrl:g??"",registryItems:p}),b=j=>{const _=j.trim();if(!_)return;const D=!!r.formState.dirtyFields.title,I=!!r.formState.dirtyFields.description,E=!!r.formState.dirtyFields.env_vars,N=T=>{if(T&&(!D&&!r.getValues("title").trim()&&T.title&&r.setValue("title",T.title,{shouldDirty:!1}),!I&&!(r.getValues("description")??"").trim()&&T.description&&r.setValue("description",T.description,{shouldDirty:!1}),!E&&T.envVarKeys?.length)){const O=r.getValues("env_vars")??[],B=new Set(O.map($=>$.key)),F=T.envVarKeys.filter($=>!B.has($));F.length>0&&r.setValue("env_vars",[...O,...F.map($=>({key:$,value:""}))],{shouldDirty:!0})}},A=Fn(_);if(A&&o){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",A.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),N(Xe({uiType:"NPX",npxPackage:A.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const T=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",T,{shouldDirty:!0}),r.setValue("connection_url",_,{shouldDirty:!0}),N(Xe({uiType:T,connectionUrl:_})??Et({uiType:T,connectionUrl:_,registryItems:p}));return}m==="NPX"&&N(Xe({uiType:"NPX",npxPackage:_}))},S=j=>{j||r.reset(),e(j)},y=async j=>{let _,D=null,I=null,E=null;j.ui_type==="NPX"?(_="STDIO",D="",E=Pn(j.npx_package||"",j.env_vars||[])):j.ui_type==="STDIO"?(_="STDIO",D="",E=En(j.stdio_command||"",j.stdio_args||"",j.stdio_cwd,j.env_vars||[])):(_=j.ui_type,D=j.connection_url||"",I=j.connection_token||null);const N=hn("conn");try{await c.create.mutateAsync({id:N,title:j.title,description:j.description||null,connection_type:_,connection_url:D,connection_token:I,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:l?.user?.id||"system",organization_id:i.id,icon:j.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),r.reset(),e(!1),n?.(N)}catch{oe.error(a("connections.createConnectionDialog.failedToCreateConnection"))}},v=a("connections.createConnectionDialog.title"),k=a("connections.createConnectionDialog.description"),C=r.formState.isSubmitting?a("connections.createConnectionDialog.saving"):a("connections.createConnectionDialog.createButton"),w=s.jsxs("div",{className:"grid gap-4",children:[s.jsx(ce,{control:r.control,name:"ui_type",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.typeLabel")}),s.jsxs(kn,{value:j.value,onValueChange:j.onChange,children:[s.jsx(fe,{children:s.jsx(Nn,{children:s.jsx(_n,{})})}),s.jsxs(Sn,{children:[s.jsx(Ue,{value:"HTTP",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.httpType")]})}),s.jsx(Ue,{value:"SSE",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.sseType")]})}),s.jsx(Ue,{value:"Websocket",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.websocketType")]})}),o&&s.jsxs(s.Fragment,{children:[s.jsx(Ue,{value:"NPX",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(et,{className:"w-4 h-4"}),a("connections.createConnectionDialog.npxPackageType")]})}),s.jsx(Ue,{value:"STDIO",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(wn,{className:"w-4 h-4"}),a("connections.createConnectionDialog.customCommandType")]})})]})]})]}),s.jsx(me,{})]})}),m==="NPX"&&s.jsx(ce,{control:r.control,name:"npx_package",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.npmPackageLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.npmPackagePlaceholder"),...j,value:j.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("npx_package",D.trim(),{shouldDirty:!0}),b(D))},onBlur:_=>{b(_.target.value),j.onBlur()}})}),s.jsx(me,{})]})}),m==="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[s.jsx(ce,{control:r.control,name:"stdio_command",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.commandLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.commandPlaceholder"),...j,value:j.value??""})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"stdio_args",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.argumentsLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.argumentsPlaceholder"),...j,value:j.value??""})}),s.jsx(me,{})]})})]}),s.jsx(ce,{control:r.control,name:"stdio_cwd",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.workingDirectoryLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.workingDirectoryPlaceholder"),...j,value:j.value??""})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a("connections.createConnectionDialog.workingDirectoryDescription")}),s.jsx(me,{})]})})]}),(m==="NPX"||m==="STDIO")&&s.jsx(ce,{control:r.control,name:"env_vars",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.environmentVariablesLabel")}),s.jsx(fe,{children:s.jsx(Bn,{value:j.value??[],onChange:j.onChange})}),s.jsx(me,{})]})}),m!=="NPX"&&m!=="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{control:r.control,name:"connection_url",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.urlLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.urlPlaceholder"),...j,value:j.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("connection_url",D.trim(),{shouldDirty:!0}),b(D))},onBlur:_=>{b(_.target.value),j.onBlur()}})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"connection_token",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:x?.token?.label??a("connections.createConnectionDialog.tokenLabelDefault")}),s.jsx(fe,{children:s.jsx(_e,{type:"password",placeholder:x?.token?.placeholder??a("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...j,value:j.value??""})}),x?.token?.helperText&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&s.jsxs(s.Fragment,{children:[" ","·"," ",s.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:a("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),s.jsx(me,{})]})})]}),s.jsx(ce,{control:r.control,name:"title",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.nameLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.namePlaceholder"),...j})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"description",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.descriptionLabel")}),s.jsx(fe,{children:s.jsx(Dn,{placeholder:a("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...j,value:j.value??""})}),s.jsx(me,{})]})})]});return d?s.jsx(_t,{open:t,onOpenChange:S,children:s.jsxs(St,{className:"max-h-[90vh]",children:[s.jsx(on,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx(Dt,{children:v}),s.jsx(an,{className:"mt-1",children:k})]}),s.jsx(ss,{asChild:!0,children:s.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:s.jsx(In,{size:16})})})]})}),s.jsx(Pt,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(y),children:[s.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:w}),s.jsx(ns,{children:s.jsx(be,{type:"submit",disabled:r.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):s.jsx(cs,{open:t,onOpenChange:S,children:s.jsxs(ds,{className:"sm:max-w-[525px]",children:[s.jsxs(us,{children:[s.jsx(fs,{children:v}),s.jsx(Cn,{children:k})]}),s.jsx(Pt,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(y),children:[s.jsx("div",{className:"py-4",children:w}),s.jsxs(vn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>S(!1),children:a("connections.createConnectionDialog.cancelButton")}),s.jsx(be,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function _o(t){const e=R.c(72),{mode:n,agentId:a,addedConnectionIds:i,onAdd:l,onCloneAndAdd:o,onConnectAndAdd:d,connectingItemId:c,search:u,onCreateConnection:f,onBrowseNavigate:p,defaultTab:r}=t,m=n===void 0?"add":n,g=r===void 0?"connected":r,h=Q(),{org:x}=ge(),b=z.useDeferredValue(u),S=u!==b;let y;e[0]!==b?(y=b.trim().toLowerCase(),e[0]=b,e[1]=y):y=e[1];const v=y;let k;e[2]!==g?(k=M=>M??g,e[2]=g,e[3]=k):k=e[3];const[C,w]=Es(Ms.connectionsTab(x.slug)+(g==="all"?":home-modal":":agent-modal"),k);let j;e[4]!==C||e[5]!==w?(j=M=>{M!==C&&Z("connections_dialog_tab_changed",{to_tab:M}),w(M)},e[4]=C,e[5]=w,e[6]=j):j=e[6];const _=j;let D;e[7]!==x.id||e[8]!==x.slug?(D={connectionId:en,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=D):D=e[9];const I=On(D),E=b?.trim().split(/\s+/).filter(Boolean)??[],N=E.length>0?{operator:"or",conditions:E.flatMap(Fo)}:void 0,A={...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(A),{data:O,fetchNextPage:B,hasNextPage:F,isFetchingNextPage:$}=$n({queryKey:ye.collectionListInfinite(I,x.id,"","CONNECTIONS",T),queryFn:async M=>{const{pageParam:Y}=M,je=Y===void 0?0:Y;return(await I.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:je}})).structuredContent},initialPageParam:0,getNextPageParam:To,staleTime:3e4}),G=O?.pages.flatMap(Io)??[],P=yn(G),K=new Set(G.filter(Ao).map(wo)),L=is(),U=rs(L,b),V=Mt(U.loadMore,U.hasMore,U.isLoadingMore),J=Mt(B,F??!1,$),W=C==="all"||!!v,pe=W?U.items.filter(M=>{const Y=xn(M);if(Y&&K.has(Y))return!1;if(!v)return!0;const je=tt(M._meta),ke=[M.title,M.description,M.name,M.server?.title,M.server?.description,M.server?.name,je?.friendly_name,je?.friendlyName].filter(Boolean).join(" ").toLowerCase();return E.some(re=>ke.includes(re.toLowerCase()))}):[],te=pe.filter(Do),se=pe.filter(So);let ae;e[10]!==i?(ae=M=>M.some(Y=>i.has(Y.id)),e[10]=i,e[11]=ae):ae=e[11];const ie=ae;let he;e[12]!==i||e[13]!==a||e[14]!==c||e[15]!==ie||e[16]!==m||e[17]!==l||e[18]!==p||e[19]!==o||e[20]!==h?(he=(M,Y,je,ke,re)=>{const Ye=ie(re),Me=re.find(Ne=>!i.has(Ne.id)),ne=re[0];if(m==="browse"){const Ne=Mn(ne);return s.jsx(ft,{connection:{title:Y,icon:je,description:re.length>1?`${re.length} instances`:ke??void 0},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs(Je,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(Ge,{size:11})," ",h("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{Z("connection_browse_clicked",{app_name:ne.app_name??null,connection_id:ne.id,instances_count:re.length}),p?.(Ne)}},M)}return s.jsx(ft,{connection:{title:Y,icon:je,description:ke},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[Ye&&s.jsxs(Je,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(Ge,{size:11})," ",h("virtualMcp.connectionDialogContent.added")]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Me?(Z("connection_add_clicked",{action:"use_existing",app_name:ne.app_name??null,connection_id:Me.id}),a&&Z("agent_connection_attached",{agent_id:a,connection_id:Me.id,app_name:ne.app_name??null,mode:"existing"}),l(Me.id)):(Z("connection_add_clicked",{action:"clone",app_name:ne.app_name??null,base_connection_id:ne.id}),o(ne))},children:h("virtualMcp.connectionDialogContent.add")})]})},M)},e[12]=i,e[13]=a,e[14]=c,e[15]=ie,e[16]=m,e[17]=l,e[18]=p,e[19]=o,e[20]=h,e[21]=he):he=e[21];const H=he;let q;e[22]!==c||e[23]!==m||e[24]!==d||e[25]!==h?(q=M=>{const Y=tt(M._meta),je=Y?.friendlyName||Y?.friendly_name||M.server?.title||M.title||M.server?.name||M.name||M.id||"",ke=M.server?.description||M.description||null,re=M.server?.icons?.[0]?.src||jn(M.server?.repository)||null,Ye=Y?.official===!0,Me=Y?.verified===!0,ne=Y?.owner==="deco";return s.jsx(ft,{connection:{title:je,description:ke,icon:re},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[ne&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:h("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.builtByDeco")})]}),!ne&&Ye&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx(Je,{variant:"outline",size:"icon",children:s.jsx(mt,{})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!ne&&!Ye&&Me&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx(Je,{variant:"outline",size:"icon",children:s.jsx(mt,{})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Z("connection_add_clicked",{action:"connect_new",registry_item_id:M.id,app_name:Y?.friendlyName||M.server?.name||M.name||null}),d(M)},children:c===M.id?s.jsx(He,{className:"size-3.5"}):h(m==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${M.id}`)},e[22]=c,e[23]=m,e[24]=d,e[25]=h,e[26]=q):q=e[26];const xe=q;let ee;e[27]!==C||e[28]!==_||e[29]!==f||e[30]!==v||e[31]!==h?(ee=!v&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx(Ln,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:M=>_(M)}),s.jsxs(be,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{Z("connections_dialog_custom_clicked"),f()},children:[s.jsx(Qe,{size:12}),h("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=C,e[28]=_,e[29]=f,e[30]=v,e[31]=h,e[32]=ee):ee=e[32];const Ce=S&&"opacity-50 pointer-events-none";let le;e[33]!==Ce?(le=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ce),e[33]=Ce,e[34]=le):le=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let we;e[35]!==H?(we=M=>{if(M.type==="group")return H(M.key,M.title,M.icon,null,M.connections);const Y=M.connection;return H(Y.id,Y.title,Y.icon,Y.description??null,[Y])},e[35]=H,e[36]=we):we=e[36];const at=P.map(we);let Ae;e[37]!==J?(Ae=s.jsx("div",{ref:J,className:"col-span-full h-1"}),e[37]=J,e[38]=Ae):Ae=e[38];let Ie;e[39]!==$?(Ie=$&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),e[39]=$,e[40]=Ie):Ie=e[40];const lt=W&&te.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx(mt,{size:13,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionVerified")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),it=W&&te.map(xe),rt=W&&se.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionAllConnections")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),ct=W&&se.map(xe);let Te;e[41]!==V||e[42]!==L||e[43]!==W?(Te=W&&L.length>0&&s.jsx("div",{ref:V,className:"col-span-full h-1"}),e[41]=V,e[42]=L,e[43]=W,e[44]=Te):Te=e[44];let Be;e[45]!==U.isLoadingMore||e[46]!==W?(Be=W&&U.isLoadingMore&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),e[45]=U.isLoadingMore,e[46]=W,e[47]=Be):Be=e[47];let Fe;e[48]!==at||e[49]!==Ae||e[50]!==Ie||e[51]!==lt||e[52]!==it||e[53]!==rt||e[54]!==ct||e[55]!==Te||e[56]!==Be?(Fe=s.jsxs("div",{className:De,children:[at,Ae,Ie,lt,it,rt,ct,Te,Be]}),e[48]=at,e[49]=Ae,e[50]=Ie,e[51]=lt,e[52]=it,e[53]=rt,e[54]=ct,e[55]=Te,e[56]=Be,e[57]=Fe):Fe=e[57];let Pe;e[58]!==C||e[59]!==P.length||e[60]!==se||e[61]!==u||e[62]!==h||e[63]!==te?(Pe=P.length===0&&te.length===0&&se.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?h("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):h(C==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=C,e[59]=P.length,e[60]=se,e[61]=u,e[62]=h,e[63]=te,e[64]=Pe):Pe=e[64];let Ee;e[65]!==le||e[66]!==Fe||e[67]!==Pe?(Ee=s.jsxs("div",{className:le,children:[Fe,Pe]}),e[65]=le,e[66]=Fe,e[67]=Pe,e[68]=Ee):Ee=e[68];let We;return e[69]!==ee||e[70]!==Ee?(We=s.jsxs(s.Fragment,{children:[ee,Ee]}),e[69]=ee,e[70]=Ee,e[71]=We):We=e[71],We}function So(t){return!t.verified&&!tt(t._meta)?.verified&&!t.meta?.verified}function Do(t){return t.verified||tt(t._meta)?.verified||t.meta?.verified}function wo(t){return t.app_name}function Ao(t){return t.app_name}function Io(t){return t?.items??[]}function To(t,e){if(t?.hasMore)return e.reduce(Bo,0)}function Bo(t,e){return t+(e?.items?.length??0)}function Fo(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function hl({open:t,onOpenChange:e,defaultTab:n,initialSearch:a="",...i}){const l=Q(),o=i.mode??"add",d="agentId"in i?i.agentId:void 0,c="addedConnectionIds"in i?i.addedConnectionIds??new Set:new Set,u="onAdd"in i&&i.onAdd?i.onAdd:N=>{},f=(N,A,T)=>{d&&Z("agent_connection_attached",{agent_id:d,connection_id:N,app_name:A,mode:T})},[p,r]=z.useState(null),[m,g]=z.useState(a),[h,x]=z.useState(!1),[b,S]=z.useState(t);t!==b&&(S(t),t&&g(a));const{org:y}=ge(),{data:v}=Ct.useSession(),k=ms(),C=vt(),w=qt(),j=N=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:N}})},_=()=>{C.invalidateQueries({predicate:N=>{const A=N.queryKey;return A[1]===y.id&&A[3]==="collection"&&A[4]==="CONNECTIONS"}})},D=async(N,A)=>{Z("connection_oauth_succeeded",{connection_id:N,flow:A});const T=new URL(`/api/${y.slug}/mcp/${N}`,window.location.origin);await C.invalidateQueries({queryKey:ye.isMCPAuthenticated(T.href,null)}),_()},I=async N=>{r(N.app_name??N.id);try{const T=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,B=(await k.create.mutateAsync({title:T,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,F=await gt({connectionId:B,orgId:y.id,orgSlug:y.slug,persistFallback:$=>k.update.mutateAsync({id:B,data:{connection_token:$}}).then(()=>{})});if(F.ran&&!F.ok){Z("connection_oauth_failed",{connection_id:B,flow:"clone",error:F.error??"no_token"}),oe.error(l("virtualMcp.addConnectionDialog.authenticationFailedError",{error:F.error??"no token received"})),await k.delete.mutateAsync(B);return}F.ran&&await D(B,"clone"),f(B,N.app_name??null,"clone"),u(B)}catch(A){console.error("Failed to add connection:",A),oe.error(l("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{r(null)}},E=async N=>{if(!(!y||!v?.user?.id)){r(N.id);try{const A=bn(N,y.id,v.user.id,{remoteIndex:0}),T=A.connection_type==="STDIO",O=!!A.connection_url,B=T&&A.connection_headers&&typeof A.connection_headers=="object"&&"command"in A.connection_headers;if(!O&&!B){oe.error(l("virtualMcp.addConnectionDialog.mcpServerConnectionError")),r(null);return}const{id:F}=await k.create.mutateAsync(A),$=await gt({connectionId:F,orgId:y.id,orgSlug:y.slug,persistFallback:G=>k.update.mutateAsync({id:F,data:{connection_token:G}}).then(()=>{})});if($.ran&&!$.ok){Z("connection_oauth_failed",{connection_id:F,flow:"connect_new",error:$.error??"no_token"}),oe.warning(l("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:l("virtualMcp.addConnectionDialog.signInFailedDescription",{error:$.error??"no token received"})}),f(F,A.app_name??null,"new"),u(F);return}$.ran?(await D(F,"connect_new"),oe.success(l("virtualMcp.addConnectionDialog.connectedAuthenticated"))):oe.success(l("virtualMcp.addConnectionDialog.connected")),f(F,A.app_name??null,"new"),u(F)}catch(A){console.error("Failed to connect:",A),oe.error(l("virtualMcp.addConnectionDialog.failedToConnect"))}finally{r(null)}}};return s.jsxs(cs,{open:t,onOpenChange:e,children:[s.jsxs(ds,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[s.jsx(us,{className:"px-6 pt-5 pb-0 shrink-0",children:s.jsx(fs,{className:"text-base font-semibold",children:l(o==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),s.jsx("div",{className:"pt-3 shrink-0",children:s.jsx(pn,{value:m,onChange:g,placeholder:l("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),children:s.jsx(_o,{mode:o,agentId:d,addedConnectionIds:c,onAdd:u,onCloneAndAdd:I,onConnectAndAdd:E,connectingItemId:p,search:m,onCreateConnection:()=>x(!0),onBrowseNavigate:j,defaultTab:n})})]}),s.jsx(No,{open:h,onOpenChange:x,onCreated:async N=>{x(!1);const A=await gt({connectionId:N,orgId:y.id,orgSlug:y.slug,persistFallback:T=>k.update.mutateAsync({id:N,data:{connection_token:T}}).then(()=>{})});if(A.ran&&!A.ok){Z("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:A.error??"no_token"}),oe.warning(l("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:l("virtualMcp.addConnectionDialog.signInFailedDescription",{error:A.error??"no token received"})}),f(N,null,"custom"),u(N),e(!1);return}A.ran&&await D(N,"custom_create"),f(N,null,"custom"),u(N),e(!1)}})]})}const Rt=new Map;function xl(){const{org:t}=ge(),e=kt(),n=Rn(),a=n.find(x=>x.providerId==="deco"),{data:i,isLoading:l,refetch:o,isFetching:d}=Yt({queryKey:ye.aiProviderCredits(t.id,"deco"),enabled:!!a,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=i?.balanceCents??null,u=c!=null?c/100:null,f=z.useRef(new Map);if(c!=null){const x=Rt.get(t.id);f.current.get(t.id)&&x!=null&&c>x&&Z("credits_topped_up_detected",{organization_id:t.id,delta_cents:c-x,previous_balance_cents:x,new_balance_cents:c}),Rt.set(t.id,c),f.current.set(t.id,!0)}const p=!!a,r=c!=null&&c>0,m=c!=null&&c===0,g=c!=null&&c===200,h=n.length>0&&n.every(x=>x.providerId==="deco");return{hasDecoKey:p,decoKeyId:a?.id??null,balanceCents:c,balanceDollars:u,hasCredits:r,isZeroBalance:m,isInitialFreeCredit:g,hasOnlyDecoProvider:h,isLoading:l,isFetching:d,refetch:o}}const Po=4,Eo="TASK";function Mo(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,Po)||Eo}function Lo(t,e){return e==null?null:`${Mo(t)}-${String(e).padStart(2,"0")}`}const $o=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function Oo(t){const e=$o.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function Kt(t){const e=R.c(8),{size:n,className:a}=t,i=n===void 0?16:n;let l;e[0]!==i?(l={width:i,height:i},e[0]=i,e[1]=l):l=e[1];let o;e[2]!==a?(o=X("shrink-0 rounded-full object-cover",a),e[2]=a,e[3]=o):o=e[3];let d;return e[4]!==i||e[5]!==l||e[6]!==o?(d=s.jsx("img",{src:tn,alt:"Super Agent",width:i,height:i,style:l,className:o}),e[4]=i,e[5]=l,e[6]=o,e[7]=d):d=e[7],d}function jl(t,e){if(!e)return null;const n=e.toLowerCase();return t.find(a=>{const i=a.bucket.toLowerCase();return a.siteSlug?.toLowerCase()===n||i===n||i===`deco-assets-${n}`})??null}const zt=()=>0;function Ro(t){const{orgSlug:e,enabled:n=!0,onUpdate:a,onDelete:i,onResync:l}=t,o=z.useRef(a);o.current=a;const d=z.useRef(i);d.current=i;const c=z.useRef(l);c.current=l;const u=z.useRef(null),f=z.useRef(n),p=z.useRef(e);(!u.current||f.current!==n||p.current!==e)&&(f.current=n,p.current=e,u.current=m=>{if(!n||!e)return()=>{};const g=h=>{let x;try{x=JSON.parse(h.data)}catch{return}x.data&&(h.type===Kn?d.current?.(x.data.id):o.current(x.data)),m()};return Un.subscribe(e,g,()=>c.current?.())}),z.useSyncExternalStore(u.current,zt,zt)}function Ko(t,e){return{queryKey:ye.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:n}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:n}}}}function zo(){const t=R.c(21),{org:e,locator:n}=ge(),a=vt();let i;t[0]!==n?(i=ye.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const l=i;let o;t[2]!==n||t[3]!==a||t[4]!==l?(o=r=>{a.cancelQueries({queryKey:l}),a.setQueryData(l,m=>m&&{...m,items:m.items.some(g=>g.id===r.id)?m.items.map(g=>g.id===r.id?r:g):[r,...m.items]}),a.invalidateQueries({queryKey:ye.taskBoardActivity(n,r.id)})},t[2]=n,t[3]=a,t[4]=l,t[5]=o):o=t[5];let d,c;t[6]!==a||t[7]!==l?(d=()=>{a.invalidateQueries({queryKey:l})},c=r=>{a.cancelQueries({queryKey:l}),a.setQueryData(l,m=>m&&{...m,items:m.items.filter(g=>g.id!==r)})},t[6]=a,t[7]=l,t[8]=d,t[9]=c):(d=t[8],c=t[9]);let u;t[10]!==e.slug||t[11]!==o||t[12]!==d||t[13]!==c?(u={orgSlug:e.slug,onUpdate:o,onResync:d,onDelete:c},t[10]=e.slug,t[11]=o,t[12]=d,t[13]=c,t[14]=u):u=t[14],Ro(u);let f;t[15]!==a||t[16]!==l?(f=r=>{const m=r.subject,g=r.data.status;a.cancelQueries({queryKey:l}),a.setQueryData(l,h=>h&&{...h,items:h.items.map(x=>x.threads.some(b=>b.threadId===m)?{...x,threads:x.threads.map(b=>b.threadId===m?{...b,status:g}:b)}:x)})},t[15]=a,t[16]=l,t[17]=f):f=t[17];let p;t[18]!==e.slug||t[19]!==f?(p={orgSlug:e.slug,onTaskStatus:f},t[18]=e.slug,t[19]=f,t[20]=p):p=t[20],Hn(p)}function bl(){const t=R.c(9),{locator:e}=ge(),n=kt();let a;t[0]!==e||t[1]!==n?(a=Ko(e,n),t[0]=e,t[1]=n,t[2]=a):a=t[2];const i=Yt(a);zo();let l;t[3]!==i.data?.items?(l=i.data?.items??[],t[3]=i.data?.items,t[4]=l):l=t[4];let o;return t[5]!==i.error||t[6]!==i.isLoading||t[7]!==l?(o={items:l,isLoading:i.isLoading,error:i.error},t[5]=i.error,t[6]=i.isLoading,t[7]=l,t[8]=o):o=t[8],o}function yl(){const t=R.c(70),{org:e,locator:n}=ge(),a=kt(),i=vt(),l=Q();let o;t[0]!==n?(o=ye.taskBoardItems(n),t[0]=n,t[1]=o):o=t[1];const d=o;let c;t[2]!==i||t[3]!==d?(c=()=>i.invalidateQueries({queryKey:d}),t[2]=i,t[3]=d,t[4]=c):c=t[4];const u=c;let f;t[5]!==a?(f=P=>a.call("TASK_BOARD_ITEM_CREATE",P),t[5]=a,t[6]=f):f=t[6];let p;t[7]!==u||t[8]!==f?(p={mutationFn:f,onSuccess:u},t[7]=u,t[8]=f,t[9]=p):p=t[9];const r=Le(p);let m;t[10]!==a?(m=P=>a.call("TASK_BOARD_ITEM_UPDATE",P),t[10]=a,t[11]=m):m=t[11];let g;t[12]!==i||t[13]!==d?(g=async P=>{await i.cancelQueries({queryKey:d});const K=i.getQueryData(d);return i.setQueryData(d,L=>L&&{...L,items:L.items.map(U=>U.id===P.id?{...U,...P}:U)}),{previous:K}},t[12]=i,t[13]=d,t[14]=g):g=t[14];let h;t[15]!==e?(h=(P,K)=>{K.status==="done"&&Z("task_marked_done",{organization_id:e.id,task_board_item_id:K.id})},t[15]=e,t[16]=h):h=t[16];let x;t[17]!==i||t[18]!==d?(x=(P,K,L)=>{L?.previous&&i.setQueryData(d,L.previous)},t[17]=i,t[18]=d,t[19]=x):x=t[19];let b;t[20]!==u||t[21]!==n||t[22]!==i?(b=(P,K,L)=>{u(),i.invalidateQueries({queryKey:ye.taskBoardActivity(n,L.id)})},t[20]=u,t[21]=n,t[22]=i,t[23]=b):b=t[23];let S;t[24]!==m||t[25]!==g||t[26]!==h||t[27]!==x||t[28]!==b?(S={mutationFn:m,onMutate:g,onSuccess:h,onError:x,onSettled:b},t[24]=m,t[25]=g,t[26]=h,t[27]=x,t[28]=b,t[29]=S):S=t[29];const y=Le(S);let v;t[30]!==a?(v=P=>a.call("TASK_BOARD_ITEM_DELETE",{id:P}),t[30]=a,t[31]=v):v=t[31];let k;t[32]!==u||t[33]!==l?(k=P=>{oe.error(P instanceof Error&&P.message?P.message:l("taskBoard.taskBoard.deleteError")),u()},t[32]=u,t[33]=l,t[34]=k):k=t[34];let C;t[35]!==u||t[36]!==v||t[37]!==k?(C={mutationFn:v,onSuccess:u,onError:k},t[35]=u,t[36]=v,t[37]=k,t[38]=C):C=t[38];const w=Le(C);let j;t[39]!==a?(j=async P=>{const K=await Promise.allSettled(P.map(L=>a.call("TASK_BOARD_ITEM_DELETE",{id:L})));return{total:P.length,failed:K.filter(Vo).length}},t[39]=a,t[40]=j):j=t[40];let _,D;t[41]!==l?(_=P=>{const{total:K,failed:L}=P;L!==0&&oe.error(l("taskBoard.taskBoard.deleteBulkError",{failed:String(L),total:String(K)}))},D=()=>oe.error(l("taskBoard.taskBoard.deleteError")),t[41]=l,t[42]=_,t[43]=D):(_=t[42],D=t[43]);let I;t[44]!==u||t[45]!==j||t[46]!==_||t[47]!==D?(I={mutationFn:j,onSuccess:_,onError:D,onSettled:u},t[44]=u,t[45]=j,t[46]=_,t[47]=D,t[48]=I):I=t[48];const E=Le(I);let N;t[49]!==a?(N=P=>a.call("TASK_BOARD_ITEM_UPDATE",P),t[49]=a,t[50]=N):N=t[50];let A;t[51]!==u||t[52]!==N?(A={mutationFn:N,onSuccess:u},t[51]=u,t[52]=N,t[53]=A):A=t[53];const T=Le(A);let O;t[54]!==a?(O=P=>a.call("TASK_BOARD_ITEM_RERUN",P),t[54]=a,t[55]=O):O=t[55];let B;t[56]!==u||t[57]!==n||t[58]!==i?(B=(P,K,L)=>{u(),i.invalidateQueries({queryKey:ye.taskBoardActivity(n,L.id)})},t[56]=u,t[57]=n,t[58]=i,t[59]=B):B=t[59];let F;t[60]!==O||t[61]!==B?(F={mutationFn:O,onSettled:B},t[60]=O,t[61]=B,t[62]=F):F=t[62];const $=Le(F);let G;return t[63]!==r||t[64]!==T||t[65]!==w||t[66]!==E||t[67]!==$||t[68]!==y?(G={create:r,update:y,remove:w,removeMany:E,link:T,rerun:$},t[63]=r,t[64]=T,t[65]=w,t[66]=E,t[67]=$,t[68]=y,t[69]=G):G=t[69],G}function Vo(t){return t.status==="rejected"}const Uo=["ended_after_delivery","superseded"];function Ho(t){return!!t&&Uo.includes(t)}function Cl(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function vl(t){return t.failureKind!=="superseded"}function vs(t){return t.threads.some(e=>e.status==="requires_action")}function kl(t){return t.status==="in_review"&&!t.assigneeId}function Nl(t){return vs(t)}function _l(t){return t.status==="in_progress"&&vs(t)?"text-warning animate-pulse":Ns(t.status).iconClassName}function Sl(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!Ho(n.failureKind))?"failed":null}function Dl(t,e,n){const a=t.findIndex(f=>f.id===n),i=e===n?t[a+1]?.id??null:e,l=t.filter(f=>f.id!==n),o=i?l.findIndex(f=>f.id===i):-1,d=o===-1?l.length:o,c=l[d-1],u=l[d];return c&&u?(c.sortOrder+u.sortOrder)/2:c?c.sortOrder+1:u?u.sortOrder-1:0}function wl(t,e){return Array.from({length:e},(n,a)=>t-(e-1-a)*1e-4)}const Go=["archived"],ks={triage:{labelKey:"taskBoard.config.statusBacklog",icon:Qn,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:bs,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:Gs,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Yn,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:Hs,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:An,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:Us,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Wn,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Ls,iconClassName:"text-muted-foreground"}},qo={icon:bs,iconClassName:"text-muted-foreground"},Qo=ks;function Ns(t){return Qo[t]??qo}function Al(t,e){const n=ks[t];return{label:n?e(n.labelKey):t,visual:Ns(t)}}const Il=["bug","feature","chore","spike","security"],Tl={bug:{labelKey:"taskBoard.config.typeBug",icon:Jn,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:Ws,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:Qs,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:qs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Xn,iconClassName:"text-purple-500"}};function jt(t){return Vn.includes(t)}function Bl(t){return wt.filter(e=>t||!jt(e))}function Fl({deliveryEnabled:t,shownLanes:e,occupied:n}){const a=wt.filter(o=>t||!jt(o)||n.includes(o)),i=a.filter(o=>Go.includes(o)||!t&&jt(o)),l=i.filter(o=>!e.includes(o));return{lanes:a.filter(o=>!l.includes(o)),hidden:l,hideable:i}}const Vt="lane:";function Wo(t){return wt.includes(t)}function Pl({overId:t,statusOf:e}){if(t===void 0)return null;const n=String(t),a=n.startsWith(Vt)?n.slice(Vt.length):e(n);return a!==void 0&&Wo(a)?a:null}const Yo=["none","low","medium","high","urgent"],Ze={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Ft,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:Vs,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Ft,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:zs,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:Ks,iconClassName:"text-destructive"}};function El(t,e=Date.now()){const n=new Date(t).getTime();return Number.isNaN(n)?null:n<e?"overdue":n-e<=Xo*864e5?"soon":null}const Xo=3;function Ut(t){return`color-mix(in oklab, ${t??zn} var(--user-color-strength), transparent)`}const bt="__unassigned__",yt="__no_repo__",Ke="__any__",_s={assignee:null,priority:null,due:null,tags:[],repo:null,search:""};function Jo(t){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||t.repo!==null||t.search.trim()!==""}function Zo(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(t.repo!==null?1:0)+(t.search.trim()!==""?1:0)}const ea=864e5;function ta(t,e){const n=new Date(t),a=new Date(e);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()}function Ss(t,e){const n=t.trim();return n===""?!1:e!=null&&Oo(n)===e}function sa(t,e){return t.assigneeId===e?!0:t.assigneeId===xt&&t.assignedBy===e}function Ml(t,e){const n=e.search.trim().toLowerCase();if(n!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(n)&&!Ss(n,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===bt){if(t.assigneeId!==null)return!1}else if(!sa(t,e.assignee))return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const a=new Date(t.dueDate).getTime(),i=Date.now();if(e.due==="overdue"&&a>=i||e.due==="today"&&!ta(a,i)||e.due==="week"&&(a<i||a>i+7*ea))return!1}if(e.tags.length>0){const a=t.tags.map(i=>i.id);if(!e.tags.some(i=>a.includes(i)))return!1}if(e.repo!==null){if(e.repo===yt){if(t.repo!=null)return!1}else if(t.repo?.toLowerCase()!==e.repo.toLowerCase())return!1}return!0}const Ht={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function Se(t,e=!1){return X("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function na(t){const e=R.c(107),{value:n,members:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($t,{size:14,className:"shrink-0"}),e[0]=u):u=e[0];let f=u,p;e[1]!==o?(p=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=p):p=e[2];let r=p;if(n===bt){let H;e[3]!==o?(H=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=H):H=e[4],r=H}else if(n===xt){let H;e[5]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Kt,{size:14}),e[5]=H):H=e[5],f=H;let q;e[6]!==o?(q=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=q):q=e[7],r=q}else if(n){let H,q,xe,ee;if(e[8]!==a||e[9]!==n){let De;e[14]!==n?(De=we=>we.userId===n,e[14]=n,e[15]=De):De=e[15],q=a.find(De),H=Lt,xe=q?.user?.image??void 0,ee=Ot(q?.user?.name),e[8]=a,e[9]=n,e[10]=H,e[11]=q,e[12]=xe,e[13]=ee}else H=e[10],q=e[11],xe=e[12],ee=e[13];let Ce;e[16]!==H||e[17]!==xe||e[18]!==ee?(Ce=s.jsx(H,{url:xe,fallback:ee,shape:"circle",size:"2xs"}),e[16]=H,e[17]=xe,e[18]=ee,e[19]=Ce):Ce=e[19],f=Ce;let le;e[20]!==q?.user?.name||e[21]!==o?(le=q?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=q?.user?.name,e[21]=o,e[22]=le):le=e[22],r=le}let m;e[23]!==i?(m=H=>{i(H),c(!1)},e[23]=i,e[24]=m):m=e[24];const g=m,h=n!==null;let x;e[25]!==l||e[26]!==h?(x=Se(h,l),e[25]=l,e[26]=h,e[27]=x):x=e[27];const b=x,S=l&&"ml-auto";let y;e[28]!==S?(y=X("shrink-0 opacity-60",S),e[28]=S,e[29]=y):y=e[29];const v=y;let k;e[30]!==r?(k=s.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[30]=r,e[31]=k):k=e[31];let C;e[32]!==v?(C=s.jsx(Ve,{size:12,className:v}),e[32]=v,e[33]=C):C=e[33];let w;e[34]!==f||e[35]!==k||e[36]!==C||e[37]!==b?(w=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:b,children:[f,k,C]})}),e[34]=f,e[35]=k,e[36]=C,e[37]=b,e[38]=w):w=e[38];let j;e[39]!==o?(j=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=j):j=e[40];let _;e[41]!==o?(_=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=o,e[42]=_):_=e[42];let D;e[43]!==j||e[44]!==_?(D=s.jsx(At,{placeholder:j,"aria-label":_,className:"h-9"}),e[43]=j,e[44]=_,e[45]=D):D=e[45];let I;e[46]!==o?(I=o("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=o,e[47]=I):I=e[47];let E;e[48]!==I?(E=s.jsx(It,{children:I}),e[48]=I,e[49]=E):E=e[49];let N;e[50]!==o?(N=o("taskBoard.taskFilters.assigneeAnyone"),e[50]=o,e[51]=N):N=e[51];let A;e[52]!==g?(A=()=>g(null),e[52]=g,e[53]=A):A=e[53];let T;e[54]!==o?(T=o("taskBoard.taskFilters.assigneeAnyone"),e[54]=o,e[55]=T):T=e[55];let O;e[56]!==N||e[57]!==A||e[58]!==T?(O=s.jsx(ve,{value:N,onSelect:A,children:T}),e[56]=N,e[57]=A,e[58]=T,e[59]=O):O=e[59];let B;e[60]!==o?(B=o("taskBoard.taskFilters.assigneeUnassigned"),e[60]=o,e[61]=B):B=e[61];let F;e[62]!==g?(F=()=>g(bt),e[62]=g,e[63]=F):F=e[63];let $;e[64]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx($t,{size:16,className:"text-muted-foreground"}),e[64]=$):$=e[64];let G;e[65]!==o?(G=o("taskBoard.taskFilters.assigneeUnassigned"),e[65]=o,e[66]=G):G=e[66];let P;e[67]!==B||e[68]!==F||e[69]!==G?(P=s.jsxs(ve,{value:B,onSelect:F,className:"gap-2",children:[$,G]}),e[67]=B,e[68]=F,e[69]=G,e[70]=P):P=e[70];let K;e[71]!==o?(K=o("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=o,e[72]=K):K=e[72];let L;e[73]!==g?(L=()=>g(xt),e[73]=g,e[74]=L):L=e[74];let U;e[75]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Kt,{size:16}),e[75]=U):U=e[75];let V;e[76]!==o?(V=o("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=o,e[77]=V):V=e[77];let J;e[78]!==K||e[79]!==L||e[80]!==V?(J=s.jsxs(ve,{value:K,onSelect:L,className:"gap-2",children:[U,V]}),e[78]=K,e[79]=L,e[80]=V,e[81]=J):J=e[81];let W;e[82]!==O||e[83]!==P||e[84]!==J?(W=s.jsxs(qe,{children:[O,P,J]}),e[82]=O,e[83]=P,e[84]=J,e[85]=W):W=e[85];let pe;e[86]!==o?(pe=o("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=o,e[87]=pe):pe=e[87];let te;if(e[88]!==a||e[89]!==g){let H;e[91]!==g?(H=q=>s.jsxs(ve,{value:q.user?.name??q.userId,onSelect:()=>g(q.userId),className:"gap-2",children:[s.jsx(Lt,{url:q.user?.image??void 0,fallback:Ot(q.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:q.user?.name??q.userId})]},q.userId),e[91]=g,e[92]=H):H=e[92],te=a.map(H),e[88]=a,e[89]=g,e[90]=te}else te=e[90];let se;e[93]!==pe||e[94]!==te?(se=s.jsx(qe,{heading:pe,children:te}),e[93]=pe,e[94]=te,e[95]=se):se=e[95];let ae;e[96]!==E||e[97]!==W||e[98]!==se?(ae=s.jsxs(Tt,{children:[E,W,se]}),e[96]=E,e[97]=W,e[98]=se,e[99]=ae):ae=e[99];let ie;e[100]!==D||e[101]!==ae?(ie=s.jsx(ot,{align:"start",className:"w-56 p-0",children:s.jsxs(Bt,{children:[D,ae]})}),e[100]=D,e[101]=ae,e[102]=ie):ie=e[102];let he;return e[103]!==d||e[104]!==w||e[105]!==ie?(he=s.jsxs(nt,{open:d,onOpenChange:c,children:[w,ie]}),e[103]=d,e[104]=w,e[105]=ie,e[106]=he):he=e[106],he}function oa(t){const e=R.c(33),{value:n,onChange:a,block:i}=t,l=Q(),o=n!==null;let d;e[0]!==i||e[1]!==o?(d=Se(o,i),e[0]=i,e[1]=o,e[2]=d):d=e[2];const c=d,u=i&&"ml-auto";let f;e[3]!==u?(f=X("shrink-0 opacity-60",u),e[3]=u,e[4]=f):f=e[4];const p=f;let r;e[5]!==n?(r=n?s.jsx("span",{className:X("size-2 shrink-0 rounded-full",Ze[n].dotClassName)}):s.jsx(Gn,{size:14,className:"shrink-0"}),e[5]=n,e[6]=r):r=e[6];let m;e[7]!==l||e[8]!==n?(m=l(n?Ze[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=l,e[8]=n,e[9]=m):m=e[9];let g;e[10]!==p?(g=s.jsx(Ve,{size:12,className:p}),e[10]=p,e[11]=g):g=e[11];let h;e[12]!==r||e[13]!==m||e[14]!==g||e[15]!==c?(h=s.jsx(ps,{asChild:!0,children:s.jsxs("button",{type:"button",className:c,children:[r,m,g]})}),e[12]=r,e[13]=m,e[14]=g,e[15]=c,e[16]=h):h=e[16];const x=n??Ke;let b;e[17]!==a?(b=w=>a(w===Ke?null:w),e[17]=a,e[18]=b):b=e[18];let S;e[19]!==l?(S=l("taskBoard.taskFilters.priorityAnyPriority"),e[19]=l,e[20]=S):S=e[20];let y;e[21]!==S?(y=s.jsx(st,{value:Ke,children:S}),e[21]=S,e[22]=y):y=e[22];let v;e[23]!==l?(v=Yo.map(w=>s.jsxs(st,{value:w,className:"gap-2",children:[s.jsx("span",{className:X("size-2 rounded-full",Ze[w].dotClassName)}),l(Ze[w].labelKey)]},w)),e[23]=l,e[24]=v):v=e[24];let k;e[25]!==b||e[26]!==y||e[27]!==v||e[28]!==x?(k=s.jsx(hs,{align:"start",className:"w-40",children:s.jsxs(xs,{value:x,onValueChange:b,children:[y,v]})}),e[25]=b,e[26]=y,e[27]=v,e[28]=x,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==h?(C=s.jsxs(js,{children:[h,k]}),e[30]=k,e[31]=h,e[32]=C):C=e[32],C}function aa(t){const e=R.c(35),{value:n,onChange:a,block:i}=t,l=Q();let o;e[0]!==l||e[1]!==n?(o=n?l(Ht[n]):void 0,e[0]=l,e[1]=n,e[2]=o):o=e[2];const d=o,c=n!==null;let u;e[3]!==i||e[4]!==c?(u=Se(c,i),e[3]=i,e[4]=c,e[5]=u):u=e[5];const f=u,p=i&&"ml-auto";let r;e[6]!==p?(r=X("shrink-0 opacity-60",p),e[6]=p,e[7]=r):r=e[7];const m=r;let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ut,{size:14,className:"shrink-0"}),e[8]=g):g=e[8];let h;e[9]!==d||e[10]!==l?(h=d??l("taskBoard.taskFilters.dueDateLabel"),e[9]=d,e[10]=l,e[11]=h):h=e[11];let x;e[12]!==m?(x=s.jsx(Ve,{size:12,className:m}),e[12]=m,e[13]=x):x=e[13];let b;e[14]!==h||e[15]!==x||e[16]!==f?(b=s.jsx(ps,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,children:[g,h,x]})}),e[14]=h,e[15]=x,e[16]=f,e[17]=b):b=e[17];const S=n??Ke;let y;e[18]!==a?(y=D=>a(D===Ke?null:D),e[18]=a,e[19]=y):y=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{size:16,className:"text-muted-foreground"}),e[20]=v):v=e[20];let k;e[21]!==l?(k=l("taskBoard.taskFilters.dueDateAnyTime"),e[21]=l,e[22]=k):k=e[22];let C;e[23]!==k?(C=s.jsxs(st,{value:Ke,className:"gap-2",children:[v,k]}),e[23]=k,e[24]=C):C=e[24];let w;e[25]!==l?(w=Object.entries(Ht).map(D=>{const[I,E]=D,N=I==="overdue";return s.jsxs(st,{value:I,className:X("gap-2",N&&"text-destructive"),children:[s.jsx(ut,{size:16,className:X("shrink-0",N?"text-destructive":"text-muted-foreground")}),l(E)]},I)}),e[25]=l,e[26]=w):w=e[26];let j;e[27]!==S||e[28]!==y||e[29]!==C||e[30]!==w?(j=s.jsx(hs,{align:"start",className:"w-44",children:s.jsxs(xs,{value:S,onValueChange:y,children:[C,w]})}),e[27]=S,e[28]=y,e[29]=C,e[30]=w,e[31]=j):j=e[31];let _;return e[32]!==j||e[33]!==b?(_=s.jsxs(js,{children:[b,j]}),e[32]=j,e[33]=b,e[34]=_):_=e[34],_}function la(t){const e=R.c(56),{value:n,tags:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]!==i||e[1]!==n?(u=B=>i(n.includes(B)?n.filter(F=>F!==B):[...n,B]),e[0]=i,e[1]=n,e[2]=u):u=e[2];const f=u;let p;e[3]!==o||e[4]!==a||e[5]!==n[0]||e[6]!==n.length?(p=n.length===0?o("taskBoard.taskFilters.tagsLabel"):n.length===1?a.find(B=>B.id===n[0])?.name??o("taskBoard.taskFilters.tagsLabel"):o("taskBoard.taskFilters.tagsSelectedCount",{count:n.length}),e[3]=o,e[4]=a,e[5]=n[0],e[6]=n.length,e[7]=p):p=e[7];const r=p,m=n.length>0;let g;e[8]!==l||e[9]!==m?(g=Se(m,l),e[8]=l,e[9]=m,e[10]=g):g=e[10];const h=g,x=l&&"ml-auto";let b;e[11]!==x?(b=X("shrink-0 opacity-60",x),e[11]=x,e[12]=b):b=e[12];const S=b;let y;e[13]!==a||e[14]!==n[0]||e[15]!==n.length?(y=n.length===1?s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ut(a.find(B=>B.id===n[0])?.color)}}):s.jsx(Ys,{size:14,className:"shrink-0"}),e[13]=a,e[14]=n[0],e[15]=n.length,e[16]=y):y=e[16];let v;e[17]!==r?(v=s.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[17]=r,e[18]=v):v=e[18];let k;e[19]!==S?(k=s.jsx(Ve,{size:12,className:S}),e[19]=S,e[20]=k):k=e[20];let C;e[21]!==y||e[22]!==v||e[23]!==k||e[24]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,v,k]})}),e[21]=y,e[22]=v,e[23]=k,e[24]=h,e[25]=C):C=e[25];let w;e[26]!==o?(w=o("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=o,e[27]=w):w=e[27];let j;e[28]!==o?(j=o("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=o,e[29]=j):j=e[29];let _;e[30]!==w||e[31]!==j?(_=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[30]=w,e[31]=j,e[32]=_):_=e[32];let D;e[33]!==o?(D=o("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=o,e[34]=D):D=e[34];let I;e[35]!==D?(I=s.jsx(It,{children:D}),e[35]=D,e[36]=I):I=e[36];let E;if(e[37]!==a||e[38]!==f||e[39]!==n){let B;e[41]!==f||e[42]!==n?(B=F=>s.jsxs(ve,{value:F.name,onSelect:()=>f(F.id),className:"gap-2",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ut(F.color)}}),s.jsx("span",{className:"flex-1 truncate",children:F.name}),n.includes(F.id)&&s.jsx(Ge,{size:14,className:"shrink-0 text-foreground"})]},F.id),e[41]=f,e[42]=n,e[43]=B):B=e[43],E=a.map(B),e[37]=a,e[38]=f,e[39]=n,e[40]=E}else E=e[40];let N;e[44]!==E?(N=s.jsx(qe,{children:E}),e[44]=E,e[45]=N):N=e[45];let A;e[46]!==I||e[47]!==N?(A=s.jsxs(Tt,{children:[I,N]}),e[46]=I,e[47]=N,e[48]=A):A=e[48];let T;e[49]!==_||e[50]!==A?(T=s.jsx(ot,{align:"start",className:"w-56 p-0",children:s.jsxs(Bt,{children:[_,A]})}),e[49]=_,e[50]=A,e[51]=T):T=e[51];let O;return e[52]!==d||e[53]!==C||e[54]!==T?(O=s.jsxs(nt,{open:d,onOpenChange:c,children:[C,T]}),e[52]=d,e[53]=C,e[54]=T,e[55]=O):O=e[55],O}function ia(t){const e=R.c(73),{value:n,repos:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]!==o||e[1]!==n?(u=n===null?o("taskBoard.taskFilters.repoLabel"):n===yt?o("taskBoard.taskFilters.repoNoRepo"):n,e[0]=o,e[1]=n,e[2]=u):u=e[2];const f=u;let p;e[3]!==i?(p=J=>{i(J),c(!1)},e[3]=i,e[4]=p):p=e[4];const r=p,m=n!==null;let g;e[5]!==l||e[6]!==m?(g=Se(m,l),e[5]=l,e[6]=m,e[7]=g):g=e[7];const h=g,x=l&&"ml-auto";let b;e[8]!==x?(b=X("shrink-0 opacity-60",x),e[8]=x,e[9]=b):b=e[9];const S=b;let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ht,{className:"size-3.5 shrink-0"}),e[10]=y):y=e[10];let v;e[11]!==f?(v=s.jsx("span",{className:"max-w-[12rem] truncate",children:f}),e[11]=f,e[12]=v):v=e[12];let k;e[13]!==S?(k=s.jsx(Ve,{size:12,className:S}),e[13]=S,e[14]=k):k=e[14];let C;e[15]!==v||e[16]!==k||e[17]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,v,k]})}),e[15]=v,e[16]=k,e[17]=h,e[18]=C):C=e[18];let w;e[19]!==o?(w=o("taskBoard.taskFilters.repoFilterPlaceholder"),e[19]=o,e[20]=w):w=e[20];let j;e[21]!==o?(j=o("taskBoard.taskFilters.repoFilterPlaceholder"),e[21]=o,e[22]=j):j=e[22];let _;e[23]!==w||e[24]!==j?(_=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[23]=w,e[24]=j,e[25]=_):_=e[25];let D;e[26]!==o?(D=o("taskBoard.taskFilters.repoNoReposFound"),e[26]=o,e[27]=D):D=e[27];let I;e[28]!==D?(I=s.jsx(It,{children:D}),e[28]=D,e[29]=I):I=e[29];let E;e[30]!==o?(E=o("taskBoard.taskFilters.repoAnyRepo"),e[30]=o,e[31]=E):E=e[31];let N;e[32]!==r?(N=()=>r(null),e[32]=r,e[33]=N):N=e[33];let A;e[34]!==o?(A=o("taskBoard.taskFilters.repoAnyRepo"),e[34]=o,e[35]=A):A=e[35];let T;e[36]!==E||e[37]!==N||e[38]!==A?(T=s.jsx(ve,{value:E,onSelect:N,children:A}),e[36]=E,e[37]=N,e[38]=A,e[39]=T):T=e[39];let O;e[40]!==o?(O=o("taskBoard.taskFilters.repoNoRepo"),e[40]=o,e[41]=O):O=e[41];let B;e[42]!==r?(B=()=>r(yt),e[42]=r,e[43]=B):B=e[43];let F;e[44]!==o?(F=o("taskBoard.taskFilters.repoNoRepo"),e[44]=o,e[45]=F):F=e[45];let $;e[46]!==O||e[47]!==B||e[48]!==F?($=s.jsx(ve,{value:O,onSelect:B,children:F}),e[46]=O,e[47]=B,e[48]=F,e[49]=$):$=e[49];let G;e[50]!==T||e[51]!==$?(G=s.jsxs(qe,{children:[T,$]}),e[50]=T,e[51]=$,e[52]=G):G=e[52];let P;if(e[53]!==a||e[54]!==r||e[55]!==n){let J;e[57]!==r||e[58]!==n?(J=W=>s.jsxs(ve,{value:W,onSelect:()=>r(W),className:"gap-2",children:[s.jsx(ht,{className:"size-4 shrink-0"}),s.jsx("span",{className:"flex-1 truncate",children:W}),n===W&&s.jsx(Ge,{size:14,className:"shrink-0 text-foreground"})]},W),e[57]=r,e[58]=n,e[59]=J):J=e[59],P=a.map(J),e[53]=a,e[54]=r,e[55]=n,e[56]=P}else P=e[56];let K;e[60]!==P?(K=s.jsx(qe,{children:P}),e[60]=P,e[61]=K):K=e[61];let L;e[62]!==I||e[63]!==G||e[64]!==K?(L=s.jsxs(Tt,{children:[I,G,K]}),e[62]=I,e[63]=G,e[64]=K,e[65]=L):L=e[65];let U;e[66]!==_||e[67]!==L?(U=s.jsx(ot,{align:"start",className:"w-64 p-0",children:s.jsxs(Bt,{children:[_,L]})}),e[66]=_,e[67]=L,e[68]=U):U=e[68];let V;return e[69]!==d||e[70]!==C||e[71]!==U?(V=s.jsxs(nt,{open:d,onOpenChange:c,children:[C,U]}),e[69]=d,e[70]=C,e[71]=U,e[72]=V):V=e[72],V}function ra(t){const e=R.c(25),{value:n,onChange:a,block:i}=t,l=Q(),[o,d]=z.useState(n!==""),[c,u]=z.useState(!1),[f,p]=z.useState(n);n!==f&&(p(n),n===""&&!c&&d(!1));const r=o||i,m=r?"w-32 sm:w-44":"w-8 px-0 justify-center",g=i&&"h-10 w-full px-3 text-sm sm:w-full";let h;e[0]!==m||e[1]!==g?(h=X("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",m,g),e[0]=m,e[1]=g,e[2]=h):h=e[2];let x;e[3]!==l?(x=l("taskBoard.taskFilters.searchLabel"),e[3]=l,e[4]=x):x=e[4];let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=()=>d(!0),e[5]=b):b=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Xs,{size:14}),e[6]=S):S=e[6];let y;e[7]!==x?(y=s.jsx("button",{type:"button","aria-label":x,onClick:b,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=x,e[8]=y):y=e[8];let v;e[9]!==i||e[10]!==r||e[11]!==a||e[12]!==l||e[13]!==n?(v=r&&s.jsx("input",{autoFocus:!i,value:n,onChange:w=>a(w.target.value),onFocus:()=>u(!0),onBlur:()=>{u(!1),n===""&&d(!1)},placeholder:l("taskBoard.taskFilters.searchPlaceholder"),"aria-label":l("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=i,e[10]=r,e[11]=a,e[12]=l,e[13]=n,e[14]=v):v=e[14];let k;e[15]!==i||e[16]!==a||e[17]!==l||e[18]!==n?(k=n!==""&&s.jsx("button",{type:"button","aria-label":l("taskBoard.taskFilters.searchClearLabel"),onMouseDown:ca,onClick:()=>{a(""),i||d(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:s.jsx($s,{size:14})}),e[15]=i,e[16]=a,e[17]=l,e[18]=n,e[19]=k):k=e[19];let C;return e[20]!==h||e[21]!==y||e[22]!==v||e[23]!==k?(C=s.jsxs("div",{className:h,children:[y,v,k]}),e[20]=h,e[21]=y,e[22]=v,e[23]=k,e[24]=C):C=e[24],C}function ca(t){return t.preventDefault()}function da(t){const e=R.c(20),{block:n,onClick:a}=t,i=Q();let l;e[0]!==i?(l=i("taskBoard.taskFilters.boardSettingsLabel"),e[0]=i,e[1]=l):l=e[1];const o=l;let d;e[2]!==n?(d=X(Se(!1,n),n?"h-10 w-full":"w-8 justify-center px-0"),e[2]=n,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(qn,{size:14,className:"shrink-0"}),e[4]=c):c=e[4];let u;e[5]!==n||e[6]!==o?(u=n&&s.jsx("span",{children:o}),e[5]=n,e[6]=o,e[7]=u):u=e[7];let f;e[8]!==o||e[9]!==a||e[10]!==d||e[11]!==u?(f=s.jsxs("button",{type:"button",onClick:a,"aria-label":o,className:d,children:[c,u]}),e[8]=o,e[9]=a,e[10]=d,e[11]=u,e[12]=f):f=e[12];const p=f;if(n)return p;let r;e[13]!==p?(r=s.jsx($e,{asChild:!0,children:p}),e[13]=p,e[14]=r):r=e[14];let m;e[15]!==o?(m=s.jsx(Oe,{side:"top",children:o}),e[15]=o,e[16]=m):m=e[16];let g;return e[17]!==r||e[18]!==m?(g=s.jsxs(Re,{children:[r,m]}),e[17]=r,e[18]=m,e[19]=g):g=e[19],g}function Ds(t){const e=R.c(53),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d,block:c}=t;let u;e[0]!==n||e[1]!==o?(u=C=>o({...n,search:C}),e[0]=n,e[1]=o,e[2]=u):u=e[2];let f;e[3]!==c||e[4]!==n.search||e[5]!==u?(f=s.jsx(ra,{block:c,value:n.search,onChange:u}),e[3]=c,e[4]=n.search,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==n||e[8]!==o?(p=C=>o({...n,assignee:C}),e[7]=n,e[8]=o,e[9]=p):p=e[9];let r;e[10]!==c||e[11]!==n.assignee||e[12]!==a||e[13]!==p?(r=s.jsx(na,{block:c,value:n.assignee,members:a,onChange:p}),e[10]=c,e[11]=n.assignee,e[12]=a,e[13]=p,e[14]=r):r=e[14];let m;e[15]!==n||e[16]!==o?(m=C=>o({...n,priority:C}),e[15]=n,e[16]=o,e[17]=m):m=e[17];let g;e[18]!==c||e[19]!==n.priority||e[20]!==m?(g=s.jsx(oa,{block:c,value:n.priority,onChange:m}),e[18]=c,e[19]=n.priority,e[20]=m,e[21]=g):g=e[21];let h;e[22]!==n||e[23]!==o?(h=C=>o({...n,due:C}),e[22]=n,e[23]=o,e[24]=h):h=e[24];let x;e[25]!==c||e[26]!==n.due||e[27]!==h?(x=s.jsx(aa,{block:c,value:n.due,onChange:h}),e[25]=c,e[26]=n.due,e[27]=h,e[28]=x):x=e[28];let b;e[29]!==n||e[30]!==o?(b=C=>o({...n,tags:C}),e[29]=n,e[30]=o,e[31]=b):b=e[31];let S;e[32]!==c||e[33]!==n.tags||e[34]!==b||e[35]!==i?(S=s.jsx(la,{block:c,value:n.tags,tags:i,onChange:b}),e[32]=c,e[33]=n.tags,e[34]=b,e[35]=i,e[36]=S):S=e[36];let y;e[37]!==c||e[38]!==n||e[39]!==o||e[40]!==l?(y=(l.length>0||n.repo!==null)&&s.jsx(ia,{block:c,value:n.repo,repos:l,onChange:C=>o({...n,repo:C})}),e[37]=c,e[38]=n,e[39]=o,e[40]=l,e[41]=y):y=e[41];let v;e[42]!==c||e[43]!==d?(v=s.jsx(da,{block:c,onClick:d}),e[42]=c,e[43]=d,e[44]=v):v=e[44];let k;return e[45]!==S||e[46]!==y||e[47]!==v||e[48]!==f||e[49]!==r||e[50]!==g||e[51]!==x?(k=s.jsxs(s.Fragment,{children:[f,r,g,x,S,y,v]}),e[45]=S,e[46]=y,e[47]=v,e[48]=f,e[49]=r,e[50]=g,e[51]=x,e[52]=k):k=e[52],k}function Ll(t){const e=R.c(15),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}=t,c=Q();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(gs,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=u):u=e[0];let f;e[1]!==n||e[2]!==a||e[3]!==o||e[4]!==d||e[5]!==l||e[6]!==i?(f=s.jsx(Ds,{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}),e[1]=n,e[2]=a,e[3]=o,e[4]=d,e[5]=l,e[6]=i,e[7]=f):f=e[7];let p;e[8]!==n||e[9]!==o||e[10]!==c?(p=Jo(n)&&s.jsx("button",{type:"button",onClick:()=>o(_s),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:c("taskBoard.taskFilters.clearButton")}),e[8]=n,e[9]=o,e[10]=c,e[11]=p):p=e[11];let r;return e[12]!==f||e[13]!==p?(r=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u,f,p]}),e[12]=f,e[13]=p,e[14]=r):r=e[14],r}function $l(t){const e=R.c(41),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}=t,c=Q(),[u,f]=z.useState(!1),p=Zo(n),r=p>0;let m;e[0]!==r?(m=Se(r),e[0]=r,e[1]=m):m=e[1];const g=m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(gs,{size:14,className:"shrink-0"}),e[2]=h):h=e[2];let x;e[3]!==c?(x=c("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=c,e[4]=x):x=e[4];let b;e[5]!==p?(b=p>0&&s.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:p}),e[5]=p,e[6]=b):b=e[6];let S;e[7]!==x||e[8]!==b||e[9]!==g?(S=s.jsx(ln,{asChild:!0,children:s.jsxs("button",{type:"button",className:g,children:[h,x,b]})}),e[7]=x,e[8]=b,e[9]=g,e[10]=S):S=e[10];let y;e[11]!==c?(y=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=y):y=e[12];let v;e[13]!==y?(v=s.jsx(Dt,{className:"px-4 pt-4 text-base font-medium text-foreground",children:y}),e[13]=y,e[14]=v):v=e[14];let k;e[15]!==n||e[16]!==a||e[17]!==o||e[18]!==d||e[19]!==l||e[20]!==i?(k=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(Ds,{block:!0,filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d})}),e[15]=n,e[16]=a,e[17]=o,e[18]=d,e[19]=l,e[20]=i,e[21]=k):k=e[21];let C;e[22]!==p||e[23]!==o||e[24]!==c?(C=p>0&&s.jsx(be,{variant:"outline",className:"flex-1",onClick:()=>o(_s),children:c("taskBoard.taskFilters.clearAllButton")}),e[22]=p,e[23]=o,e[24]=c,e[25]=C):C=e[25];let w;e[26]!==c?(w=c("taskBoard.taskFilters.doneButton"),e[26]=c,e[27]=w):w=e[27];let j;e[28]!==w?(j=s.jsx(ss,{asChild:!0,children:s.jsx(be,{className:"flex-1",children:w})}),e[28]=w,e[29]=j):j=e[29];let _;e[30]!==C||e[31]!==j?(_=s.jsxs(ns,{className:"flex-row gap-2",children:[C,j]}),e[30]=C,e[31]=j,e[32]=_):_=e[32];let D;e[33]!==_||e[34]!==v||e[35]!==k?(D=s.jsxs(St,{className:"p-0",children:[v,k,_]}),e[33]=_,e[34]=v,e[35]=k,e[36]=D):D=e[36];let I;return e[37]!==u||e[38]!==D||e[39]!==S?(I=s.jsxs(_t,{open:u,onOpenChange:f,direction:"bottom",children:[S,D]}),e[37]=u,e[38]=D,e[39]=S,e[40]=I):I=e[40],I}function Ol(t,e){return Lo(t,e.keySeq)??e.id}function Rl(t,e){const n=e?.trim();if(n)return t.find(a=>Ss(n,a.keySeq))??t.find(a=>a.id===n)}export{hl as A,wl as B,Fl as C,Sl as D,_s as E,Nl as F,Dl as G,Pl as H,Ml as I,Go as J,El as K,Vt as L,Co as M,pl as N,Ze as P,Kt as S,Tl as T,Ol as a,kl as b,Ko as c,ml as d,gl as e,zo as f,yl as g,Yo as h,vs as i,Il as j,Ut as k,Al as l,jl as m,Ns as n,Bl as o,Cl as p,vl as q,Ho as r,_l as s,Lo as t,xl as u,ks as v,bl as w,Rl as x,$l as y,Ll as z};
|
|
1
|
+
import{bW as ws,c as R,l as X,j as s,h as He,r as z,I as Gt,G as As,o as Z,b as Q,b6 as Is,W as ge,d as qt,a6 as Qt,_ as Wt,L as Ts,a1 as $e,a2 as Oe,a4 as Re,a as Ct,F as Bs,ar as Fs,as as Ps,B as be,t as oe,H as Es,J as Ms,K as ye,n as vt,a7 as kt,m as Yt,e as Le,bm as Ls,ap as $s}from"./index-DuTFQdyn.js";import{c as Xt,u as Os,d as Jt}from"./thread-route-UpxprbYB.js";import{t as Ve}from"./ChevronUp-CKAKUsLZ.js";import{A as Zt,N as Rs,s as dt,aL as Ks,aM as zs,aN as Ft,aO as Vs,t as Us,aP as Hs,a6 as Gs,aQ as qs,o as Qs,aR as Ws,a4 as ut,a3 as Ys,aa as Xs}from"./agent-icon-Bxsxnhg4.js";import{a as es,i as Js,e as Zs,S as en,f as tn}from"./constants-DNuUCxmW.js";import{b as Nt,u as sn}from"./use-virtual-mcp-nLa9DgC8.js";import{g as nn}from"./github-repo-BpKUwJal.js";import{T as ts}from"./toolbar-icon-button-C71EiiMK.js";import{P as nt,a as ze,b as ot}from"./popover-DF2wTNDa.js";import{D as _t,a as St,b as Dt,c as on,e as an,f as ss,g as ns,d as ln}from"./drawer-DcQ3SCMM.js";import{i as rn}from"./SearchMd-C_odO2p9.js";import{i as Ge}from"./Check-BX2gygbe.js";import{s as Qe}from"./Plus-B5hmmemV.js";import{G as ht,a as cn}from"./github-repo-picker-B7FKQdS9.js";import{g as dn,u as un,b as os}from"./hooks-CbjISts1.js";import{g as fn,b as as}from"./use-project-scope-CCn_7fuY.js";import{u as ls}from"./shell-layout-1ZMT0Tc1.js";import{a as mn}from"./use-navigate-to-agent-CgD7hYim.js";import{d as gn}from"./thread-intent-mGN-1FVs.js";import{C as pn}from"./collection-search-M_RRr6Xl.js";import{g as hn,b as xn,a as jn,e as bn}from"./extract-connection-data-UVgsucP8.js";import{u as is,a as rs,g as yn,C as ft}from"./connection-card-BjwMqpRy.js";import{D as cs,b as ds,c as us,d as fs,h as Cn,e as vn}from"./dialog-MZN5GEGy.js";import{d as ce,a as de,e as ue,b as fe,c as me,F as Pt}from"./form-Dbv9rnRr.js";import{I as _e}from"./input-BQBB8gcC.js";import{S as kn,a as Nn,b as _n,c as Sn,d as Ue}from"./select-Clrs7oqv.js";import{T as Dn}from"./textarea-5EDWymdh.js";import{b as ms}from"./use-connection-CS7s7hVb.js";import{n as et,a as mt,i as gs}from"./Tool02-pfppv5IR.js";import{b as wn,d as An}from"./UserSquare-Cis5hkvt.js";import{s as In}from"./XClose-eQ0IqAwM.js";import{c as Tn,i as Xe,a as Et,E as Bn,p as Fn,b as Pn,d as En}from"./connection-form-helpers-Dwp_oeO7.js";import{a as gt}from"./authenticate-and-persist-oauth-_W6RIHUW.js";import{g as Mn}from"./connection-slug-CITJ0kGN.js";import{C as Ln}from"./collection-tabs-C8VQp3Vj.js";import{u as Mt}from"./use-infinite-scroll-Dt4fLfGW.js";import{B as Je}from"./badge-C_BaeWRr.js";import{u as $n}from"./useSuspenseInfiniteQuery-yiEBUT8w.js";import{u as On}from"./use-mcp-client-BUvHJAtF.js";import{g as tt}from"./metadata-dUsYcpuu.js";import{u as Rn}from"./use-ai-providers-Dpe1dK4t.js";import{T as Kn,C as wt,c as zn,d as Vn,S as xt}from"./task-board-h1SC3xFJ.js";import{t as Un}from"./decopilot-sse-pool-CXw15f-z.js";import{u as Hn}from"./use-decopilot-events-ya7dVgqN.js";import{A as Lt}from"./avatar-CIaf_qwP.js";import{h as st,D as ps,b as hs,g as xs,c as js}from"./dropdown-menu-g-JnC1d_.js";import{a as At,c as It,d as ve,e as qe,b as Tt,C as Bt}from"./command-YM_TkZoa.js";import{s as Gn}from"./TrendUp01-CHK-OeEA.js";import{a as qn}from"./Settings02-Bu5ySj3i.js";import{s as $t}from"./User01-CgCTj81P.js";import{g as Ot}from"./get-initials-D-f_fDFw.js";import{i as Qn}from"./AlertCircle-C2NBg9mc.js";import{i as Wn}from"./CheckCircle-DliFzmTw.js";import{a as bs}from"./DotsVertical-BAzYPODX.js";import{s as Yn}from"./Eye-C8bJ0pht.js";import{i as Xn}from"./Shield01-CeyvRCTS.js";const Jn=ws("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function Zn(t){const e=R.c(21),{value:n,onChange:a,placeholder:i,onKeyDown:l,className:o,isSearching:d,disabled:c}=t,u=i===void 0?"Search...":i;let f;e[0]!==o?(f=X("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=f):f=e[1];const p=c?"cursor-not-allowed opacity-50":"cursor-text";let r;e[2]!==p?(r=X("flex items-center gap-2.5 h-12 px-4",p),e[2]=p,e[3]=r):r=e[3];let m;e[4]!==d?(m=d?s.jsx(He,{className:"size-4 text-muted-foreground shrink-0"}):s.jsx(rn,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=d,e[5]=m):m=e[5];let g;e[6]!==a?(g=S=>a(S.target.value),e[6]=a,e[7]=g):g=e[7];let h;e[8]!==c||e[9]!==l||e[10]!==u||e[11]!==g||e[12]!==n?(h=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:l,placeholder:u,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=l,e[10]=u,e[11]=g,e[12]=n,e[13]=h):h=e[13];let x;e[14]!==r||e[15]!==m||e[16]!==h?(x=s.jsxs("label",{className:r,children:[m,h]}),e[14]=r,e[15]=m,e[16]=h,e[17]=x):x=e[17];let b;return e[18]!==f||e[19]!==x?(b=s.jsx("div",{className:f,children:x}),e[18]=f,e[19]=x,e[20]=b):b=e[20],b}function eo(t,e,n){if(!n)return null;const a=dn(t,e);return a?a.threads.get().find(l=>l.id===n)?.branch??null:null}const ys=z.createContext(null);function ml(t){const e=R.c(5),{children:n}=t,[a,i]=z.useState(!1);let l;e[0]!==a?(l={empty:a,setEmpty:i},e[0]=a,e[1]=l):l=e[1];let o;return e[2]!==n||e[3]!==l?(o=s.jsx(ys.Provider,{value:l,children:n}),e[2]=n,e[3]=l,e[4]=o):o=e[4],o}function to(){return z.useContext(ys)?.empty??!1}function so(t){const e=R.c(6),{value:n,onChange:a}=t,i=Q();let l;e[0]!==i?(l=i("sidebar.agentsSection.searchAgents"),e[0]=i,e[1]=l):l=e[1];let o;return e[2]!==a||e[3]!==l||e[4]!==n?(o=s.jsx(Zn,{value:n,onChange:a,placeholder:l}),e[2]=a,e[3]=l,e[4]=n,e[5]=o):o=e[5],o}function no(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.noAgentsFound"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:n}),t[2]=n,t[3]=a):a=t[3],a}function oo(t){const e=R.c(10),{org:n,onClose:a}=t,i=Q();let l;e[0]!==n.slug?(l={org:n.slug},e[0]=n.slug,e[1]=l):l=e[1];let o;e[2]!==a?(o=()=>a(),e[2]=a,e[3]=o):o=e[3];let d;e[4]!==i?(d=i("sidebar.agentsSection.seeAllAgents"),e[4]=i,e[5]=d):d=e[5];let c;return e[6]!==l||e[7]!==o||e[8]!==d?(c=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ts,{to:"/$org/settings/agents",params:l,onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:d})}),e[6]=l,e[7]=o,e[8]=d,e[9]=c):c=e[9],c}function ao(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.agents"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx(Cs,{children:n}),t[2]=n,t[3]=a):a=t[3],a}function lo(t){const e=R.c(11),{onImportFromGithub:n}=t,a=Q();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ht,{className:"size-3.5"}),e[0]=i):i=e[0];let l;e[1]!==a?(l=a("sidebar.agentsSection.import"),e[1]=a,e[2]=l):l=e[2];let o;e[3]!==n||e[4]!==l?(o=s.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[i,l]}),e[3]=n,e[4]=l,e[5]=o):o=e[5];let d;e[6]!==a?(d=a("sidebar.agentsSection.codeAgents"),e[6]=a,e[7]=d):d=e[7];let c;return e[8]!==o||e[9]!==d?(c=s.jsx(Cs,{action:o,children:d}),e[8]=o,e[9]=d,e[10]=c):c=e[10],c}function io(t){const e=R.c(11),{setOpen:n,emptyCtaClass:a}=t,i=Q();let l;e[0]!==i?(l=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=l):l=e[1];let o;e[2]!==a?(o=X(a),e[2]=a,e[3]=o):o=e[3];let d;e[4]!==n?(d=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[4]=n,e[5]=d):d=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qe,{className:"size-4"}),e[6]=c):c=e[6];let u;return e[7]!==l||e[8]!==o||e[9]!==d?(u=s.jsx(ts,{"aria-label":l,className:o,onClick:d,children:c}),e[7]=l,e[8]=o,e[9]=d,e[10]=u):u=e[10],u}function ro(t){const e=R.c(17),{setOpen:n,highlightEmpty:a,emptyCtaClass:i}=t,l=Q();let o;e[0]!==a||e[1]!==l?(o=a?void 0:l("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=l,e[2]=o):o=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]!==n?(c=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[5]=n,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Qe,{}),e[7]=u):u=e[7];let f;e[8]!==l?(f=l("sidebar.agentsSection.newAgent"),e[8]=l,e[9]=f):f=e[9];let p;e[10]!==f?(p=s.jsx("span",{children:f}),e[10]=f,e[11]=p):p=e[11];let r;return e[12]!==o||e[13]!==d||e[14]!==c||e[15]!==p?(r=s.jsx(Qt,{children:s.jsxs(Wt,{tooltip:o,className:d,onClick:c,children:[u,p]})}),e[12]=o,e[13]=d,e[14]=c,e[15]=p,e[16]=r):r=e[16],r}function co(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.browseAgents"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx(Dt,{className:"sr-only",children:n}),t[2]=n,t[3]=a):a=t[3],a}function uo(t){const e=R.c(8),{emptyCtaClass:n}=t,a=Q();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==n?(l=X(n),e[2]=n,e[3]=l):l=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Qe,{className:"size-4"}),e[4]=o):o=e[4];let d;return e[5]!==i||e[6]!==l?(d=s.jsx(ts,{"aria-label":i,className:l,children:o}),e[5]=i,e[6]=l,e[7]=d):d=e[7],d}function fo(t){const e=R.c(19),{wrapEmptyHint:n,highlightEmpty:a,emptyCtaClass:i}=t,l=Q();let o;e[0]!==a||e[1]!==l?(o=a?void 0:l("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=l,e[2]=o):o=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qe,{}),e[5]=c):c=e[5];let u;e[6]!==l?(u=l("sidebar.agentsSection.newAgent"),e[6]=l,e[7]=u):u=e[7];let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let p;e[10]!==o||e[11]!==d||e[12]!==f?(p=s.jsx(ze,{asChild:!0,children:s.jsxs(Wt,{tooltip:o,className:d,children:[c,f]})}),e[10]=o,e[11]=d,e[12]=f,e[13]=p):p=e[13];let r;e[14]!==p||e[15]!==n?(r=n(p),e[14]=p,e[15]=n,e[16]=r):r=e[16];let m;return e[17]!==r?(m=s.jsx(Qt,{children:r}),e[17]=r,e[18]=m):m=e[18],m}function mo(t){const e=R.c(9),{children:n}=t,a=Q();let i;e[0]!==n?(i=s.jsx($e,{asChild:!0,children:n}),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==a?(l=a("sidebar.agentsSection.selectAnExistingAgent"),e[2]=a,e[3]=l):l=e[3];let o;e[4]!==l?(o=s.jsx(Oe,{side:"right",sideOffset:8,children:l}),e[4]=l,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs(Re,{defaultOpen:!0,delayDuration:0,children:[i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function go(t){const e=qt(),{create:n}=un(),{locator:a}=ge(),i=Xt(),l=Os();return async o=>{const d=crypto.randomUUID(),c=o===l?eo(t,a,i??""):null;try{await n({id:d,virtual_mcp_id:o,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:d},search:{virtualmcpid:o}})}}function pt(t){const e=R.c(20),{agent:n,selected:a,onClick:i}=t,l=a?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==l?(o=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",l),e[0]=l,e[1]=o):o=e[1];let d;e[2]!==n.icon||e[3]!==n.title?(d=s.jsx(Zt,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=d):d=e[4];let c;e[5]!==n.title?(c=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=c):c=e[6];let u;e[7]!==n.description?(u=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=u):u=e[8];let f;e[9]!==c||e[10]!==u?(f=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,u]}),e[9]=c,e[10]=u,e[11]=f):f=e[11];let p;e[12]!==a?(p=a&&s.jsx(Ge,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=a,e[13]=p):p=e[13];let r;return e[14]!==i||e[15]!==o||e[16]!==d||e[17]!==f||e[18]!==p?(r=s.jsxs("button",{type:"button",onClick:i,className:o,children:[d,f,p]}),e[14]=i,e[15]=o,e[16]=d,e[17]=f,e[18]=p,e[19]=r):r=e[19],r}function Cs(t){const e=R.c(5),{children:n,action:a}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==a||e[3]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,a]}),e[2]=a,e[3]=i,e[4]=l):l=e[4],l}function po(t){const e=R.c(43),{onClose:n,onSelectAgent:a,selectedAgentId:i,onImportFromGithub:l}=t,[o,d]=z.useState(""),c=z.useDeferredValue(o),u=c||void 0;let f;e[0]!==u?(f={searchTerm:u},e[0]=u,e[1]=f):f=e[1];const p=Nt(f),r=p??[],{org:m}=ge(),g=go(m.slug),h=fn(p),x=c.toLowerCase(),b=r.filter(bo).filter(V=>!h.has(V.id)).filter(jo),S=b.filter(xo),y=b.filter(ho),v=es(m.id),k=!c||v.title.toLowerCase().includes(x),C=!!(a&&k);let w;e[2]!==n||e[3]!==a?(w=()=>{a?.(null),n(),d("")},e[2]=n,e[3]=a,e[4]=w):w=e[4];const j=w;let _;e[5]!==g||e[6]!==n||e[7]!==a?(_=V=>{if(a){a(V.id),n(),d("");return}n(),d(""),g(V.id)},e[5]=g,e[6]=n,e[7]=a,e[8]=_):_=e[8];const D=_,I="flex flex-col max-h-[min(640px,80dvh)]";let E;e[9]!==o?(E=s.jsx(so,{value:o,onChange:d}),e[9]=o,e[10]=E):E=e[10];const N="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5";let A;e[11]!==v||e[12]!==a||e[13]!==j||e[14]!==i||e[15]!==k?(A=a&&k&&v&&s.jsx(pt,{agent:v,selected:!i||i===v.id,onClick:j}),e[11]=v,e[12]=a,e[13]=j,e[14]=i,e[15]=k,e[16]=A):A=e[16];const T=(S.length>0||!c)&&s.jsx(lo,{onImportFromGithub:l});let O;e[17]!==D||e[18]!==a||e[19]!==i?(O=V=>s.jsx(pt,{agent:V,selected:a?i===V.id:void 0,onClick:()=>D(V)},V.id),e[17]=D,e[18]=a,e[19]=i,e[20]=O):O=e[20];const B=S.map(O),F=y.length>0&&s.jsx(ao,{});let $;e[21]!==D||e[22]!==a||e[23]!==i?($=V=>s.jsx(pt,{agent:V,selected:a?i===V.id:void 0,onClick:()=>D(V)},V.id),e[21]=D,e[22]=a,e[23]=i,e[24]=$):$=e[24];const G=y.map($);let P;e[25]!==C||e[26]!==c||e[27]!==b.length?(P=b.length===0&&!C&&c&&s.jsx(no,{}),e[25]=C,e[26]=c,e[27]=b.length,e[28]=P):P=e[28];let K;e[29]!==B||e[30]!==F||e[31]!==G||e[32]!==P||e[33]!==A||e[34]!==T?(K=s.jsxs("div",{className:N,children:[A,T,B,F,G,P]}),e[29]=B,e[30]=F,e[31]=G,e[32]=P,e[33]=A,e[34]=T,e[35]=K):K=e[35];let L;e[36]!==n||e[37]!==m?(L=s.jsx(oo,{org:m,onClose:n}),e[36]=n,e[37]=m,e[38]=L):L=e[38];let U;return e[39]!==K||e[40]!==L||e[41]!==E?(U=s.jsxs("div",{className:I,children:[E,K,L]}),e[39]=K,e[40]=L,e[41]=E,e[42]=U):U=e[42],U}function ho(t){return!as(t.metadata)}function xo(t){return as(t.metadata)}function jo(t){return!Zs(t.id)}function bo(t){return!Js(t.id)}function yo(t){const e=R.c(14),{compact:n,trigger:a,onSelectAgent:i,selectedAgentId:l,side:o,align:d}=t===void 0?{}:t,c=n===void 0?!1:n,u=o===void 0?"right":o,f=d===void 0?"start":d,[p,r]=z.useState(!1),[m,g]=z.useState(!1),h=Gt(),{setOpenMobile:x}=As(),b=to(),S=b?"border border-border":void 0;let y;e[0]!==b?(y=N=>b?s.jsx(mo,{children:N}):N,e[0]=b,e[1]=y):y=e[1];const v=y;let k;e[2]!==h||e[3]!==x?(k=()=>{r(!1),h&&x(!1)},e[2]=h,e[3]=x,e[4]=k):k=e[4];const C=k;let w;e[5]!==C||e[6]!==g?(w=()=>{C(),g(!0)},e[5]=C,e[6]=g,e[7]=w):w=e[7];const j=w,_=p&&s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Is,{className:"h-4 w-24"})}),children:s.jsx(po,{onClose:C,onSelectAgent:i,selectedAgentId:l,onImportFromGithub:j})}),D=h?s.jsxs(s.Fragment,{children:[a?z.cloneElement(a,{onClick:N=>{a.props.onClick?.(N),r(!0)}}):c?v(s.jsx(io,{setOpen:r,emptyCtaClass:S})):s.jsx(ro,{setOpen:r,highlightEmpty:b,emptyCtaClass:S}),s.jsx(_t,{open:p,onOpenChange:r,direction:"bottom",children:s.jsxs(St,{className:"max-h-[85dvh] p-0",children:[s.jsx(co,{}),_]})})]}):s.jsxs(nt,{open:p,onOpenChange:N=>{N&&!p&&Z("agent_browser_opened",{surface:"desktop_popover"}),r(N)},children:[a?s.jsx(ze,{asChild:!0,children:a}):c?v(s.jsx(ze,{asChild:!0,children:s.jsx(uo,{emptyCtaClass:S})})):s.jsx(fo,{wrapEmptyHint:v,highlightEmpty:b,emptyCtaClass:S}),s.jsx(ot,{className:"w-[380px] p-0 overflow-hidden",side:u,align:f,children:_})]});let I;e[8]!==m||e[9]!==g?(I=s.jsx(cn,{open:m,onOpenChange:g,mode:"agent"}),e[8]=m,e[9]=g,e[10]=I):I=e[10];let E;return e[11]!==D||e[12]!==I?(E=s.jsxs(s.Fragment,{children:[D,I]}),e[11]=D,e[12]=I,e[13]=E):E=e[13],E}function Co(){const t=R.c(2),e=Nt()??[];let n;return t[0]!==e?(n=a=>{if(!a)return;const i=e.find(l=>l.id===a);return i?gn(i.metadata):void 0},t[0]=e,t[1]=n):n=t[1],n}const vo="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function ko(t){const e=R.c(29),{agentId:n,fallback:a,onOpenHome:i,onPick:l}=t,o=Q(),d=sn(n)??a??null;let c,u,f,p,r;e[0]!==d?.title||e[1]!==i||e[2]!==o?(r=d?.title??o("header.shellBreadcrumb.superAgentDefaultName"),p="flex min-w-0 items-center gap-0",c="button",u=i,f=o("header.shellBreadcrumb.openAgentHome",{name:r}),e[0]=d?.title,e[1]=i,e[2]=o,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=r):(c=e[3],u=e[4],f=e[5],p=e[6],r=e[7]);const m=d?.icon??null;let g;e[8]!==m||e[9]!==r?(g=s.jsx(Zt,{icon:m,name:r,size:"xs"}),e[8]=m,e[9]=r,e[10]=g):g=e[10];let h;e[11]!==c||e[12]!==u||e[13]!==f||e[14]!==g?(h=s.jsx("button",{type:c,onClick:u,"aria-label":f,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:g}),e[11]=c,e[12]=u,e[13]=f,e[14]=g,e[15]=h):h=e[15];let x;e[16]!==r?(x=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:r}),e[16]=r,e[17]=x):x=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ve,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=b):b=e[18];let S;e[19]!==x?(S=s.jsxs("button",{type:"button",className:vo,children:[x,b]}),e[19]=x,e[20]=S):S=e[20];let y;e[21]!==n||e[22]!==l||e[23]!==S?(y=s.jsx(yo,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:l,trigger:S}),e[21]=n,e[22]=l,e[23]=S,e[24]=y):y=e[24];let v;return e[25]!==y||e[26]!==p||e[27]!==h?(v=s.jsxs("div",{className:p,children:[h,y]}),e[25]=y,e[26]=p,e[27]=h,e[28]=v):v=e[28],v}function gl(t){const e=R.c(22);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:a}=n,{org:i}=ge(),{threads:l}=os(),o=Nt(),{data:d}=Ct.useSession(),{setTaskId:c,createNewTask:u}=ls(),f=Co();let p;e[2]!==i.id?(p=es(i.id),e[2]=i.id,e[3]=p):p=e[3];const r=p,m=r.id,g=Jt();let h;e[4]!==o||e[5]!==u||e[6]!==m||e[7]!==a||e[8]!==f||e[9]!==d?.user?.id||e[10]!==c||e[11]!==l?(h=k=>{const C=k??m,w=(o??[]).find(_=>_.id===C),j=mn(l,C,d?.user?.id,f(C),!!(w&&nn(w)));j?c(j.id,C):u(C),a?.()},e[4]=o,e[5]=u,e[6]=m,e[7]=a,e[8]=f,e[9]=d?.user?.id,e[10]=c,e[11]=l,e[12]=h):h=e[12];const x=h;let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=b):b=e[13];const S=g===m?r:void 0;let y;e[14]!==g||e[15]!==x?(y=()=>x(g),e[14]=g,e[15]=x,e[16]=y):y=e[16];let v;return e[17]!==g||e[18]!==x||e[19]!==S||e[20]!==y?(v=s.jsx(z.Suspense,{fallback:b,children:s.jsx(ko,{agentId:g,fallback:S,onOpenHome:y,onPick:x})}),e[17]=g,e[18]=x,e[19]=S,e[20]=y,e[21]=v):v=e[21],v}function pl(){const t=R.c(20),e=Q(),{threads:n}=os(),{createNewTask:a}=ls(),i=Jt(),l=Xt();let o;t[0]!==l||t[1]!==n?(o=n.find(x=>x.id===l)?.branch??null,t[0]=l,t[1]=n,t[2]=o):o=t[2];const d=o;let c;t[3]!==i||t[4]!==a||t[5]!==d?(c=()=>{a(i,d)},t[3]=i,t[4]=a,t[5]=d,t[6]=c):c=t[6];const u=c;let f;t[7]!==e?(f=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=f):f=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Rs,{size:16}),t[9]=p):p=t[9];let r;t[10]!==u||t[11]!==f?(r=s.jsx($e,{asChild:!0,children:s.jsx("button",{type:"button",onClick:u,"aria-label":f,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:p})}),t[10]=u,t[11]=f,t[12]=r):r=t[12];let m;t[13]!==e?(m=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=m):m=t[14];let g;t[15]!==m?(g=s.jsx(Oe,{side:"bottom",children:m}),t[15]=m,t[16]=g):g=t[16];let h;return t[17]!==r||t[18]!==g?(h=s.jsxs(Re,{children:[r,g]}),t[17]=r,t[18]=g,t[19]=h):h=t[19],h}function No({open:t,onOpenChange:e,onCreated:n}){const a=Q(),{org:i}=ge(),{data:l}=Ct.useSession(),{stdioEnabled:o}=Bs(),d=Gt(),c=ms(),u=is(),p=rs(u,"").items,r=Fs({resolver:Ps(Tn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),m=r.watch("ui_type"),g=r.watch("connection_url"),h=r.watch("npx_package"),x=Xe({uiType:m,connectionUrl:g??"",npxPackage:h??""})??Et({uiType:m,connectionUrl:g??"",registryItems:p}),b=j=>{const _=j.trim();if(!_)return;const D=!!r.formState.dirtyFields.title,I=!!r.formState.dirtyFields.description,E=!!r.formState.dirtyFields.env_vars,N=T=>{if(T&&(!D&&!r.getValues("title").trim()&&T.title&&r.setValue("title",T.title,{shouldDirty:!1}),!I&&!(r.getValues("description")??"").trim()&&T.description&&r.setValue("description",T.description,{shouldDirty:!1}),!E&&T.envVarKeys?.length)){const O=r.getValues("env_vars")??[],B=new Set(O.map($=>$.key)),F=T.envVarKeys.filter($=>!B.has($));F.length>0&&r.setValue("env_vars",[...O,...F.map($=>({key:$,value:""}))],{shouldDirty:!0})}},A=Fn(_);if(A&&o){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",A.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),N(Xe({uiType:"NPX",npxPackage:A.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const T=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",T,{shouldDirty:!0}),r.setValue("connection_url",_,{shouldDirty:!0}),N(Xe({uiType:T,connectionUrl:_})??Et({uiType:T,connectionUrl:_,registryItems:p}));return}m==="NPX"&&N(Xe({uiType:"NPX",npxPackage:_}))},S=j=>{j||r.reset(),e(j)},y=async j=>{let _,D=null,I=null,E=null;j.ui_type==="NPX"?(_="STDIO",D="",E=Pn(j.npx_package||"",j.env_vars||[])):j.ui_type==="STDIO"?(_="STDIO",D="",E=En(j.stdio_command||"",j.stdio_args||"",j.stdio_cwd,j.env_vars||[])):(_=j.ui_type,D=j.connection_url||"",I=j.connection_token||null);const N=hn("conn");try{await c.create.mutateAsync({id:N,title:j.title,description:j.description||null,connection_type:_,connection_url:D,connection_token:I,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:l?.user?.id||"system",organization_id:i.id,icon:j.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),r.reset(),e(!1),n?.(N)}catch{oe.error(a("connections.createConnectionDialog.failedToCreateConnection"))}},v=a("connections.createConnectionDialog.title"),k=a("connections.createConnectionDialog.description"),C=r.formState.isSubmitting?a("connections.createConnectionDialog.saving"):a("connections.createConnectionDialog.createButton"),w=s.jsxs("div",{className:"grid gap-4",children:[s.jsx(ce,{control:r.control,name:"ui_type",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.typeLabel")}),s.jsxs(kn,{value:j.value,onValueChange:j.onChange,children:[s.jsx(fe,{children:s.jsx(Nn,{children:s.jsx(_n,{})})}),s.jsxs(Sn,{children:[s.jsx(Ue,{value:"HTTP",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.httpType")]})}),s.jsx(Ue,{value:"SSE",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.sseType")]})}),s.jsx(Ue,{value:"Websocket",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.websocketType")]})}),o&&s.jsxs(s.Fragment,{children:[s.jsx(Ue,{value:"NPX",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(et,{className:"w-4 h-4"}),a("connections.createConnectionDialog.npxPackageType")]})}),s.jsx(Ue,{value:"STDIO",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(wn,{className:"w-4 h-4"}),a("connections.createConnectionDialog.customCommandType")]})})]})]})]}),s.jsx(me,{})]})}),m==="NPX"&&s.jsx(ce,{control:r.control,name:"npx_package",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.npmPackageLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.npmPackagePlaceholder"),...j,value:j.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("npx_package",D.trim(),{shouldDirty:!0}),b(D))},onBlur:_=>{b(_.target.value),j.onBlur()}})}),s.jsx(me,{})]})}),m==="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[s.jsx(ce,{control:r.control,name:"stdio_command",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.commandLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.commandPlaceholder"),...j,value:j.value??""})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"stdio_args",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.argumentsLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.argumentsPlaceholder"),...j,value:j.value??""})}),s.jsx(me,{})]})})]}),s.jsx(ce,{control:r.control,name:"stdio_cwd",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.workingDirectoryLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.workingDirectoryPlaceholder"),...j,value:j.value??""})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a("connections.createConnectionDialog.workingDirectoryDescription")}),s.jsx(me,{})]})})]}),(m==="NPX"||m==="STDIO")&&s.jsx(ce,{control:r.control,name:"env_vars",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.environmentVariablesLabel")}),s.jsx(fe,{children:s.jsx(Bn,{value:j.value??[],onChange:j.onChange})}),s.jsx(me,{})]})}),m!=="NPX"&&m!=="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{control:r.control,name:"connection_url",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.urlLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.urlPlaceholder"),...j,value:j.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("connection_url",D.trim(),{shouldDirty:!0}),b(D))},onBlur:_=>{b(_.target.value),j.onBlur()}})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"connection_token",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:x?.token?.label??a("connections.createConnectionDialog.tokenLabelDefault")}),s.jsx(fe,{children:s.jsx(_e,{type:"password",placeholder:x?.token?.placeholder??a("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...j,value:j.value??""})}),x?.token?.helperText&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&s.jsxs(s.Fragment,{children:[" ","·"," ",s.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:a("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),s.jsx(me,{})]})})]}),s.jsx(ce,{control:r.control,name:"title",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.nameLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.namePlaceholder"),...j})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"description",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.descriptionLabel")}),s.jsx(fe,{children:s.jsx(Dn,{placeholder:a("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...j,value:j.value??""})}),s.jsx(me,{})]})})]});return d?s.jsx(_t,{open:t,onOpenChange:S,children:s.jsxs(St,{className:"max-h-[90vh]",children:[s.jsx(on,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx(Dt,{children:v}),s.jsx(an,{className:"mt-1",children:k})]}),s.jsx(ss,{asChild:!0,children:s.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:s.jsx(In,{size:16})})})]})}),s.jsx(Pt,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(y),children:[s.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:w}),s.jsx(ns,{children:s.jsx(be,{type:"submit",disabled:r.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):s.jsx(cs,{open:t,onOpenChange:S,children:s.jsxs(ds,{className:"sm:max-w-[525px]",children:[s.jsxs(us,{children:[s.jsx(fs,{children:v}),s.jsx(Cn,{children:k})]}),s.jsx(Pt,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(y),children:[s.jsx("div",{className:"py-4",children:w}),s.jsxs(vn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>S(!1),children:a("connections.createConnectionDialog.cancelButton")}),s.jsx(be,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function _o(t){const e=R.c(72),{mode:n,agentId:a,addedConnectionIds:i,onAdd:l,onCloneAndAdd:o,onConnectAndAdd:d,connectingItemId:c,search:u,onCreateConnection:f,onBrowseNavigate:p,defaultTab:r}=t,m=n===void 0?"add":n,g=r===void 0?"connected":r,h=Q(),{org:x}=ge(),b=z.useDeferredValue(u),S=u!==b;let y;e[0]!==b?(y=b.trim().toLowerCase(),e[0]=b,e[1]=y):y=e[1];const v=y;let k;e[2]!==g?(k=M=>M??g,e[2]=g,e[3]=k):k=e[3];const[C,w]=Es(Ms.connectionsTab(x.slug)+(g==="all"?":home-modal":":agent-modal"),k);let j;e[4]!==C||e[5]!==w?(j=M=>{M!==C&&Z("connections_dialog_tab_changed",{to_tab:M}),w(M)},e[4]=C,e[5]=w,e[6]=j):j=e[6];const _=j;let D;e[7]!==x.id||e[8]!==x.slug?(D={connectionId:en,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=D):D=e[9];const I=On(D),E=b?.trim().split(/\s+/).filter(Boolean)??[],N=E.length>0?{operator:"or",conditions:E.flatMap(Fo)}:void 0,A={...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(A),{data:O,fetchNextPage:B,hasNextPage:F,isFetchingNextPage:$}=$n({queryKey:ye.collectionListInfinite(I,x.id,"","CONNECTIONS",T),queryFn:async M=>{const{pageParam:Y}=M,je=Y===void 0?0:Y;return(await I.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:je}})).structuredContent},initialPageParam:0,getNextPageParam:To,staleTime:3e4}),G=O?.pages.flatMap(Io)??[],P=yn(G),K=new Set(G.filter(Ao).map(wo)),L=is(),U=rs(L,b),V=Mt(U.loadMore,U.hasMore,U.isLoadingMore),J=Mt(B,F??!1,$),W=C==="all"||!!v,pe=W?U.items.filter(M=>{const Y=xn(M);if(Y&&K.has(Y))return!1;if(!v)return!0;const je=tt(M._meta),ke=[M.title,M.description,M.name,M.server?.title,M.server?.description,M.server?.name,je?.friendly_name,je?.friendlyName].filter(Boolean).join(" ").toLowerCase();return E.some(re=>ke.includes(re.toLowerCase()))}):[],te=pe.filter(Do),se=pe.filter(So);let ae;e[10]!==i?(ae=M=>M.some(Y=>i.has(Y.id)),e[10]=i,e[11]=ae):ae=e[11];const ie=ae;let he;e[12]!==i||e[13]!==a||e[14]!==c||e[15]!==ie||e[16]!==m||e[17]!==l||e[18]!==p||e[19]!==o||e[20]!==h?(he=(M,Y,je,ke,re)=>{const Ye=ie(re),Me=re.find(Ne=>!i.has(Ne.id)),ne=re[0];if(m==="browse"){const Ne=Mn(ne);return s.jsx(ft,{connection:{title:Y,icon:je,description:re.length>1?`${re.length} instances`:ke??void 0},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs(Je,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(Ge,{size:11})," ",h("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{Z("connection_browse_clicked",{app_name:ne.app_name??null,connection_id:ne.id,instances_count:re.length}),p?.(Ne)}},M)}return s.jsx(ft,{connection:{title:Y,icon:je,description:ke},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[Ye&&s.jsxs(Je,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(Ge,{size:11})," ",h("virtualMcp.connectionDialogContent.added")]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Me?(Z("connection_add_clicked",{action:"use_existing",app_name:ne.app_name??null,connection_id:Me.id}),a&&Z("agent_connection_attached",{agent_id:a,connection_id:Me.id,app_name:ne.app_name??null,mode:"existing"}),l(Me.id)):(Z("connection_add_clicked",{action:"clone",app_name:ne.app_name??null,base_connection_id:ne.id}),o(ne))},children:h("virtualMcp.connectionDialogContent.add")})]})},M)},e[12]=i,e[13]=a,e[14]=c,e[15]=ie,e[16]=m,e[17]=l,e[18]=p,e[19]=o,e[20]=h,e[21]=he):he=e[21];const H=he;let q;e[22]!==c||e[23]!==m||e[24]!==d||e[25]!==h?(q=M=>{const Y=tt(M._meta),je=Y?.friendlyName||Y?.friendly_name||M.server?.title||M.title||M.server?.name||M.name||M.id||"",ke=M.server?.description||M.description||null,re=M.server?.icons?.[0]?.src||jn(M.server?.repository)||null,Ye=Y?.official===!0,Me=Y?.verified===!0,ne=Y?.owner==="deco";return s.jsx(ft,{connection:{title:je,description:ke,icon:re},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[ne&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:h("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.builtByDeco")})]}),!ne&&Ye&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx(Je,{variant:"outline",size:"icon",children:s.jsx(mt,{})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!ne&&!Ye&&Me&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx(Je,{variant:"outline",size:"icon",children:s.jsx(mt,{})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Z("connection_add_clicked",{action:"connect_new",registry_item_id:M.id,app_name:Y?.friendlyName||M.server?.name||M.name||null}),d(M)},children:c===M.id?s.jsx(He,{className:"size-3.5"}):h(m==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${M.id}`)},e[22]=c,e[23]=m,e[24]=d,e[25]=h,e[26]=q):q=e[26];const xe=q;let ee;e[27]!==C||e[28]!==_||e[29]!==f||e[30]!==v||e[31]!==h?(ee=!v&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx(Ln,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:M=>_(M)}),s.jsxs(be,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{Z("connections_dialog_custom_clicked"),f()},children:[s.jsx(Qe,{size:12}),h("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=C,e[28]=_,e[29]=f,e[30]=v,e[31]=h,e[32]=ee):ee=e[32];const Ce=S&&"opacity-50 pointer-events-none";let le;e[33]!==Ce?(le=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ce),e[33]=Ce,e[34]=le):le=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let we;e[35]!==H?(we=M=>{if(M.type==="group")return H(M.key,M.title,M.icon,null,M.connections);const Y=M.connection;return H(Y.id,Y.title,Y.icon,Y.description??null,[Y])},e[35]=H,e[36]=we):we=e[36];const at=P.map(we);let Ae;e[37]!==J?(Ae=s.jsx("div",{ref:J,className:"col-span-full h-1"}),e[37]=J,e[38]=Ae):Ae=e[38];let Ie;e[39]!==$?(Ie=$&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),e[39]=$,e[40]=Ie):Ie=e[40];const lt=W&&te.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx(mt,{size:13,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionVerified")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),it=W&&te.map(xe),rt=W&&se.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionAllConnections")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),ct=W&&se.map(xe);let Te;e[41]!==V||e[42]!==L||e[43]!==W?(Te=W&&L.length>0&&s.jsx("div",{ref:V,className:"col-span-full h-1"}),e[41]=V,e[42]=L,e[43]=W,e[44]=Te):Te=e[44];let Be;e[45]!==U.isLoadingMore||e[46]!==W?(Be=W&&U.isLoadingMore&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),e[45]=U.isLoadingMore,e[46]=W,e[47]=Be):Be=e[47];let Fe;e[48]!==at||e[49]!==Ae||e[50]!==Ie||e[51]!==lt||e[52]!==it||e[53]!==rt||e[54]!==ct||e[55]!==Te||e[56]!==Be?(Fe=s.jsxs("div",{className:De,children:[at,Ae,Ie,lt,it,rt,ct,Te,Be]}),e[48]=at,e[49]=Ae,e[50]=Ie,e[51]=lt,e[52]=it,e[53]=rt,e[54]=ct,e[55]=Te,e[56]=Be,e[57]=Fe):Fe=e[57];let Pe;e[58]!==C||e[59]!==P.length||e[60]!==se||e[61]!==u||e[62]!==h||e[63]!==te?(Pe=P.length===0&&te.length===0&&se.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?h("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):h(C==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=C,e[59]=P.length,e[60]=se,e[61]=u,e[62]=h,e[63]=te,e[64]=Pe):Pe=e[64];let Ee;e[65]!==le||e[66]!==Fe||e[67]!==Pe?(Ee=s.jsxs("div",{className:le,children:[Fe,Pe]}),e[65]=le,e[66]=Fe,e[67]=Pe,e[68]=Ee):Ee=e[68];let We;return e[69]!==ee||e[70]!==Ee?(We=s.jsxs(s.Fragment,{children:[ee,Ee]}),e[69]=ee,e[70]=Ee,e[71]=We):We=e[71],We}function So(t){return!t.verified&&!tt(t._meta)?.verified&&!t.meta?.verified}function Do(t){return t.verified||tt(t._meta)?.verified||t.meta?.verified}function wo(t){return t.app_name}function Ao(t){return t.app_name}function Io(t){return t?.items??[]}function To(t,e){if(t?.hasMore)return e.reduce(Bo,0)}function Bo(t,e){return t+(e?.items?.length??0)}function Fo(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function hl({open:t,onOpenChange:e,defaultTab:n,initialSearch:a="",...i}){const l=Q(),o=i.mode??"add",d="agentId"in i?i.agentId:void 0,c="addedConnectionIds"in i?i.addedConnectionIds??new Set:new Set,u="onAdd"in i&&i.onAdd?i.onAdd:N=>{},f=(N,A,T)=>{d&&Z("agent_connection_attached",{agent_id:d,connection_id:N,app_name:A,mode:T})},[p,r]=z.useState(null),[m,g]=z.useState(a),[h,x]=z.useState(!1),[b,S]=z.useState(t);t!==b&&(S(t),t&&g(a));const{org:y}=ge(),{data:v}=Ct.useSession(),k=ms(),C=vt(),w=qt(),j=N=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:N}})},_=()=>{C.invalidateQueries({predicate:N=>{const A=N.queryKey;return A[1]===y.id&&A[3]==="collection"&&A[4]==="CONNECTIONS"}})},D=async(N,A)=>{Z("connection_oauth_succeeded",{connection_id:N,flow:A});const T=new URL(`/api/${y.slug}/mcp/${N}`,window.location.origin);await C.invalidateQueries({queryKey:ye.isMCPAuthenticated(T.href,null)}),_()},I=async N=>{r(N.app_name??N.id);try{const T=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,B=(await k.create.mutateAsync({title:T,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,F=await gt({connectionId:B,orgId:y.id,orgSlug:y.slug,persistFallback:$=>k.update.mutateAsync({id:B,data:{connection_token:$}}).then(()=>{})});if(F.ran&&!F.ok){Z("connection_oauth_failed",{connection_id:B,flow:"clone",error:F.error??"no_token"}),oe.error(l("virtualMcp.addConnectionDialog.authenticationFailedError",{error:F.error??"no token received"})),await k.delete.mutateAsync(B);return}F.ran&&await D(B,"clone"),f(B,N.app_name??null,"clone"),u(B)}catch(A){console.error("Failed to add connection:",A),oe.error(l("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{r(null)}},E=async N=>{if(!(!y||!v?.user?.id)){r(N.id);try{const A=bn(N,y.id,v.user.id,{remoteIndex:0}),T=A.connection_type==="STDIO",O=!!A.connection_url,B=T&&A.connection_headers&&typeof A.connection_headers=="object"&&"command"in A.connection_headers;if(!O&&!B){oe.error(l("virtualMcp.addConnectionDialog.mcpServerConnectionError")),r(null);return}const{id:F}=await k.create.mutateAsync(A),$=await gt({connectionId:F,orgId:y.id,orgSlug:y.slug,persistFallback:G=>k.update.mutateAsync({id:F,data:{connection_token:G}}).then(()=>{})});if($.ran&&!$.ok){Z("connection_oauth_failed",{connection_id:F,flow:"connect_new",error:$.error??"no_token"}),oe.warning(l("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:l("virtualMcp.addConnectionDialog.signInFailedDescription",{error:$.error??"no token received"})}),f(F,A.app_name??null,"new"),u(F);return}$.ran?(await D(F,"connect_new"),oe.success(l("virtualMcp.addConnectionDialog.connectedAuthenticated"))):oe.success(l("virtualMcp.addConnectionDialog.connected")),f(F,A.app_name??null,"new"),u(F)}catch(A){console.error("Failed to connect:",A),oe.error(l("virtualMcp.addConnectionDialog.failedToConnect"))}finally{r(null)}}};return s.jsxs(cs,{open:t,onOpenChange:e,children:[s.jsxs(ds,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[s.jsx(us,{className:"px-6 pt-5 pb-0 shrink-0",children:s.jsx(fs,{className:"text-base font-semibold",children:l(o==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),s.jsx("div",{className:"pt-3 shrink-0",children:s.jsx(pn,{value:m,onChange:g,placeholder:l("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),children:s.jsx(_o,{mode:o,agentId:d,addedConnectionIds:c,onAdd:u,onCloneAndAdd:I,onConnectAndAdd:E,connectingItemId:p,search:m,onCreateConnection:()=>x(!0),onBrowseNavigate:j,defaultTab:n})})]}),s.jsx(No,{open:h,onOpenChange:x,onCreated:async N=>{x(!1);const A=await gt({connectionId:N,orgId:y.id,orgSlug:y.slug,persistFallback:T=>k.update.mutateAsync({id:N,data:{connection_token:T}}).then(()=>{})});if(A.ran&&!A.ok){Z("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:A.error??"no_token"}),oe.warning(l("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:l("virtualMcp.addConnectionDialog.signInFailedDescription",{error:A.error??"no token received"})}),f(N,null,"custom"),u(N),e(!1);return}A.ran&&await D(N,"custom_create"),f(N,null,"custom"),u(N),e(!1)}})]})}const Rt=new Map;function xl(){const{org:t}=ge(),e=kt(),n=Rn(),a=n.find(x=>x.providerId==="deco"),{data:i,isLoading:l,refetch:o,isFetching:d}=Yt({queryKey:ye.aiProviderCredits(t.id,"deco"),enabled:!!a,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=i?.balanceCents??null,u=c!=null?c/100:null,f=z.useRef(new Map);if(c!=null){const x=Rt.get(t.id);f.current.get(t.id)&&x!=null&&c>x&&Z("credits_topped_up_detected",{organization_id:t.id,delta_cents:c-x,previous_balance_cents:x,new_balance_cents:c}),Rt.set(t.id,c),f.current.set(t.id,!0)}const p=!!a,r=c!=null&&c>0,m=c!=null&&c===0,g=c!=null&&c===200,h=n.length>0&&n.every(x=>x.providerId==="deco");return{hasDecoKey:p,decoKeyId:a?.id??null,balanceCents:c,balanceDollars:u,hasCredits:r,isZeroBalance:m,isInitialFreeCredit:g,hasOnlyDecoProvider:h,isLoading:l,isFetching:d,refetch:o}}const Po=4,Eo="TASK";function Mo(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,Po)||Eo}function Lo(t,e){return e==null?null:`${Mo(t)}-${String(e).padStart(2,"0")}`}const $o=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function Oo(t){const e=$o.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function Kt(t){const e=R.c(8),{size:n,className:a}=t,i=n===void 0?16:n;let l;e[0]!==i?(l={width:i,height:i},e[0]=i,e[1]=l):l=e[1];let o;e[2]!==a?(o=X("shrink-0 rounded-full object-cover",a),e[2]=a,e[3]=o):o=e[3];let d;return e[4]!==i||e[5]!==l||e[6]!==o?(d=s.jsx("img",{src:tn,alt:"Super Agent",width:i,height:i,style:l,className:o}),e[4]=i,e[5]=l,e[6]=o,e[7]=d):d=e[7],d}function jl(t,e){if(!e)return null;const n=e.toLowerCase();return t.find(a=>{const i=a.bucket.toLowerCase();return a.siteSlug?.toLowerCase()===n||i===n||i===`deco-assets-${n}`})??null}const zt=()=>0;function Ro(t){const{orgSlug:e,enabled:n=!0,onUpdate:a,onDelete:i,onResync:l}=t,o=z.useRef(a);o.current=a;const d=z.useRef(i);d.current=i;const c=z.useRef(l);c.current=l;const u=z.useRef(null),f=z.useRef(n),p=z.useRef(e);(!u.current||f.current!==n||p.current!==e)&&(f.current=n,p.current=e,u.current=m=>{if(!n||!e)return()=>{};const g=h=>{let x;try{x=JSON.parse(h.data)}catch{return}x.data&&(h.type===Kn?d.current?.(x.data.id):o.current(x.data)),m()};return Un.subscribe(e,g,()=>c.current?.())}),z.useSyncExternalStore(u.current,zt,zt)}function Ko(t,e){return{queryKey:ye.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:n}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:n}}}}function zo(){const t=R.c(21),{org:e,locator:n}=ge(),a=vt();let i;t[0]!==n?(i=ye.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const l=i;let o;t[2]!==n||t[3]!==a||t[4]!==l?(o=r=>{a.cancelQueries({queryKey:l}),a.setQueryData(l,m=>m&&{...m,items:m.items.some(g=>g.id===r.id)?m.items.map(g=>g.id===r.id?r:g):[r,...m.items]}),a.invalidateQueries({queryKey:ye.taskBoardActivity(n,r.id)})},t[2]=n,t[3]=a,t[4]=l,t[5]=o):o=t[5];let d,c;t[6]!==a||t[7]!==l?(d=()=>{a.invalidateQueries({queryKey:l})},c=r=>{a.cancelQueries({queryKey:l}),a.setQueryData(l,m=>m&&{...m,items:m.items.filter(g=>g.id!==r)})},t[6]=a,t[7]=l,t[8]=d,t[9]=c):(d=t[8],c=t[9]);let u;t[10]!==e.slug||t[11]!==o||t[12]!==d||t[13]!==c?(u={orgSlug:e.slug,onUpdate:o,onResync:d,onDelete:c},t[10]=e.slug,t[11]=o,t[12]=d,t[13]=c,t[14]=u):u=t[14],Ro(u);let f;t[15]!==a||t[16]!==l?(f=r=>{const m=r.subject,g=r.data.status;a.cancelQueries({queryKey:l}),a.setQueryData(l,h=>h&&{...h,items:h.items.map(x=>x.threads.some(b=>b.threadId===m)?{...x,threads:x.threads.map(b=>b.threadId===m?{...b,status:g}:b)}:x)})},t[15]=a,t[16]=l,t[17]=f):f=t[17];let p;t[18]!==e.slug||t[19]!==f?(p={orgSlug:e.slug,onTaskStatus:f},t[18]=e.slug,t[19]=f,t[20]=p):p=t[20],Hn(p)}function bl(){const t=R.c(9),{locator:e}=ge(),n=kt();let a;t[0]!==e||t[1]!==n?(a=Ko(e,n),t[0]=e,t[1]=n,t[2]=a):a=t[2];const i=Yt(a);zo();let l;t[3]!==i.data?.items?(l=i.data?.items??[],t[3]=i.data?.items,t[4]=l):l=t[4];let o;return t[5]!==i.error||t[6]!==i.isLoading||t[7]!==l?(o={items:l,isLoading:i.isLoading,error:i.error},t[5]=i.error,t[6]=i.isLoading,t[7]=l,t[8]=o):o=t[8],o}function yl(){const t=R.c(70),{org:e,locator:n}=ge(),a=kt(),i=vt(),l=Q();let o;t[0]!==n?(o=ye.taskBoardItems(n),t[0]=n,t[1]=o):o=t[1];const d=o;let c;t[2]!==i||t[3]!==d?(c=()=>i.invalidateQueries({queryKey:d}),t[2]=i,t[3]=d,t[4]=c):c=t[4];const u=c;let f;t[5]!==a?(f=P=>a.call("TASK_BOARD_ITEM_CREATE",P),t[5]=a,t[6]=f):f=t[6];let p;t[7]!==u||t[8]!==f?(p={mutationFn:f,onSuccess:u},t[7]=u,t[8]=f,t[9]=p):p=t[9];const r=Le(p);let m;t[10]!==a?(m=P=>a.call("TASK_BOARD_ITEM_UPDATE",P),t[10]=a,t[11]=m):m=t[11];let g;t[12]!==i||t[13]!==d?(g=async P=>{await i.cancelQueries({queryKey:d});const K=i.getQueryData(d);return i.setQueryData(d,L=>L&&{...L,items:L.items.map(U=>U.id===P.id?{...U,...P}:U)}),{previous:K}},t[12]=i,t[13]=d,t[14]=g):g=t[14];let h;t[15]!==e?(h=(P,K)=>{K.status==="done"&&Z("task_marked_done",{organization_id:e.id,task_board_item_id:K.id})},t[15]=e,t[16]=h):h=t[16];let x;t[17]!==i||t[18]!==d?(x=(P,K,L)=>{L?.previous&&i.setQueryData(d,L.previous)},t[17]=i,t[18]=d,t[19]=x):x=t[19];let b;t[20]!==u||t[21]!==n||t[22]!==i?(b=(P,K,L)=>{u(),i.invalidateQueries({queryKey:ye.taskBoardActivity(n,L.id)})},t[20]=u,t[21]=n,t[22]=i,t[23]=b):b=t[23];let S;t[24]!==m||t[25]!==g||t[26]!==h||t[27]!==x||t[28]!==b?(S={mutationFn:m,onMutate:g,onSuccess:h,onError:x,onSettled:b},t[24]=m,t[25]=g,t[26]=h,t[27]=x,t[28]=b,t[29]=S):S=t[29];const y=Le(S);let v;t[30]!==a?(v=P=>a.call("TASK_BOARD_ITEM_DELETE",{id:P}),t[30]=a,t[31]=v):v=t[31];let k;t[32]!==u||t[33]!==l?(k=P=>{oe.error(P instanceof Error&&P.message?P.message:l("taskBoard.taskBoard.deleteError")),u()},t[32]=u,t[33]=l,t[34]=k):k=t[34];let C;t[35]!==u||t[36]!==v||t[37]!==k?(C={mutationFn:v,onSuccess:u,onError:k},t[35]=u,t[36]=v,t[37]=k,t[38]=C):C=t[38];const w=Le(C);let j;t[39]!==a?(j=async P=>{const K=await Promise.allSettled(P.map(L=>a.call("TASK_BOARD_ITEM_DELETE",{id:L})));return{total:P.length,failed:K.filter(Vo).length}},t[39]=a,t[40]=j):j=t[40];let _,D;t[41]!==l?(_=P=>{const{total:K,failed:L}=P;L!==0&&oe.error(l("taskBoard.taskBoard.deleteBulkError",{failed:String(L),total:String(K)}))},D=()=>oe.error(l("taskBoard.taskBoard.deleteError")),t[41]=l,t[42]=_,t[43]=D):(_=t[42],D=t[43]);let I;t[44]!==u||t[45]!==j||t[46]!==_||t[47]!==D?(I={mutationFn:j,onSuccess:_,onError:D,onSettled:u},t[44]=u,t[45]=j,t[46]=_,t[47]=D,t[48]=I):I=t[48];const E=Le(I);let N;t[49]!==a?(N=P=>a.call("TASK_BOARD_ITEM_UPDATE",P),t[49]=a,t[50]=N):N=t[50];let A;t[51]!==u||t[52]!==N?(A={mutationFn:N,onSuccess:u},t[51]=u,t[52]=N,t[53]=A):A=t[53];const T=Le(A);let O;t[54]!==a?(O=P=>a.call("TASK_BOARD_ITEM_RERUN",P),t[54]=a,t[55]=O):O=t[55];let B;t[56]!==u||t[57]!==n||t[58]!==i?(B=(P,K,L)=>{u(),i.invalidateQueries({queryKey:ye.taskBoardActivity(n,L.id)})},t[56]=u,t[57]=n,t[58]=i,t[59]=B):B=t[59];let F;t[60]!==O||t[61]!==B?(F={mutationFn:O,onSettled:B},t[60]=O,t[61]=B,t[62]=F):F=t[62];const $=Le(F);let G;return t[63]!==r||t[64]!==T||t[65]!==w||t[66]!==E||t[67]!==$||t[68]!==y?(G={create:r,update:y,remove:w,removeMany:E,link:T,rerun:$},t[63]=r,t[64]=T,t[65]=w,t[66]=E,t[67]=$,t[68]=y,t[69]=G):G=t[69],G}function Vo(t){return t.status==="rejected"}const Uo=["ended_after_delivery","superseded"];function Ho(t){return!!t&&Uo.includes(t)}function Cl(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function vl(t){return t.failureKind!=="superseded"}function vs(t){return t.threads.some(e=>e.status==="requires_action")}function kl(t){return t.status==="in_review"&&!t.assigneeId}function Nl(t){return vs(t)}function _l(t){return t.status==="in_progress"&&vs(t)?"text-warning animate-pulse":Ns(t.status).iconClassName}function Sl(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!Ho(n.failureKind))?"failed":null}function Dl(t,e,n){const a=t.findIndex(f=>f.id===n),i=e===n?t[a+1]?.id??null:e,l=t.filter(f=>f.id!==n),o=i?l.findIndex(f=>f.id===i):-1,d=o===-1?l.length:o,c=l[d-1],u=l[d];return c&&u?(c.sortOrder+u.sortOrder)/2:c?c.sortOrder+1:u?u.sortOrder-1:0}function wl(t,e){return Array.from({length:e},(n,a)=>t-(e-1-a)*1e-4)}const Go=["archived"],ks={triage:{labelKey:"taskBoard.config.statusBacklog",icon:Qn,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:bs,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:Gs,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Yn,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:Hs,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:An,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:Us,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Wn,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Ls,iconClassName:"text-muted-foreground"}},qo={icon:bs,iconClassName:"text-muted-foreground"},Qo=ks;function Ns(t){return Qo[t]??qo}function Al(t,e){const n=ks[t];return{label:n?e(n.labelKey):t,visual:Ns(t)}}const Il=["bug","feature","chore","spike","security"],Tl={bug:{labelKey:"taskBoard.config.typeBug",icon:Jn,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:Ws,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:Qs,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:qs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Xn,iconClassName:"text-purple-500"}};function jt(t){return Vn.includes(t)}function Bl(t){return wt.filter(e=>t||!jt(e))}function Fl({deliveryEnabled:t,shownLanes:e,occupied:n}){const a=wt.filter(o=>t||!jt(o)||n.includes(o)),i=a.filter(o=>Go.includes(o)||!t&&jt(o)),l=i.filter(o=>!e.includes(o));return{lanes:a.filter(o=>!l.includes(o)),hidden:l,hideable:i}}const Vt="lane:";function Wo(t){return wt.includes(t)}function Pl({overId:t,statusOf:e}){if(t===void 0)return null;const n=String(t),a=n.startsWith(Vt)?n.slice(Vt.length):e(n);return a!==void 0&&Wo(a)?a:null}const Yo=["none","low","medium","high","urgent"],Ze={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Ft,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:Vs,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Ft,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:zs,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:Ks,iconClassName:"text-destructive"}};function El(t,e=Date.now()){const n=new Date(t).getTime();return Number.isNaN(n)?null:n<e?"overdue":n-e<=Xo*864e5?"soon":null}const Xo=3;function Ut(t){return`color-mix(in oklab, ${t??zn} var(--user-color-strength), transparent)`}const bt="__unassigned__",yt="__no_repo__",Ke="__any__",_s={assignee:null,priority:null,due:null,tags:[],repo:null,search:""};function Jo(t){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||t.repo!==null||t.search.trim()!==""}function Zo(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(t.repo!==null?1:0)+(t.search.trim()!==""?1:0)}const ea=864e5;function ta(t,e){const n=new Date(t),a=new Date(e);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()}function Ss(t,e){const n=t.trim();return n===""?!1:e!=null&&Oo(n)===e}function sa(t,e){return t.assigneeId===e?!0:t.assigneeId===xt&&t.assignedBy===e}function Ml(t,e){const n=e.search.trim().toLowerCase();if(n!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(n)&&!Ss(n,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===bt){if(t.assigneeId!==null)return!1}else if(!sa(t,e.assignee))return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const a=new Date(t.dueDate).getTime(),i=Date.now();if(e.due==="overdue"&&a>=i||e.due==="today"&&!ta(a,i)||e.due==="week"&&(a<i||a>i+7*ea))return!1}if(e.tags.length>0){const a=t.tags.map(i=>i.id);if(!e.tags.some(i=>a.includes(i)))return!1}if(e.repo!==null){if(e.repo===yt){if(t.repo!=null)return!1}else if(t.repo?.toLowerCase()!==e.repo.toLowerCase())return!1}return!0}const Ht={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function Se(t,e=!1){return X("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function na(t){const e=R.c(107),{value:n,members:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($t,{size:14,className:"shrink-0"}),e[0]=u):u=e[0];let f=u,p;e[1]!==o?(p=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=p):p=e[2];let r=p;if(n===bt){let H;e[3]!==o?(H=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=H):H=e[4],r=H}else if(n===xt){let H;e[5]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Kt,{size:14}),e[5]=H):H=e[5],f=H;let q;e[6]!==o?(q=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=q):q=e[7],r=q}else if(n){let H,q,xe,ee;if(e[8]!==a||e[9]!==n){let De;e[14]!==n?(De=we=>we.userId===n,e[14]=n,e[15]=De):De=e[15],q=a.find(De),H=Lt,xe=q?.user?.image??void 0,ee=Ot(q?.user?.name),e[8]=a,e[9]=n,e[10]=H,e[11]=q,e[12]=xe,e[13]=ee}else H=e[10],q=e[11],xe=e[12],ee=e[13];let Ce;e[16]!==H||e[17]!==xe||e[18]!==ee?(Ce=s.jsx(H,{url:xe,fallback:ee,shape:"circle",size:"2xs"}),e[16]=H,e[17]=xe,e[18]=ee,e[19]=Ce):Ce=e[19],f=Ce;let le;e[20]!==q?.user?.name||e[21]!==o?(le=q?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=q?.user?.name,e[21]=o,e[22]=le):le=e[22],r=le}let m;e[23]!==i?(m=H=>{i(H),c(!1)},e[23]=i,e[24]=m):m=e[24];const g=m,h=n!==null;let x;e[25]!==l||e[26]!==h?(x=Se(h,l),e[25]=l,e[26]=h,e[27]=x):x=e[27];const b=x,S=l&&"ml-auto";let y;e[28]!==S?(y=X("shrink-0 opacity-60",S),e[28]=S,e[29]=y):y=e[29];const v=y;let k;e[30]!==r?(k=s.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[30]=r,e[31]=k):k=e[31];let C;e[32]!==v?(C=s.jsx(Ve,{size:12,className:v}),e[32]=v,e[33]=C):C=e[33];let w;e[34]!==f||e[35]!==k||e[36]!==C||e[37]!==b?(w=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:b,children:[f,k,C]})}),e[34]=f,e[35]=k,e[36]=C,e[37]=b,e[38]=w):w=e[38];let j;e[39]!==o?(j=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=j):j=e[40];let _;e[41]!==o?(_=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=o,e[42]=_):_=e[42];let D;e[43]!==j||e[44]!==_?(D=s.jsx(At,{placeholder:j,"aria-label":_,className:"h-9"}),e[43]=j,e[44]=_,e[45]=D):D=e[45];let I;e[46]!==o?(I=o("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=o,e[47]=I):I=e[47];let E;e[48]!==I?(E=s.jsx(It,{children:I}),e[48]=I,e[49]=E):E=e[49];let N;e[50]!==o?(N=o("taskBoard.taskFilters.assigneeAnyone"),e[50]=o,e[51]=N):N=e[51];let A;e[52]!==g?(A=()=>g(null),e[52]=g,e[53]=A):A=e[53];let T;e[54]!==o?(T=o("taskBoard.taskFilters.assigneeAnyone"),e[54]=o,e[55]=T):T=e[55];let O;e[56]!==N||e[57]!==A||e[58]!==T?(O=s.jsx(ve,{value:N,onSelect:A,children:T}),e[56]=N,e[57]=A,e[58]=T,e[59]=O):O=e[59];let B;e[60]!==o?(B=o("taskBoard.taskFilters.assigneeUnassigned"),e[60]=o,e[61]=B):B=e[61];let F;e[62]!==g?(F=()=>g(bt),e[62]=g,e[63]=F):F=e[63];let $;e[64]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx($t,{size:16,className:"text-muted-foreground"}),e[64]=$):$=e[64];let G;e[65]!==o?(G=o("taskBoard.taskFilters.assigneeUnassigned"),e[65]=o,e[66]=G):G=e[66];let P;e[67]!==B||e[68]!==F||e[69]!==G?(P=s.jsxs(ve,{value:B,onSelect:F,className:"gap-2",children:[$,G]}),e[67]=B,e[68]=F,e[69]=G,e[70]=P):P=e[70];let K;e[71]!==o?(K=o("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=o,e[72]=K):K=e[72];let L;e[73]!==g?(L=()=>g(xt),e[73]=g,e[74]=L):L=e[74];let U;e[75]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Kt,{size:16}),e[75]=U):U=e[75];let V;e[76]!==o?(V=o("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=o,e[77]=V):V=e[77];let J;e[78]!==K||e[79]!==L||e[80]!==V?(J=s.jsxs(ve,{value:K,onSelect:L,className:"gap-2",children:[U,V]}),e[78]=K,e[79]=L,e[80]=V,e[81]=J):J=e[81];let W;e[82]!==O||e[83]!==P||e[84]!==J?(W=s.jsxs(qe,{children:[O,P,J]}),e[82]=O,e[83]=P,e[84]=J,e[85]=W):W=e[85];let pe;e[86]!==o?(pe=o("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=o,e[87]=pe):pe=e[87];let te;if(e[88]!==a||e[89]!==g){let H;e[91]!==g?(H=q=>s.jsxs(ve,{value:q.user?.name??q.userId,onSelect:()=>g(q.userId),className:"gap-2",children:[s.jsx(Lt,{url:q.user?.image??void 0,fallback:Ot(q.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:q.user?.name??q.userId})]},q.userId),e[91]=g,e[92]=H):H=e[92],te=a.map(H),e[88]=a,e[89]=g,e[90]=te}else te=e[90];let se;e[93]!==pe||e[94]!==te?(se=s.jsx(qe,{heading:pe,children:te}),e[93]=pe,e[94]=te,e[95]=se):se=e[95];let ae;e[96]!==E||e[97]!==W||e[98]!==se?(ae=s.jsxs(Tt,{children:[E,W,se]}),e[96]=E,e[97]=W,e[98]=se,e[99]=ae):ae=e[99];let ie;e[100]!==D||e[101]!==ae?(ie=s.jsx(ot,{align:"start",className:"w-56 p-0",children:s.jsxs(Bt,{children:[D,ae]})}),e[100]=D,e[101]=ae,e[102]=ie):ie=e[102];let he;return e[103]!==d||e[104]!==w||e[105]!==ie?(he=s.jsxs(nt,{open:d,onOpenChange:c,children:[w,ie]}),e[103]=d,e[104]=w,e[105]=ie,e[106]=he):he=e[106],he}function oa(t){const e=R.c(33),{value:n,onChange:a,block:i}=t,l=Q(),o=n!==null;let d;e[0]!==i||e[1]!==o?(d=Se(o,i),e[0]=i,e[1]=o,e[2]=d):d=e[2];const c=d,u=i&&"ml-auto";let f;e[3]!==u?(f=X("shrink-0 opacity-60",u),e[3]=u,e[4]=f):f=e[4];const p=f;let r;e[5]!==n?(r=n?s.jsx("span",{className:X("size-2 shrink-0 rounded-full",Ze[n].dotClassName)}):s.jsx(Gn,{size:14,className:"shrink-0"}),e[5]=n,e[6]=r):r=e[6];let m;e[7]!==l||e[8]!==n?(m=l(n?Ze[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=l,e[8]=n,e[9]=m):m=e[9];let g;e[10]!==p?(g=s.jsx(Ve,{size:12,className:p}),e[10]=p,e[11]=g):g=e[11];let h;e[12]!==r||e[13]!==m||e[14]!==g||e[15]!==c?(h=s.jsx(ps,{asChild:!0,children:s.jsxs("button",{type:"button",className:c,children:[r,m,g]})}),e[12]=r,e[13]=m,e[14]=g,e[15]=c,e[16]=h):h=e[16];const x=n??Ke;let b;e[17]!==a?(b=w=>a(w===Ke?null:w),e[17]=a,e[18]=b):b=e[18];let S;e[19]!==l?(S=l("taskBoard.taskFilters.priorityAnyPriority"),e[19]=l,e[20]=S):S=e[20];let y;e[21]!==S?(y=s.jsx(st,{value:Ke,children:S}),e[21]=S,e[22]=y):y=e[22];let v;e[23]!==l?(v=Yo.map(w=>s.jsxs(st,{value:w,className:"gap-2",children:[s.jsx("span",{className:X("size-2 rounded-full",Ze[w].dotClassName)}),l(Ze[w].labelKey)]},w)),e[23]=l,e[24]=v):v=e[24];let k;e[25]!==b||e[26]!==y||e[27]!==v||e[28]!==x?(k=s.jsx(hs,{align:"start",className:"w-40",children:s.jsxs(xs,{value:x,onValueChange:b,children:[y,v]})}),e[25]=b,e[26]=y,e[27]=v,e[28]=x,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==h?(C=s.jsxs(js,{children:[h,k]}),e[30]=k,e[31]=h,e[32]=C):C=e[32],C}function aa(t){const e=R.c(35),{value:n,onChange:a,block:i}=t,l=Q();let o;e[0]!==l||e[1]!==n?(o=n?l(Ht[n]):void 0,e[0]=l,e[1]=n,e[2]=o):o=e[2];const d=o,c=n!==null;let u;e[3]!==i||e[4]!==c?(u=Se(c,i),e[3]=i,e[4]=c,e[5]=u):u=e[5];const f=u,p=i&&"ml-auto";let r;e[6]!==p?(r=X("shrink-0 opacity-60",p),e[6]=p,e[7]=r):r=e[7];const m=r;let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ut,{size:14,className:"shrink-0"}),e[8]=g):g=e[8];let h;e[9]!==d||e[10]!==l?(h=d??l("taskBoard.taskFilters.dueDateLabel"),e[9]=d,e[10]=l,e[11]=h):h=e[11];let x;e[12]!==m?(x=s.jsx(Ve,{size:12,className:m}),e[12]=m,e[13]=x):x=e[13];let b;e[14]!==h||e[15]!==x||e[16]!==f?(b=s.jsx(ps,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,children:[g,h,x]})}),e[14]=h,e[15]=x,e[16]=f,e[17]=b):b=e[17];const S=n??Ke;let y;e[18]!==a?(y=D=>a(D===Ke?null:D),e[18]=a,e[19]=y):y=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{size:16,className:"text-muted-foreground"}),e[20]=v):v=e[20];let k;e[21]!==l?(k=l("taskBoard.taskFilters.dueDateAnyTime"),e[21]=l,e[22]=k):k=e[22];let C;e[23]!==k?(C=s.jsxs(st,{value:Ke,className:"gap-2",children:[v,k]}),e[23]=k,e[24]=C):C=e[24];let w;e[25]!==l?(w=Object.entries(Ht).map(D=>{const[I,E]=D,N=I==="overdue";return s.jsxs(st,{value:I,className:X("gap-2",N&&"text-destructive"),children:[s.jsx(ut,{size:16,className:X("shrink-0",N?"text-destructive":"text-muted-foreground")}),l(E)]},I)}),e[25]=l,e[26]=w):w=e[26];let j;e[27]!==S||e[28]!==y||e[29]!==C||e[30]!==w?(j=s.jsx(hs,{align:"start",className:"w-44",children:s.jsxs(xs,{value:S,onValueChange:y,children:[C,w]})}),e[27]=S,e[28]=y,e[29]=C,e[30]=w,e[31]=j):j=e[31];let _;return e[32]!==j||e[33]!==b?(_=s.jsxs(js,{children:[b,j]}),e[32]=j,e[33]=b,e[34]=_):_=e[34],_}function la(t){const e=R.c(56),{value:n,tags:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]!==i||e[1]!==n?(u=B=>i(n.includes(B)?n.filter(F=>F!==B):[...n,B]),e[0]=i,e[1]=n,e[2]=u):u=e[2];const f=u;let p;e[3]!==o||e[4]!==a||e[5]!==n[0]||e[6]!==n.length?(p=n.length===0?o("taskBoard.taskFilters.tagsLabel"):n.length===1?a.find(B=>B.id===n[0])?.name??o("taskBoard.taskFilters.tagsLabel"):o("taskBoard.taskFilters.tagsSelectedCount",{count:n.length}),e[3]=o,e[4]=a,e[5]=n[0],e[6]=n.length,e[7]=p):p=e[7];const r=p,m=n.length>0;let g;e[8]!==l||e[9]!==m?(g=Se(m,l),e[8]=l,e[9]=m,e[10]=g):g=e[10];const h=g,x=l&&"ml-auto";let b;e[11]!==x?(b=X("shrink-0 opacity-60",x),e[11]=x,e[12]=b):b=e[12];const S=b;let y;e[13]!==a||e[14]!==n[0]||e[15]!==n.length?(y=n.length===1?s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ut(a.find(B=>B.id===n[0])?.color)}}):s.jsx(Ys,{size:14,className:"shrink-0"}),e[13]=a,e[14]=n[0],e[15]=n.length,e[16]=y):y=e[16];let v;e[17]!==r?(v=s.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[17]=r,e[18]=v):v=e[18];let k;e[19]!==S?(k=s.jsx(Ve,{size:12,className:S}),e[19]=S,e[20]=k):k=e[20];let C;e[21]!==y||e[22]!==v||e[23]!==k||e[24]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,v,k]})}),e[21]=y,e[22]=v,e[23]=k,e[24]=h,e[25]=C):C=e[25];let w;e[26]!==o?(w=o("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=o,e[27]=w):w=e[27];let j;e[28]!==o?(j=o("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=o,e[29]=j):j=e[29];let _;e[30]!==w||e[31]!==j?(_=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[30]=w,e[31]=j,e[32]=_):_=e[32];let D;e[33]!==o?(D=o("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=o,e[34]=D):D=e[34];let I;e[35]!==D?(I=s.jsx(It,{children:D}),e[35]=D,e[36]=I):I=e[36];let E;if(e[37]!==a||e[38]!==f||e[39]!==n){let B;e[41]!==f||e[42]!==n?(B=F=>s.jsxs(ve,{value:F.name,onSelect:()=>f(F.id),className:"gap-2",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ut(F.color)}}),s.jsx("span",{className:"flex-1 truncate",children:F.name}),n.includes(F.id)&&s.jsx(Ge,{size:14,className:"shrink-0 text-foreground"})]},F.id),e[41]=f,e[42]=n,e[43]=B):B=e[43],E=a.map(B),e[37]=a,e[38]=f,e[39]=n,e[40]=E}else E=e[40];let N;e[44]!==E?(N=s.jsx(qe,{children:E}),e[44]=E,e[45]=N):N=e[45];let A;e[46]!==I||e[47]!==N?(A=s.jsxs(Tt,{children:[I,N]}),e[46]=I,e[47]=N,e[48]=A):A=e[48];let T;e[49]!==_||e[50]!==A?(T=s.jsx(ot,{align:"start",className:"w-56 p-0",children:s.jsxs(Bt,{children:[_,A]})}),e[49]=_,e[50]=A,e[51]=T):T=e[51];let O;return e[52]!==d||e[53]!==C||e[54]!==T?(O=s.jsxs(nt,{open:d,onOpenChange:c,children:[C,T]}),e[52]=d,e[53]=C,e[54]=T,e[55]=O):O=e[55],O}function ia(t){const e=R.c(73),{value:n,repos:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]!==o||e[1]!==n?(u=n===null?o("taskBoard.taskFilters.repoLabel"):n===yt?o("taskBoard.taskFilters.repoNoRepo"):n,e[0]=o,e[1]=n,e[2]=u):u=e[2];const f=u;let p;e[3]!==i?(p=J=>{i(J),c(!1)},e[3]=i,e[4]=p):p=e[4];const r=p,m=n!==null;let g;e[5]!==l||e[6]!==m?(g=Se(m,l),e[5]=l,e[6]=m,e[7]=g):g=e[7];const h=g,x=l&&"ml-auto";let b;e[8]!==x?(b=X("shrink-0 opacity-60",x),e[8]=x,e[9]=b):b=e[9];const S=b;let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ht,{className:"size-3.5 shrink-0"}),e[10]=y):y=e[10];let v;e[11]!==f?(v=s.jsx("span",{className:"max-w-[12rem] truncate",children:f}),e[11]=f,e[12]=v):v=e[12];let k;e[13]!==S?(k=s.jsx(Ve,{size:12,className:S}),e[13]=S,e[14]=k):k=e[14];let C;e[15]!==v||e[16]!==k||e[17]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,v,k]})}),e[15]=v,e[16]=k,e[17]=h,e[18]=C):C=e[18];let w;e[19]!==o?(w=o("taskBoard.taskFilters.repoFilterPlaceholder"),e[19]=o,e[20]=w):w=e[20];let j;e[21]!==o?(j=o("taskBoard.taskFilters.repoFilterPlaceholder"),e[21]=o,e[22]=j):j=e[22];let _;e[23]!==w||e[24]!==j?(_=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[23]=w,e[24]=j,e[25]=_):_=e[25];let D;e[26]!==o?(D=o("taskBoard.taskFilters.repoNoReposFound"),e[26]=o,e[27]=D):D=e[27];let I;e[28]!==D?(I=s.jsx(It,{children:D}),e[28]=D,e[29]=I):I=e[29];let E;e[30]!==o?(E=o("taskBoard.taskFilters.repoAnyRepo"),e[30]=o,e[31]=E):E=e[31];let N;e[32]!==r?(N=()=>r(null),e[32]=r,e[33]=N):N=e[33];let A;e[34]!==o?(A=o("taskBoard.taskFilters.repoAnyRepo"),e[34]=o,e[35]=A):A=e[35];let T;e[36]!==E||e[37]!==N||e[38]!==A?(T=s.jsx(ve,{value:E,onSelect:N,children:A}),e[36]=E,e[37]=N,e[38]=A,e[39]=T):T=e[39];let O;e[40]!==o?(O=o("taskBoard.taskFilters.repoNoRepo"),e[40]=o,e[41]=O):O=e[41];let B;e[42]!==r?(B=()=>r(yt),e[42]=r,e[43]=B):B=e[43];let F;e[44]!==o?(F=o("taskBoard.taskFilters.repoNoRepo"),e[44]=o,e[45]=F):F=e[45];let $;e[46]!==O||e[47]!==B||e[48]!==F?($=s.jsx(ve,{value:O,onSelect:B,children:F}),e[46]=O,e[47]=B,e[48]=F,e[49]=$):$=e[49];let G;e[50]!==T||e[51]!==$?(G=s.jsxs(qe,{children:[T,$]}),e[50]=T,e[51]=$,e[52]=G):G=e[52];let P;if(e[53]!==a||e[54]!==r||e[55]!==n){let J;e[57]!==r||e[58]!==n?(J=W=>s.jsxs(ve,{value:W,onSelect:()=>r(W),className:"gap-2",children:[s.jsx(ht,{className:"size-4 shrink-0"}),s.jsx("span",{className:"flex-1 truncate",children:W}),n===W&&s.jsx(Ge,{size:14,className:"shrink-0 text-foreground"})]},W),e[57]=r,e[58]=n,e[59]=J):J=e[59],P=a.map(J),e[53]=a,e[54]=r,e[55]=n,e[56]=P}else P=e[56];let K;e[60]!==P?(K=s.jsx(qe,{children:P}),e[60]=P,e[61]=K):K=e[61];let L;e[62]!==I||e[63]!==G||e[64]!==K?(L=s.jsxs(Tt,{children:[I,G,K]}),e[62]=I,e[63]=G,e[64]=K,e[65]=L):L=e[65];let U;e[66]!==_||e[67]!==L?(U=s.jsx(ot,{align:"start",className:"w-64 p-0",children:s.jsxs(Bt,{children:[_,L]})}),e[66]=_,e[67]=L,e[68]=U):U=e[68];let V;return e[69]!==d||e[70]!==C||e[71]!==U?(V=s.jsxs(nt,{open:d,onOpenChange:c,children:[C,U]}),e[69]=d,e[70]=C,e[71]=U,e[72]=V):V=e[72],V}function ra(t){const e=R.c(25),{value:n,onChange:a,block:i}=t,l=Q(),[o,d]=z.useState(n!==""),[c,u]=z.useState(!1),[f,p]=z.useState(n);n!==f&&(p(n),n===""&&!c&&d(!1));const r=o||i,m=r?"w-32 sm:w-44":"w-8 px-0 justify-center",g=i&&"h-10 w-full px-3 text-sm sm:w-full";let h;e[0]!==m||e[1]!==g?(h=X("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",m,g),e[0]=m,e[1]=g,e[2]=h):h=e[2];let x;e[3]!==l?(x=l("taskBoard.taskFilters.searchLabel"),e[3]=l,e[4]=x):x=e[4];let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=()=>d(!0),e[5]=b):b=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Xs,{size:14}),e[6]=S):S=e[6];let y;e[7]!==x?(y=s.jsx("button",{type:"button","aria-label":x,onClick:b,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=x,e[8]=y):y=e[8];let v;e[9]!==i||e[10]!==r||e[11]!==a||e[12]!==l||e[13]!==n?(v=r&&s.jsx("input",{autoFocus:!i,value:n,onChange:w=>a(w.target.value),onFocus:()=>u(!0),onBlur:()=>{u(!1),n===""&&d(!1)},placeholder:l("taskBoard.taskFilters.searchPlaceholder"),"aria-label":l("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=i,e[10]=r,e[11]=a,e[12]=l,e[13]=n,e[14]=v):v=e[14];let k;e[15]!==i||e[16]!==a||e[17]!==l||e[18]!==n?(k=n!==""&&s.jsx("button",{type:"button","aria-label":l("taskBoard.taskFilters.searchClearLabel"),onMouseDown:ca,onClick:()=>{a(""),i||d(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:s.jsx($s,{size:14})}),e[15]=i,e[16]=a,e[17]=l,e[18]=n,e[19]=k):k=e[19];let C;return e[20]!==h||e[21]!==y||e[22]!==v||e[23]!==k?(C=s.jsxs("div",{className:h,children:[y,v,k]}),e[20]=h,e[21]=y,e[22]=v,e[23]=k,e[24]=C):C=e[24],C}function ca(t){return t.preventDefault()}function da(t){const e=R.c(20),{block:n,onClick:a}=t,i=Q();let l;e[0]!==i?(l=i("taskBoard.taskFilters.boardSettingsLabel"),e[0]=i,e[1]=l):l=e[1];const o=l;let d;e[2]!==n?(d=X(Se(!1,n),n?"h-10 w-full":"w-8 justify-center px-0"),e[2]=n,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(qn,{size:14,className:"shrink-0"}),e[4]=c):c=e[4];let u;e[5]!==n||e[6]!==o?(u=n&&s.jsx("span",{children:o}),e[5]=n,e[6]=o,e[7]=u):u=e[7];let f;e[8]!==o||e[9]!==a||e[10]!==d||e[11]!==u?(f=s.jsxs("button",{type:"button",onClick:a,"aria-label":o,className:d,children:[c,u]}),e[8]=o,e[9]=a,e[10]=d,e[11]=u,e[12]=f):f=e[12];const p=f;if(n)return p;let r;e[13]!==p?(r=s.jsx($e,{asChild:!0,children:p}),e[13]=p,e[14]=r):r=e[14];let m;e[15]!==o?(m=s.jsx(Oe,{side:"top",children:o}),e[15]=o,e[16]=m):m=e[16];let g;return e[17]!==r||e[18]!==m?(g=s.jsxs(Re,{children:[r,m]}),e[17]=r,e[18]=m,e[19]=g):g=e[19],g}function Ds(t){const e=R.c(53),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d,block:c}=t;let u;e[0]!==n||e[1]!==o?(u=C=>o({...n,search:C}),e[0]=n,e[1]=o,e[2]=u):u=e[2];let f;e[3]!==c||e[4]!==n.search||e[5]!==u?(f=s.jsx(ra,{block:c,value:n.search,onChange:u}),e[3]=c,e[4]=n.search,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==n||e[8]!==o?(p=C=>o({...n,assignee:C}),e[7]=n,e[8]=o,e[9]=p):p=e[9];let r;e[10]!==c||e[11]!==n.assignee||e[12]!==a||e[13]!==p?(r=s.jsx(na,{block:c,value:n.assignee,members:a,onChange:p}),e[10]=c,e[11]=n.assignee,e[12]=a,e[13]=p,e[14]=r):r=e[14];let m;e[15]!==n||e[16]!==o?(m=C=>o({...n,priority:C}),e[15]=n,e[16]=o,e[17]=m):m=e[17];let g;e[18]!==c||e[19]!==n.priority||e[20]!==m?(g=s.jsx(oa,{block:c,value:n.priority,onChange:m}),e[18]=c,e[19]=n.priority,e[20]=m,e[21]=g):g=e[21];let h;e[22]!==n||e[23]!==o?(h=C=>o({...n,due:C}),e[22]=n,e[23]=o,e[24]=h):h=e[24];let x;e[25]!==c||e[26]!==n.due||e[27]!==h?(x=s.jsx(aa,{block:c,value:n.due,onChange:h}),e[25]=c,e[26]=n.due,e[27]=h,e[28]=x):x=e[28];let b;e[29]!==n||e[30]!==o?(b=C=>o({...n,tags:C}),e[29]=n,e[30]=o,e[31]=b):b=e[31];let S;e[32]!==c||e[33]!==n.tags||e[34]!==b||e[35]!==i?(S=s.jsx(la,{block:c,value:n.tags,tags:i,onChange:b}),e[32]=c,e[33]=n.tags,e[34]=b,e[35]=i,e[36]=S):S=e[36];let y;e[37]!==c||e[38]!==n||e[39]!==o||e[40]!==l?(y=(l.length>0||n.repo!==null)&&s.jsx(ia,{block:c,value:n.repo,repos:l,onChange:C=>o({...n,repo:C})}),e[37]=c,e[38]=n,e[39]=o,e[40]=l,e[41]=y):y=e[41];let v;e[42]!==c||e[43]!==d?(v=s.jsx(da,{block:c,onClick:d}),e[42]=c,e[43]=d,e[44]=v):v=e[44];let k;return e[45]!==S||e[46]!==y||e[47]!==v||e[48]!==f||e[49]!==r||e[50]!==g||e[51]!==x?(k=s.jsxs(s.Fragment,{children:[f,r,g,x,S,y,v]}),e[45]=S,e[46]=y,e[47]=v,e[48]=f,e[49]=r,e[50]=g,e[51]=x,e[52]=k):k=e[52],k}function Ll(t){const e=R.c(15),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}=t,c=Q();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(gs,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=u):u=e[0];let f;e[1]!==n||e[2]!==a||e[3]!==o||e[4]!==d||e[5]!==l||e[6]!==i?(f=s.jsx(Ds,{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}),e[1]=n,e[2]=a,e[3]=o,e[4]=d,e[5]=l,e[6]=i,e[7]=f):f=e[7];let p;e[8]!==n||e[9]!==o||e[10]!==c?(p=Jo(n)&&s.jsx("button",{type:"button",onClick:()=>o(_s),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:c("taskBoard.taskFilters.clearButton")}),e[8]=n,e[9]=o,e[10]=c,e[11]=p):p=e[11];let r;return e[12]!==f||e[13]!==p?(r=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u,f,p]}),e[12]=f,e[13]=p,e[14]=r):r=e[14],r}function $l(t){const e=R.c(41),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}=t,c=Q(),[u,f]=z.useState(!1),p=Zo(n),r=p>0;let m;e[0]!==r?(m=Se(r),e[0]=r,e[1]=m):m=e[1];const g=m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(gs,{size:14,className:"shrink-0"}),e[2]=h):h=e[2];let x;e[3]!==c?(x=c("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=c,e[4]=x):x=e[4];let b;e[5]!==p?(b=p>0&&s.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:p}),e[5]=p,e[6]=b):b=e[6];let S;e[7]!==x||e[8]!==b||e[9]!==g?(S=s.jsx(ln,{asChild:!0,children:s.jsxs("button",{type:"button",className:g,children:[h,x,b]})}),e[7]=x,e[8]=b,e[9]=g,e[10]=S):S=e[10];let y;e[11]!==c?(y=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=y):y=e[12];let v;e[13]!==y?(v=s.jsx(Dt,{className:"px-4 pt-4 text-base font-medium text-foreground",children:y}),e[13]=y,e[14]=v):v=e[14];let k;e[15]!==n||e[16]!==a||e[17]!==o||e[18]!==d||e[19]!==l||e[20]!==i?(k=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(Ds,{block:!0,filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d})}),e[15]=n,e[16]=a,e[17]=o,e[18]=d,e[19]=l,e[20]=i,e[21]=k):k=e[21];let C;e[22]!==p||e[23]!==o||e[24]!==c?(C=p>0&&s.jsx(be,{variant:"outline",className:"flex-1",onClick:()=>o(_s),children:c("taskBoard.taskFilters.clearAllButton")}),e[22]=p,e[23]=o,e[24]=c,e[25]=C):C=e[25];let w;e[26]!==c?(w=c("taskBoard.taskFilters.doneButton"),e[26]=c,e[27]=w):w=e[27];let j;e[28]!==w?(j=s.jsx(ss,{asChild:!0,children:s.jsx(be,{className:"flex-1",children:w})}),e[28]=w,e[29]=j):j=e[29];let _;e[30]!==C||e[31]!==j?(_=s.jsxs(ns,{className:"flex-row gap-2",children:[C,j]}),e[30]=C,e[31]=j,e[32]=_):_=e[32];let D;e[33]!==_||e[34]!==v||e[35]!==k?(D=s.jsxs(St,{className:"p-0",children:[v,k,_]}),e[33]=_,e[34]=v,e[35]=k,e[36]=D):D=e[36];let I;return e[37]!==u||e[38]!==D||e[39]!==S?(I=s.jsxs(_t,{open:u,onOpenChange:f,direction:"bottom",children:[S,D]}),e[37]=u,e[38]=D,e[39]=S,e[40]=I):I=e[40],I}function Ol(t,e){return Lo(t,e.keySeq)??e.id}function Rl(t,e){const n=e?.trim();if(n)return t.find(a=>Ss(n,a.keySeq))??t.find(a=>a.id===n)}export{hl as A,wl as B,Fl as C,Sl as D,_s as E,Nl as F,Dl as G,Pl as H,Ml as I,Go as J,El as K,Vt as L,Co as M,pl as N,Ze as P,Kt as S,Tl as T,Ol as a,kl as b,Ko as c,ml as d,gl as e,zo as f,yl as g,Yo as h,vs as i,Il as j,Ut as k,Al as l,jl as m,Ns as n,Bl as o,Cl as p,vl as q,Ho as r,_l as s,Lo as t,xl as u,ks as v,bl as w,Rl as x,$l as y,Ll as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as P,r as z,j as a,l as W,B as U,W as J,a7 as G,K as H,m as ee,n as te,e as se,b as M,b6 as ae,t as q,dr as Y,ds as Q,dq as re,P as V,dt as fe,p as me}from"./index-CAw6g9tV.js";import{I as X}from"./input-CRq9rZYf.js";import{i as oe}from"./Check-Jn0qXgT0.js";import{i as ce}from"./ChevronSelectorVertical-BPOo032l.js";import{a as ue,c as ge,d as pe,e as he,b as je,C as xe}from"./command-CEQjEkRa.js";import{a as be,P as ye,b as Se}from"./popover-BIPtCsqc.js";import{S as ve}from"./switch-DlPMc1e_.js";import{c as Pe,d as Te,b as Ne,f as Ce,g as we,e as _e,a as ke,A as Ie}from"./alert-dialog-BU3enZKF.js";import{R as Ae,A as Re}from"./review-settings-BSEiFN9m.js";import{T as Ee}from"./textarea-BClvRA4H.js";import{f as De}from"./task-board-DHq8t-_N.js";import{R as $e}from"./require-capability-DMuYJppW.js";import"./index-DU91evk-.js";import"./dialog-DDd8wUS7.js";import"./SearchMd-C1loDEwy.js";import"./UserSquare-BEv1iIj5.js";import"./GitBranch01-Bde_Ik_K.js";import"./use-organization-settings-Dh58cpUx.js";import"./constants-DNuUCxmW.js";import"./schema-BoK0jTZh.js";import"./access-gate-DhjnuxYh.js";import"./capability-load-error-BERy8yZe.js";function Oe(t){const e=P.c(41),{options:l,value:s,onChange:n,placeholder:i,triggerClassName:r,contentClassName:o,width:c,renderTrigger:d,renderItem:f,emptyMessage:m,searchPlaceholder:u,filter:g}=t,p=i===void 0?"Select...":i,b=c===void 0?"w-[200px]":c,h=m===void 0?"No results found.":m,j=u===void 0?"Search...":u;let x;e[0]!==s?(x=K=>K.value===s,e[0]=s,e[1]=x):x=e[1];const y=l.find(x),[v,S]=z.useState(!1),T=ye,N=be,_=!0,C=d?a.jsx("div",{className:W("cursor-pointer",r),children:d(y)}):a.jsxs(U,{variant:"outline",role:"combobox",className:W("justify-between",b,r),children:[y?y.label:p,a.jsx(ce,{className:"opacity-50"})]});let w;e[2]!==N||e[3]!==C?(w=a.jsx(N,{asChild:_,children:C}),e[2]=N,e[3]=C,e[4]=w):w=e[4];let k;e[5]!==o?(k=W("p-0",o),e[5]=o,e[6]=k):k=e[6];let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O={width:"var(--radix-popover-trigger-width)"},e[7]=O):O=e[7];let B;e[8]!==j?(B=a.jsx(ue,{placeholder:j,className:"h-9"}),e[8]=j,e[9]=B):B=e[9];let A;e[10]!==h?(A=a.jsx(ge,{children:h}),e[10]=h,e[11]=A):A=e[11];let R;if(e[12]!==n||e[13]!==l||e[14]!==f||e[15]!==S||e[16]!==s){let K;e[18]!==n||e[19]!==f||e[20]!==S||e[21]!==s?(K=I=>{const le=s===I.value;return a.jsx(pe,{value:I.label,onSelect:()=>{n(I.value===s?"":I.value),S(!1)},children:f?f(I,le):a.jsxs(a.Fragment,{children:[I.label,a.jsx(oe,{className:W("ml-auto",le?"opacity-100":"opacity-0")})]})},I.value)},e[18]=n,e[19]=f,e[20]=S,e[21]=s,e[22]=K):K=e[22],R=l.map(K),e[12]=n,e[13]=l,e[14]=f,e[15]=S,e[16]=s,e[17]=R}else R=e[17];let E;e[23]!==R?(E=a.jsx(he,{children:R}),e[23]=R,e[24]=E):E=e[24];let L;e[25]!==A||e[26]!==E?(L=a.jsxs(je,{children:[A,E]}),e[25]=A,e[26]=E,e[27]=L):L=e[27];let D;e[28]!==g||e[29]!==B||e[30]!==L?(D=a.jsxs(xe,{filter:g,children:[B,L]}),e[28]=g,e[29]=B,e[30]=L,e[31]=D):D=e[31];let $;e[32]!==D||e[33]!==k?($=a.jsx(Se,{className:k,style:O,children:D}),e[32]=D,e[33]=k,e[34]=$):$=e[34];let F;return e[35]!==T||e[36]!==v||e[37]!==S||e[38]!==$||e[39]!==w?(F=a.jsxs(T,{open:v,onOpenChange:S,children:[w,$]}),e[35]=T,e[36]=v,e[37]=S,e[38]=$,e[39]=w,e[40]=F):F=e[40],F}function Be(t){const e=P.c(4),{size:l,className:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx("path",{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0z"}),e[0]=n):n=e[0];let i;return e[1]!==s||e[2]!==l?(i=a.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:n}),e[1]=s,e[2]=l,e[3]=i):i=e[3],i}function de(t){const e=t.projectName?.replace(/\s+/g," ").trim(),l=t.name.trim();return e?{primary:e,secondary:[l,t.projectKey].filter(Boolean).join(" · ")}:{primary:l,secondary:t.projectKey??""}}function Fe(t){const{primary:e,secondary:l}=de(t);return[e,l,`#${t.id}`].filter(Boolean).join(" ")}function ne(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function Ke(t,e){const l=ne(e).trim();if(!l)return 1;const s=ne(t);return l.split(/\s+/).every(n=>s.includes(n))?1:0}function Le(){const t=P.c(7),{org:e}=J(),l=G();let s;t[0]!==e.id?(s=H.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=l,t[3]=n):n=t[3];let i;return t[4]!==s||t[5]!==n?(i={queryKey:s,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6],ee(i)}function ie(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=async o=>(await l.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function qe(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=()=>l.call("JIRA_INTEGRATION_DELETE",{}),t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function Me(t){const e=P.c(8),{org:l}=J(),s=G();let n;e[0]!==l.id?(n=H.jiraBoards(l.id),e[0]=l.id,e[1]=n):n=e[1];let i;e[2]!==s?(i=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=i):i=e[3];let r;return e[4]!==t||e[5]!==n||e[6]!==i?(r={queryKey:n,enabled:t,staleTime:6e4,queryFn:i},e[4]=t,e[5]=n,e[6]=i,e[7]=r):r=e[7],ee(r)}function ze(){const t=P.c(12),{org:e}=J(),l=G();let s;t[0]!==e.id?(s=H.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=l,t[3]=n):n=t[3];let i;t[4]!==s||t[5]!==n?(i={queryKey:s,staleTime:6e4,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6];const r=ee(i);let o;t[7]!==r.data?(o=r.data?.find(Ue)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let c;return t[9]!==r.isPending||t[10]!==o?(c={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=c):c=t[11],c}function Ue(t){return t.columnKey===null}function Je(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=async o=>{const c=o.trim();if(!c){await l.call("TASK_BOARD_PROMPT_DELETE",{});return}await l.call("TASK_BOARD_PROMPT_UPSERT",{prompt:c})},t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function Ge(){const t=P.c(16),e=M(),{prompt:l,isPending:s}=ze(),n=Je(),[i,r]=z.useState(l),[o,c]=z.useState(l);o!==l&&(c(l),r(l));let d;t[0]!==e?(d=e("settings.taskPrompt.title"),t[0]=e,t[1]=d):d=t[1];let f;t[2]!==e?(f=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=f):f=t[3];let m;t[4]!==i||t[5]!==s||t[6]!==l||t[7]!==n||t[8]!==e?(m=s?a.jsx(ae,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(Ee,{value:i,rows:10,maxLength:De,placeholder:e("settings.taskPrompt.placeholder"),onChange:p=>r(p.target.value)}),a.jsx(U,{size:"sm",disabled:i===l||n.isPending,onClick:()=>n.mutate(i,{onSuccess:()=>q.success(e("settings.taskPrompt.saved")),onError:()=>q.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=i,t[5]=s,t[6]=l,t[7]=n,t[8]=e,t[9]=m):m=t[9];let u;t[10]!==f||t[11]!==m?(u=a.jsx(Y,{children:a.jsx(Q,{title:f,children:m})}),t[10]=f,t[11]=m,t[12]=u):u=t[12];let g;return t[13]!==d||t[14]!==u?(g=a.jsx(re,{title:d,children:u}),t[13]=d,t[14]=u,t[15]=g):g=t[15],g}function Z(t,e){return t instanceof Error?t.message:e}const He="https://id.atlassian.com/manage-profile/security/api-tokens";function Qe(t){const e=P.c(7),{stepKeys:l}=t,s=M();let n;if(e[0]!==l||e[1]!==s){let r;e[3]!==s?(r=o=>a.jsx("li",{children:s(o)},o),e[3]=s,e[4]=r):r=e[4],n=l.map(r),e[0]=l,e[1]=s,e[2]=n}else n=e[2];let i;return e[5]!==n?(i=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=i):i=e[6],i}function We(){const t=P.c(69),e=M(),l=ie(),[s,n]=z.useState(""),[i,r]=z.useState(""),[o,c]=z.useState("");let d;t[0]!==o||t[1]!==i||t[2]!==s?(d=s.trim()!==""&&i.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=i,t[2]=s,t[3]=d):d=t[3];const f=d;let m;t[4]!==e?(m=e("settings.jira.siteLabel"),t[4]=e,t[5]=m):m=t[5];let u;t[6]!==m?(u=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:m}),t[6]=m,t[7]=u):u=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=I=>n(I.target.value),t[8]=g):g=t[8];let p;t[9]!==e?(p=e("settings.jira.sitePlaceholder"),t[9]=e,t[10]=p):p=t[10];let b;t[11]!==s||t[12]!==p?(b=a.jsx(X,{value:s,onChange:g,placeholder:p,autoComplete:"off"}),t[11]=s,t[12]=p,t[13]=b):b=t[13];let h;t[14]!==u||t[15]!==b?(h=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[u,b]}),t[14]=u,t[15]=b,t[16]=h):h=t[16];let j;t[17]!==e?(j=e("settings.jira.emailLabel"),t[17]=e,t[18]=j):j=t[18];let x;t[19]!==j?(x=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:j}),t[19]=j,t[20]=x):x=t[20];let y;t[21]===Symbol.for("react.memo_cache_sentinel")?(y=I=>r(I.target.value),t[21]=y):y=t[21];let v;t[22]!==e?(v=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=v):v=t[23];let S;t[24]!==i||t[25]!==v?(S=a.jsx(X,{value:i,onChange:y,placeholder:v,autoComplete:"off"}),t[24]=i,t[25]=v,t[26]=S):S=t[26];let T;t[27]!==S||t[28]!==x?(T=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[x,S]}),t[27]=S,t[28]=x,t[29]=T):T=t[29];let N;t[30]!==e?(N=e("settings.jira.tokenLabel"),t[30]=e,t[31]=N):N=t[31];let _;t[32]!==N?(_=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:N}),t[32]=N,t[33]=_):_=t[33];let C;t[34]!==e?(C=e("settings.jira.createTokenLink"),t[34]=e,t[35]=C):C=t[35];let w;t[36]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(me,{size:12}),t[36]=w):w=t[36];let k;t[37]!==C?(k=a.jsxs("a",{href:He,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[C,w]}),t[37]=C,t[38]=k):k=t[38];let O;t[39]!==_||t[40]!==k?(O=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_,k]}),t[39]=_,t[40]=k,t[41]=O):O=t[41];let B;t[42]===Symbol.for("react.memo_cache_sentinel")?(B=I=>c(I.target.value),t[42]=B):B=t[42];let A;t[43]!==e?(A=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=A):A=t[44];let R;t[45]!==o||t[46]!==A?(R=a.jsx(X,{type:"password",value:o,onChange:B,placeholder:A,autoComplete:"off"}),t[45]=o,t[46]=A,t[47]=R):R=t[47];let E;t[48]!==O||t[49]!==R?(E=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,R]}),t[48]=O,t[49]=R,t[50]=E):E=t[50];const L=!f||l.isPending;let D;t[51]!==o||t[52]!==i||t[53]!==s||t[54]!==e||t[55]!==l?(D=()=>l.mutate({siteUrl:s.trim(),email:i.trim(),apiToken:o.trim()},{onSuccess:()=>q.success(e("settings.jira.connected")),onError:I=>q.error(Z(I,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=i,t[53]=s,t[54]=e,t[55]=l,t[56]=D):D=t[56];let $;t[57]!==e||t[58]!==l.isPending?($=l.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=l.isPending,t[59]=$):$=t[59];let F;t[60]!==L||t[61]!==D||t[62]!==$?(F=a.jsx(U,{size:"sm",className:"w-fit",disabled:L,onClick:D,children:$}),t[60]=L,t[61]=D,t[62]=$,t[63]=F):F=t[63];let K;return t[64]!==T||t[65]!==E||t[66]!==F||t[67]!==h?(K=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[h,T,E,F]}),t[64]=T,t[65]=E,t[66]=F,t[67]=h,t[68]=K):K=t[68],K}function Ve(t){const e=P.c(44),{integration:l}=t,s=M(),n=qe(),[i,r]=z.useState(!1),o=l.siteUrl,c=l.email;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>r(!0),e[0]=d):d=e[0];let f;e[1]!==s?(f=s("settings.jira.disconnect"),e[1]=s,e[2]=f):f=e[2];let m;e[3]!==f?(m=a.jsx(U,{variant:"outline",size:"sm",onClick:d,children:f}),e[3]=f,e[4]=m):m=e[4];let u;e[5]!==l.email||e[6]!==l.siteUrl||e[7]!==m?(u=a.jsx(Q,{title:o,description:c,action:m}),e[5]=l.email,e[6]=l.siteUrl,e[7]=m,e[8]=u):u=e[8];let g;e[9]!==s?(g=s("settings.jira.disconnectTitle"),e[9]=s,e[10]=g):g=e[10];let p;e[11]!==g?(p=a.jsx(Pe,{children:g}),e[11]=g,e[12]=p):p=e[12];let b;e[13]!==s?(b=s("settings.jira.disconnectDescription"),e[13]=s,e[14]=b):b=e[14];let h;e[15]!==b?(h=a.jsx(Te,{children:b}),e[15]=b,e[16]=h):h=e[16];let j;e[17]!==h||e[18]!==p?(j=a.jsxs(Ne,{children:[p,h]}),e[17]=h,e[18]=p,e[19]=j):j=e[19];let x;e[20]!==s?(x=s("settings.jira.cancel"),e[20]=s,e[21]=x):x=e[21];let y;e[22]!==x?(y=a.jsx(Ce,{children:x}),e[22]=x,e[23]=y):y=e[23];let v;e[24]!==n||e[25]!==s?(v=()=>n.mutate(void 0,{onSuccess:()=>q.success(s("settings.jira.disconnected")),onError:k=>q.error(Z(k,s("settings.jira.saveFailed")))}),e[24]=n,e[25]=s,e[26]=v):v=e[26];let S;e[27]!==s?(S=s("settings.jira.disconnect"),e[27]=s,e[28]=S):S=e[28];let T;e[29]!==v||e[30]!==S?(T=a.jsx(we,{onClick:v,children:S}),e[29]=v,e[30]=S,e[31]=T):T=e[31];let N;e[32]!==y||e[33]!==T?(N=a.jsxs(_e,{children:[y,T]}),e[32]=y,e[33]=T,e[34]=N):N=e[34];let _;e[35]!==j||e[36]!==N?(_=a.jsxs(ke,{children:[j,N]}),e[35]=j,e[36]=N,e[37]=_):_=e[37];let C;e[38]!==i||e[39]!==_?(C=a.jsx(Ie,{open:i,onOpenChange:r,children:_}),e[38]=i,e[39]=_,e[40]=C):C=e[40];let w;return e[41]!==C||e[42]!==u?(w=a.jsxs(a.Fragment,{children:[u,C]}),e[41]=C,e[42]=u,e[43]=w):w=e[43],w}function Ye(t){const e=P.c(36),{integration:l}=t,s=M(),n=ie(),i=Me(!0);let r,o;e[0]!==i.data||e[1]!==l.boardId||e[2]!==l.boardName?(r=(i.data??[]).map(Ze),o=l.boardId?r.find(y=>y.value===l.boardId)?.primary??l.boardName??l.boardId:null,e[0]=i.data,e[1]=l.boardId,e[2]=l.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const c=o;let d;e[5]!==s?(d=s("settings.jira.boardLabel"),e[5]=s,e[6]=d):d=e[6];let f;e[7]!==s?(f=s("settings.jira.boardDescription"),e[7]=s,e[8]=f):f=e[8];const m=l.boardId??"";let u;e[9]!==s?(u=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=u):u=e[10];let g;e[11]!==s?(g=s("settings.jira.boardSearchPlaceholder"),e[11]=s,e[12]=g):g=e[12];let p;e[13]!==i.isPending||e[14]!==s?(p=i.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=i.isPending,e[14]=s,e[15]=p):p=e[15];let b;e[16]!==c||e[17]!==s?(b=()=>a.jsxs(U,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:c??s("settings.jira.boardPlaceholder")}),a.jsx(ce,{className:"opacity-50 shrink-0"})]}),e[16]=c,e[17]=s,e[18]=b):b=e[18];let h;e[19]!==r||e[20]!==l.boardId||e[21]!==s||e[22]!==n?(h=y=>{!y||y===l.boardId||n.mutate({boardId:y,boardName:r.find(v=>v.value===y)?.primary??null},{onError:v=>q.error(Z(v,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=l.boardId,e[21]=s,e[22]=n,e[23]=h):h=e[23];let j;e[24]!==r||e[25]!==m||e[26]!==u||e[27]!==g||e[28]!==p||e[29]!==b||e[30]!==h?(j=a.jsx(Oe,{options:r,value:m,width:"w-72",triggerClassName:"shrink-0",placeholder:u,searchPlaceholder:g,filter:Ke,emptyMessage:p,renderTrigger:b,renderItem:Xe,onChange:h}),e[24]=r,e[25]=m,e[26]=u,e[27]=g,e[28]=p,e[29]=b,e[30]=h,e[31]=j):j=e[31];let x;return e[32]!==j||e[33]!==d||e[34]!==f?(x=a.jsx(Q,{title:d,description:f,action:j}),e[32]=j,e[33]=d,e[34]=f,e[35]=x):x=e[35],x}function Xe(t,e){return a.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate",children:t.primary}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.secondary})]}),a.jsx(oe,{className:W("mt-0.5 shrink-0",e?"opacity-100":"opacity-0")})]})}function Ze(t){const{primary:e,secondary:l}=de(t);return{value:String(t.id),label:Fe(t),primary:e,secondary:l}}function et(t){const e=P.c(16),{integration:l}=t,s=M(),n=ie();let i;e[0]!==s?(i=s("settings.jira.enabledLabel"),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==s?(r=s("settings.jira.enabledDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==l.boardId||e[5]!==s||e[6]!==n?(o=f=>{if(f&&!l.boardId){q.error(s("settings.jira.enableRequirements"));return}n.mutate({enabled:f},{onError:m=>q.error(Z(m,s("settings.jira.saveFailed")))})},e[4]=l.boardId,e[5]=s,e[6]=n,e[7]=o):o=e[7];let c;e[8]!==l.enabled||e[9]!==o||e[10]!==n.isPending?(c=a.jsx(ve,{checked:l.enabled,disabled:n.isPending,onCheckedChange:o}),e[8]=l.enabled,e[9]=o,e[10]=n.isPending,e[11]=c):c=e[11];let d;return e[12]!==i||e[13]!==r||e[14]!==c?(d=a.jsx(Q,{title:i,description:r,action:c}),e[12]=i,e[13]=r,e[14]=c,e[15]=d):d=e[15],d}function tt(t){const e=P.c(24),{integration:l}=t,s=M(),n=`${window.location.origin}/api/_jira/webhook/${l.webhookSecret}`;let i;e[0]!==s?(i=s("settings.jira.webhookTitle"),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==s?(r=s("settings.jira.webhookDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==n?(o=a.jsx(X,{readOnly:!0,value:n,className:"font-mono text-xs"}),e[4]=n,e[5]=o):o=e[5];let c;e[6]!==s||e[7]!==n?(c=()=>{navigator.clipboard.writeText(n),q.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=n,e[8]=c):c=e[8];let d;e[9]!==s?(d=s("settings.jira.webhookCopy"),e[9]=s,e[10]=d):d=e[10];let f;e[11]!==c||e[12]!==d?(f=a.jsx(U,{variant:"outline",size:"sm",className:"shrink-0",onClick:c,children:d}),e[11]=c,e[12]=d,e[13]=f):f=e[13];let m;e[14]!==o||e[15]!==f?(m=a.jsxs("div",{className:"flex items-center gap-2",children:[o,f]}),e[14]=o,e[15]=f,e[16]=m):m=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(Qe,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=u):u=e[17];let g;e[18]!==m?(g=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[m,u]}),e[18]=m,e[19]=g):g=e[19];let p;return e[20]!==i||e[21]!==r||e[22]!==g?(p=a.jsx(Q,{title:i,description:r,children:g}),e[20]=i,e[21]=r,e[22]=g,e[23]=p):p=e[23],p}function st(){const t=P.c(11),e=M(),l=Le();if(l.isPending){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(Y,{children:a.jsx("div",{className:"p-4",children:a.jsx(ae,{className:"h-40 w-full"})})}),t[0]=i):i=t[0],i}if(!l.data){let i;t[1]!==e?(i=e("settings.jira.connectTitle"),t[1]=e,t[2]=i):i=t[2];let r;t[3]!==e?(r=e("settings.jira.connectDescription"),t[3]=e,t[4]=r):r=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(We,{}),t[5]=o):o=t[5];let c;return t[6]!==i||t[7]!==r?(c=a.jsx(Y,{children:a.jsx(Q,{title:i,description:r,children:o})}),t[6]=i,t[7]=r,t[8]=c):c=t[8],c}const s=l.data;let n;return t[9]!==s?(n=a.jsxs(Y,{children:[a.jsx(Ve,{integration:s}),a.jsx(Ye,{integration:s}),a.jsx(et,{integration:s}),a.jsx(tt,{integration:s})]}),t[9]=s,t[10]=n):n=t[10],n}function it(){const t=P.c(18),e=M();let l;t[0]!==e?(l=e("settings.nav.tasks"),t[0]=e,t[1]=l):l=t[1];let s;t[2]!==l?(s=a.jsx(V.Title,{children:l}),t[2]=l,t[3]=s):s=t[3];let n,i,r;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx(Ae,{}),i=a.jsx(Ge,{}),r=a.jsx(Re,{}),t[4]=n,t[5]=i,t[6]=r):(n=t[4],i=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(Be,{size:18}),t[7]=o):o=t[7];let c;t[8]!==e?(c=e("settings.jira.sectionTitle"),t[8]=e,t[9]=c):c=t[9];let d;t[10]!==c?(d=a.jsxs("span",{className:"flex items-center gap-2",children:[o,c]}),t[10]=c,t[11]=d):d=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(st,{}),t[12]=f):f=t[12];let m;t[13]!==d?(m=a.jsx(re,{title:d,children:f}),t[13]=d,t[14]=m):m=t[14];let u;return t[15]!==s||t[16]!==m?(u=a.jsx(V,{children:a.jsx(V.Content,{children:a.jsx(V.Body,{children:a.jsxs(fe,{children:[s,n,i,r,m]})})})}),t[15]=s,t[16]=m,t[17]=u):u=t[17],u}function Ct(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx($e,{capability:"org:manage",area:"settings",children:a.jsx(it,{})}),t[0]=e):e=t[0],e}export{Ct as default};
|
|
1
|
+
import{c as P,r as z,j as a,l as W,B as U,W as J,a7 as G,K as H,m as ee,n as te,e as se,b as M,b6 as ae,t as q,dr as Y,ds as Q,dq as re,P as V,dt as fe,p as me}from"./index-DuTFQdyn.js";import{I as X}from"./input-BQBB8gcC.js";import{i as oe}from"./Check-BX2gygbe.js";import{i as ce}from"./ChevronSelectorVertical-kHOMBDm7.js";import{a as ue,c as ge,d as pe,e as he,b as je,C as xe}from"./command-YM_TkZoa.js";import{a as be,P as ye,b as Se}from"./popover-DF2wTNDa.js";import{S as ve}from"./switch-D7TGNQH3.js";import{c as Pe,d as Te,b as Ne,f as Ce,g as we,e as _e,a as ke,A as Ie}from"./alert-dialog-CPeNK-tT.js";import{R as Ae,A as Re}from"./review-settings-kCQ3yxbO.js";import{T as Ee}from"./textarea-5EDWymdh.js";import{f as De}from"./task-board-h1SC3xFJ.js";import{R as $e}from"./require-capability-CbuOrbcP.js";import"./index-CsgWXHyv.js";import"./dialog-MZN5GEGy.js";import"./SearchMd-C_odO2p9.js";import"./UserSquare-Cis5hkvt.js";import"./GitBranch01-Bab5ZdgR.js";import"./use-organization-settings-BAFA--7u.js";import"./constants-DNuUCxmW.js";import"./schema-D_IYS8Ao.js";import"./access-gate-Boh4pe2s.js";import"./capability-load-error-CiU11Kky.js";function Oe(t){const e=P.c(41),{options:l,value:s,onChange:n,placeholder:i,triggerClassName:r,contentClassName:o,width:c,renderTrigger:d,renderItem:f,emptyMessage:m,searchPlaceholder:u,filter:g}=t,p=i===void 0?"Select...":i,b=c===void 0?"w-[200px]":c,h=m===void 0?"No results found.":m,j=u===void 0?"Search...":u;let x;e[0]!==s?(x=K=>K.value===s,e[0]=s,e[1]=x):x=e[1];const y=l.find(x),[v,S]=z.useState(!1),T=ye,N=be,_=!0,C=d?a.jsx("div",{className:W("cursor-pointer",r),children:d(y)}):a.jsxs(U,{variant:"outline",role:"combobox",className:W("justify-between",b,r),children:[y?y.label:p,a.jsx(ce,{className:"opacity-50"})]});let w;e[2]!==N||e[3]!==C?(w=a.jsx(N,{asChild:_,children:C}),e[2]=N,e[3]=C,e[4]=w):w=e[4];let k;e[5]!==o?(k=W("p-0",o),e[5]=o,e[6]=k):k=e[6];let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O={width:"var(--radix-popover-trigger-width)"},e[7]=O):O=e[7];let B;e[8]!==j?(B=a.jsx(ue,{placeholder:j,className:"h-9"}),e[8]=j,e[9]=B):B=e[9];let A;e[10]!==h?(A=a.jsx(ge,{children:h}),e[10]=h,e[11]=A):A=e[11];let R;if(e[12]!==n||e[13]!==l||e[14]!==f||e[15]!==S||e[16]!==s){let K;e[18]!==n||e[19]!==f||e[20]!==S||e[21]!==s?(K=I=>{const le=s===I.value;return a.jsx(pe,{value:I.label,onSelect:()=>{n(I.value===s?"":I.value),S(!1)},children:f?f(I,le):a.jsxs(a.Fragment,{children:[I.label,a.jsx(oe,{className:W("ml-auto",le?"opacity-100":"opacity-0")})]})},I.value)},e[18]=n,e[19]=f,e[20]=S,e[21]=s,e[22]=K):K=e[22],R=l.map(K),e[12]=n,e[13]=l,e[14]=f,e[15]=S,e[16]=s,e[17]=R}else R=e[17];let E;e[23]!==R?(E=a.jsx(he,{children:R}),e[23]=R,e[24]=E):E=e[24];let L;e[25]!==A||e[26]!==E?(L=a.jsxs(je,{children:[A,E]}),e[25]=A,e[26]=E,e[27]=L):L=e[27];let D;e[28]!==g||e[29]!==B||e[30]!==L?(D=a.jsxs(xe,{filter:g,children:[B,L]}),e[28]=g,e[29]=B,e[30]=L,e[31]=D):D=e[31];let $;e[32]!==D||e[33]!==k?($=a.jsx(Se,{className:k,style:O,children:D}),e[32]=D,e[33]=k,e[34]=$):$=e[34];let F;return e[35]!==T||e[36]!==v||e[37]!==S||e[38]!==$||e[39]!==w?(F=a.jsxs(T,{open:v,onOpenChange:S,children:[w,$]}),e[35]=T,e[36]=v,e[37]=S,e[38]=$,e[39]=w,e[40]=F):F=e[40],F}function Be(t){const e=P.c(4),{size:l,className:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx("path",{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0z"}),e[0]=n):n=e[0];let i;return e[1]!==s||e[2]!==l?(i=a.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:n}),e[1]=s,e[2]=l,e[3]=i):i=e[3],i}function de(t){const e=t.projectName?.replace(/\s+/g," ").trim(),l=t.name.trim();return e?{primary:e,secondary:[l,t.projectKey].filter(Boolean).join(" · ")}:{primary:l,secondary:t.projectKey??""}}function Fe(t){const{primary:e,secondary:l}=de(t);return[e,l,`#${t.id}`].filter(Boolean).join(" ")}function ne(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function Ke(t,e){const l=ne(e).trim();if(!l)return 1;const s=ne(t);return l.split(/\s+/).every(n=>s.includes(n))?1:0}function Le(){const t=P.c(7),{org:e}=J(),l=G();let s;t[0]!==e.id?(s=H.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=l,t[3]=n):n=t[3];let i;return t[4]!==s||t[5]!==n?(i={queryKey:s,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6],ee(i)}function ie(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=async o=>(await l.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function qe(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=()=>l.call("JIRA_INTEGRATION_DELETE",{}),t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function Me(t){const e=P.c(8),{org:l}=J(),s=G();let n;e[0]!==l.id?(n=H.jiraBoards(l.id),e[0]=l.id,e[1]=n):n=e[1];let i;e[2]!==s?(i=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=i):i=e[3];let r;return e[4]!==t||e[5]!==n||e[6]!==i?(r={queryKey:n,enabled:t,staleTime:6e4,queryFn:i},e[4]=t,e[5]=n,e[6]=i,e[7]=r):r=e[7],ee(r)}function ze(){const t=P.c(12),{org:e}=J(),l=G();let s;t[0]!==e.id?(s=H.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=l,t[3]=n):n=t[3];let i;t[4]!==s||t[5]!==n?(i={queryKey:s,staleTime:6e4,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6];const r=ee(i);let o;t[7]!==r.data?(o=r.data?.find(Ue)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let c;return t[9]!==r.isPending||t[10]!==o?(c={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=c):c=t[11],c}function Ue(t){return t.columnKey===null}function Je(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=async o=>{const c=o.trim();if(!c){await l.call("TASK_BOARD_PROMPT_DELETE",{});return}await l.call("TASK_BOARD_PROMPT_UPSERT",{prompt:c})},t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function Ge(){const t=P.c(16),e=M(),{prompt:l,isPending:s}=ze(),n=Je(),[i,r]=z.useState(l),[o,c]=z.useState(l);o!==l&&(c(l),r(l));let d;t[0]!==e?(d=e("settings.taskPrompt.title"),t[0]=e,t[1]=d):d=t[1];let f;t[2]!==e?(f=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=f):f=t[3];let m;t[4]!==i||t[5]!==s||t[6]!==l||t[7]!==n||t[8]!==e?(m=s?a.jsx(ae,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(Ee,{value:i,rows:10,maxLength:De,placeholder:e("settings.taskPrompt.placeholder"),onChange:p=>r(p.target.value)}),a.jsx(U,{size:"sm",disabled:i===l||n.isPending,onClick:()=>n.mutate(i,{onSuccess:()=>q.success(e("settings.taskPrompt.saved")),onError:()=>q.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=i,t[5]=s,t[6]=l,t[7]=n,t[8]=e,t[9]=m):m=t[9];let u;t[10]!==f||t[11]!==m?(u=a.jsx(Y,{children:a.jsx(Q,{title:f,children:m})}),t[10]=f,t[11]=m,t[12]=u):u=t[12];let g;return t[13]!==d||t[14]!==u?(g=a.jsx(re,{title:d,children:u}),t[13]=d,t[14]=u,t[15]=g):g=t[15],g}function Z(t,e){return t instanceof Error?t.message:e}const He="https://id.atlassian.com/manage-profile/security/api-tokens";function Qe(t){const e=P.c(7),{stepKeys:l}=t,s=M();let n;if(e[0]!==l||e[1]!==s){let r;e[3]!==s?(r=o=>a.jsx("li",{children:s(o)},o),e[3]=s,e[4]=r):r=e[4],n=l.map(r),e[0]=l,e[1]=s,e[2]=n}else n=e[2];let i;return e[5]!==n?(i=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=i):i=e[6],i}function We(){const t=P.c(69),e=M(),l=ie(),[s,n]=z.useState(""),[i,r]=z.useState(""),[o,c]=z.useState("");let d;t[0]!==o||t[1]!==i||t[2]!==s?(d=s.trim()!==""&&i.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=i,t[2]=s,t[3]=d):d=t[3];const f=d;let m;t[4]!==e?(m=e("settings.jira.siteLabel"),t[4]=e,t[5]=m):m=t[5];let u;t[6]!==m?(u=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:m}),t[6]=m,t[7]=u):u=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=I=>n(I.target.value),t[8]=g):g=t[8];let p;t[9]!==e?(p=e("settings.jira.sitePlaceholder"),t[9]=e,t[10]=p):p=t[10];let b;t[11]!==s||t[12]!==p?(b=a.jsx(X,{value:s,onChange:g,placeholder:p,autoComplete:"off"}),t[11]=s,t[12]=p,t[13]=b):b=t[13];let h;t[14]!==u||t[15]!==b?(h=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[u,b]}),t[14]=u,t[15]=b,t[16]=h):h=t[16];let j;t[17]!==e?(j=e("settings.jira.emailLabel"),t[17]=e,t[18]=j):j=t[18];let x;t[19]!==j?(x=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:j}),t[19]=j,t[20]=x):x=t[20];let y;t[21]===Symbol.for("react.memo_cache_sentinel")?(y=I=>r(I.target.value),t[21]=y):y=t[21];let v;t[22]!==e?(v=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=v):v=t[23];let S;t[24]!==i||t[25]!==v?(S=a.jsx(X,{value:i,onChange:y,placeholder:v,autoComplete:"off"}),t[24]=i,t[25]=v,t[26]=S):S=t[26];let T;t[27]!==S||t[28]!==x?(T=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[x,S]}),t[27]=S,t[28]=x,t[29]=T):T=t[29];let N;t[30]!==e?(N=e("settings.jira.tokenLabel"),t[30]=e,t[31]=N):N=t[31];let _;t[32]!==N?(_=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:N}),t[32]=N,t[33]=_):_=t[33];let C;t[34]!==e?(C=e("settings.jira.createTokenLink"),t[34]=e,t[35]=C):C=t[35];let w;t[36]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(me,{size:12}),t[36]=w):w=t[36];let k;t[37]!==C?(k=a.jsxs("a",{href:He,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[C,w]}),t[37]=C,t[38]=k):k=t[38];let O;t[39]!==_||t[40]!==k?(O=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_,k]}),t[39]=_,t[40]=k,t[41]=O):O=t[41];let B;t[42]===Symbol.for("react.memo_cache_sentinel")?(B=I=>c(I.target.value),t[42]=B):B=t[42];let A;t[43]!==e?(A=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=A):A=t[44];let R;t[45]!==o||t[46]!==A?(R=a.jsx(X,{type:"password",value:o,onChange:B,placeholder:A,autoComplete:"off"}),t[45]=o,t[46]=A,t[47]=R):R=t[47];let E;t[48]!==O||t[49]!==R?(E=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,R]}),t[48]=O,t[49]=R,t[50]=E):E=t[50];const L=!f||l.isPending;let D;t[51]!==o||t[52]!==i||t[53]!==s||t[54]!==e||t[55]!==l?(D=()=>l.mutate({siteUrl:s.trim(),email:i.trim(),apiToken:o.trim()},{onSuccess:()=>q.success(e("settings.jira.connected")),onError:I=>q.error(Z(I,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=i,t[53]=s,t[54]=e,t[55]=l,t[56]=D):D=t[56];let $;t[57]!==e||t[58]!==l.isPending?($=l.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=l.isPending,t[59]=$):$=t[59];let F;t[60]!==L||t[61]!==D||t[62]!==$?(F=a.jsx(U,{size:"sm",className:"w-fit",disabled:L,onClick:D,children:$}),t[60]=L,t[61]=D,t[62]=$,t[63]=F):F=t[63];let K;return t[64]!==T||t[65]!==E||t[66]!==F||t[67]!==h?(K=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[h,T,E,F]}),t[64]=T,t[65]=E,t[66]=F,t[67]=h,t[68]=K):K=t[68],K}function Ve(t){const e=P.c(44),{integration:l}=t,s=M(),n=qe(),[i,r]=z.useState(!1),o=l.siteUrl,c=l.email;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>r(!0),e[0]=d):d=e[0];let f;e[1]!==s?(f=s("settings.jira.disconnect"),e[1]=s,e[2]=f):f=e[2];let m;e[3]!==f?(m=a.jsx(U,{variant:"outline",size:"sm",onClick:d,children:f}),e[3]=f,e[4]=m):m=e[4];let u;e[5]!==l.email||e[6]!==l.siteUrl||e[7]!==m?(u=a.jsx(Q,{title:o,description:c,action:m}),e[5]=l.email,e[6]=l.siteUrl,e[7]=m,e[8]=u):u=e[8];let g;e[9]!==s?(g=s("settings.jira.disconnectTitle"),e[9]=s,e[10]=g):g=e[10];let p;e[11]!==g?(p=a.jsx(Pe,{children:g}),e[11]=g,e[12]=p):p=e[12];let b;e[13]!==s?(b=s("settings.jira.disconnectDescription"),e[13]=s,e[14]=b):b=e[14];let h;e[15]!==b?(h=a.jsx(Te,{children:b}),e[15]=b,e[16]=h):h=e[16];let j;e[17]!==h||e[18]!==p?(j=a.jsxs(Ne,{children:[p,h]}),e[17]=h,e[18]=p,e[19]=j):j=e[19];let x;e[20]!==s?(x=s("settings.jira.cancel"),e[20]=s,e[21]=x):x=e[21];let y;e[22]!==x?(y=a.jsx(Ce,{children:x}),e[22]=x,e[23]=y):y=e[23];let v;e[24]!==n||e[25]!==s?(v=()=>n.mutate(void 0,{onSuccess:()=>q.success(s("settings.jira.disconnected")),onError:k=>q.error(Z(k,s("settings.jira.saveFailed")))}),e[24]=n,e[25]=s,e[26]=v):v=e[26];let S;e[27]!==s?(S=s("settings.jira.disconnect"),e[27]=s,e[28]=S):S=e[28];let T;e[29]!==v||e[30]!==S?(T=a.jsx(we,{onClick:v,children:S}),e[29]=v,e[30]=S,e[31]=T):T=e[31];let N;e[32]!==y||e[33]!==T?(N=a.jsxs(_e,{children:[y,T]}),e[32]=y,e[33]=T,e[34]=N):N=e[34];let _;e[35]!==j||e[36]!==N?(_=a.jsxs(ke,{children:[j,N]}),e[35]=j,e[36]=N,e[37]=_):_=e[37];let C;e[38]!==i||e[39]!==_?(C=a.jsx(Ie,{open:i,onOpenChange:r,children:_}),e[38]=i,e[39]=_,e[40]=C):C=e[40];let w;return e[41]!==C||e[42]!==u?(w=a.jsxs(a.Fragment,{children:[u,C]}),e[41]=C,e[42]=u,e[43]=w):w=e[43],w}function Ye(t){const e=P.c(36),{integration:l}=t,s=M(),n=ie(),i=Me(!0);let r,o;e[0]!==i.data||e[1]!==l.boardId||e[2]!==l.boardName?(r=(i.data??[]).map(Ze),o=l.boardId?r.find(y=>y.value===l.boardId)?.primary??l.boardName??l.boardId:null,e[0]=i.data,e[1]=l.boardId,e[2]=l.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const c=o;let d;e[5]!==s?(d=s("settings.jira.boardLabel"),e[5]=s,e[6]=d):d=e[6];let f;e[7]!==s?(f=s("settings.jira.boardDescription"),e[7]=s,e[8]=f):f=e[8];const m=l.boardId??"";let u;e[9]!==s?(u=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=u):u=e[10];let g;e[11]!==s?(g=s("settings.jira.boardSearchPlaceholder"),e[11]=s,e[12]=g):g=e[12];let p;e[13]!==i.isPending||e[14]!==s?(p=i.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=i.isPending,e[14]=s,e[15]=p):p=e[15];let b;e[16]!==c||e[17]!==s?(b=()=>a.jsxs(U,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:c??s("settings.jira.boardPlaceholder")}),a.jsx(ce,{className:"opacity-50 shrink-0"})]}),e[16]=c,e[17]=s,e[18]=b):b=e[18];let h;e[19]!==r||e[20]!==l.boardId||e[21]!==s||e[22]!==n?(h=y=>{!y||y===l.boardId||n.mutate({boardId:y,boardName:r.find(v=>v.value===y)?.primary??null},{onError:v=>q.error(Z(v,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=l.boardId,e[21]=s,e[22]=n,e[23]=h):h=e[23];let j;e[24]!==r||e[25]!==m||e[26]!==u||e[27]!==g||e[28]!==p||e[29]!==b||e[30]!==h?(j=a.jsx(Oe,{options:r,value:m,width:"w-72",triggerClassName:"shrink-0",placeholder:u,searchPlaceholder:g,filter:Ke,emptyMessage:p,renderTrigger:b,renderItem:Xe,onChange:h}),e[24]=r,e[25]=m,e[26]=u,e[27]=g,e[28]=p,e[29]=b,e[30]=h,e[31]=j):j=e[31];let x;return e[32]!==j||e[33]!==d||e[34]!==f?(x=a.jsx(Q,{title:d,description:f,action:j}),e[32]=j,e[33]=d,e[34]=f,e[35]=x):x=e[35],x}function Xe(t,e){return a.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate",children:t.primary}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.secondary})]}),a.jsx(oe,{className:W("mt-0.5 shrink-0",e?"opacity-100":"opacity-0")})]})}function Ze(t){const{primary:e,secondary:l}=de(t);return{value:String(t.id),label:Fe(t),primary:e,secondary:l}}function et(t){const e=P.c(16),{integration:l}=t,s=M(),n=ie();let i;e[0]!==s?(i=s("settings.jira.enabledLabel"),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==s?(r=s("settings.jira.enabledDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==l.boardId||e[5]!==s||e[6]!==n?(o=f=>{if(f&&!l.boardId){q.error(s("settings.jira.enableRequirements"));return}n.mutate({enabled:f},{onError:m=>q.error(Z(m,s("settings.jira.saveFailed")))})},e[4]=l.boardId,e[5]=s,e[6]=n,e[7]=o):o=e[7];let c;e[8]!==l.enabled||e[9]!==o||e[10]!==n.isPending?(c=a.jsx(ve,{checked:l.enabled,disabled:n.isPending,onCheckedChange:o}),e[8]=l.enabled,e[9]=o,e[10]=n.isPending,e[11]=c):c=e[11];let d;return e[12]!==i||e[13]!==r||e[14]!==c?(d=a.jsx(Q,{title:i,description:r,action:c}),e[12]=i,e[13]=r,e[14]=c,e[15]=d):d=e[15],d}function tt(t){const e=P.c(24),{integration:l}=t,s=M(),n=`${window.location.origin}/api/_jira/webhook/${l.webhookSecret}`;let i;e[0]!==s?(i=s("settings.jira.webhookTitle"),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==s?(r=s("settings.jira.webhookDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==n?(o=a.jsx(X,{readOnly:!0,value:n,className:"font-mono text-xs"}),e[4]=n,e[5]=o):o=e[5];let c;e[6]!==s||e[7]!==n?(c=()=>{navigator.clipboard.writeText(n),q.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=n,e[8]=c):c=e[8];let d;e[9]!==s?(d=s("settings.jira.webhookCopy"),e[9]=s,e[10]=d):d=e[10];let f;e[11]!==c||e[12]!==d?(f=a.jsx(U,{variant:"outline",size:"sm",className:"shrink-0",onClick:c,children:d}),e[11]=c,e[12]=d,e[13]=f):f=e[13];let m;e[14]!==o||e[15]!==f?(m=a.jsxs("div",{className:"flex items-center gap-2",children:[o,f]}),e[14]=o,e[15]=f,e[16]=m):m=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(Qe,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=u):u=e[17];let g;e[18]!==m?(g=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[m,u]}),e[18]=m,e[19]=g):g=e[19];let p;return e[20]!==i||e[21]!==r||e[22]!==g?(p=a.jsx(Q,{title:i,description:r,children:g}),e[20]=i,e[21]=r,e[22]=g,e[23]=p):p=e[23],p}function st(){const t=P.c(11),e=M(),l=Le();if(l.isPending){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(Y,{children:a.jsx("div",{className:"p-4",children:a.jsx(ae,{className:"h-40 w-full"})})}),t[0]=i):i=t[0],i}if(!l.data){let i;t[1]!==e?(i=e("settings.jira.connectTitle"),t[1]=e,t[2]=i):i=t[2];let r;t[3]!==e?(r=e("settings.jira.connectDescription"),t[3]=e,t[4]=r):r=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(We,{}),t[5]=o):o=t[5];let c;return t[6]!==i||t[7]!==r?(c=a.jsx(Y,{children:a.jsx(Q,{title:i,description:r,children:o})}),t[6]=i,t[7]=r,t[8]=c):c=t[8],c}const s=l.data;let n;return t[9]!==s?(n=a.jsxs(Y,{children:[a.jsx(Ve,{integration:s}),a.jsx(Ye,{integration:s}),a.jsx(et,{integration:s}),a.jsx(tt,{integration:s})]}),t[9]=s,t[10]=n):n=t[10],n}function it(){const t=P.c(18),e=M();let l;t[0]!==e?(l=e("settings.nav.tasks"),t[0]=e,t[1]=l):l=t[1];let s;t[2]!==l?(s=a.jsx(V.Title,{children:l}),t[2]=l,t[3]=s):s=t[3];let n,i,r;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx(Ae,{}),i=a.jsx(Ge,{}),r=a.jsx(Re,{}),t[4]=n,t[5]=i,t[6]=r):(n=t[4],i=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(Be,{size:18}),t[7]=o):o=t[7];let c;t[8]!==e?(c=e("settings.jira.sectionTitle"),t[8]=e,t[9]=c):c=t[9];let d;t[10]!==c?(d=a.jsxs("span",{className:"flex items-center gap-2",children:[o,c]}),t[10]=c,t[11]=d):d=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(st,{}),t[12]=f):f=t[12];let m;t[13]!==d?(m=a.jsx(re,{title:d,children:f}),t[13]=d,t[14]=m):m=t[14];let u;return t[15]!==s||t[16]!==m?(u=a.jsx(V,{children:a.jsx(V.Content,{children:a.jsx(V.Body,{children:a.jsxs(fe,{children:[s,n,i,r,m]})})})}),t[15]=s,t[16]=m,t[17]=u):u=t[17],u}function Ct(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx($e,{capability:"org:manage",area:"settings",children:a.jsx(it,{})}),t[0]=e):e=t[0],e}export{Ct as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,l,j as n}from"./index-
|
|
1
|
+
import{c as o,l,j as n}from"./index-DuTFQdyn.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as h}from"./slugify-CEUa2lfQ.js";import{J as m}from"./index-
|
|
1
|
+
import{s as h}from"./slugify-CEUa2lfQ.js";import{J as m}from"./index-DuTFQdyn.js";function c(r){const t=r?.trim();if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n.href}catch{return null}}function d(r){return c(r?.previewServerUrl)??c(r?.productionUrl)}function I(r){return r?.find(t=>t.production)?.domain??r?.[0]?.domain}function p(r){const t=r?.trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;return c(n)}function S(r){const t=h(r??"");return t?p(`${t}.deco.site`):null}function l(r){return r==="cms"||r==="sandbox"?r:null}function w(r){return!!d(r)&&r?.fastPreview===!0}function y(r){return w(r)?"cms":"sandbox"}function T(r,t){return l(r?.runtime)??y(t)}function a(r,t){return m.chatThreadIntent(r,t)}function U(r,t,n,e){if(!(!e.runtime&&!e.branch))try{r.setItem(a(t,n),JSON.stringify(e))}catch{}}function g(r,t,n){try{r.removeItem(a(t,n))}catch{}}function P(r,t,n){const e=a(t,n);let u=null;try{u=r.getItem(e),r.removeItem(e)}catch{return{}}if(!u)return{};let i;try{i=JSON.parse(u)}catch{return{}}if(!i||typeof i!="object")return{};const o=i,s=l(o.runtime),f=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...s?{runtime:s}:{},...f?{branch:f}:{}}}export{d as a,p as b,P as c,y as d,g as e,S as f,I as g,l as p,T as r,c as s,U as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as y,b as T,j as i,B as L,r as O,J as U,u as k,f as D,W as E,d as V,Z as H,y as z,dz as B}from"./index-CAw6g9tV.js";import{d as J,h as K,c as F,b as G,D as W}from"./dialog-DDd8wUS7.js";import{i as Y}from"./Check-Jn0qXgT0.js";import{a as Q}from"./Copy01-jXW2eGyY.js";import{n as X}from"./Download01-BpcIjY9x.js";import{u as M,D as j}from"./use-destination-route-C5lOfatk.js";import{a as $}from"./constants-DNuUCxmW.js";const Z="https://github.com/decocms/studio/releases";function q(){return`curl -fsSL ${window.location.origin}/install.sh | sh`}function ee(e){return`https://github.com/decocms/studio/releases/download/native-v${e}/deco-${e}-linux-x86_64.AppImage`}function we(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)&&!("ontouchend"in document)}function te(){return typeof navigator<"u"&&/Linux/.test(navigator.platform)&&!/Android/.test(navigator.userAgent)&&!("ontouchend"in document)}async function ne(e,t){if(!e)return!1;try{return await e.writeText(t),!0}catch{return!1}}function P(e){const t=y.c(12),{copiedLabel:n}=e,s=T(),[o,r]=O.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=q(),t[0]=l):l=t[0];const a=l;let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("code",{className:"block rounded-md border bg-muted px-3 py-2.5 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap select-all",children:a}),t[1]=c):c=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{ne(navigator.clipboard,a).then(p=>{p&&(r(!0),setTimeout(()=>r(!1),2e3))})},t[2]=d):d=t[2];let u;t[3]!==o?(u=o?i.jsx(Y,{size:16}):i.jsx(Q,{size:16}),t[3]=o,t[4]=u):u=t[4];let f;t[5]!==o||t[6]!==n||t[7]!==s?(f=o?n:s("downloadApp.copyLabel"),t[5]=o,t[6]=n,t[7]=s,t[8]=f):f=t[8];let m;return t[9]!==u||t[10]!==f?(m=i.jsxs("div",{className:"flex flex-col gap-3",children:[c,i.jsxs(L,{type:"button",className:"w-full gap-2",onClick:d,children:[u,f]})]}),t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function oe(){const e=y.c(18),t=T();let n;e[0]!==t?(n=t("downloadApp.copiedLabel"),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==n?(s=i.jsx(P,{copiedLabel:n}),e[2]=n,e[3]=s):s=e[3];let o;e[4]!==t?(o=t("downloadApp.terminalHint"),e[4]=t,e[5]=o):o=e[5];let r;e[6]!==o?(r=i.jsx("p",{children:o}),e[6]=o,e[7]=r):r=e[7];let l;e[8]!==t?(l=t("downloadApp.appleSiliconNote"),e[8]=t,e[9]=l):l=e[9];let a;e[10]!==l?(a=i.jsx("p",{children:l}),e[10]=l,e[11]=a):a=e[11];let c;e[12]!==r||e[13]!==a?(c=i.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[r,a]}),e[12]=r,e[13]=a,e[14]=c):c=e[14];let d;return e[15]!==s||e[16]!==c?(d=i.jsxs(i.Fragment,{children:[s,c]}),e[15]=s,e[16]=c,e[17]=d):d=e[17],d}function se(){const e=y.c(42),t=T();let n;e[0]!==t?(n=t("downloadApp.copiedLabelLinux"),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==n?(s=i.jsx(P,{copiedLabel:n}),e[2]=n,e[3]=s):s=e[3];let o;e[4]!==t?(o=t("downloadApp.linuxInstallerHint"),e[4]=t,e[5]=o):o=e[5];let r;e[6]!==o?(r=i.jsx("p",{children:o}),e[6]=o,e[7]=r):r=e[7];let l;e[8]!==t?(l=t("downloadApp.linuxArchNote"),e[8]=t,e[9]=l):l=e[9];let a;e[10]!==l?(a=i.jsx("p",{children:l}),e[10]=l,e[11]=a):a=e[11];let c;e[12]!==r||e[13]!==a?(c=i.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[r,a]}),e[12]=r,e[13]=a,e[14]=c):c=e[14];let d;e[15]!==t?(d=t("downloadApp.linuxDirectDownloadHint"),e[15]=t,e[16]=d):d=e[16];let u;e[17]!==d?(u=i.jsx("p",{children:d}),e[17]=d,e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=ee("4.321.6"),e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[20]=m):m=e[20];let p;e[21]!==t?(p=t("downloadApp.downloadAppImage"),e[21]=t,e[22]=p):p=e[22];let h;e[23]!==p?(h=i.jsx(L,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:i.jsxs("a",{href:f,rel:"noreferrer",children:[m,p]})}),e[23]=p,e[24]=h):h=e[24];let S;e[25]!==t?(S=t("downloadApp.linuxChmodHint"),e[25]=t,e[26]=S):S=e[26];let I;e[27]!==S?(I=i.jsx("p",{children:S}),e[27]=S,e[28]=I):I=e[28];let g;e[29]!==t?(g=t("downloadApp.allReleases"),e[29]=t,e[30]=g):g=e[30];let x;e[31]!==g?(x=i.jsx("a",{href:Z,target:"_blank",rel:"noreferrer",className:"underline-offset-2 hover:text-foreground hover:underline",children:g}),e[31]=g,e[32]=x):x=e[32];let A;e[33]!==h||e[34]!==I||e[35]!==x||e[36]!==u?(A=i.jsxs("div",{className:"flex flex-col items-start gap-2 border-t pt-4 text-xs text-muted-foreground",children:[u,h,I,x]}),e[33]=h,e[34]=I,e[35]=x,e[36]=u,e[37]=A):A=e[37];let _;return e[38]!==s||e[39]!==A||e[40]!==c?(_=i.jsxs(i.Fragment,{children:[s,c,A]}),e[38]=s,e[39]=A,e[40]=c,e[41]=_):_=e[41],_}function je(e){const t=y.c(19),{open:n,onOpenChange:s}=e,o=T();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=te(),t[0]=r):r=t[0];const l=r;let a;t[1]!==o?(a=o("downloadApp.title"),t[1]=o,t[2]=a):a=t[2];let c;t[3]!==a?(c=i.jsx(J,{children:a}),t[3]=a,t[4]=c):c=t[4];let d;t[5]!==o?(d=o(l?"downloadApp.linuxDescription":"downloadApp.description"),t[5]=o,t[6]=d):d=t[6];let u;t[7]!==d?(u=i.jsx(K,{children:d}),t[7]=d,t[8]=u):u=t[8];let f;t[9]!==c||t[10]!==u?(f=i.jsxs(F,{children:[c,u]}),t[9]=c,t[10]=u,t[11]=f):f=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=l?i.jsx(se,{}):i.jsx(oe,{}),t[12]=m):m=t[12];let p;t[13]!==f?(p=i.jsxs(G,{className:"sm:max-w-md",children:[f,m]}),t[13]=f,t[14]=p):p=t[14];let h;return t[15]!==s||t[16]!==n||t[17]!==p?(h=i.jsx(W,{open:n,onOpenChange:s,children:p}),t[15]=s,t[16]=n,t[17]=p,t[18]=h):h=t[18],h}const re=1e4,Te="true",R=2;function N(e,t){return U.chatAutosend(e,t)}function ae(e){return e==="pending"||e==="sending"}function le(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;const n=t;let s=0;n.status==="sending"?s=n.retryAt===void 0?1:R:n.retryAt!==void 0&&(s=1);const o=n.attempt===void 0?s:n.attempt;return typeof n.createdAt!="number"||typeof n.message!="object"||!ae(n.status)||n.retryAt!==void 0&&typeof n.retryAt!="number"||typeof o!="number"||!Number.isInteger(o)||o<0||o>R?null:{...t,attempt:o}}function De(e,t,n,s,o=Date.now()){const r={message:s,createdAt:o,status:"pending",attempt:0};return e.setItem(N(t,n),JSON.stringify(r)),r}function ie(e,t,n){const s=N(t,n),o=le(e.getItem(s));return o||(e.removeItem(s),null)}function Ne(e,t,n,s=Date.now()){const o=N(t,n),r=ie(e,t,n);if(!r||r.status!=="pending")return null;if(r.attempt>=R)return e.removeItem(o),null;const l=r.retryAt??r.createdAt;if(s-l>=re)return e.removeItem(o),null;const a={...r,status:"sending",attempt:r.attempt+1};return e.setItem(o,JSON.stringify(a)),{message:a.message,createdAt:a.createdAt,attempt:a.attempt}}function Re(e,t,n){e.removeItem(N(t,n))}const ce="/shell/$org/org-shell/agent-shell";function de(e){return e.threadInSearch||!e.threadId?{to:"."}:{to:"/$org/$taskId",params:{org:e.orgSlug,taskId:e.threadId}}}function ue(e){return e.taskIdParam??e.threadSearch??null}function ke(){const e=y.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=D(t);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[1]=s):s=e[1];const o=k(s);let r;return e[2]!==n.taskId||e[3]!==o.thread?(r=ue({taskIdParam:n.taskId,threadSearch:o.thread}),e[2]=n.taskId,e[3]=o.thread,e[4]=r):r=e[4],r}function fe(e){return(e.onAgentsRoute||e.onHomeRoute||e.legacyRoute)&&e.virtualMcpIdSearch||void 0}function me(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0],D(t).taskId!==void 0}function pe(){const e=y.c(6);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=k(t),s=M(),o=me(),r=s===j.agents,l=s===j.home;let a;return e[1]!==o||e[2]!==n.virtualmcpid||e[3]!==r||e[4]!==l?(a=fe({virtualMcpIdSearch:n.virtualmcpid,onAgentsRoute:r,onHomeRoute:l,legacyRoute:o}),e[1]=o,e[2]=n.virtualmcpid,e[3]=r,e[4]=l,e[5]=a):a=e[5],a}function Le(){const e=y.c(3),{org:t}=E(),n=pe();let s;return e[0]!==t||e[1]!==n?(s=n??$(t.id).id,e[0]=t,e[1]=n,e[2]=s):s=e[2],s}function he(e){const{virtualmcpid:t,...n}=e.changes;return{...e.prev,...n,thread:e.threadId}}function Ee(e){return e.routeAgentId??e.threadVirtualMcpId??null}function ge(e){if(e.targetVirtualMcpId===void 0)return{kind:"stay",project:e.currentProject};const t=e.targetVirtualMcpId===e.decopilotId?void 0:e.targetVirtualMcpId;return t!==void 0&&e.currentProject===void 0?{kind:"relocate",project:t}:{kind:"stay",project:t}}function xe(){const e=y.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=D(t);let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:ce,shouldThrow:!1},e[1]=s):s=e[1],!!H(s)&&n.taskId===void 0}function Me(){const e=y.c(12),t=V();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const s=D(n),o=xe(),{org:r}=E(),l=s.org??"",a=M()===j.agents;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[1]=c):c=e[1];const d=k(c),u=a?d.virtualmcpid:void 0,f=s.panel;let m;e[2]!==r.id?(m=$(r.id),e[2]=r.id,e[3]=m):m=e[3];const p=m.id;let h;return e[4]!==f||e[5]!==u||e[6]!==p||e[7]!==t||e[8]!==a||e[9]!==l||e[10]!==o?(h=(S,I,g)=>{const x=de({threadInSearch:o,orgSlug:l,threadId:S}),A=g?.replace??!1;if(x.to==="/$org/$taskId")return t({to:x.to,params:x.params,search:I,replace:A});const _=ge({currentProject:u,targetVirtualMcpId:g?.virtualMcpId,decopilotId:p}),w=g?.view&&g.view.tabId!==void 0?z(g.view.tabId):g?.view?{panel:void 0,payload:B()}:null,C=_.kind==="relocate"&&!a,b=v=>he({prev:C?{sidepanel:v.sidepanel}:v,changes:{...I(v),...w?.payload??{}},threadId:S});return _.kind==="relocate"?t({to:j.agents,params:{org:l,panel:w?w.panel:f},search:v=>({...typeof b=="function"?b(v):b,virtualmcpid:_.project}),replace:A}):t({to:".",params:v=>w?{...v,panel:w.panel}:v,search:v=>({...typeof b=="function"?b(v):b,...a?{virtualmcpid:_.project}:{}}),replace:A})},e[4]=f,e[5]=u,e[6]=p,e[7]=t,e[8]=a,e[9]=l,e[10]=o,e[11]=h):h=e[11],h}export{Te as A,je as D,te as a,Me as b,ke as c,Le as d,Ne as e,Re as f,we as i,Ee as r,pe as u,De as w};
|
|
1
|
+
import{c as y,b as T,j as i,B as L,r as O,J as U,u as k,f as D,W as E,d as V,Z as H,y as z,dz as B}from"./index-DuTFQdyn.js";import{d as J,h as K,c as F,b as G,D as W}from"./dialog-MZN5GEGy.js";import{i as Y}from"./Check-BX2gygbe.js";import{a as Q}from"./Copy01-C__uU62x.js";import{n as X}from"./Download01-BSiLOFk1.js";import{u as M,D as j}from"./use-destination-route-BNo7ZUVL.js";import{a as $}from"./constants-DNuUCxmW.js";const Z="https://github.com/decocms/studio/releases";function q(){return`curl -fsSL ${window.location.origin}/install.sh | sh`}function ee(e){return`https://github.com/decocms/studio/releases/download/native-v${e}/deco-${e}-linux-x86_64.AppImage`}function we(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)&&!("ontouchend"in document)}function te(){return typeof navigator<"u"&&/Linux/.test(navigator.platform)&&!/Android/.test(navigator.userAgent)&&!("ontouchend"in document)}async function ne(e,t){if(!e)return!1;try{return await e.writeText(t),!0}catch{return!1}}function P(e){const t=y.c(12),{copiedLabel:n}=e,s=T(),[o,r]=O.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=q(),t[0]=l):l=t[0];const a=l;let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("code",{className:"block rounded-md border bg-muted px-3 py-2.5 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap select-all",children:a}),t[1]=c):c=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{ne(navigator.clipboard,a).then(p=>{p&&(r(!0),setTimeout(()=>r(!1),2e3))})},t[2]=d):d=t[2];let u;t[3]!==o?(u=o?i.jsx(Y,{size:16}):i.jsx(Q,{size:16}),t[3]=o,t[4]=u):u=t[4];let f;t[5]!==o||t[6]!==n||t[7]!==s?(f=o?n:s("downloadApp.copyLabel"),t[5]=o,t[6]=n,t[7]=s,t[8]=f):f=t[8];let m;return t[9]!==u||t[10]!==f?(m=i.jsxs("div",{className:"flex flex-col gap-3",children:[c,i.jsxs(L,{type:"button",className:"w-full gap-2",onClick:d,children:[u,f]})]}),t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function oe(){const e=y.c(18),t=T();let n;e[0]!==t?(n=t("downloadApp.copiedLabel"),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==n?(s=i.jsx(P,{copiedLabel:n}),e[2]=n,e[3]=s):s=e[3];let o;e[4]!==t?(o=t("downloadApp.terminalHint"),e[4]=t,e[5]=o):o=e[5];let r;e[6]!==o?(r=i.jsx("p",{children:o}),e[6]=o,e[7]=r):r=e[7];let l;e[8]!==t?(l=t("downloadApp.appleSiliconNote"),e[8]=t,e[9]=l):l=e[9];let a;e[10]!==l?(a=i.jsx("p",{children:l}),e[10]=l,e[11]=a):a=e[11];let c;e[12]!==r||e[13]!==a?(c=i.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[r,a]}),e[12]=r,e[13]=a,e[14]=c):c=e[14];let d;return e[15]!==s||e[16]!==c?(d=i.jsxs(i.Fragment,{children:[s,c]}),e[15]=s,e[16]=c,e[17]=d):d=e[17],d}function se(){const e=y.c(42),t=T();let n;e[0]!==t?(n=t("downloadApp.copiedLabelLinux"),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==n?(s=i.jsx(P,{copiedLabel:n}),e[2]=n,e[3]=s):s=e[3];let o;e[4]!==t?(o=t("downloadApp.linuxInstallerHint"),e[4]=t,e[5]=o):o=e[5];let r;e[6]!==o?(r=i.jsx("p",{children:o}),e[6]=o,e[7]=r):r=e[7];let l;e[8]!==t?(l=t("downloadApp.linuxArchNote"),e[8]=t,e[9]=l):l=e[9];let a;e[10]!==l?(a=i.jsx("p",{children:l}),e[10]=l,e[11]=a):a=e[11];let c;e[12]!==r||e[13]!==a?(c=i.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[r,a]}),e[12]=r,e[13]=a,e[14]=c):c=e[14];let d;e[15]!==t?(d=t("downloadApp.linuxDirectDownloadHint"),e[15]=t,e[16]=d):d=e[16];let u;e[17]!==d?(u=i.jsx("p",{children:d}),e[17]=d,e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=ee("4.322.0"),e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[20]=m):m=e[20];let p;e[21]!==t?(p=t("downloadApp.downloadAppImage"),e[21]=t,e[22]=p):p=e[22];let h;e[23]!==p?(h=i.jsx(L,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:i.jsxs("a",{href:f,rel:"noreferrer",children:[m,p]})}),e[23]=p,e[24]=h):h=e[24];let S;e[25]!==t?(S=t("downloadApp.linuxChmodHint"),e[25]=t,e[26]=S):S=e[26];let I;e[27]!==S?(I=i.jsx("p",{children:S}),e[27]=S,e[28]=I):I=e[28];let g;e[29]!==t?(g=t("downloadApp.allReleases"),e[29]=t,e[30]=g):g=e[30];let x;e[31]!==g?(x=i.jsx("a",{href:Z,target:"_blank",rel:"noreferrer",className:"underline-offset-2 hover:text-foreground hover:underline",children:g}),e[31]=g,e[32]=x):x=e[32];let A;e[33]!==h||e[34]!==I||e[35]!==x||e[36]!==u?(A=i.jsxs("div",{className:"flex flex-col items-start gap-2 border-t pt-4 text-xs text-muted-foreground",children:[u,h,I,x]}),e[33]=h,e[34]=I,e[35]=x,e[36]=u,e[37]=A):A=e[37];let _;return e[38]!==s||e[39]!==A||e[40]!==c?(_=i.jsxs(i.Fragment,{children:[s,c,A]}),e[38]=s,e[39]=A,e[40]=c,e[41]=_):_=e[41],_}function je(e){const t=y.c(19),{open:n,onOpenChange:s}=e,o=T();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=te(),t[0]=r):r=t[0];const l=r;let a;t[1]!==o?(a=o("downloadApp.title"),t[1]=o,t[2]=a):a=t[2];let c;t[3]!==a?(c=i.jsx(J,{children:a}),t[3]=a,t[4]=c):c=t[4];let d;t[5]!==o?(d=o(l?"downloadApp.linuxDescription":"downloadApp.description"),t[5]=o,t[6]=d):d=t[6];let u;t[7]!==d?(u=i.jsx(K,{children:d}),t[7]=d,t[8]=u):u=t[8];let f;t[9]!==c||t[10]!==u?(f=i.jsxs(F,{children:[c,u]}),t[9]=c,t[10]=u,t[11]=f):f=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=l?i.jsx(se,{}):i.jsx(oe,{}),t[12]=m):m=t[12];let p;t[13]!==f?(p=i.jsxs(G,{className:"sm:max-w-md",children:[f,m]}),t[13]=f,t[14]=p):p=t[14];let h;return t[15]!==s||t[16]!==n||t[17]!==p?(h=i.jsx(W,{open:n,onOpenChange:s,children:p}),t[15]=s,t[16]=n,t[17]=p,t[18]=h):h=t[18],h}const re=1e4,Te="true",R=2;function N(e,t){return U.chatAutosend(e,t)}function ae(e){return e==="pending"||e==="sending"}function le(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;const n=t;let s=0;n.status==="sending"?s=n.retryAt===void 0?1:R:n.retryAt!==void 0&&(s=1);const o=n.attempt===void 0?s:n.attempt;return typeof n.createdAt!="number"||typeof n.message!="object"||!ae(n.status)||n.retryAt!==void 0&&typeof n.retryAt!="number"||typeof o!="number"||!Number.isInteger(o)||o<0||o>R?null:{...t,attempt:o}}function De(e,t,n,s,o=Date.now()){const r={message:s,createdAt:o,status:"pending",attempt:0};return e.setItem(N(t,n),JSON.stringify(r)),r}function ie(e,t,n){const s=N(t,n),o=le(e.getItem(s));return o||(e.removeItem(s),null)}function Ne(e,t,n,s=Date.now()){const o=N(t,n),r=ie(e,t,n);if(!r||r.status!=="pending")return null;if(r.attempt>=R)return e.removeItem(o),null;const l=r.retryAt??r.createdAt;if(s-l>=re)return e.removeItem(o),null;const a={...r,status:"sending",attempt:r.attempt+1};return e.setItem(o,JSON.stringify(a)),{message:a.message,createdAt:a.createdAt,attempt:a.attempt}}function Re(e,t,n){e.removeItem(N(t,n))}const ce="/shell/$org/org-shell/agent-shell";function de(e){return e.threadInSearch||!e.threadId?{to:"."}:{to:"/$org/$taskId",params:{org:e.orgSlug,taskId:e.threadId}}}function ue(e){return e.taskIdParam??e.threadSearch??null}function ke(){const e=y.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=D(t);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[1]=s):s=e[1];const o=k(s);let r;return e[2]!==n.taskId||e[3]!==o.thread?(r=ue({taskIdParam:n.taskId,threadSearch:o.thread}),e[2]=n.taskId,e[3]=o.thread,e[4]=r):r=e[4],r}function fe(e){return(e.onAgentsRoute||e.onHomeRoute||e.legacyRoute)&&e.virtualMcpIdSearch||void 0}function me(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0],D(t).taskId!==void 0}function pe(){const e=y.c(6);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=k(t),s=M(),o=me(),r=s===j.agents,l=s===j.home;let a;return e[1]!==o||e[2]!==n.virtualmcpid||e[3]!==r||e[4]!==l?(a=fe({virtualMcpIdSearch:n.virtualmcpid,onAgentsRoute:r,onHomeRoute:l,legacyRoute:o}),e[1]=o,e[2]=n.virtualmcpid,e[3]=r,e[4]=l,e[5]=a):a=e[5],a}function Le(){const e=y.c(3),{org:t}=E(),n=pe();let s;return e[0]!==t||e[1]!==n?(s=n??$(t.id).id,e[0]=t,e[1]=n,e[2]=s):s=e[2],s}function he(e){const{virtualmcpid:t,...n}=e.changes;return{...e.prev,...n,thread:e.threadId}}function Ee(e){return e.routeAgentId??e.threadVirtualMcpId??null}function ge(e){if(e.targetVirtualMcpId===void 0)return{kind:"stay",project:e.currentProject};const t=e.targetVirtualMcpId===e.decopilotId?void 0:e.targetVirtualMcpId;return t!==void 0&&e.currentProject===void 0?{kind:"relocate",project:t}:{kind:"stay",project:t}}function xe(){const e=y.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=D(t);let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:ce,shouldThrow:!1},e[1]=s):s=e[1],!!H(s)&&n.taskId===void 0}function Me(){const e=y.c(12),t=V();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const s=D(n),o=xe(),{org:r}=E(),l=s.org??"",a=M()===j.agents;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[1]=c):c=e[1];const d=k(c),u=a?d.virtualmcpid:void 0,f=s.panel;let m;e[2]!==r.id?(m=$(r.id),e[2]=r.id,e[3]=m):m=e[3];const p=m.id;let h;return e[4]!==f||e[5]!==u||e[6]!==p||e[7]!==t||e[8]!==a||e[9]!==l||e[10]!==o?(h=(S,I,g)=>{const x=de({threadInSearch:o,orgSlug:l,threadId:S}),A=g?.replace??!1;if(x.to==="/$org/$taskId")return t({to:x.to,params:x.params,search:I,replace:A});const _=ge({currentProject:u,targetVirtualMcpId:g?.virtualMcpId,decopilotId:p}),w=g?.view&&g.view.tabId!==void 0?z(g.view.tabId):g?.view?{panel:void 0,payload:B()}:null,C=_.kind==="relocate"&&!a,b=v=>he({prev:C?{sidepanel:v.sidepanel}:v,changes:{...I(v),...w?.payload??{}},threadId:S});return _.kind==="relocate"?t({to:j.agents,params:{org:l,panel:w?w.panel:f},search:v=>({...typeof b=="function"?b(v):b,virtualmcpid:_.project}),replace:A}):t({to:".",params:v=>w?{...v,panel:w.panel}:v,search:v=>({...typeof b=="function"?b(v):b,...a?{virtualmcpid:_.project}:{}}),replace:A})},e[4]=f,e[5]=u,e[6]=p,e[7]=t,e[8]=a,e[9]=l,e[10]=o,e[11]=h):h=e[11],h}export{Te as A,je as D,te as a,Me as b,ke as c,Le as d,Ne as e,Re as f,we as i,Ee as r,pe as u,De as w};
|