@knpkv/control-center 0.9.4 → 0.9.5
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/.vite/manifest.json +406 -406
- package/dist/client/assets/ActiveWorkPage-CeWw2uZl.js +2 -0
- package/dist/client/assets/ActiveWorkPage-CeWw2uZl.js.map +1 -0
- package/dist/client/assets/{AgentPage-YiYORLod.js → AgentPage-BAy7IgjJ.js} +3 -3
- package/dist/client/assets/AgentPage-BAy7IgjJ.js.map +1 -0
- package/dist/client/assets/{AtlassianOAuthCallbackPage-PfsrTytb.js → AtlassianOAuthCallbackPage-DDCTmcmB.js} +2 -2
- package/dist/client/assets/AtlassianOAuthCallbackPage-DDCTmcmB.js.map +1 -0
- package/dist/client/assets/{AuthorizedSharePage-BCwnILXF.js → AuthorizedSharePage-BZPfotuK.js} +2 -2
- package/dist/client/assets/AuthorizedSharePage-BZPfotuK.js.map +1 -0
- package/dist/client/assets/{BrowserSessionHydrator-BAb76EvO.js → BrowserSessionHydrator-B3yI9F2z.js} +2 -2
- package/dist/client/assets/{BrowserSessionHydrator-BAb76EvO.js.map → BrowserSessionHydrator-B3yI9F2z.js.map} +1 -1
- package/dist/client/assets/{CommandSearch-BSVXQfjF.js → CommandSearch-BrwiVFBI.js} +2 -2
- package/dist/client/assets/{CommandSearch-BSVXQfjF.js.map → CommandSearch-BrwiVFBI.js.map} +1 -1
- package/dist/client/assets/Domain-DH_T_LJ8.js.map +1 -1
- package/dist/client/assets/{ItemsPage-BzinDuxs.js → ItemsPage-CYmo7Dkm.js} +2 -2
- package/dist/client/assets/ItemsPage-CYmo7Dkm.js.map +1 -0
- package/dist/client/assets/{OpenPullRequestPage-BABGk9v2.js → OpenPullRequestPage-BcwTerpY.js} +2 -2
- package/dist/client/assets/OpenPullRequestPage-BcwTerpY.js.map +1 -0
- package/dist/client/assets/{Pages-Bfn7_LhJ.js → Pages-Cj24BSjm.js} +2 -2
- package/dist/client/assets/{Pages-Bfn7_LhJ.js.map → Pages-Cj24BSjm.js.map} +1 -1
- package/dist/client/assets/{PairPage-4meDmW_A.js → PairPage-JhivkRf1.js} +2 -2
- package/dist/client/assets/PairPage-JhivkRf1.js.map +1 -0
- package/dist/client/assets/PortfolioOverview-C0RZCx6V.js +2 -0
- package/dist/client/assets/PortfolioOverview-C0RZCx6V.js.map +1 -0
- package/dist/client/assets/{PullRequestReviewPanel-68vgbLzs.js → PullRequestReviewPanel-BeYAld4m.js} +4 -4
- package/dist/client/assets/{PullRequestReviewPanel-68vgbLzs.js.map → PullRequestReviewPanel-BeYAld4m.js.map} +1 -1
- package/dist/client/assets/ReleaseRoute-1bUQCSJi.js +2 -0
- package/dist/client/assets/ReleaseRoute-1bUQCSJi.js.map +1 -0
- package/dist/client/assets/{ReleaseWorkset-DcI6qwPE.js → ReleaseWorkset-DGufwIFe.js} +2 -2
- package/dist/client/assets/ReleaseWorkset-DGufwIFe.js.map +1 -0
- package/dist/client/assets/{ReviewSuggestionOverview-kNqjbwKQ.js → ReviewSuggestionOverview-CfU-Ynzq.js} +2 -2
- package/dist/client/assets/{ReviewSuggestionOverview-kNqjbwKQ.js.map → ReviewSuggestionOverview-CfU-Ynzq.js.map} +1 -1
- package/dist/client/assets/{ReviewSuggestionPublicationSurface-BtoYEprT.js → ReviewSuggestionPublicationSurface-DA-3PPs_.js} +2 -2
- package/dist/client/assets/ReviewSuggestionPublicationSurface-DA-3PPs_.js.map +1 -0
- package/dist/client/assets/{ServicesPage-DihUx1kr.js → ServicesPage-6G9OTRDn.js} +2 -2
- package/dist/client/assets/ServicesPage-6G9OTRDn.js.map +1 -0
- package/dist/client/assets/{TimelinePage-DyluBeEt.js → TimelinePage-D6YUtggO.js} +2 -2
- package/dist/client/assets/TimelinePage-D6YUtggO.js.map +1 -0
- package/dist/client/assets/{WorkspaceEntityLink-DjonIGqM.js → WorkspaceEntityLink-BqUurz8P.js} +2 -2
- package/dist/client/assets/{WorkspaceEntityLink-DjonIGqM.js.map → WorkspaceEntityLink-BqUurz8P.js.map} +1 -1
- package/dist/client/assets/{WorkspaceEntityRoute-DUVwW5WN.js → WorkspaceEntityRoute-CfupCFGN.js} +4 -4
- package/dist/client/assets/{WorkspaceEntityRoute-DUVwW5WN.js.map → WorkspaceEntityRoute-CfupCFGN.js.map} +1 -1
- package/dist/client/assets/{WorkspaceHomeLink-DSGM8jZK.js → WorkspaceHomeLink-DkAnxFk1.js} +2 -2
- package/dist/client/assets/{WorkspaceHomeLink-DSGM8jZK.js.map → WorkspaceHomeLink-DkAnxFk1.js.map} +1 -1
- package/dist/client/assets/{WorkspacePullRequestDetails-Z3MfihsH.js → WorkspacePullRequestDetails-SexYOZUB.js} +3 -3
- package/dist/client/assets/{WorkspacePullRequestDetails-Z3MfihsH.js.map → WorkspacePullRequestDetails-SexYOZUB.js.map} +1 -1
- package/dist/client/assets/{WorkspaceReleaseLayout-S6XHWEwh.js → WorkspaceReleaseLayout-J_IWrKc9.js} +2 -2
- package/dist/client/assets/{WorkspaceReleaseLayout-S6XHWEwh.js.map → WorkspaceReleaseLayout-J_IWrKc9.js.map} +1 -1
- package/dist/client/assets/{WorkspaceSettingsPage-Dn_eDC3m.js → WorkspaceSettingsPage-CFB0X_Oz.js} +2 -2
- package/dist/client/assets/WorkspaceSettingsPage-CFB0X_Oz.js.map +1 -0
- package/dist/client/assets/{angular-html-B-gwpVlh-DEM_d4RI.js → angular-html-B-gwpVlh-BHk2rITT.js} +2 -2
- package/dist/client/assets/{angular-html-B-gwpVlh-DEM_d4RI.js.map → angular-html-B-gwpVlh-BHk2rITT.js.map} +1 -1
- package/dist/client/assets/{angular-ts-BdaH9qH_-6UMLodBB.js → angular-ts-BdaH9qH_-DDpR3-gU.js} +2 -2
- package/dist/client/assets/{angular-ts-BdaH9qH_-6UMLodBB.js.map → angular-ts-BdaH9qH_-DDpR3-gU.js.map} +1 -1
- package/dist/client/assets/{apl-BLTDDucx-DIkkahEc.js → apl-BLTDDucx-C5lAAuBL.js} +2 -2
- package/dist/client/assets/{apl-BLTDDucx-DIkkahEc.js.map → apl-BLTDDucx-C5lAAuBL.js.map} +1 -1
- package/dist/client/assets/{astro-CM3EIsEH-D5DYxAYu.js → astro-CM3EIsEH-C-4mMpDY.js} +2 -2
- package/dist/client/assets/{astro-CM3EIsEH-D5DYxAYu.js.map → astro-CM3EIsEH-C-4mMpDY.js.map} +1 -1
- package/dist/client/assets/{blade-BuLZ1b4i-CBKkB_Nt.js → blade-BuLZ1b4i-Bo26Vrie.js} +2 -2
- package/dist/client/assets/{blade-BuLZ1b4i-CBKkB_Nt.js.map → blade-BuLZ1b4i-Bo26Vrie.js.map} +1 -1
- package/dist/client/assets/{c-BOe7FNWg-C15nlYFX.js → c-BOe7FNWg-Bn-hh2gC.js} +2 -2
- package/dist/client/assets/{c-BOe7FNWg-C15nlYFX.js.map → c-BOe7FNWg-Bn-hh2gC.js.map} +1 -1
- package/dist/client/assets/{chapel-DS426I0C-DoL0pgIr.js → chapel-DS426I0C-DZfMl2AF.js} +2 -2
- package/dist/client/assets/{chapel-DS426I0C-DoL0pgIr.js.map → chapel-DS426I0C-DZfMl2AF.js.map} +1 -1
- package/dist/client/assets/{cobol-D88xw2SU-DlPiznQQ.js → cobol-D88xw2SU-Dszzocsd.js} +2 -2
- package/dist/client/assets/{cobol-D88xw2SU-DlPiznQQ.js.map → cobol-D88xw2SU-Dszzocsd.js.map} +1 -1
- package/dist/client/assets/{coffee-9O-pYXz5-QB78c27T.js → coffee-9O-pYXz5-B-EAY7Cr.js} +2 -2
- package/dist/client/assets/{coffee-9O-pYXz5-QB78c27T.js.map → coffee-9O-pYXz5-B-EAY7Cr.js.map} +1 -1
- package/dist/client/assets/{controlCenterRelayDock-CDyCPu8u.js → controlCenterRelayDock-Bq4z8Xad.js} +3 -3
- package/dist/client/assets/{controlCenterRelayDock-CDyCPu8u.js.map → controlCenterRelayDock-Bq4z8Xad.js.map} +1 -1
- package/dist/client/assets/{controlCenterRelayDockChrome-BWLgzJhc.js → controlCenterRelayDockChrome-M45VQcSE.js} +2 -2
- package/dist/client/assets/{controlCenterRelayDockChrome-BWLgzJhc.js.map → controlCenterRelayDockChrome-M45VQcSE.js.map} +1 -1
- package/dist/client/assets/{cpp-CPk7VU6o-XEasjJQb.js → cpp-CPk7VU6o-B1PTCDWN.js} +2 -2
- package/dist/client/assets/{cpp-CPk7VU6o-XEasjJQb.js.map → cpp-CPk7VU6o-B1PTCDWN.js.map} +1 -1
- package/dist/client/assets/{crystal-CRftOMVe-Cl7VOKqv.js → crystal-CRftOMVe-3NFSGC4Y.js} +2 -2
- package/dist/client/assets/{crystal-CRftOMVe-Cl7VOKqv.js.map → crystal-CRftOMVe-3NFSGC4Y.js.map} +1 -1
- package/dist/client/assets/{css-DKjIhbA_-BqYkMclh.js → css-DKjIhbA_-BZzy1gno.js} +2 -2
- package/dist/client/assets/{css-DKjIhbA_-BqYkMclh.js.map → css-DKjIhbA_-BZzy1gno.js.map} +1 -1
- package/dist/client/assets/{diff-c2VIds2u.js → diff-CuvBMVEl.js} +3 -3
- package/dist/client/assets/{diff-c2VIds2u.js.map → diff-CuvBMVEl.js.map} +1 -1
- package/dist/client/assets/{edge-CZci3foK-CcvbLJND.js → edge-CZci3foK-BdZTWeOq.js} +2 -2
- package/dist/client/assets/{edge-CZci3foK-CcvbLJND.js.map → edge-CZci3foK-BdZTWeOq.js.map} +1 -1
- package/dist/client/assets/{elixir-BFbWRTPN-DCo1tsYk.js → elixir-BFbWRTPN-BSsfSNAc.js} +2 -2
- package/dist/client/assets/{elixir-BFbWRTPN-DCo1tsYk.js.map → elixir-BFbWRTPN-BSsfSNAc.js.map} +1 -1
- package/dist/client/assets/{elm-BFCSOEGh-KAuEEkOS.js → elm-BFCSOEGh-B7etdM00.js} +2 -2
- package/dist/client/assets/{elm-BFCSOEGh-KAuEEkOS.js.map → elm-BFCSOEGh-B7etdM00.js.map} +1 -1
- package/dist/client/assets/{erb-C0EkZJvn-3O5TlDRJ.js → erb-C0EkZJvn-BUpElafA.js} +2 -2
- package/dist/client/assets/{erb-C0EkZJvn-3O5TlDRJ.js.map → erb-C0EkZJvn-BUpElafA.js.map} +1 -1
- package/dist/client/assets/{git-rebase-DBDs07B2-BKfziPiX.js → git-rebase-DBDs07B2-3YW7dddl.js} +2 -2
- package/dist/client/assets/{git-rebase-DBDs07B2-BKfziPiX.js.map → git-rebase-DBDs07B2-3YW7dddl.js.map} +1 -1
- package/dist/client/assets/{glimmer-js-oqYt1Bty-oOPiIwDh.js → glimmer-js-oqYt1Bty-Q18N5198.js} +2 -2
- package/dist/client/assets/{glimmer-js-oqYt1Bty-oOPiIwDh.js.map → glimmer-js-oqYt1Bty-Q18N5198.js.map} +1 -1
- package/dist/client/assets/{glimmer-ts-CjmgbZTn-C8gjUbKN.js → glimmer-ts-CjmgbZTn-DflPUBBN.js} +2 -2
- package/dist/client/assets/{glimmer-ts-CjmgbZTn-C8gjUbKN.js.map → glimmer-ts-CjmgbZTn-DflPUBBN.js.map} +1 -1
- package/dist/client/assets/{glsl-BqUMGrwT-5PoVKbXD.js → glsl-BqUMGrwT-DZSnNyRQ.js} +2 -2
- package/dist/client/assets/{glsl-BqUMGrwT-5PoVKbXD.js.map → glsl-BqUMGrwT-DZSnNyRQ.js.map} +1 -1
- package/dist/client/assets/{graphql-CEJryLGF-Bx3HP-fV.js → graphql-CEJryLGF-BxoDC-bv.js} +2 -2
- package/dist/client/assets/{graphql-CEJryLGF-Bx3HP-fV.js.map → graphql-CEJryLGF-BxoDC-bv.js.map} +1 -1
- package/dist/client/assets/{hack-DwBIwaGr-C2bRI1k_.js → hack-DwBIwaGr-BD9UbS9V.js} +2 -2
- package/dist/client/assets/{hack-DwBIwaGr-C2bRI1k_.js.map → hack-DwBIwaGr-BD9UbS9V.js.map} +1 -1
- package/dist/client/assets/{haml-BgD6GFV2-C-E92qmq.js → haml-BgD6GFV2-tYRnxnkA.js} +2 -2
- package/dist/client/assets/{haml-BgD6GFV2-C-E92qmq.js.map → haml-BgD6GFV2-tYRnxnkA.js.map} +1 -1
- package/dist/client/assets/{handlebars-DAEAtsmp-B3Qkz-fG.js → handlebars-DAEAtsmp-CzuHoTaP.js} +2 -2
- package/dist/client/assets/{handlebars-DAEAtsmp-B3Qkz-fG.js.map → handlebars-DAEAtsmp-CzuHoTaP.js.map} +1 -1
- package/dist/client/assets/{html-B63qAdeQ-mzUq7RfB.js → html-B63qAdeQ-BvgXBi7v.js} +2 -2
- package/dist/client/assets/{html-B63qAdeQ-mzUq7RfB.js.map → html-B63qAdeQ-BvgXBi7v.js.map} +1 -1
- package/dist/client/assets/{html-derivative-DliF0Izh-DKttJgx1.js → html-derivative-DliF0Izh-BdazZa_A.js} +2 -2
- package/dist/client/assets/{html-derivative-DliF0Izh-DKttJgx1.js.map → html-derivative-DliF0Izh-BdazZa_A.js.map} +1 -1
- package/dist/client/assets/{http-BPdteiK2-BzL978Ty.js → http-BPdteiK2-DscIPq9Z.js} +2 -2
- package/dist/client/assets/{http-BPdteiK2-BzL978Ty.js.map → http-BPdteiK2-DscIPq9Z.js.map} +1 -1
- package/dist/client/assets/{hurl-y6bQoMbn-VmDIgNNg.js → hurl-y6bQoMbn-BniTWOKW.js} +2 -2
- package/dist/client/assets/{hurl-y6bQoMbn-VmDIgNNg.js.map → hurl-y6bQoMbn-BniTWOKW.js.map} +1 -1
- package/dist/client/assets/{index-BHQ_NP1r.js → index-DlDEYM2e.js} +3 -3
- package/dist/client/assets/{index-BHQ_NP1r.js.map → index-DlDEYM2e.js.map} +1 -1
- package/dist/client/assets/index-vGJLpF-N.css +1 -0
- package/dist/client/assets/{java-HDTZqoJ--r_CiLO3G.js → java-HDTZqoJ--DonfC-m-.js} +2 -2
- package/dist/client/assets/{java-HDTZqoJ--r_CiLO3G.js.map → java-HDTZqoJ--DonfC-m-.js.map} +1 -1
- package/dist/client/assets/{javascript-B8-PXjxO-D8IL8RVw.js → javascript-B8-PXjxO-DrojTnjU.js} +2 -2
- package/dist/client/assets/{javascript-B8-PXjxO-D8IL8RVw.js.map → javascript-B8-PXjxO-DrojTnjU.js.map} +1 -1
- package/dist/client/assets/{jinja-Li2helwk-iQ5WpNSs.js → jinja-Li2helwk-Bn7ViII1.js} +2 -2
- package/dist/client/assets/{jinja-Li2helwk-iQ5WpNSs.js.map → jinja-Li2helwk-Bn7ViII1.js.map} +1 -1
- package/dist/client/assets/{jison-D4pd2L4r-CnB2TCTC.js → jison-D4pd2L4r-CURwtPm2.js} +2 -2
- package/dist/client/assets/{jison-D4pd2L4r-CnB2TCTC.js.map → jison-D4pd2L4r-CURwtPm2.js.map} +1 -1
- package/dist/client/assets/{json-CHeq_08V-BzfhDAQG.js → json-CHeq_08V-DGJ-08B3.js} +2 -2
- package/dist/client/assets/{json-CHeq_08V-BzfhDAQG.js.map → json-CHeq_08V-DGJ-08B3.js.map} +1 -1
- package/dist/client/assets/{jsx-CTDAtxCE-BHaCLB5C.js → jsx-CTDAtxCE-B7AjYoF3.js} +2 -2
- package/dist/client/assets/{jsx-CTDAtxCE-BHaCLB5C.js.map → jsx-CTDAtxCE-B7AjYoF3.js.map} +1 -1
- package/dist/client/assets/{julia-B8HGxjvO-DUNXU97h.js → julia-B8HGxjvO-CX2HXF0x.js} +2 -2
- package/dist/client/assets/{julia-B8HGxjvO-DUNXU97h.js.map → julia-B8HGxjvO-CX2HXF0x.js.map} +1 -1
- package/dist/client/assets/{just-C1IY8eCo-CwcMki68.js → just-C1IY8eCo-194MeSWx.js} +2 -2
- package/dist/client/assets/{just-C1IY8eCo-CwcMki68.js.map → just-C1IY8eCo-194MeSWx.js.map} +1 -1
- package/dist/client/assets/{latex-CWjLpLhK-C2bYvB1V.js → latex-CWjLpLhK-CJV_bAR4.js} +2 -2
- package/dist/client/assets/{latex-CWjLpLhK-C2bYvB1V.js.map → latex-CWjLpLhK-CJV_bAR4.js.map} +1 -1
- package/dist/client/assets/{liquid-DO0vm52w-5ftSWtSQ.js → liquid-DO0vm52w-C-oH3gBH.js} +2 -2
- package/dist/client/assets/{liquid-DO0vm52w-5ftSWtSQ.js.map → liquid-DO0vm52w-C-oH3gBH.js.map} +1 -1
- package/dist/client/assets/{lua-rOZn354j-BFEal9UY.js → lua-rOZn354j-CWNr0VLI.js} +2 -2
- package/dist/client/assets/{lua-rOZn354j-BFEal9UY.js.map → lua-rOZn354j-CWNr0VLI.js.map} +1 -1
- package/dist/client/assets/{marko-CiZdnOV9-VE4QpTYR.js → marko-CiZdnOV9-D1oeBgJ5.js} +2 -2
- package/dist/client/assets/{marko-CiZdnOV9-VE4QpTYR.js.map → marko-CiZdnOV9-D1oeBgJ5.js.map} +1 -1
- package/dist/client/assets/{mdc-D1ADfxGi-DASKK9_I.js → mdc-D1ADfxGi-DDe8MjBS.js} +2 -2
- package/dist/client/assets/{mdc-D1ADfxGi-DASKK9_I.js.map → mdc-D1ADfxGi-DDe8MjBS.js.map} +1 -1
- package/dist/client/assets/{nginx-8KXIzHX2-OWn8Z957.js → nginx-8KXIzHX2-76JDQPWv.js} +2 -2
- package/dist/client/assets/{nginx-8KXIzHX2-OWn8Z957.js.map → nginx-8KXIzHX2-76JDQPWv.js.map} +1 -1
- package/dist/client/assets/{nim-CbBDSJf5-DzS23snq.js → nim-CbBDSJf5-Bg0Tpvlj.js} +2 -2
- package/dist/client/assets/{nim-CbBDSJf5-DzS23snq.js.map → nim-CbBDSJf5-Bg0Tpvlj.js.map} +1 -1
- package/dist/client/assets/{org-BlnOvN6p-mzfee9SX.js → org-BlnOvN6p-CpQvn0Ms.js} +2 -2
- package/dist/client/assets/{org-BlnOvN6p-mzfee9SX.js.map → org-BlnOvN6p-CpQvn0Ms.js.map} +1 -1
- package/dist/client/assets/patterns-CJ4c7F5A.js +2 -0
- package/dist/client/assets/patterns-CJ4c7F5A.js.map +1 -0
- package/dist/client/assets/{perl-CntHWu4k-C3Q6THHX.js → perl-CntHWu4k-R8g6ivQx.js} +2 -2
- package/dist/client/assets/{perl-CntHWu4k-C3Q6THHX.js.map → perl-CntHWu4k-R8g6ivQx.js.map} +1 -1
- package/dist/client/assets/{php-VF06KE26-uqmHEtRE.js → php-VF06KE26-qz2OohxQ.js} +2 -2
- package/dist/client/assets/{php-VF06KE26-uqmHEtRE.js.map → php-VF06KE26-qz2OohxQ.js.map} +1 -1
- package/dist/client/assets/primitives-Dj-qYrUZ-BIf5RLs4.js +2 -0
- package/dist/client/assets/primitives-Dj-qYrUZ-BIf5RLs4.js.map +1 -0
- package/dist/client/assets/{pug-DeZwH1tK-Dy2R8X_Z.js → pug-DeZwH1tK-hE7p1XRn.js} +2 -2
- package/dist/client/assets/{pug-DeZwH1tK-Dy2R8X_Z.js.map → pug-DeZwH1tK-hE7p1XRn.js.map} +1 -1
- package/dist/client/assets/{pullRequestReviewThreadReplay-Dhslqjta.js → pullRequestReviewThreadReplay-D-FuOlQ0.js} +2 -2
- package/dist/client/assets/{pullRequestReviewThreadReplay-Dhslqjta.js.map → pullRequestReviewThreadReplay-D-FuOlQ0.js.map} +1 -1
- package/dist/client/assets/{qml-CQhAR2tt-CkperL57.js → qml-CQhAR2tt-Blcerr_b.js} +2 -2
- package/dist/client/assets/{qml-CQhAR2tt-CkperL57.js.map → qml-CQhAR2tt-Blcerr_b.js.map} +1 -1
- package/dist/client/assets/{r-CGShpgkr-BeuwoEHJ.js → r-CGShpgkr-Bu3ifplH.js} +2 -2
- package/dist/client/assets/{r-CGShpgkr-BeuwoEHJ.js.map → r-CGShpgkr-Bu3ifplH.js.map} +1 -1
- package/dist/client/assets/{razor-CgB2QCs6-C9kZAmAY.js → razor-CgB2QCs6-C0YckD9e.js} +2 -2
- package/dist/client/assets/{razor-CgB2QCs6-C9kZAmAY.js.map → razor-CgB2QCs6-C0YckD9e.js.map} +1 -1
- package/dist/client/assets/{regexp-go_CdRjx-BvThUXwF.js → regexp-go_CdRjx-FwuQxSe1.js} +2 -2
- package/dist/client/assets/{regexp-go_CdRjx-BvThUXwF.js.map → regexp-go_CdRjx-FwuQxSe1.js.map} +1 -1
- package/dist/client/assets/{releaseRoutes-D04aOk03.js → releaseRoutes-Bpw_kfZI.js} +2 -2
- package/dist/client/assets/{releaseRoutes-D04aOk03.js.map → releaseRoutes-Bpw_kfZI.js.map} +1 -1
- package/dist/client/assets/{rst-CbWMI8ou-B_CNFtWj.js → rst-CbWMI8ou-_a-jzVR0.js} +2 -2
- package/dist/client/assets/{rst-CbWMI8ou-B_CNFtWj.js.map → rst-CbWMI8ou-_a-jzVR0.js.map} +1 -1
- package/dist/client/assets/{ruby-DsGwIs06-BNNoCsny.js → ruby-DsGwIs06-CvuKCvaN.js} +2 -2
- package/dist/client/assets/{ruby-DsGwIs06-BNNoCsny.js.map → ruby-DsGwIs06-CvuKCvaN.js.map} +1 -1
- package/dist/client/assets/{sas-DjxN8J4Z-DQwiaVY0.js → sas-DjxN8J4Z-6vMiHBWz.js} +2 -2
- package/dist/client/assets/{sas-DjxN8J4Z-DQwiaVY0.js.map → sas-DjxN8J4Z-6vMiHBWz.js.map} +1 -1
- package/dist/client/assets/{scss-bkiiULjK-BdNohiDl.js → scss-bkiiULjK-RWkdLi31.js} +2 -2
- package/dist/client/assets/{scss-bkiiULjK-BdNohiDl.js.map → scss-bkiiULjK-RWkdLi31.js.map} +1 -1
- package/dist/client/assets/{shellscript-Cuh1SIPr-CH9Y9Zzx.js → shellscript-Cuh1SIPr-xep8lhFb.js} +2 -2
- package/dist/client/assets/{shellscript-Cuh1SIPr-CH9Y9Zzx.js.map → shellscript-Cuh1SIPr-xep8lhFb.js.map} +1 -1
- package/dist/client/assets/{shellsession-C4UOwxb7-BVPXZqFb.js → shellsession-C4UOwxb7-B2Mjt8G4.js} +2 -2
- package/dist/client/assets/{shellsession-C4UOwxb7-BVPXZqFb.js.map → shellsession-C4UOwxb7-B2Mjt8G4.js.map} +1 -1
- package/dist/client/assets/{soy-CeGFXpLT-bVeC_qdu.js → soy-CeGFXpLT-DB96q8ji.js} +2 -2
- package/dist/client/assets/{soy-CeGFXpLT-bVeC_qdu.js.map → soy-CeGFXpLT-DB96q8ji.js.map} +1 -1
- package/dist/client/assets/{sql-qDYmMTO1-DRMw6L4F.js → sql-qDYmMTO1-Dp7sA9Pq.js} +2 -2
- package/dist/client/assets/{sql-qDYmMTO1-DRMw6L4F.js.map → sql-qDYmMTO1-Dp7sA9Pq.js.map} +1 -1
- package/dist/client/assets/{stata-Dzus_rwP-DcGzBrZt.js → stata-Dzus_rwP-Bk81H3oK.js} +2 -2
- package/dist/client/assets/{stata-Dzus_rwP-DcGzBrZt.js.map → stata-Dzus_rwP-Bk81H3oK.js.map} +1 -1
- package/dist/client/assets/{surrealql-DmTrf8uR-BGVhamzy.js → surrealql-DmTrf8uR-BAVDL68E.js} +2 -2
- package/dist/client/assets/{surrealql-DmTrf8uR-BGVhamzy.js.map → surrealql-DmTrf8uR-BAVDL68E.js.map} +1 -1
- package/dist/client/assets/{svelte-CWlRonoS-d0HsRKWL.js → svelte-CWlRonoS-g4MbXmCf.js} +2 -2
- package/dist/client/assets/{svelte-CWlRonoS-d0HsRKWL.js.map → svelte-CWlRonoS-g4MbXmCf.js.map} +1 -1
- package/dist/client/assets/{templ-EuFg1gKs-BBJ25IwK.js → templ-EuFg1gKs-B9lc3TqB.js} +2 -2
- package/dist/client/assets/{templ-EuFg1gKs-BBJ25IwK.js.map → templ-EuFg1gKs-B9lc3TqB.js.map} +1 -1
- package/dist/client/assets/{tex-Cbbx1SXS-Dh8M7x1F.js → tex-Cbbx1SXS-DPEKlVuI.js} +2 -2
- package/dist/client/assets/{tex-Cbbx1SXS-Dh8M7x1F.js.map → tex-Cbbx1SXS-DPEKlVuI.js.map} +1 -1
- package/dist/client/assets/{ts-tags-DOHpIWV2-DXabLRoX.js → ts-tags-DOHpIWV2-DN6mmSGx.js} +2 -2
- package/dist/client/assets/{ts-tags-DOHpIWV2-DXabLRoX.js.map → ts-tags-DOHpIWV2-DN6mmSGx.js.map} +1 -1
- package/dist/client/assets/{tsx-DmRL3u_2-Cn0tVC2C.js → tsx-DmRL3u_2-DulNQGwe.js} +2 -2
- package/dist/client/assets/{tsx-DmRL3u_2-Cn0tVC2C.js.map → tsx-DmRL3u_2-DulNQGwe.js.map} +1 -1
- package/dist/client/assets/{twig-BzcHspK1-BW8kSayf.js → twig-BzcHspK1-j95wbDo4.js} +2 -2
- package/dist/client/assets/{twig-BzcHspK1-BW8kSayf.js.map → twig-BzcHspK1-j95wbDo4.js.map} +1 -1
- package/dist/client/assets/{typescript-BYTx4UxO-XIX20smz.js → typescript-BYTx4UxO-C2eU2nTQ.js} +2 -2
- package/dist/client/assets/{typescript-BYTx4UxO-XIX20smz.js.map → typescript-BYTx4UxO-C2eU2nTQ.js.map} +1 -1
- package/dist/client/assets/{typst-BrfC91e7-BTQczO73.js → typst-BrfC91e7-Bry73qoG.js} +2 -2
- package/dist/client/assets/{typst-BrfC91e7-BTQczO73.js.map → typst-BrfC91e7-Bry73qoG.js.map} +1 -1
- package/dist/client/assets/{useWorkspaceDefaultLanding-DygvrKuK.js → useWorkspaceDefaultLanding-DPM3tzSI.js} +2 -2
- package/dist/client/assets/{useWorkspaceDefaultLanding-DygvrKuK.js.map → useWorkspaceDefaultLanding-DPM3tzSI.js.map} +1 -1
- package/dist/client/assets/{vue-B92PIQFm-Bo7Ratnf.js → vue-B92PIQFm-_KBJBFm9.js} +2 -2
- package/dist/client/assets/{vue-B92PIQFm-Bo7Ratnf.js.map → vue-B92PIQFm-_KBJBFm9.js.map} +1 -1
- package/dist/client/assets/{vue-html-EDHI-aeE-DZaGT8SW.js → vue-html-EDHI-aeE-Cx5Qo046.js} +2 -2
- package/dist/client/assets/{vue-html-EDHI-aeE-DZaGT8SW.js.map → vue-html-EDHI-aeE-Cx5Qo046.js.map} +1 -1
- package/dist/client/assets/{vue-vine-CmMdgoEY-D5tBNukX.js → vue-vine-CmMdgoEY-CDgVVhf3.js} +2 -2
- package/dist/client/assets/{vue-vine-CmMdgoEY-D5tBNukX.js.map → vue-vine-CmMdgoEY-CDgVVhf3.js.map} +1 -1
- package/dist/client/assets/{workspaceEntityRoutes-FAiial9O.js → workspaceEntityRoutes-Cc_RtLvy.js} +2 -2
- package/dist/client/assets/{workspaceEntityRoutes-FAiial9O.js.map → workspaceEntityRoutes-Cc_RtLvy.js.map} +1 -1
- package/dist/client/assets/{workspaceScrollCapture-AJpPgzgz.js → workspaceScrollCapture-Dg3Pebh8.js} +2 -2
- package/dist/client/assets/{workspaceScrollCapture-AJpPgzgz.js.map → workspaceScrollCapture-Dg3Pebh8.js.map} +1 -1
- package/dist/client/assets/{xml-Bz9Nzp99-Bj4-GEHY.js → xml-Bz9Nzp99-bfRaCa2x.js} +2 -2
- package/dist/client/assets/{xml-Bz9Nzp99-Bj4-GEHY.js.map → xml-Bz9Nzp99-bfRaCa2x.js.map} +1 -1
- package/dist/client/assets/{xsl-D0pOnfMq-9186FOf_.js → xsl-D0pOnfMq-BaQuui65.js} +2 -2
- package/dist/client/assets/{xsl-D0pOnfMq-9186FOf_.js.map → xsl-D0pOnfMq-BaQuui65.js.map} +1 -1
- package/dist/client/assets/{yaml-DKDHNCIP-ISipY-zA.js → yaml-DKDHNCIP-B5ot5BQr.js} +2 -2
- package/dist/client/assets/{yaml-DKDHNCIP-ISipY-zA.js.map → yaml-DKDHNCIP-B5ot5BQr.js.map} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/assets/controlCenterApi-CIz0g85O.js.map +1 -1
- package/package.json +8 -8
- package/dist/client/assets/ActiveWorkPage-BxSGZWS_.js +0 -2
- package/dist/client/assets/ActiveWorkPage-BxSGZWS_.js.map +0 -1
- package/dist/client/assets/AgentPage-YiYORLod.js.map +0 -1
- package/dist/client/assets/AtlassianOAuthCallbackPage-PfsrTytb.js.map +0 -1
- package/dist/client/assets/AuthorizedSharePage-BCwnILXF.js.map +0 -1
- package/dist/client/assets/ItemsPage-BzinDuxs.js.map +0 -1
- package/dist/client/assets/OpenPullRequestPage-BABGk9v2.js.map +0 -1
- package/dist/client/assets/PairPage-4meDmW_A.js.map +0 -1
- package/dist/client/assets/PortfolioOverview-BRB_qe4T.js +0 -2
- package/dist/client/assets/PortfolioOverview-BRB_qe4T.js.map +0 -1
- package/dist/client/assets/ReleaseRoute-D1srSd83.js +0 -2
- package/dist/client/assets/ReleaseRoute-D1srSd83.js.map +0 -1
- package/dist/client/assets/ReleaseWorkset-DcI6qwPE.js.map +0 -1
- package/dist/client/assets/ReviewSuggestionPublicationSurface-BtoYEprT.js.map +0 -1
- package/dist/client/assets/ServicesPage-DihUx1kr.js.map +0 -1
- package/dist/client/assets/TimelinePage-DyluBeEt.js.map +0 -1
- package/dist/client/assets/WorkspaceSettingsPage-Dn_eDC3m.js.map +0 -1
- package/dist/client/assets/index-BZ52pCV1.css +0 -1
- package/dist/client/assets/patterns-D0U0WCQS.js +0 -2
- package/dist/client/assets/patterns-D0U0WCQS.js.map +0 -1
- package/dist/client/assets/primitives-CjQX0eVM-BPKvllZ_.js +0 -2
- package/dist/client/assets/primitives-CjQX0eVM-BPKvllZ_.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{u as n}from"./hooks-CGvBGjhq.js";import{d as r,i,r as a,v as o}from"./Dialog-_t9OodCK-CzkLh9VB.js";import{t as s}from"./jsx-runtime-NZYk81nU.js";import{E as c,b as l,y as u}from"./index-BHQ_NP1r.js";import{n as d}from"./patterns-D0U0WCQS.js";import{n as f,t as p}from"./primitives-CjQX0eVM-BPKvllZ_.js";import{Ka as m,Wr as h}from"./agent-api-0YXZd1ag.js";import{a as g,c as _,d as v,i as y,l as b,o as x,r as S,s as C}from"./serviceOnboarding-BXJRvJ79.js";import{t as w}from"./connectionTestTransport-DtTYdbuO.js";import{r as T}from"./atlassianOAuthSetupIntentStorage-BFd1um3D.js";var E=e(t(),1),D={form:`_form_piwc3_1`,intro:`_intro_piwc3_2`,fallback:`_fallback_piwc3_3`,resources:`_resources_piwc3_16`,actions:`_actions_piwc3_22`,error:`_error_piwc3_29`},O=(e,t)=>{switch(e.kind){case`integer`:return{_tag:`integer`,key:e.key,value:Number(t)};case`secret`:return{_tag:`secret`,key:e.key,value:t};case`text`:case`url`:return{_tag:e.kind,key:e.key,value:t}}},k=(e,t)=>e.configurationFields.flatMap(e=>{let n=t.get(e.key)??e.defaultValue;return n===null&&!e.required?[]:[O(e,n??``)]}),A=s(),j=(e,t)=>e.find(e=>e.profileId===t),M=(e,t)=>e.status===`valid`&&(t.preferredSiteId===null||e.cloudId===t.preferredSiteId)&&t.providers.every(t=>e.providers.includes(t)),N=e=>e.status===`expired`?`expired`:e.providers.includes(`jira`)?e.providers.includes(`confluence`)?`Jira + Confluence`:`Jira only`:`Confluence only`,P=({catalogs:e,isSubmitting:t,onCancel:n,onStartOAuth:a,onSubmit:o,profiles:s,profilesState:c,setupIntent:l})=>{let u=e.find(({providerId:e})=>e===`jira`),d=e.find(({providerId:e})=>e===`confluence`),p=l.providers.includes(`jira`),m=l.providers.includes(`confluence`),[h,g]=(0,E.useState)(`Atlassian workspace`),[_,v]=(0,E.useState)(`oauth`),[y,b]=(0,E.useState)(``),[x,S]=(0,E.useState)(``),[C,w]=(0,E.useState)(``),[O,P]=(0,E.useState)(``),[F,ee]=(0,E.useState)(``),[I,te]=(0,E.useState)(``),[L,R]=(0,E.useState)(``),[z,B]=(0,E.useState)(``),[V,ne]=(0,E.useState)(!1),[H,U]=(0,E.useState)(null),[re,ie]=(0,E.useState)(``),[W,G]=(0,E.useState)(``),[K,q]=(0,E.useState)(null),J=(0,E.useRef)(null);(0,E.useEffect)(()=>()=>J.current?.abort(),[]),(0,E.useEffect)(()=>{if(_!==`oauth`)return;let e=j(s,y);if(e!==void 0&&M(e,l))return;let t=l.preferredProfileId===null?void 0:j(s,l.preferredProfileId),n=t!==void 0&&M(t,l)?t:s.find(e=>M(e,l));b(n?.profileId??``)},[_,y,s,l]),(0,E.useEffect)(()=>{l.preferredSiteId!==null&&w(l.preferredSiteId)},[l.preferredSiteId]),(0,E.useEffect)(()=>{if(_!==`oauth`)return;let e=j(s,y);e!==void 0&&(S(e.siteUrl),w(e.cloudId))},[_,y,s]);let ae=e=>{if(e.preventDefault(),q(null),p&&u===void 0||m&&d===void 0){q(`The installed Atlassian adapters are unavailable.`);return}let t=h.trim(),n=x.trim(),r=C.trim(),i=O.trim(),a=F.trim(),c=I.trim();if(t.length===0||n.length===0||r.length===0||p&&i.length===0||m&&(a.length===0||c.length===0)){q(p&&m?`Add the Atlassian site identity, Jira project, Confluence space, and readable health page.`:p?`Add the Atlassian site identity and Jira project.`:`Add the Atlassian site identity, Confluence space, and readable health page.`);return}let f=_===`oauth`?[[`authMode`,`oauth`],[`oauthProfileId`,y]]:[[`authMode`,`api-token`],[`email`,L.trim()],[`apiToken`,z]],g=j(s,y);if(_===`oauth`&&(g===void 0||!M(g,l))){q(`Choose a valid profile for the products being connected, or use an API token instead.`);return}if(_===`api-token`&&(L.trim().length===0||z.length===0)){q(`Add the Atlassian email and API token.`);return}if(_===`api-token`&&p&&l.preferredSiteId!==null){q(`Use a matching OAuth profile to add a Jira project to this Atlassian site.`);return}let v=[...f,[`webBaseUrl`,n],[`siteBaseUrl`,n],[`siteId`,r],[`projectId`,i],[`spaceId`,a],[`probePageId`,c]],b=new Map(v);o([...p&&u!==void 0?[{catalog:u,displayName:`${t} · Jira`,values:k(u,b)}]:[],...m&&d!==void 0?[{catalog:d,displayName:`${t} · Confluence`,values:k(d,b)}]:[]]).then(e=>{e||q(`Some Atlassian services could not be connected. Review the cards below and retry.`)})},Y=e=>{if(l.requestedOAuthProviders===null)return;q(null),U(null),ne(!0),J.current?.abort();let t=new AbortController;J.current=t,a(l.requestedOAuthProviders,t.signal,e).then(e=>{if(!t.signal.aborted){if(e._tag===`configuration-required`){U(e.callbackUrl),q(`OAuth needs a one-time local client configuration before sign-in.`),ne(!1);return}if(!T(e.authorizationUrl,{preferredSiteId:l.preferredSiteId,providers:l.providers})){q(`Control Center could not preserve this Atlassian setup across sign-in. Try again.`),ne(!1);return}window.location.assign(e.authorizationUrl)}},()=>{t.signal.aborted||(q(`Control Center could not start Atlassian sign-in. Try again.`),ne(!1))})},X=()=>{let e=re.trim();if(e.length===0||W.length===0){q(`Add the Atlassian OAuth client ID and client secret.`);return}Y({clientId:e,clientSecret:W})},Z=()=>{J.current?.abort(),J.current=null,ne(!1),v(`api-token`)},Q=c===`loading`?`Finding local Atlassian OAuth profiles…`:c===`failed`?`OAuth profile discovery is unavailable. API token fallback remains available.`:c===`ready`?`${s.filter(e=>M(e,l)).length} ${p&&m?`shared `:``}OAuth ${s.filter(e=>M(e,l)).length===1?`profile`:`profiles`} ready`:`OAuth profiles stay on this machine and are shared by Jira and Confluence.`;return(0,A.jsxs)(`form`,{className:D.form,onSubmit:ae,children:[(0,A.jsxs)(`div`,{className:D.intro,children:[(0,A.jsx)(f,{as:`h3`,variant:`card-title`,children:p&&m?`One identity. Jira and Confluence together.`:p?`Connect Jira with your Atlassian identity.`:`Connect Confluence with your Atlassian identity.`}),(0,A.jsx)(f,{tone:`secondary`,variant:`body`,children:`OAuth is preferred. Control Center reads the selected local profile only inside the server runtime.`}),(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:Q})]}),(0,A.jsx)(i,{label:`Account name`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,maxLength:90,onChange:e=>g(e.currentTarget.value),value:h})}),_===`oauth`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(r,{disabled:l.requestedOAuthProviders===null,loading:V,onClick:()=>Y(),type:`button`,variant:`primary`,children:`Sign in with Atlassian`}),H===null?null:(0,A.jsxs)(`div`,{className:D.fallback,children:[(0,A.jsxs)(f,{as:`p`,tone:`secondary`,variant:`meta`,children:[`Create an OAuth 2.0 integration in Atlassian Developer Console and add `,(0,A.jsx)(`code`,{children:H}),`as its callback URL. The credentials stay on this Control Center machine.`]}),(0,A.jsx)(i,{label:`OAuth client ID`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,autoComplete:`off`,maxLength:500,onChange:e=>ie(e.currentTarget.value),value:re})}),(0,A.jsx)(i,{label:`OAuth client secret`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,autoComplete:`off`,maxLength:16384,onChange:e=>G(e.currentTarget.value),type:`password`,value:W})}),(0,A.jsx)(r,{loading:V,onClick:X,type:`button`,variant:`primary`,children:`Save OAuth app and continue`})]}),(0,A.jsx)(i,{label:`OAuth profile`,required:!0,size:`compact`,children:e=>(0,A.jsxs)(`select`,{...e,onChange:e=>b(e.currentTarget.value),value:y,children:[(0,A.jsx)(`option`,{value:``,children:`Choose a profile already on this machine`}),s.filter(e=>l.preferredSiteId===null||e.cloudId===l.preferredSiteId).map(e=>(0,A.jsxs)(`option`,{disabled:!M(e,l),value:e.profileId,children:[e.name,` · `,N(e)]},e.profileId))]})}),p&&l.preferredSiteId!==null?null:(0,A.jsx)(r,{onClick:Z,type:`button`,variant:`quiet`,children:`Use API token instead`})]}):(0,A.jsxs)(`div`,{className:D.fallback,children:[(0,A.jsx)(i,{label:`Atlassian email`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,autoComplete:`username`,onChange:e=>R(e.currentTarget.value),type:`email`,value:L})}),(0,A.jsx)(i,{label:`API token`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,autoComplete:`off`,maxLength:16384,onChange:e=>B(e.currentTarget.value),type:`password`,value:z})}),(0,A.jsx)(r,{onClick:()=>v(`oauth`),type:`button`,variant:`quiet`,children:`Use OAuth profile`})]}),(0,A.jsx)(i,{label:`Atlassian site URL`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,disabled:_===`oauth`,onChange:e=>S(e.currentTarget.value),placeholder:`https://team.atlassian.net/`,type:`url`,value:x})}),(0,A.jsx)(i,{description:`The stable Atlassian cloud ID; filled from OAuth when available.`,label:`Site ID`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,disabled:_===`oauth`||l.preferredSiteId!==null,onChange:e=>w(e.currentTarget.value),value:C})}),p?(0,A.jsx)(i,{description:`The immutable Jira project ID followed by this connection.`,label:`Jira project ID`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,onChange:e=>P(e.currentTarget.value),value:O})}):null,m?(0,A.jsxs)(`div`,{className:D.resources,children:[(0,A.jsx)(i,{label:`Confluence space ID`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,onChange:e=>ee(e.currentTarget.value),value:F})}),(0,A.jsx)(i,{description:`A readable page used only for the connection check.`,label:`Health page ID`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,onChange:e=>te(e.currentTarget.value),value:I})})]}):null,K===null?null:(0,A.jsx)(f,{as:`p`,className:D.error,role:`alert`,variant:`body`,children:K}),(0,A.jsxs)(`div`,{className:D.actions,children:[(0,A.jsx)(r,{disabled:t,onClick:n,type:`button`,variant:`secondary`,children:`Cancel`}),(0,A.jsx)(r,{loading:t,type:`submit`,variant:`primary`,children:`Connect Atlassian`})]})]})},F={form:`_form_1gjxb_1`,intro:`_intro_1gjxb_6`,resources:`_resources_1gjxb_11`,discoveryActions:`_discoveryActions_1gjxb_22`,resourcePanelHeading:`_resourcePanelHeading_1gjxb_23`,resourcePanel:`_resourcePanel_1gjxb_23`,choiceList:`_choiceList_1gjxb_44`,choice:`_choice_1gjxb_44`,actions:`_actions_1gjxb_58`,error:`_error_1gjxb_65`},ee=20,I=e=>[...new Set(e.split(/[\n,]/u).map(e=>e.trim()).filter(e=>e.length>0))],te=(e,t)=>[...new Set([...e,...I(t)])],L=(e,t)=>[...new Set([...e,...t])].sort((e,t)=>e.localeCompare(t)),R=(e,t)=>{let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.toLocaleLowerCase().includes(n))},z=({accountName:e,codeCommit:t,codePipeline:n,pipelineNames:r,profile:i,region:a,repositoryNames:o})=>[...o.map(n=>({catalog:t,displayName:`${e} · ${n}`,values:k(t,new Map([[`profile`,i],[`region`,a],[`repositoryName`,n]]))})),...r.map(t=>({catalog:n,displayName:`${e} · ${t}`,values:k(n,new Map([[`profile`,i],[`region`,a],[`pipelineName`,t]]))}))],B=(e,t)=>{switch(t){case`loading`:return`Discovering local AWS profiles…`;case`ready`:return`${e} local AWS ${e===1?`profile`:`profiles`} detected`;case`failed`:return`Profile discovery unavailable. Enter a profile manually.`;case`idle`:return`AWS profiles are discovered locally by the Control Center server.`}},V=(e,t)=>t===`authorization`?`${e} access was denied. Select names manually or update this profile's permissions.`:`${e} discovery is unavailable (${t}). Select names manually or refresh.`,ne=({label:e,query:t,selected:n,service:r,setQuery:a,setSelected:s})=>{if(r._tag===`failed`){let t=[...n].sort((e,t)=>e.localeCompare(t));return(0,A.jsxs)(`div`,{className:F.resourcePanel,children:[(0,A.jsxs)(`div`,{className:F.resourcePanelHeading,children:[(0,A.jsx)(f,{as:`h4`,variant:`card-title`,children:e}),(0,A.jsx)(o,{label:`${n.size} selected`,size:`compact`,tone:`neutral`})]}),(0,A.jsx)(f,{as:`p`,className:F.error,role:`status`,variant:`body`,children:V(e===`Repositories`?`CodeCommit`:`CodePipeline`,r.failureClass)}),t.length===0?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:`Preserved from the previous discovery. Clear any resource you no longer want to connect.`}),(0,A.jsx)(`div`,{className:F.choiceList,children:t.map(e=>(0,A.jsxs)(`label`,{className:F.choice,children:[(0,A.jsx)(`input`,{checked:!0,onChange:()=>{let t=new Set(n);t.delete(e),s(t)},type:`checkbox`}),(0,A.jsx)(`span`,{children:e})]},e))})]})]})}let c=L(r.names,n),l=R(c,t);return(0,A.jsxs)(`div`,{className:F.resourcePanel,children:[(0,A.jsxs)(`div`,{className:F.resourcePanelHeading,children:[(0,A.jsx)(f,{as:`h4`,variant:`card-title`,children:e}),(0,A.jsx)(o,{label:`${n.size} selected`,size:`compact`,tone:`neutral`})]}),c.length===0?(0,A.jsxs)(f,{tone:`secondary`,variant:`body`,children:[`No `,e.toLocaleLowerCase(),` were found in this region.`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(i,{label:`Search ${e.toLocaleLowerCase()}`,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,onChange:e=>a(e.currentTarget.value),type:`search`,value:t})}),(0,A.jsx)(`div`,{className:F.choiceList,children:l.map(e=>(0,A.jsxs)(`label`,{className:F.choice,children:[(0,A.jsx)(`input`,{checked:n.has(e),onChange:t=>{let r=new Set(n);t.currentTarget.checked?r.add(e):r.delete(e),s(r)},type:`checkbox`}),(0,A.jsx)(`span`,{children:e})]},e))}),l.length===0?(0,A.jsx)(f,{tone:`secondary`,variant:`body`,children:`No matching resources.`}):null,r.truncated?(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:`Showing the first 20 names. Use manual entry for another name.`}):null]})]})},H=({awsProfiles:e,awsProfilesState:t,catalogs:n,isSubmitting:a,onCancel:o,onDiscover:s,onSubmit:c})=>{let l=n.find(({providerId:e})=>e===`codecommit`),u=n.find(({providerId:e})=>e===`codepipeline`),[d,p]=(0,E.useState)(`AWS account`),[m,h]=(0,E.useState)(`default`),[g,_]=(0,E.useState)(``),[v,y]=(0,E.useState)(``),[b,x]=(0,E.useState)(``),[S,C]=(0,E.useState)(new Set),[w,T]=(0,E.useState)(new Set),[D,O]=(0,E.useState)(``),[k,j]=(0,E.useState)(``),[M,N]=(0,E.useState)(!0),[P,I]=(0,E.useState)({_tag:`idle`}),[L,R]=(0,E.useState)(null),V=(0,E.useRef)(null);(0,E.useEffect)(()=>()=>V.current?.abort(),[]),(0,E.useEffect)(()=>{let t=e.find(e=>e.profile===m)?.region;t!=null&&_(e=>e.trim().length===0?t:e)},[e,m]);let H=()=>{V.current?.abort(),V.current=null,I({_tag:`idle`}),C(new Set),T(new Set)};return(0,A.jsxs)(`form`,{className:F.form,onSubmit:e=>{if(e.preventDefault(),R(null),l===void 0||u===void 0){R(`The installed AWS adapters are unavailable.`);return}let t=d.trim(),n=m.trim(),r=g.trim();if(t.length===0||n.length===0||r.length===0){R(`Add an account name, AWS profile, and region.`);return}let i=te(S,M?v:``),a=te(w,M?b:``);if(i.length===0&&a.length===0){R(`Select or manually add at least one repository or pipeline to follow.`);return}if(i.length>ee||a.length>ee){R(`Follow at most ${ee} repositories and pipelines per account.`);return}if([...i,...a].some(e=>e.length>100)){R(`Repository and pipeline names must be 100 characters or fewer.`);return}c(z({accountName:t,codeCommit:l,codePipeline:u,pipelineNames:a,profile:n,region:r,repositoryNames:i})).then(e=>{e||R(`Some AWS resources could not be connected. Review the cards below and retry.`)})},children:[(0,A.jsxs)(`div`,{className:F.intro,children:[(0,A.jsx)(f,{as:`h3`,variant:`card-title`,children:`One account. Many delivery streams.`}),(0,A.jsx)(f,{tone:`secondary`,variant:`body`,children:`Choose one local AWS profile and region, verify its account, then select CodeCommit repositories and CodePipeline pipelines.`}),(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:B(e.length,t)})]}),(0,A.jsx)(i,{label:`Account name`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,maxLength:90,onChange:e=>p(e.currentTarget.value),value:d})}),(0,A.jsx)(i,{label:`AWS profile`,required:!0,size:`compact`,children:t=>(0,A.jsx)(`input`,{...t,list:e.length>0?`aws-account-profiles`:void 0,maxLength:200,onChange:t=>{let n=t.currentTarget.value,r=e.find(e=>e.profile===n)?.region;h(n),_(r??``),H()},value:m})}),(0,A.jsx)(i,{label:`AWS region`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,maxLength:100,onChange:e=>{_(e.currentTarget.value),H()},value:g})}),(0,A.jsxs)(`div`,{className:F.discoveryActions,children:[(0,A.jsx)(r,{loading:P._tag===`loading`,onClick:()=>{R(null);let e={profile:m.trim(),region:g.trim()};if(e.profile.length===0||e.region.length===0){R(`Add an AWS profile and region before testing discovery.`);return}V.current?.abort();let t=new AbortController;V.current=t,I({_tag:`loading`}),s(e,t.signal).then(e=>{t.signal.aborted||(V.current=null,I({_tag:`ready`,response:e}))},()=>{t.signal.aborted||(V.current=null,I({_tag:`failed`}))})},type:`button`,variant:`secondary`,children:P._tag===`ready`?`Refresh discovery`:`Test & discover`}),P._tag===`ready`?(0,A.jsxs)(f,{tone:`secondary`,variant:`body`,children:[`Verified AWS account `,P.response.accountId]}):P._tag===`failed`?(0,A.jsx)(f,{as:`p`,className:F.error,role:`alert`,variant:`body`,children:`Account verification failed. Check the profile and region, or enter resource names manually.`}):null]}),P._tag===`ready`?(0,A.jsxs)(`div`,{className:F.resources,children:[(0,A.jsx)(ne,{label:`Repositories`,query:D,selected:S,service:P.response.codeCommit,setQuery:O,setSelected:C}),(0,A.jsx)(ne,{label:`Pipelines`,query:k,selected:w,service:P.response.codePipeline,setQuery:j,setSelected:T})]}):null,(0,A.jsx)(`div`,{children:(0,A.jsx)(r,{onClick:()=>N(e=>!e),type:`button`,variant:`quiet`,children:M?`Hide manual name entry`:`Enter resource names manually`})}),M?(0,A.jsxs)(`div`,{className:F.resources,children:[(0,A.jsx)(i,{description:`Comma or line separated. Maximum 20 including selected names.`,label:`Repository names`,size:`compact`,children:e=>(0,A.jsx)(`textarea`,{...e,maxLength:4096,onChange:e=>y(e.currentTarget.value),placeholder:`payments-api\\nrisk-engine`,value:v})}),(0,A.jsx)(i,{description:`Comma or line separated. Maximum 20 including selected names.`,label:`Pipeline names`,size:`compact`,children:e=>(0,A.jsx)(`textarea`,{...e,maxLength:4096,onChange:e=>x(e.currentTarget.value),placeholder:`payments-production\\nrisk-production`,value:b})})]}):null,e.length>0?(0,A.jsx)(`datalist`,{id:`aws-account-profiles`,children:e.map(e=>(0,A.jsx)(`option`,{label:e.region??`Region not configured`,value:e.profile},e.profile))}):null,L===null?null:(0,A.jsx)(f,{as:`p`,className:F.error,role:`alert`,variant:`body`,children:L}),(0,A.jsxs)(`div`,{className:F.actions,children:[(0,A.jsx)(r,{disabled:a,onClick:o,type:`button`,variant:`secondary`,children:`Cancel`}),(0,A.jsx)(r,{loading:a,type:`submit`,variant:`primary`,children:`Connect AWS account`})]})]})},U={page:`_page_xjg2t_1`,heading:`_heading_xjg2t_6`,grid:`_grid_xjg2t_12`,accounts:`_accounts_xjg2t_18`,accountCard:`_accountCard_xjg2t_19`,accountIdentity:`_accountIdentity_xjg2t_20`,resourceList:`_resourceList_xjg2t_21`,resource:`_resource_xjg2t_21`,sectionHeading:`_sectionHeading_xjg2t_23`,resourceBody:`_resourceBody_xjg2t_34`,accountGrid:`_accountGrid_xjg2t_44`,accountHeading:`_accountHeading_xjg2t_49`,resourceSummary:`_resourceSummary_xjg2t_50`,resourceStatus:`_resourceStatus_xjg2t_51`,accountActions:`_accountActions_xjg2t_52`,resourceActions:`_resourceActions_xjg2t_53`,disclosure:`_disclosure_xjg2t_124`,card:`_card_xjg2t_147`,cardHeading:`_cardHeading_xjg2t_153`,cardAction:`_cardAction_xjg2t_154`,synchronization:`_synchronization_xjg2t_161`,syncState:`_syncState_xjg2t_162`,administration:`_administration_xjg2t_167`,administrationSection:`_administrationSection_xjg2t_168`,credentialRecovery:`_credentialRecovery_xjg2t_169`,diagnostics:`_diagnostics_xjg2t_170`,accountEdit:`_accountEdit_xjg2t_171`,administrationLabels:`_administrationLabels_xjg2t_181`,diagnostic:`_diagnostic_xjg2t_170`,accountEditAction:`_accountEditAction_xjg2t_183`,syncActions:`_syncActions_xjg2t_202`,connectionIdentity:`_connectionIdentity_xjg2t_208`,testEvidence:`_testEvidence_xjg2t_215`,identity:`_identity_xjg2t_224`,setupForm:`_setupForm_xjg2t_229`,setupActions:`_setupActions_xjg2t_234`,setupError:`_setupError_xjg2t_241`,identifier:`_identifier_xjg2t_245`},re=e=>h(e.checkedAt),ie=({state:e})=>{if(e===void 0||e._tag===`testing`)return null;if(e._tag===`request-failed`)return(0,A.jsxs)(`div`,{"aria-live":`polite`,className:U.testEvidence,role:`status`,children:[(0,A.jsx)(o,{label:`Test failed`,tone:`critical`}),(0,A.jsx)(f,{tone:`secondary`,variant:`body`,children:`Control Center could not complete the test. Check the server and try again.`})]});let t=e.result,n=re(t);return(0,A.jsxs)(`div`,{"aria-live":`polite`,className:U.testEvidence,role:`status`,children:[(0,A.jsx)(o,{label:t._tag===`healthy`?`Connection healthy`:`Test failed`,tone:t._tag===`healthy`?`positive`:`critical`}),t._tag===`healthy`?(0,A.jsxs)(`div`,{className:U.identity,children:[(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:t.identity.label}),(0,A.jsx)(f,{as:`span`,variant:`card-title`,children:t.identity.displayName}),(0,A.jsx)(f,{className:U.identifier,tone:`secondary`,variant:`body`,children:t.identity.providerImmutableId})]}):(0,A.jsx)(f,{tone:`secondary`,variant:`body`,children:t.safeMessage}),(0,A.jsxs)(f,{tone:`secondary`,variant:`meta`,children:[`Checked `,(0,A.jsx)(`time`,{dateTime:n,children:n}),` · `,t.latencyMilliseconds,` ms`]})]})},W=e=>e===`critical`?`critical`:e===`warning`?`caution`:`neutral`,G=({atlassianOAuthProviders:e,canConfigure:t,onReauthorize:n,onRevoke:a,onStartAtlassianOAuth:s,state:c})=>{let[l,u]=(0,E.useState)(new Map),[d,p]=(0,E.useState)(`idle`),[m,h]=(0,E.useState)(`idle`),[g,_]=(0,E.useState)(null),[v,y]=(0,E.useState)(``),[b,x]=(0,E.useState)(``),S=(0,E.useRef)(null);if((0,E.useEffect)(()=>{u(new Map),p(`idle`),h(`idle`),_(null),S.current?.abort(),S.current=null},[c?._tag===`ready`?c.administration.configuration.revision:c?._tag]),(0,E.useEffect)(()=>()=>S.current?.abort(),[]),c===void 0)return null;if(c._tag===`loading`)return(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:`Loading permissions and diagnostics…`});if(c._tag===`failed`)return(0,A.jsx)(f,{className:U.setupError,role:`alert`,variant:`body`,children:`Administration details are unavailable.`});let{administration:C}=c,w=C.credentialFields.filter(({key:e})=>e!==`oauthProfileId`),D=C.credentialFields.some(({key:e})=>e===`oauthProfileId`)&&(C.connection.providerId===`jira`||C.connection.providerId===`confluence`)&&s!==void 0,O=C.configuration.values.find(({key:e})=>e===`siteId`),k=O?._tag===`text`||O?._tag===`url`?O.value:null,j=e=>{e.preventDefault();let t=w.flatMap(e=>{let t=l.get(e.key)??``;return t.trim().length===0?[]:[{key:e.key,value:e.kind===`secret`?t:t.trim()}]});t.length!==0&&(p(`reauthorizing`),n(t).then(e=>{p(e?`idle`:`failed`),e&&u(new Map)}))},M=()=>{p(`revoking`),a().then(e=>p(e?`idle`:`failed`))},N=t=>{if(!D||s===void 0)return;let n=e??(C.connection.providerId===`jira`?[`jira`]:[`confluence`]);S.current?.abort();let r=new AbortController;S.current=r,h(`starting`),_(null),s(n,r.signal,t).then(e=>{if(!r.signal.aborted){if(e._tag===`configuration-required`){_(e.callbackUrl),h(`configuration-required`);return}if(!T(e.authorizationUrl,{preferredSiteId:k,providers:n,recoveryConnectionId:C.connection.pluginConnectionId})){h(`failed`);return}window.location.assign(e.authorizationUrl)}},()=>{r.signal.aborted||h(`failed`)})};return(0,A.jsxs)(`section`,{"aria-label":`Connection administration`,className:U.administration,children:[(0,A.jsxs)(`div`,{className:U.administrationSection,children:[(0,A.jsx)(f,{as:`h4`,variant:`label`,children:`Permissions`}),(0,A.jsxs)(`div`,{className:U.administrationLabels,children:[C.permissions.map(e=>(0,A.jsx)(o,{label:`${e.capabilityId} v${e.version}`,size:`compact`,tone:e.state===`available`?`positive`:`neutral`},`${e.capabilityId}:${e.version}`)),C.permissions.length===0?(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:`No provider operations were negotiated.`}):null]})]}),(0,A.jsxs)(`div`,{className:U.administrationSection,children:[(0,A.jsx)(f,{as:`h4`,variant:`label`,children:`Schedule and freshness`}),(0,A.jsxs)(f,{tone:`secondary`,variant:`meta`,children:[C.schedule.mode===`manual`?`Manual synchronization`:`This provider does not support synchronization`,C.synchronization?.lastSuccessAt===null||C.synchronization?.lastSuccessAt===void 0?` · No successful sync recorded`:` · Last successful sync ${C.synchronization.lastSuccessAt}`]})]}),(0,A.jsxs)(`div`,{className:U.administrationSection,children:[(0,A.jsx)(f,{as:`h4`,variant:`label`,children:`Diagnostics`}),(0,A.jsx)(`div`,{className:U.diagnostics,children:C.diagnostics.map(e=>(0,A.jsxs)(`div`,{className:U.diagnostic,children:[(0,A.jsx)(o,{label:e.severity,size:`compact`,tone:W(e.severity)}),(0,A.jsx)(f,{variant:`meta`,children:e.summary})]},e.code))})]}),t&&C.credentialFields.length>0?(0,A.jsxs)(`form`,{className:U.credentialRecovery,onSubmit:j,children:[(0,A.jsx)(f,{as:`h4`,variant:`label`,children:`Credential recovery`}),(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:`Values are sent directly to the machine-local secret store and are never returned by this page.`}),w.map(e=>(0,A.jsx)(i,{description:e.description,label:e.label,size:`compact`,children:t=>(0,A.jsx)(`input`,{...t,autoComplete:`off`,maxLength:16384,onChange:t=>{let n=t.currentTarget.value;u(t=>new Map(t).set(e.key,n))},type:`password`,value:l.get(e.key)??``})},e.key)),D?(0,A.jsxs)(`div`,{className:U.administrationSection,children:[(0,A.jsx)(f,{variant:`meta`,children:`Atlassian OAuth recovery creates a new machine-local profile and verifies this connection’s existing site and resource before applying it.`}),(0,A.jsx)(r,{loading:m===`starting`,onClick:()=>N(),type:`button`,variant:`secondary`,children:`Sign in with Atlassian`}),m===`configuration-required`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(f,{tone:`secondary`,variant:`meta`,children:[`Configure the OAuth callback URL in Atlassian: `,g]}),(0,A.jsx)(i,{label:`OAuth client ID`,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,onChange:e=>y(e.currentTarget.value),value:v})}),(0,A.jsx)(i,{label:`OAuth client secret`,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,autoComplete:`off`,onChange:e=>x(e.currentTarget.value),type:`password`,value:b})}),(0,A.jsx)(r,{onClick:()=>{let e=v.trim();if(e.length===0||b.length===0){h(`failed`);return}N({clientId:e,clientSecret:b})},type:`button`,variant:`secondary`,children:`Save client and sign in`})]}):null,m===`failed`?(0,A.jsx)(f,{className:U.setupError,role:`alert`,variant:`body`,children:`Atlassian sign-in could not start. Verify the local OAuth client and try again.`}):null]}):null,(0,A.jsxs)(`div`,{className:U.resourceActions,children:[w.length>0?(0,A.jsx)(r,{disabled:d===`revoking`,loading:d===`reauthorizing`,type:`submit`,variant:`secondary`,children:`Replace credentials and test`}):null,(0,A.jsx)(r,{disabled:d===`reauthorizing`,loading:d===`revoking`,onClick:M,type:`button`,variant:`quiet`,children:`Revoke credentials`})]}),d===`failed`?(0,A.jsx)(f,{className:U.setupError,role:`alert`,variant:`body`,children:`The credential change was not applied. Refresh the details and try again.`}):null]}):null]})},K=e=>{switch(e){case`never`:return{label:`Never synchronized`,tone:`neutral`};case`running`:return{label:`Synchronizing`,tone:`progress`};case`synchronized`:return{label:`Synchronized`,tone:`positive`};case`source-unavailable`:return{label:`Source unavailable`,tone:`critical`};case`interrupted`:return{label:`Interrupted`,tone:`critical`}}},q=({isSyncing:e,synchronization:t})=>{let n=e?{label:`Synchronizing…`,tone:`progress`}:K(t.result);return(0,A.jsxs)(`div`,{className:U.syncState,children:[(0,A.jsx)(o,{label:n.label,size:`compact`,tone:n.tone}),(0,A.jsxs)(f,{tone:`secondary`,variant:`meta`,children:[`Last attempt:`,` `,t.lastAttemptAt===null?`never`:h(t.lastAttemptAt),` · Last success: `,t.lastSuccessAt===null?`never`:h(t.lastSuccessAt),` · ${t.pagesCommitted} ${t.pagesCommitted===1?`page`:`pages`}`]})]})},J=({canSynchronize:e,onRefresh:t,onSynchronize:n,state:i})=>{if(i===void 0)return null;let a=i._tag===`syncing`,s=i._tag===`ready`?i.synchronization:i._tag===`syncing`?i.previous:null;return(0,A.jsxs)(`div`,{className:U.synchronization,children:[s===null?a?(0,A.jsx)(o,{label:`Synchronizing…`,size:`compact`,tone:`progress`}):null:(0,A.jsx)(q,{isSyncing:a,synchronization:s}),i._tag===`loading`?(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:`Loading synchronization state…`}):null,i._tag===`failed`?(0,A.jsx)(f,{as:`p`,className:U.setupError,role:`alert`,variant:`body`,children:`Synchronization state is unavailable.`}):null,(0,A.jsxs)(`div`,{className:U.syncActions,children:[(0,A.jsx)(r,{disabled:!e||i._tag===`loading`||i._tag===`syncing`,loading:i._tag===`syncing`,onClick:n,variant:`secondary`,children:`Sync now`}),i._tag===`failed`?(0,A.jsx)(r,{onClick:t,variant:`quiet`,children:`Refresh state`}):null]})]})},ae=(e,t)=>{if(!e.isEnabled)return{label:`Disabled`,tone:`neutral`};if(t?._tag===`testing`)return{label:`Checking`,tone:`progress`};if(t?._tag===`result`)return t.result._tag===`healthy`?{label:`Healthy`,tone:`positive`}:{label:`Unavailable`,tone:`critical`};if(e.health===null)return{label:`Not checked`,tone:`neutral`};switch(e.health._tag){case`healthy`:return{label:`Healthy`,tone:`positive`};case`degraded`:return{label:`Degraded`,tone:`caution`};case`unavailable`:return{label:`Unavailable`,tone:`critical`};case`disabled`:return{label:`Not checked`,tone:`neutral`}}},Y=e=>{switch(e){case`codecommit`:return`Repository`;case`codepipeline`:return`Pipeline`;case`jira`:return`Project`;case`confluence`:return`Space`;case`clockify`:return`Workspace`}},X=e=>{let t=[];return e.resources.some(({providerId:e})=>e===`jira`)&&t.push(`jira`),e.resources.some(({providerId:e})=>e===`confluence`)&&t.push(`confluence`),t.length===0?void 0:t},Z=(e,t,n)=>(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:U.connectionIdentity,children:[(0,A.jsx)(d,{service:e.providerId,size:`compact`}),(0,A.jsxs)(`div`,{className:U.identity,children:[(0,A.jsx)(f,{as:`h3`,variant:`card-title`,children:e.displayName}),(0,A.jsxs)(f,{className:U.identifier,tone:`secondary`,variant:`meta`,children:[Y(e.providerId),` · `,e.providerImmutableId]})]})]}),(0,A.jsxs)(`div`,{className:U.resourceStatus,children:[(0,A.jsx)(o,{label:t.label,size:`compact`,tone:t.tone}),n?(0,A.jsxs)(`span`,{className:U.disclosure,children:[`Controls `,(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`›`})]}):null]})]}),Q=({administrationState:e,atlassianOAuthProviders:t,canConfigure:n,connection:i,enablementState:a,onReauthorize:o,onRefreshSynchronization:s,onRevoke:c,onSetEnabled:l,onStartAtlassianOAuth:u,onSynchronize:d,onTest:p,resource:m,synchronizationState:h,testState:g})=>{let _=ae(i,g),v=g?._tag===`testing`,y=a===`changing`,b=_.tone===`caution`||_.tone===`critical`||_.tone===`progress`,x=(0,E.useRef)(null),S=(0,E.useRef)(!1);return(0,E.useEffect)(()=>{b&&!S.current&&x.current!==null&&(x.current.open=!0),S.current=b},[b]),(0,A.jsxs)(`details`,{className:U.resource,"data-status-tone":_.tone,ref:x,children:[(0,A.jsx)(`summary`,{className:U.resourceSummary,children:Z(m,_,!0)}),(0,A.jsxs)(`div`,{className:U.resourceBody,children:[(0,A.jsx)(ie,{state:g}),(0,A.jsx)(J,{canSynchronize:n&&i.isEnabled,onRefresh:()=>s(i.pluginConnectionId),onSynchronize:()=>d(i.pluginConnectionId),state:h}),(0,A.jsx)(G,{...t===void 0?{}:{atlassianOAuthProviders:t},canConfigure:n,onReauthorize:e=>o(i.pluginConnectionId,e),onRevoke:()=>c(i.pluginConnectionId),onStartAtlassianOAuth:u,state:e}),(0,A.jsxs)(`div`,{className:U.resourceActions,children:[(0,A.jsx)(r,{disabled:!n||y||v||!i.isEnabled,loading:v,onClick:()=>p(i.pluginConnectionId),variant:`secondary`,children:`Test`}),(0,A.jsx)(r,{disabled:!n||y,loading:y,onClick:()=>l(i.pluginConnectionId,!i.isEnabled),variant:`quiet`,children:i.isEnabled?`Disable`:`Enable`})]}),a===`request-failed`?(0,A.jsx)(f,{as:`p`,className:U.setupError,role:`alert`,variant:`body`,children:`Control Center could not change this service. Refresh and try again.`}):null]})]})},oe=({account:e,administrationStates:t,canConfigure:n,connections:a,enablementStates:s,onAdd:c,onReauthorize:l,onRefreshSynchronization:u,onRename:d,onRevoke:m,onSetEnabled:h,onStartAtlassianOAuth:g,onSynchronize:_,onTest:v,synchronizationStates:y,testStates:b})=>{let[x,S]=(0,E.useState)(!1),[C,w]=(0,E.useState)(e.displayName),[T,D]=(0,E.useState)(`idle`);return(0,E.useEffect)(()=>w(e.displayName),[e.displayName]),(0,A.jsxs)(p,{as:`article`,className:U.accountCard,padding:`default`,form:`grouped`,children:[(0,A.jsxs)(`div`,{className:U.accountHeading,children:[(0,A.jsxs)(`div`,{className:U.accountIdentity,children:[(0,A.jsxs)(f,{as:`h2`,variant:`section-title`,children:[e.providerFamily===`aws`?`AWS account`:e.providerFamily===`atlassian`?`Atlassian site`:`Provider account`,` `,e.displayName]}),(0,A.jsxs)(f,{className:U.identifier,tone:`secondary`,variant:`meta`,children:[`Verified identity · `,e.providerImmutableId]})]}),(0,A.jsx)(o,{label:`${e.resources.length} ${e.resources.length===1?`resource`:`resources`}`,size:`compact`,tone:`positive`})]}),n?x?(0,A.jsxs)(`form`,{className:U.accountEdit,onSubmit:e=>{e.preventDefault(),D(`saving`),d(C.trim()).then(e=>{D(e?`idle`:`failed`),e&&S(!1)})},children:[(0,A.jsx)(i,{label:`Account display name`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,maxLength:200,onChange:e=>w(e.currentTarget.value),value:C})}),(0,A.jsxs)(`div`,{className:U.resourceActions,children:[(0,A.jsx)(r,{loading:T===`saving`,type:`submit`,variant:`secondary`,children:`Save account name`}),(0,A.jsx)(r,{disabled:T===`saving`,onClick:()=>{w(e.displayName),S(!1),D(`idle`)},type:`button`,variant:`quiet`,children:`Cancel`})]}),T===`failed`?(0,A.jsx)(f,{className:U.setupError,role:`alert`,variant:`body`,children:`The account changed elsewhere. Refresh and try again.`}):null]}):(0,A.jsx)(`div`,{className:U.accountEditAction,children:(0,A.jsx)(r,{onClick:()=>S(!0),variant:`quiet`,children:`Edit account name`})}):null,(0,A.jsx)(`div`,{className:U.resourceList,children:e.resources.map(r=>{let i=a.find(e=>e.followedResourceId===r.followedResourceId),o=i===void 0?void 0:b.get(i.pluginConnectionId),c=i===void 0?void 0:s.get(i.pluginConnectionId),d=i===void 0?{label:`Followed`,tone:`neutral`}:ae(i,o);if(i===void 0)return(0,A.jsx)(`div`,{className:U.resource,"data-status-tone":d.tone,children:(0,A.jsx)(`div`,{className:U.resourceSummary,children:Z(r,d,!1)})},r.followedResourceId);let f=X(e);return(0,E.createElement)(Q,{...f===void 0?{}:{atlassianOAuthProviders:f},canConfigure:n,connection:i,administrationState:t.get(i.pluginConnectionId),enablementState:c,key:r.followedResourceId,onRefreshSynchronization:u,onReauthorize:l,onRevoke:m,onStartAtlassianOAuth:g,onSetEnabled:h,onSynchronize:_,onTest:v,resource:r,synchronizationState:y.get(i.pluginConnectionId),testState:o})})}),e.providerFamily===`aws`?(0,A.jsxs)(`div`,{className:U.accountActions,children:[(0,A.jsx)(r,{disabled:!n,onClick:()=>c(`codecommit`,e.providerImmutableId),variant:`secondary`,children:`Add repository`}),(0,A.jsx)(r,{disabled:!n,onClick:()=>c(`codepipeline`,e.providerImmutableId),variant:`secondary`,children:`Add pipeline`})]}):e.providerFamily===`atlassian`?(0,A.jsxs)(`div`,{className:U.accountActions,children:[(0,A.jsx)(r,{disabled:!n,onClick:()=>c(`jira`,e.providerImmutableId),variant:`secondary`,children:`Add Jira project`}),(0,A.jsx)(r,{disabled:!n,onClick:()=>c(`confluence`,e.providerImmutableId),variant:`secondary`,children:`Add Confluence space`})]}):null]})},se=e=>`${e.catalog.providerId}\0${e.displayName}`,$=[`jira`,`confluence`],ce={preferredProfileId:null,preferredSiteId:null,providers:$,requestedOAuthProviders:$},le=e=>{let t=$.filter(t=>!e.some(e=>e.providerId===t));return t.length===0?$:t},ue=(e,t,n)=>n.length===1&&$.some(r=>!n.includes(r)&&e.some(e=>e.providerId===r)&&t.some(e=>!e.profileId.startsWith(`legacy:`)&&e.providers.includes(r))),de=(e,t)=>t.length===1&&$.some(n=>!t.includes(n)&&e.some(e=>e.providerId===n)),fe=(e,t)=>({preferredProfileId:null,preferredSiteId:null,providers:t!==void 0&&e.some(({providerId:e})=>e===t)?[t]:le(e),requestedOAuthProviders:null}),pe=(e,t,n)=>{if(e.requestedOAuthProviders!==null)return e;let r=de(t,e.providers);if(r&&(n._tag===`idle`||n._tag===`loading`))return e;let i=n._tag===`ready`?n.profiles:[];return{...e,requestedOAuthProviders:r&&n._tag===`failed`||ue(t,i,e.providers)?$:e.providers}},me=({administrationState:e,canConfigure:t,canTest:n,connection:i,enablementState:a,onConfigure:s,onReauthorize:c,onRefreshSynchronization:l,onRevoke:u,onSetEnabled:m,onStartAtlassianOAuth:h,onSynchronize:g,onTest:_,synchronizationState:v,testState:y})=>{let b=y?._tag===`testing`,x=y!==void 0&&y._tag!==`testing`,S=a===`changing`,C=ae(i,y);return(0,A.jsxs)(p,{as:`article`,className:U.card,padding:`default`,form:`grouped`,children:[(0,A.jsxs)(`div`,{className:U.cardHeading,children:[(0,A.jsxs)(`div`,{className:U.connectionIdentity,children:[(0,A.jsx)(d,{service:i.providerId,size:`compact`}),(0,A.jsx)(f,{as:`h2`,variant:`card-title`,children:i.displayName})]}),(0,A.jsx)(o,{label:C.label,size:`compact`,tone:C.tone})]}),(0,A.jsx)(ie,{state:y}),(0,A.jsx)(J,{canSynchronize:t&&i.isEnabled,onRefresh:()=>l(i.pluginConnectionId),onSynchronize:()=>g(i.pluginConnectionId),state:v}),(0,A.jsx)(G,{...i.providerId===`jira`?{atlassianOAuthProviders:[`jira`]}:i.providerId===`confluence`?{atlassianOAuthProviders:[`confluence`]}:{},canConfigure:t,onReauthorize:e=>c(i.pluginConnectionId,e),onRevoke:()=>u(i.pluginConnectionId),onStartAtlassianOAuth:h,state:e}),(0,A.jsxs)(`div`,{className:U.cardAction,children:[(0,A.jsx)(r,{disabled:!n||S||b||!i.isEnabled,loading:b,onClick:()=>_(i.pluginConnectionId),variant:`secondary`,children:x?`Retry test`:`Test connection`}),(0,A.jsx)(r,{disabled:!t,onClick:s,variant:`secondary`,children:`Add connection`}),(0,A.jsx)(r,{disabled:!t||S,loading:S,onClick:()=>m(i.pluginConnectionId,!i.isEnabled),variant:i.isEnabled?`secondary`:`primary`,children:i.isEnabled?`Disable`:`Enable service`}),n?null:(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:`Owner access is required.`})]}),a===`request-failed`?(0,A.jsx)(f,{as:`p`,className:U.setupError,role:`alert`,variant:`body`,children:`Control Center could not change this service. Refresh and try again.`}):null]})},he=({catalog:e,isSubmitting:t,onCancel:n,onSubmit:a})=>{let[o,s]=(0,E.useState)(e.displayName),[c,l]=(0,E.useState)(null),[u,d]=(0,E.useState)(new Map(e.configurationFields.map(e=>[e.key,e.defaultValue??``]))),p=t=>{t.preventDefault(),l(null);let n=e.configurationFields.map(e=>O(e,u.get(e.key)??``));a(o,n).then(t=>{if(!t){l(`Control Center could not create this connection. Check the fields and try again.`);return}d(t=>{let n=new Map(t);for(let t of e.configurationFields)t.kind===`secret`&&n.set(t.key,``);return n})})},m=(e,t)=>{d(n=>new Map(n).set(e,t))};return(0,A.jsxs)(`form`,{className:U.setupForm,onSubmit:p,children:[(0,A.jsx)(i,{label:`Connection name`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,maxLength:200,onChange:e=>s(e.currentTarget.value),value:o})}),e.configurationFields.map(e=>(0,A.jsx)(i,{description:e.description,label:e.label,required:e.required,size:`compact`,children:t=>(0,A.jsx)(`input`,{...t,autoComplete:e.kind===`secret`?`off`:void 0,disabled:e.isReadOnly,max:e.maximum??void 0,maxLength:e.kind===`integer`?void 0:e.kind===`secret`?16384:4096,min:e.minimum??void 0,onChange:t=>m(e.key,t.currentTarget.value),type:e.kind===`secret`?`password`:e.kind===`integer`?`number`:e.kind===`url`?`url`:`text`,value:u.get(e.key)??``})},e.key)),c===null?null:(0,A.jsx)(f,{as:`p`,className:U.setupError,role:`alert`,variant:`body`,children:c}),(0,A.jsxs)(`div`,{className:U.setupActions,children:[(0,A.jsx)(r,{disabled:t,onClick:n,type:`button`,variant:`secondary`,children:`Cancel`}),(0,A.jsx)(r,{loading:t,type:`submit`,variant:`primary`,children:`Enable and test`})]})]})},ge=({atlassianProfiles:e,atlassianProfilesState:t,atlassianSetupIntent:n,awsProfiles:i,awsProfilesState:a,canConfigure:s,catalog:c,catalogs:l,isAdditional:u,isOpen:m,isRecovery:h,isSubmitting:g,onCancel:_,onDiscoverAws:v,onOpen:y,onStartAtlassianOAuth:b,onSubmit:x,onSubmitAtlassian:S,onSubmitAws:C})=>{let w=c.providerId===`codecommit`||c.providerId===`codepipeline`,T=c.providerId===`jira`||c.providerId===`confluence`;return(0,A.jsxs)(p,{as:`article`,className:U.card,padding:`default`,form:`grouped`,children:[(0,A.jsxs)(`div`,{className:U.cardHeading,children:[(0,A.jsxs)(`div`,{className:U.connectionIdentity,children:[(0,A.jsx)(d,{service:c.providerId,size:`compact`}),(0,A.jsx)(f,{as:`h2`,variant:`card-title`,children:c.displayName})]}),(0,A.jsx)(o,{label:h?`Needs correction`:u?`Add another`:`Not configured`,size:`compact`,tone:h?`critical`:`neutral`})]}),(0,A.jsx)(f,{tone:`secondary`,variant:`body`,children:c.description}),m?w?(0,A.jsx)(H,{awsProfiles:i,awsProfilesState:a,catalogs:l,isSubmitting:g,onCancel:_,onDiscover:v,onSubmit:C}):T?(0,A.jsx)(P,{catalogs:l,isSubmitting:g,onCancel:_,onStartOAuth:b,onSubmit:S,profiles:e,profilesState:t,setupIntent:n}):(0,A.jsx)(he,{catalog:c,isSubmitting:g,onCancel:_,onSubmit:x}):(0,A.jsxs)(`div`,{className:U.cardAction,children:[(0,A.jsx)(r,{disabled:!s,onClick:y,variant:`secondary`,children:w?`Configure AWS account`:u&&c.providerId===`jira`?`Add Jira project`:u&&c.providerId===`confluence`?`Add Confluence space`:T?`Configure Atlassian`:`Enable service`}),s?null:(0,A.jsx)(f,{tone:`secondary`,variant:`meta`,children:`Owner access is required.`})]})]})},_e=({actionLabel:e=`Pair to enable`,isActionDisabled:t=!1,onEnable:n,service:i,statusLabel:a=`Available`,statusTone:s=`positive`})=>(0,A.jsxs)(p,{as:`article`,className:U.card,padding:`default`,form:`grouped`,children:[(0,A.jsxs)(`div`,{className:U.cardHeading,children:[(0,A.jsxs)(`div`,{className:U.connectionIdentity,children:[(0,A.jsx)(d,{service:i.providerId,size:`compact`}),(0,A.jsx)(f,{as:`h2`,variant:`card-title`,children:i.displayName})]}),(0,A.jsx)(o,{label:a,size:`compact`,tone:s})]}),(0,A.jsx)(f,{tone:`secondary`,variant:`body`,children:i.description}),(0,A.jsx)(`div`,{className:U.cardAction,children:(0,A.jsx)(r,{disabled:t,onClick:n,variant:`primary`,children:e})})]}),ve=({transport:e=w}={})=>{let t=n(),[i,o]=c(),{invalidateSession:s,state:d}=l(),p=u(d),[h,T]=(0,E.useState)(0),[D,O]=(0,E.useState)({_tag:`idle`}),[k,j]=(0,E.useState)({_tag:`idle`}),[M,N]=(0,E.useState)({_tag:`idle`}),[P,F]=(0,E.useState)(new Map),[ee,I]=(0,E.useState)(new Map),[te,L]=(0,E.useState)(new Map),[R,z]=(0,E.useState)(new Map),[B,V]=(0,E.useState)(null),[ne,H]=(0,E.useState)(null),[re,ie]=(0,E.useState)(null),W=(0,E.useRef)(new Map),G=(0,E.useRef)(null),K=(0,E.useRef)(new Map),q=(0,E.useRef)(new Map),J=(0,E.useRef)(null),ae=(0,E.useRef)(null),Y=(0,E.useRef)(new Map),X=(0,E.useRef)(new Map),Z=(0,E.useRef)(new Map),Q=(0,E.useRef)(new Map),$=(0,E.useCallback)(t=>{if(p===null||e.administration===void 0)return;X.current.get(t)?.abort();let n=new AbortController;X.current.set(t,n),z(e=>new Map(e).set(t,{_tag:`loading`})),e.administration(t,n.signal).then(e=>{n.signal.aborted||(X.current.delete(t),z(n=>new Map(n).set(t,{_tag:`ready`,administration:e})))},e=>{n.signal.aborted||(X.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(p),z(e=>new Map(e).set(t,{_tag:`failed`})))})},[s,p,e]),le=(0,E.useCallback)(t=>{if(p===null||e.synchronization===void 0)return;Y.current.get(t)?.abort();let n=new AbortController;Y.current.set(t,n),L(e=>new Map(e).set(t,{_tag:`loading`})),e.synchronization(t,n.signal).then(e=>{n.signal.aborted||(Y.current.delete(t),L(n=>new Map(n).set(t,{_tag:`ready`,synchronization:e})))},e=>{n.signal.aborted||(Y.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(p),L(e=>new Map(e).set(t,{_tag:`failed`})))})},[s,p,e]),ue=(0,E.useCallback)(t=>{if(p===null||e.synchronize===void 0)return;Y.current.get(t)?.abort();let n=new AbortController;Y.current.set(t,n),L(e=>{let n=e.get(t),r=n?._tag===`ready`?n.synchronization:null;return new Map(e).set(t,{_tag:`syncing`,previous:r})}),e.synchronize(t,n.signal).then(e=>{n.signal.aborted||(Y.current.delete(t),L(n=>new Map(n).set(t,{_tag:`ready`,synchronization:e})))},e=>{n.signal.aborted||(Y.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(p),L(e=>new Map(e).set(t,{_tag:`failed`})))})},[s,p,e]);(0,E.useEffect)(()=>{if(p===null){O({_tag:`idle`});return}let t=new AbortController;return O({_tag:`loading`}),e.overview(t.signal).then(e=>{t.signal.aborted||O({_tag:`ready`,overview:e})},e=>{t.signal.aborted||(m(`UnauthorizedApiError`)(e)&&s(p),O({_tag:`failed`}))}),()=>t.abort()},[s,h,p,e]),(0,E.useEffect)(()=>{if(D._tag!==`ready`||e.synchronization===void 0)return;let t=D.overview.connections.filter(({supportsSynchronization:e})=>e),n=new Set(t.map(({pluginConnectionId:e})=>e));for(let[e,t]of Y.current)n.has(e)||(t.abort(),Y.current.delete(e));L(e=>{let t=new Map(e),r=!1;for(let e of t.keys())n.has(e)||(t.delete(e),r=!0);return r?t:e});for(let e of t)le(e.pluginConnectionId);return()=>{for(let e of t)Y.current.get(e.pluginConnectionId)?.abort(),Y.current.delete(e.pluginConnectionId)}},[D,le,e.synchronization]),(0,E.useEffect)(()=>{if(D._tag!==`ready`||e.administration===void 0)return;let t=new Set(D.overview.connections.map(({pluginConnectionId:e})=>e));for(let[e,n]of X.current)t.has(e)||(n.abort(),X.current.delete(e));z(e=>{let n=new Map(e),r=!1;for(let e of n.keys())t.has(e)||(n.delete(e),r=!0);return r?n:e});for(let e of t)$(e);return()=>{for(let e of t)X.current.get(e)?.abort(),X.current.delete(e)}},[D,$,e.administration]),(0,E.useEffect)(()=>{if(p===null||B!==`codecommit`&&B!==`codepipeline`)return;J.current?.abort();let t=new AbortController;J.current=t,j({_tag:`loading`});let n=e.discoverAwsProfiles;return n===void 0?(j({_tag:`failed`}),()=>t.abort()):(n(t.signal).then(e=>{t.signal.aborted||j({_tag:`ready`,profiles:e})},e=>{t.signal.aborted||(m(`UnauthorizedApiError`)(e)&&s(p),j({_tag:`failed`}))}),()=>t.abort())},[s,B,p,e]),(0,E.useEffect)(()=>{if(p===null||B!==`jira`&&B!==`confluence`)return;ae.current?.abort();let t=new AbortController;ae.current=t,N({_tag:`loading`});let n=e.discoverAtlassianProfiles;return n===void 0?(N({_tag:`failed`}),()=>t.abort()):(n(t.signal).then(e=>{t.signal.aborted||N({_tag:`ready`,profiles:e})},e=>{t.signal.aborted||(m(`UnauthorizedApiError`)(e)&&s(p),N({_tag:`failed`}))}),()=>t.abort())},[s,B,p,e]),(0,E.useEffect)(()=>(F(new Map),I(new Map),L(new Map),z(new Map),V(null),H(null),ie(null),j({_tag:`idle`}),N({_tag:`idle`}),K.current.clear(),()=>{for(let e of W.current.values())e.abort();W.current.clear(),G.current?.abort(),G.current=null,J.current?.abort(),J.current=null,ae.current?.abort(),ae.current=null;for(let e of Y.current.values())e.abort();Y.current.clear();for(let e of q.current.values())e.abort();q.current.clear();for(let e of X.current.values())e.abort();X.current.clear();for(let e of Z.current.values())e.abort();Z.current.clear();for(let e of Q.current.values())e.abort();Q.current.clear()}),[p]),(0,E.useEffect)(()=>{if(D._tag!==`ready`||d._tag!==`authenticated`||d.session.permission!==`workspace-owner`)return;let e=_(i,`enable`);if(e===null||!D.overview.catalog.some(({providerId:t})=>t===e))return;if(e===`jira`||e===`confluence`){let t=y(i),n=t?.includes(e)===!0;H(n?{preferredProfileId:S(i),preferredSiteId:g(i),providers:t,requestedOAuthProviders:t}:fe(D.overview.connections,e))}V(e);let t=new URLSearchParams(i);t.delete(`enable`),t.delete(`atlassianProfile`),t.delete(`atlassianProvider`),t.delete(`atlassianSite`),o(t,{replace:!0})},[D,i,d,o]);let de=(0,E.useCallback)((t,n=!1)=>{if(p===null)return;W.current.get(t)?.abort();let r=new AbortController;W.current.set(t,r),F(e=>new Map(e).set(t,{_tag:`testing`})),e.test(t,r.signal).then(e=>{r.signal.aborted||(W.current.delete(t),F(n=>new Map(n).set(t,{_tag:`result`,result:e})),$(t),e._tag===`healthy`&&n&&T(e=>e+1))},e=>{r.signal.aborted||(W.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(p),F(e=>new Map(e).set(t,{_tag:`request-failed`})))})},[s,$,p,e]),he=(0,E.useCallback)(async(t,n)=>{if(p===null)return!1;G.current?.abort();let r=new AbortController;G.current=r,ie(n);let i=!1,a=!1,o=!1,c=K.current.get(n)??new Set;K.current.set(n,c);let l=(e,t)=>{c.add(e),i||=t.test._tag!==`healthy`,o||=t.connection.providerAccountId!==null,O(e=>e._tag===`ready`?{_tag:`ready`,overview:{...e.overview,connections:[...e.overview.connections,t.connection]}}:e),F(e=>new Map(e).set(t.connection.pluginConnectionId,{_tag:`result`,result:t.test}))};try{let u=t.filter(e=>!c.has(se(e)));if(e.createBatch!==void 0&&u.length>0){let t=new Map,n=[];for(let r of u){let i=await e.makeConnectionId();t.set(i,se(r)),n.push({pluginConnectionId:i,providerId:r.catalog.providerId,displayName:r.displayName,values:r.values})}let i=await e.createBatch({connections:n},r.signal);if(r.signal.aborted)return!1;let o=new Set;for(let e of i.results){let n=e._tag===`failed`?e.pluginConnectionId:e.response.connection.pluginConnectionId;if(!t.has(n)||o.has(n)){a=!0;continue}if(o.add(n),e._tag===`failed`){a=!0;continue}let r=t.get(e.response.connection.pluginConnectionId);r!==void 0&&l(r,e.response)}a||=o.size!==n.length}else for(let t of u){let n=se(t),i=await e.makeConnectionId(),a=await e.create({pluginConnectionId:i,providerId:t.catalog.providerId,displayName:t.displayName,values:t.values},r.signal);if(r.signal.aborted)return!1;l(n,a)}if(o)try{let t=await e.overview(r.signal);r.signal.aborted||O({_tag:`ready`,overview:t})}catch(e){if(r.signal.aborted)return!1;m(`UnauthorizedApiError`)(e)&&s(p)}return a?K.current.set(n,c):K.current.delete(n),G.current=null,V(i||a?n:null),ie(null),!a}catch(e){return!r.signal.aborted&&(G.current=null,m(`UnauthorizedApiError`)(e)&&s(p),ie(null),!1)}},[s,p,e]),ve=(0,E.useCallback)((e,t,n)=>he([{catalog:e,displayName:t,values:n}],e.providerId),[he]),ye=(0,E.useCallback)((t,n)=>{if(p===null)return;n||(W.current.get(t)?.abort(),W.current.delete(t),F(e=>{let n=new Map(e);return n.delete(t),n})),q.current.get(t)?.abort();let r=new AbortController;q.current.set(t,r),I(e=>new Map(e).set(t,`changing`)),e.setEnabled(t,n,r.signal).then(e=>{r.signal.aborted||(q.current.delete(t),O(n=>n._tag===`ready`?{_tag:`ready`,overview:{...n.overview,connections:n.overview.connections.map(n=>n.pluginConnectionId===t?e:n)}}:n),I(e=>{let n=new Map(e);return n.delete(t),n}),n?de(t):F(e=>{let n=new Map(e);return n.delete(t),n}))},e=>{r.signal.aborted||(q.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(p),I(e=>new Map(e).set(t,`request-failed`)))})},[s,p,de,e]),be=(0,E.useCallback)(async(t,n)=>{if(p===null||e.reauthorize===void 0)return!1;let r=R.get(t);if(r?._tag!==`ready`)return!1;Z.current.get(t)?.abort();let i=new AbortController;Z.current.set(t,i);try{let a=await e.reauthorize(t,r.administration.configuration.revision,n,i.signal);return!i.signal.aborted&&(Z.current.delete(t),O(e=>e._tag===`ready`?{_tag:`ready`,overview:{...e.overview,connections:e.overview.connections.map(e=>e.pluginConnectionId===t?a.connection:e)}}:e),F(e=>new Map(e).set(t,{_tag:`result`,result:a.test})),$(t),!0)}catch(e){return!i.signal.aborted&&(Z.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(p),$(t),!1)}},[R,s,$,p,e]);(0,E.useEffect)(()=>{if(D._tag!==`ready`||d._tag!==`authenticated`||d.session.permission!==`workspace-owner`)return;let e=x(i),t=C(i);if(e===null||t===null)return;let n=D.overview.connections.find(t=>t.pluginConnectionId===e),r=R.get(e),a=r?._tag===`ready`?r.administration.credentialFields.find(({key:e})=>e===`oauthProfileId`):void 0;if(n?.providerId!==`jira`&&n?.providerId!==`confluence`||r?._tag!==`ready`||a===void 0)return;let s=new URLSearchParams(i);s.delete(`atlassianRecoveryConnection`),s.delete(`atlassianRecoveryProfile`),o(s,{replace:!0}),be(e,[{key:a.key,value:t}])},[R,D,be,i,d,o]);let xe=(0,E.useCallback)(async t=>{if(p===null||e.revoke===void 0)return!1;let n=R.get(t);if(n?._tag!==`ready`)return!1;Z.current.get(t)?.abort();let r=new AbortController;Z.current.set(t,r);try{let i=await e.revoke(t,n.administration.configuration.revision,r.signal);return!r.signal.aborted&&(Z.current.delete(t),O(e=>e._tag===`ready`?{_tag:`ready`,overview:{...e.overview,connections:e.overview.connections.map(e=>e.pluginConnectionId===t?i:e)}}:e),F(e=>{let n=new Map(e);return n.delete(t),n}),$(t),!0)}catch(e){return!r.signal.aborted&&(Z.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(p),$(t),!1)}},[R,s,$,p,e]),Se=(0,E.useCallback)(async(t,n)=>{if(p===null||e.patchAccount===void 0||n.length===0)return!1;Q.current.get(t.providerAccountId)?.abort();let r=new AbortController;Q.current.set(t.providerAccountId,r);try{let i=await e.patchAccount(t.providerAccountId,{expectedRevision:t.revision,displayName:n},r.signal);return!r.signal.aborted&&(Q.current.get(t.providerAccountId)===r&&Q.current.delete(t.providerAccountId),O(e=>e._tag===`ready`?{_tag:`ready`,overview:{...e.overview,accounts:e.overview.accounts.map(e=>e.providerAccountId===i.providerAccountId?i:e)}}:e),!0)}catch(e){return!r.signal.aborted&&(Q.current.get(t.providerAccountId)===r&&Q.current.delete(t.providerAccountId),m(`UnauthorizedApiError`)(e)&&s(p),!1)}},[s,p,e]),Ce=d._tag===`authenticated`||d._tag===`storage-unavailable`?d.session:null,we=d._tag===`authenticated`&&d.session.permission===`workspace-owner`;return(0,A.jsxs)(`section`,{"aria-labelledby":`services-title`,className:U.page,children:[(0,A.jsxs)(`header`,{className:U.heading,children:[(0,A.jsx)(f,{as:`h1`,id:`services-title`,variant:`page-title`,children:`Services`}),(0,A.jsx)(f,{tone:`secondary`,variant:`body-large`,children:Ce===null||D._tag===`ready`&&D.overview.connections.length===0?`Choose a service below. Control Center will enable it and verify the exact account before using it.`:`Configure first-party providers and verify the exact account each connection represents.`})]}),Ce===null&&d._tag!==`checking`?(0,A.jsx)(`div`,{className:U.grid,children:v.map(e=>(0,A.jsx)(_e,{onEnable:()=>t(b(e.providerId)),service:e},e.providerId))}):D._tag===`loading`||D._tag===`idle`?(0,A.jsx)(`div`,{className:U.grid,children:v.map(e=>(0,A.jsx)(_e,{actionLabel:`Loading connections`,isActionDisabled:!0,onEnable:()=>void 0,service:e,statusLabel:`Loading`,statusTone:`progress`},e.providerId))}):D._tag===`failed`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{action:(0,A.jsx)(r,{onClick:()=>T(e=>e+1),children:`Try again`}),description:`Control Center could not load connection details. The installed services remain visible below.`,title:`Connections unavailable`}),(0,A.jsx)(`div`,{className:U.grid,children:v.map(e=>(0,A.jsx)(_e,{actionLabel:`Retry connections`,onEnable:()=>T(e=>e+1),service:e,statusLabel:`Installed`,statusTone:`neutral`},e.providerId))})]}):(0,A.jsxs)(A.Fragment,{children:[D.overview.accounts.length===0?null:(0,A.jsxs)(`section`,{"aria-labelledby":`connected-accounts-title`,className:U.accounts,children:[(0,A.jsxs)(`div`,{className:U.sectionHeading,children:[(0,A.jsx)(f,{as:`h2`,id:`connected-accounts-title`,variant:`section-title`,children:`Connected accounts`}),(0,A.jsx)(f,{tone:`secondary`,variant:`body`,children:`One verified provider identity can own several followed resources.`})]}),(0,A.jsx)(`div`,{className:U.accountGrid,children:D.overview.accounts.map(t=>(0,A.jsx)(oe,{account:t,administrationStates:R,canConfigure:we,connections:D.overview.connections,enablementStates:ee,onAdd:(e,t)=>{(e===`jira`||e===`confluence`)&&H({preferredProfileId:null,preferredSiteId:t,providers:[e],requestedOAuthProviders:null}),V(e)},onSetEnabled:ye,onRefreshSynchronization:le,onReauthorize:be,onRename:e=>Se(t,e),onRevoke:xe,onStartAtlassianOAuth:e.startAtlassianOAuthGrant,onSynchronize:ue,synchronizationStates:te,onTest:de,testStates:P},t.providerAccountId))})]}),(0,A.jsx)(`div`,{className:U.grid,children:D.overview.catalog.flatMap(t=>{let n=D.overview.connections.filter(e=>e.providerId===t.providerId),r=new Set(D.overview.accounts.flatMap(({resources:e})=>e.map(({followedResourceId:e})=>e))),i=n.some(({followedResourceId:e})=>e!==null&&r.has(e)),a=n.filter(({followedResourceId:e})=>e===null||!r.has(e)),o=fe(D.overview.connections,t.providerId===`jira`||t.providerId===`confluence`?t.providerId:void 0),c=pe(ne??o,D.overview.connections,M),l=a.map(n=>(0,A.jsx)(me,{administrationState:R.get(n.pluginConnectionId),canConfigure:we,canTest:we,connection:n,enablementState:ee.get(n.pluginConnectionId),onConfigure:()=>{(t.providerId===`jira`||t.providerId===`confluence`)&&H(ce),V(t.providerId)},onSetEnabled:ye,onRefreshSynchronization:le,onReauthorize:be,onRevoke:xe,onStartAtlassianOAuth:e.startAtlassianOAuthGrant,onSynchronize:ue,onTest:e=>de(e,!0),synchronizationState:te.get(n.pluginConnectionId),testState:P.get(n.pluginConnectionId)},n.pluginConnectionId));return n.length>0&&B!==t.providerId&&(i||t.providerId!==`jira`&&t.providerId!==`confluence`)?l:[...l,(0,A.jsx)(ge,{atlassianProfiles:M._tag===`ready`?M.profiles:[],atlassianProfilesState:M._tag,atlassianSetupIntent:c,awsProfiles:k._tag===`ready`?k.profiles:[],awsProfilesState:k._tag,canConfigure:we,catalog:t,catalogs:D.overview.catalog,isAdditional:n.length>0&&(t.providerId===`jira`||t.providerId===`confluence`),isOpen:B===t.providerId,isRecovery:a.length>0,isSubmitting:re===t.providerId,onCancel:()=>{K.current.delete(t.providerId),H(null),V(null)},onDiscoverAws:(t,n)=>{let r=e.discoverAwsResources;return r===void 0?Promise.reject(Error(`AWS resource discovery is unavailable`)):r(t,n).catch(e=>(p!==null&&m(`UnauthorizedApiError`)(e)&&s(p),Promise.reject(e)))},onOpen:()=>{B!==t.providerId&&K.current.delete(t.providerId),(t.providerId===`jira`||t.providerId===`confluence`)&&H(o),V(t.providerId)},onStartAtlassianOAuth:(t,n,r)=>{let i=e.startAtlassianOAuthGrant;return i===void 0?Promise.reject(Error(`Atlassian OAuth is unavailable`)):i(t,n,r)},onSubmit:(e,n)=>ve(t,e,n),onSubmitAtlassian:e=>he(e,t.providerId),onSubmitAws:e=>he(e,t.providerId)},`${t.providerId}-catalog`)]})})]})]})};export{ve as ServicesPage};
|
|
2
|
-
//# sourceMappingURL=ServicesPage-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{u as n}from"./hooks-CGvBGjhq.js";import{d as r,i,r as a,v as o}from"./Dialog-_t9OodCK-CzkLh9VB.js";import{t as s}from"./jsx-runtime-NZYk81nU.js";import{E as c,b as l,y as u}from"./index-DlDEYM2e.js";import{y as d}from"./patterns-CJ4c7F5A.js";import{n as f,t as p}from"./primitives-Dj-qYrUZ-BIf5RLs4.js";import{Ka as m,Wr as h}from"./agent-api-0YXZd1ag.js";import{a as g,c as _,d as v,i as y,l as b,o as x,r as S,s as C}from"./serviceOnboarding-BXJRvJ79.js";import{t as w}from"./connectionTestTransport-DtTYdbuO.js";import{r as T}from"./atlassianOAuthSetupIntentStorage-BFd1um3D.js";var E=e(t(),1),D={form:`_form_piwc3_1`,intro:`_intro_piwc3_2`,fallback:`_fallback_piwc3_3`,resources:`_resources_piwc3_16`,actions:`_actions_piwc3_22`,error:`_error_piwc3_29`},O=(e,t)=>{switch(e.kind){case`integer`:return{_tag:`integer`,key:e.key,value:Number(t)};case`secret`:return{_tag:`secret`,key:e.key,value:t};case`text`:case`url`:return{_tag:e.kind,key:e.key,value:t}}},k=(e,t)=>e.configurationFields.flatMap(e=>{let n=t.get(e.key)??e.defaultValue;return n===null&&!e.required?[]:[O(e,n??``)]}),A=s(),j=(e,t)=>e.find(e=>e.profileId===t),M=(e,t)=>e.status===`valid`&&(t.preferredSiteId===null||e.cloudId===t.preferredSiteId)&&t.providers.every(t=>e.providers.includes(t)),N=e=>e.status===`expired`?`expired`:e.providers.includes(`jira`)?e.providers.includes(`confluence`)?`Jira + Confluence`:`Jira only`:`Confluence only`,P=({catalogs:e,isSubmitting:t,onCancel:n,onStartOAuth:a,onSubmit:o,profiles:s,profilesState:c,setupIntent:l})=>{let u=e.find(({providerId:e})=>e===`jira`),d=e.find(({providerId:e})=>e===`confluence`),f=l.providers.includes(`jira`),m=l.providers.includes(`confluence`),[h,g]=(0,E.useState)(`Atlassian workspace`),[_,v]=(0,E.useState)(`oauth`),[y,b]=(0,E.useState)(``),[x,S]=(0,E.useState)(``),[C,w]=(0,E.useState)(``),[O,P]=(0,E.useState)(``),[F,ee]=(0,E.useState)(``),[I,te]=(0,E.useState)(``),[L,R]=(0,E.useState)(``),[z,B]=(0,E.useState)(``),[V,ne]=(0,E.useState)(!1),[H,U]=(0,E.useState)(null),[re,ie]=(0,E.useState)(``),[W,G]=(0,E.useState)(``),[K,q]=(0,E.useState)(null),J=(0,E.useRef)(null);(0,E.useEffect)(()=>()=>J.current?.abort(),[]),(0,E.useEffect)(()=>{if(_!==`oauth`)return;let e=j(s,y);if(e!==void 0&&M(e,l))return;let t=l.preferredProfileId===null?void 0:j(s,l.preferredProfileId),n=t!==void 0&&M(t,l)?t:s.find(e=>M(e,l));b(n?.profileId??``)},[_,y,s,l]),(0,E.useEffect)(()=>{l.preferredSiteId!==null&&w(l.preferredSiteId)},[l.preferredSiteId]),(0,E.useEffect)(()=>{if(_!==`oauth`)return;let e=j(s,y);e!==void 0&&(S(e.siteUrl),w(e.cloudId))},[_,y,s]);let ae=e=>{if(e.preventDefault(),q(null),f&&u===void 0||m&&d===void 0){q(`The installed Atlassian adapters are unavailable.`);return}let t=h.trim(),n=x.trim(),r=C.trim(),i=O.trim(),a=F.trim(),c=I.trim();if(t.length===0||n.length===0||r.length===0||f&&i.length===0||m&&(a.length===0||c.length===0)){q(f&&m?`Add the Atlassian site identity, Jira project, Confluence space, and readable health page.`:f?`Add the Atlassian site identity and Jira project.`:`Add the Atlassian site identity, Confluence space, and readable health page.`);return}let p=_===`oauth`?[[`authMode`,`oauth`],[`oauthProfileId`,y]]:[[`authMode`,`api-token`],[`email`,L.trim()],[`apiToken`,z]],g=j(s,y);if(_===`oauth`&&(g===void 0||!M(g,l))){q(`Choose a valid profile for the products being connected, or use an API token instead.`);return}if(_===`api-token`&&(L.trim().length===0||z.length===0)){q(`Add the Atlassian email and API token.`);return}if(_===`api-token`&&f&&l.preferredSiteId!==null){q(`Use a matching OAuth profile to add a Jira project to this Atlassian site.`);return}let v=[...p,[`webBaseUrl`,n],[`siteBaseUrl`,n],[`siteId`,r],[`projectId`,i],[`spaceId`,a],[`probePageId`,c]],b=new Map(v);o([...f&&u!==void 0?[{catalog:u,displayName:`${t} · Jira`,values:k(u,b)}]:[],...m&&d!==void 0?[{catalog:d,displayName:`${t} · Confluence`,values:k(d,b)}]:[]]).then(e=>{e||q(`Some Atlassian services could not be connected. Review the cards below and retry.`)})},Y=e=>{if(l.requestedOAuthProviders===null)return;q(null),U(null),ne(!0),J.current?.abort();let t=new AbortController;J.current=t,a(l.requestedOAuthProviders,t.signal,e).then(e=>{if(!t.signal.aborted){if(e._tag===`configuration-required`){U(e.callbackUrl),q(`OAuth needs a one-time local client configuration before sign-in.`),ne(!1);return}if(!T(e.authorizationUrl,{preferredSiteId:l.preferredSiteId,providers:l.providers})){q(`Control Center could not preserve this Atlassian setup across sign-in. Try again.`),ne(!1);return}window.location.assign(e.authorizationUrl)}},()=>{t.signal.aborted||(q(`Control Center could not start Atlassian sign-in. Try again.`),ne(!1))})},X=()=>{let e=re.trim();if(e.length===0||W.length===0){q(`Add the Atlassian OAuth client ID and client secret.`);return}Y({clientId:e,clientSecret:W})},Z=()=>{J.current?.abort(),J.current=null,ne(!1),v(`api-token`)},Q=c===`loading`?`Finding local Atlassian OAuth profiles…`:c===`failed`?`OAuth profile discovery is unavailable. API token fallback remains available.`:c===`ready`?`${s.filter(e=>M(e,l)).length} ${f&&m?`shared `:``}OAuth ${s.filter(e=>M(e,l)).length===1?`profile`:`profiles`} ready`:`OAuth profiles stay on this machine and are shared by Jira and Confluence.`;return(0,A.jsxs)(`form`,{className:D.form,onSubmit:ae,children:[(0,A.jsxs)(`div`,{className:D.intro,children:[(0,A.jsx)(p,{as:`h3`,variant:`card-title`,children:f&&m?`One identity. Jira and Confluence together.`:f?`Connect Jira with your Atlassian identity.`:`Connect Confluence with your Atlassian identity.`}),(0,A.jsx)(p,{tone:`secondary`,variant:`body`,children:`OAuth is preferred. Control Center reads the selected local profile only inside the server runtime.`}),(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:Q})]}),(0,A.jsx)(i,{label:`Account name`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,maxLength:90,onChange:e=>g(e.currentTarget.value),value:h})}),_===`oauth`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(r,{disabled:l.requestedOAuthProviders===null,loading:V,onClick:()=>Y(),type:`button`,variant:`primary`,children:`Sign in with Atlassian`}),H===null?null:(0,A.jsxs)(`div`,{className:D.fallback,children:[(0,A.jsxs)(p,{as:`p`,tone:`secondary`,variant:`meta`,children:[`Create an OAuth 2.0 integration in Atlassian Developer Console and add `,(0,A.jsx)(`code`,{children:H}),`as its callback URL. The credentials stay on this Control Center machine.`]}),(0,A.jsx)(i,{label:`OAuth client ID`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,autoComplete:`off`,maxLength:500,onChange:e=>ie(e.currentTarget.value),value:re})}),(0,A.jsx)(i,{label:`OAuth client secret`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,autoComplete:`off`,maxLength:16384,onChange:e=>G(e.currentTarget.value),type:`password`,value:W})}),(0,A.jsx)(r,{loading:V,onClick:X,type:`button`,variant:`primary`,children:`Save OAuth app and continue`})]}),(0,A.jsx)(i,{label:`OAuth profile`,required:!0,size:`compact`,children:e=>(0,A.jsxs)(`select`,{...e,onChange:e=>b(e.currentTarget.value),value:y,children:[(0,A.jsx)(`option`,{value:``,children:`Choose a profile already on this machine`}),s.filter(e=>l.preferredSiteId===null||e.cloudId===l.preferredSiteId).map(e=>(0,A.jsxs)(`option`,{disabled:!M(e,l),value:e.profileId,children:[e.name,` · `,N(e)]},e.profileId))]})}),f&&l.preferredSiteId!==null?null:(0,A.jsx)(r,{onClick:Z,type:`button`,variant:`quiet`,children:`Use API token instead`})]}):(0,A.jsxs)(`div`,{className:D.fallback,children:[(0,A.jsx)(i,{label:`Atlassian email`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,autoComplete:`username`,onChange:e=>R(e.currentTarget.value),type:`email`,value:L})}),(0,A.jsx)(i,{label:`API token`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,autoComplete:`off`,maxLength:16384,onChange:e=>B(e.currentTarget.value),type:`password`,value:z})}),(0,A.jsx)(r,{onClick:()=>v(`oauth`),type:`button`,variant:`quiet`,children:`Use OAuth profile`})]}),(0,A.jsx)(i,{label:`Atlassian site URL`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,disabled:_===`oauth`,onChange:e=>S(e.currentTarget.value),placeholder:`https://team.atlassian.net/`,type:`url`,value:x})}),(0,A.jsx)(i,{description:`The stable Atlassian cloud ID; filled from OAuth when available.`,label:`Site ID`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,disabled:_===`oauth`||l.preferredSiteId!==null,onChange:e=>w(e.currentTarget.value),value:C})}),f?(0,A.jsx)(i,{description:`The immutable Jira project ID followed by this connection.`,label:`Jira project ID`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,onChange:e=>P(e.currentTarget.value),value:O})}):null,m?(0,A.jsxs)(`div`,{className:D.resources,children:[(0,A.jsx)(i,{label:`Confluence space ID`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,onChange:e=>ee(e.currentTarget.value),value:F})}),(0,A.jsx)(i,{description:`A readable page used only for the connection check.`,label:`Health page ID`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,onChange:e=>te(e.currentTarget.value),value:I})})]}):null,K===null?null:(0,A.jsx)(p,{as:`p`,className:D.error,role:`alert`,variant:`body`,children:K}),(0,A.jsxs)(`div`,{className:D.actions,children:[(0,A.jsx)(r,{disabled:t,onClick:n,type:`button`,variant:`secondary`,children:`Cancel`}),(0,A.jsx)(r,{loading:t,type:`submit`,variant:`primary`,children:`Connect Atlassian`})]})]})},F={form:`_form_1gjxb_1`,intro:`_intro_1gjxb_6`,resources:`_resources_1gjxb_11`,discoveryActions:`_discoveryActions_1gjxb_22`,resourcePanelHeading:`_resourcePanelHeading_1gjxb_23`,resourcePanel:`_resourcePanel_1gjxb_23`,choiceList:`_choiceList_1gjxb_44`,choice:`_choice_1gjxb_44`,actions:`_actions_1gjxb_58`,error:`_error_1gjxb_65`},ee=20,I=e=>[...new Set(e.split(/[\n,]/u).map(e=>e.trim()).filter(e=>e.length>0))],te=(e,t)=>[...new Set([...e,...I(t)])],L=(e,t)=>[...new Set([...e,...t])].sort((e,t)=>e.localeCompare(t)),R=(e,t)=>{let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.toLocaleLowerCase().includes(n))},z=({accountName:e,codeCommit:t,codePipeline:n,pipelineNames:r,profile:i,region:a,repositoryNames:o})=>[...o.map(n=>({catalog:t,displayName:`${e} · ${n}`,values:k(t,new Map([[`profile`,i],[`region`,a],[`repositoryName`,n]]))})),...r.map(t=>({catalog:n,displayName:`${e} · ${t}`,values:k(n,new Map([[`profile`,i],[`region`,a],[`pipelineName`,t]]))}))],B=(e,t)=>{switch(t){case`loading`:return`Discovering local AWS profiles…`;case`ready`:return`${e} local AWS ${e===1?`profile`:`profiles`} detected`;case`failed`:return`Profile discovery unavailable. Enter a profile manually.`;case`idle`:return`AWS profiles are discovered locally by the Control Center server.`}},V=(e,t)=>t===`authorization`?`${e} access was denied. Select names manually or update this profile's permissions.`:`${e} discovery is unavailable (${t}). Select names manually or refresh.`,ne=({label:e,query:t,selected:n,service:r,setQuery:a,setSelected:s})=>{if(r._tag===`failed`){let t=[...n].sort((e,t)=>e.localeCompare(t));return(0,A.jsxs)(`div`,{className:F.resourcePanel,children:[(0,A.jsxs)(`div`,{className:F.resourcePanelHeading,children:[(0,A.jsx)(p,{as:`h4`,variant:`card-title`,children:e}),(0,A.jsx)(o,{label:`${n.size} selected`,size:`compact`,tone:`neutral`})]}),(0,A.jsx)(p,{as:`p`,className:F.error,role:`status`,variant:`body`,children:V(e===`Repositories`?`CodeCommit`:`CodePipeline`,r.failureClass)}),t.length===0?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:`Preserved from the previous discovery. Clear any resource you no longer want to connect.`}),(0,A.jsx)(`div`,{className:F.choiceList,children:t.map(e=>(0,A.jsxs)(`label`,{className:F.choice,children:[(0,A.jsx)(`input`,{checked:!0,onChange:()=>{let t=new Set(n);t.delete(e),s(t)},type:`checkbox`}),(0,A.jsx)(`span`,{children:e})]},e))})]})]})}let c=L(r.names,n),l=R(c,t);return(0,A.jsxs)(`div`,{className:F.resourcePanel,children:[(0,A.jsxs)(`div`,{className:F.resourcePanelHeading,children:[(0,A.jsx)(p,{as:`h4`,variant:`card-title`,children:e}),(0,A.jsx)(o,{label:`${n.size} selected`,size:`compact`,tone:`neutral`})]}),c.length===0?(0,A.jsxs)(p,{tone:`secondary`,variant:`body`,children:[`No `,e.toLocaleLowerCase(),` were found in this region.`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(i,{label:`Search ${e.toLocaleLowerCase()}`,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,onChange:e=>a(e.currentTarget.value),type:`search`,value:t})}),(0,A.jsx)(`div`,{className:F.choiceList,children:l.map(e=>(0,A.jsxs)(`label`,{className:F.choice,children:[(0,A.jsx)(`input`,{checked:n.has(e),onChange:t=>{let r=new Set(n);t.currentTarget.checked?r.add(e):r.delete(e),s(r)},type:`checkbox`}),(0,A.jsx)(`span`,{children:e})]},e))}),l.length===0?(0,A.jsx)(p,{tone:`secondary`,variant:`body`,children:`No matching resources.`}):null,r.truncated?(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:`Showing the first 20 names. Use manual entry for another name.`}):null]})]})},H=({awsProfiles:e,awsProfilesState:t,catalogs:n,isSubmitting:a,onCancel:o,onDiscover:s,onSubmit:c})=>{let l=n.find(({providerId:e})=>e===`codecommit`),u=n.find(({providerId:e})=>e===`codepipeline`),[d,f]=(0,E.useState)(`AWS account`),[m,h]=(0,E.useState)(`default`),[g,_]=(0,E.useState)(``),[v,y]=(0,E.useState)(``),[b,x]=(0,E.useState)(``),[S,C]=(0,E.useState)(new Set),[w,T]=(0,E.useState)(new Set),[D,O]=(0,E.useState)(``),[k,j]=(0,E.useState)(``),[M,N]=(0,E.useState)(!0),[P,I]=(0,E.useState)({_tag:`idle`}),[L,R]=(0,E.useState)(null),V=(0,E.useRef)(null);(0,E.useEffect)(()=>()=>V.current?.abort(),[]),(0,E.useEffect)(()=>{let t=e.find(e=>e.profile===m)?.region;t!=null&&_(e=>e.trim().length===0?t:e)},[e,m]);let H=()=>{V.current?.abort(),V.current=null,I({_tag:`idle`}),C(new Set),T(new Set)};return(0,A.jsxs)(`form`,{className:F.form,onSubmit:e=>{if(e.preventDefault(),R(null),l===void 0||u===void 0){R(`The installed AWS adapters are unavailable.`);return}let t=d.trim(),n=m.trim(),r=g.trim();if(t.length===0||n.length===0||r.length===0){R(`Add an account name, AWS profile, and region.`);return}let i=te(S,M?v:``),a=te(w,M?b:``);if(i.length===0&&a.length===0){R(`Select or manually add at least one repository or pipeline to follow.`);return}if(i.length>ee||a.length>ee){R(`Follow at most ${ee} repositories and pipelines per account.`);return}if([...i,...a].some(e=>e.length>100)){R(`Repository and pipeline names must be 100 characters or fewer.`);return}c(z({accountName:t,codeCommit:l,codePipeline:u,pipelineNames:a,profile:n,region:r,repositoryNames:i})).then(e=>{e||R(`Some AWS resources could not be connected. Review the cards below and retry.`)})},children:[(0,A.jsxs)(`div`,{className:F.intro,children:[(0,A.jsx)(p,{as:`h3`,variant:`card-title`,children:`One account. Many delivery streams.`}),(0,A.jsx)(p,{tone:`secondary`,variant:`body`,children:`Choose one local AWS profile and region, verify its account, then select CodeCommit repositories and CodePipeline pipelines.`}),(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:B(e.length,t)})]}),(0,A.jsx)(i,{label:`Account name`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,maxLength:90,onChange:e=>f(e.currentTarget.value),value:d})}),(0,A.jsx)(i,{label:`AWS profile`,required:!0,size:`compact`,children:t=>(0,A.jsx)(`input`,{...t,list:e.length>0?`aws-account-profiles`:void 0,maxLength:200,onChange:t=>{let n=t.currentTarget.value,r=e.find(e=>e.profile===n)?.region;h(n),_(r??``),H()},value:m})}),(0,A.jsx)(i,{label:`AWS region`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,maxLength:100,onChange:e=>{_(e.currentTarget.value),H()},value:g})}),(0,A.jsxs)(`div`,{className:F.discoveryActions,children:[(0,A.jsx)(r,{loading:P._tag===`loading`,onClick:()=>{R(null);let e={profile:m.trim(),region:g.trim()};if(e.profile.length===0||e.region.length===0){R(`Add an AWS profile and region before testing discovery.`);return}V.current?.abort();let t=new AbortController;V.current=t,I({_tag:`loading`}),s(e,t.signal).then(e=>{t.signal.aborted||(V.current=null,I({_tag:`ready`,response:e}))},()=>{t.signal.aborted||(V.current=null,I({_tag:`failed`}))})},type:`button`,variant:`secondary`,children:P._tag===`ready`?`Refresh discovery`:`Test & discover`}),P._tag===`ready`?(0,A.jsxs)(p,{tone:`secondary`,variant:`body`,children:[`Verified AWS account `,P.response.accountId]}):P._tag===`failed`?(0,A.jsx)(p,{as:`p`,className:F.error,role:`alert`,variant:`body`,children:`Account verification failed. Check the profile and region, or enter resource names manually.`}):null]}),P._tag===`ready`?(0,A.jsxs)(`div`,{className:F.resources,children:[(0,A.jsx)(ne,{label:`Repositories`,query:D,selected:S,service:P.response.codeCommit,setQuery:O,setSelected:C}),(0,A.jsx)(ne,{label:`Pipelines`,query:k,selected:w,service:P.response.codePipeline,setQuery:j,setSelected:T})]}):null,(0,A.jsx)(`div`,{children:(0,A.jsx)(r,{onClick:()=>N(e=>!e),type:`button`,variant:`quiet`,children:M?`Hide manual name entry`:`Enter resource names manually`})}),M?(0,A.jsxs)(`div`,{className:F.resources,children:[(0,A.jsx)(i,{description:`Comma or line separated. Maximum 20 including selected names.`,label:`Repository names`,size:`compact`,children:e=>(0,A.jsx)(`textarea`,{...e,maxLength:4096,onChange:e=>y(e.currentTarget.value),placeholder:`payments-api\\nrisk-engine`,value:v})}),(0,A.jsx)(i,{description:`Comma or line separated. Maximum 20 including selected names.`,label:`Pipeline names`,size:`compact`,children:e=>(0,A.jsx)(`textarea`,{...e,maxLength:4096,onChange:e=>x(e.currentTarget.value),placeholder:`payments-production\\nrisk-production`,value:b})})]}):null,e.length>0?(0,A.jsx)(`datalist`,{id:`aws-account-profiles`,children:e.map(e=>(0,A.jsx)(`option`,{label:e.region??`Region not configured`,value:e.profile},e.profile))}):null,L===null?null:(0,A.jsx)(p,{as:`p`,className:F.error,role:`alert`,variant:`body`,children:L}),(0,A.jsxs)(`div`,{className:F.actions,children:[(0,A.jsx)(r,{disabled:a,onClick:o,type:`button`,variant:`secondary`,children:`Cancel`}),(0,A.jsx)(r,{loading:a,type:`submit`,variant:`primary`,children:`Connect AWS account`})]})]})},U={page:`_page_xjg2t_1`,heading:`_heading_xjg2t_6`,grid:`_grid_xjg2t_12`,accounts:`_accounts_xjg2t_18`,accountCard:`_accountCard_xjg2t_19`,accountIdentity:`_accountIdentity_xjg2t_20`,resourceList:`_resourceList_xjg2t_21`,resource:`_resource_xjg2t_21`,sectionHeading:`_sectionHeading_xjg2t_23`,resourceBody:`_resourceBody_xjg2t_34`,accountGrid:`_accountGrid_xjg2t_44`,accountHeading:`_accountHeading_xjg2t_49`,resourceSummary:`_resourceSummary_xjg2t_50`,resourceStatus:`_resourceStatus_xjg2t_51`,accountActions:`_accountActions_xjg2t_52`,resourceActions:`_resourceActions_xjg2t_53`,disclosure:`_disclosure_xjg2t_124`,card:`_card_xjg2t_147`,cardHeading:`_cardHeading_xjg2t_153`,cardAction:`_cardAction_xjg2t_154`,synchronization:`_synchronization_xjg2t_161`,syncState:`_syncState_xjg2t_162`,administration:`_administration_xjg2t_167`,administrationSection:`_administrationSection_xjg2t_168`,credentialRecovery:`_credentialRecovery_xjg2t_169`,diagnostics:`_diagnostics_xjg2t_170`,accountEdit:`_accountEdit_xjg2t_171`,administrationLabels:`_administrationLabels_xjg2t_181`,diagnostic:`_diagnostic_xjg2t_170`,accountEditAction:`_accountEditAction_xjg2t_183`,syncActions:`_syncActions_xjg2t_202`,connectionIdentity:`_connectionIdentity_xjg2t_208`,testEvidence:`_testEvidence_xjg2t_215`,identity:`_identity_xjg2t_224`,setupForm:`_setupForm_xjg2t_229`,setupActions:`_setupActions_xjg2t_234`,setupError:`_setupError_xjg2t_241`,identifier:`_identifier_xjg2t_245`},re=e=>h(e.checkedAt),ie=({state:e})=>{if(e===void 0||e._tag===`testing`)return null;if(e._tag===`request-failed`)return(0,A.jsxs)(`div`,{"aria-live":`polite`,className:U.testEvidence,role:`status`,children:[(0,A.jsx)(o,{label:`Test failed`,tone:`critical`}),(0,A.jsx)(p,{tone:`secondary`,variant:`body`,children:`Control Center could not complete the test. Check the server and try again.`})]});let t=e.result,n=re(t);return(0,A.jsxs)(`div`,{"aria-live":`polite`,className:U.testEvidence,role:`status`,children:[(0,A.jsx)(o,{label:t._tag===`healthy`?`Connection healthy`:`Test failed`,tone:t._tag===`healthy`?`positive`:`critical`}),t._tag===`healthy`?(0,A.jsxs)(`div`,{className:U.identity,children:[(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:t.identity.label}),(0,A.jsx)(p,{as:`span`,variant:`card-title`,children:t.identity.displayName}),(0,A.jsx)(p,{className:U.identifier,tone:`secondary`,variant:`body`,children:t.identity.providerImmutableId})]}):(0,A.jsx)(p,{tone:`secondary`,variant:`body`,children:t.safeMessage}),(0,A.jsxs)(p,{tone:`secondary`,variant:`meta`,children:[`Checked `,(0,A.jsx)(`time`,{dateTime:n,children:n}),` · `,t.latencyMilliseconds,` ms`]})]})},W=e=>e===`critical`?`critical`:e===`warning`?`caution`:`neutral`,G=({atlassianOAuthProviders:e,canConfigure:t,onReauthorize:n,onRevoke:a,onStartAtlassianOAuth:s,state:c})=>{let[l,u]=(0,E.useState)(new Map),[d,f]=(0,E.useState)(`idle`),[m,h]=(0,E.useState)(`idle`),[g,_]=(0,E.useState)(null),[v,y]=(0,E.useState)(``),[b,x]=(0,E.useState)(``),S=(0,E.useRef)(null);if((0,E.useEffect)(()=>{u(new Map),f(`idle`),h(`idle`),_(null),S.current?.abort(),S.current=null},[c?._tag===`ready`?c.administration.configuration.revision:c?._tag]),(0,E.useEffect)(()=>()=>S.current?.abort(),[]),c===void 0)return null;if(c._tag===`loading`)return(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:`Loading permissions and diagnostics…`});if(c._tag===`failed`)return(0,A.jsx)(p,{className:U.setupError,role:`alert`,variant:`body`,children:`Administration details are unavailable.`});let{administration:C}=c,w=C.credentialFields.filter(({key:e})=>e!==`oauthProfileId`),D=C.credentialFields.some(({key:e})=>e===`oauthProfileId`)&&(C.connection.providerId===`jira`||C.connection.providerId===`confluence`)&&s!==void 0,O=C.configuration.values.find(({key:e})=>e===`siteId`),k=O?._tag===`text`||O?._tag===`url`?O.value:null,j=e=>{e.preventDefault();let t=w.flatMap(e=>{let t=l.get(e.key)??``;return t.trim().length===0?[]:[{key:e.key,value:e.kind===`secret`?t:t.trim()}]});t.length!==0&&(f(`reauthorizing`),n(t).then(e=>{f(e?`idle`:`failed`),e&&u(new Map)}))},M=()=>{f(`revoking`),a().then(e=>f(e?`idle`:`failed`))},N=t=>{if(!D||s===void 0)return;let n=e??(C.connection.providerId===`jira`?[`jira`]:[`confluence`]);S.current?.abort();let r=new AbortController;S.current=r,h(`starting`),_(null),s(n,r.signal,t).then(e=>{if(!r.signal.aborted){if(e._tag===`configuration-required`){_(e.callbackUrl),h(`configuration-required`);return}if(!T(e.authorizationUrl,{preferredSiteId:k,providers:n,recoveryConnectionId:C.connection.pluginConnectionId})){h(`failed`);return}window.location.assign(e.authorizationUrl)}},()=>{r.signal.aborted||h(`failed`)})};return(0,A.jsxs)(`section`,{"aria-label":`Connection administration`,className:U.administration,children:[(0,A.jsxs)(`div`,{className:U.administrationSection,children:[(0,A.jsx)(p,{as:`h4`,variant:`label`,children:`Permissions`}),(0,A.jsxs)(`div`,{className:U.administrationLabels,children:[C.permissions.map(e=>(0,A.jsx)(o,{label:`${e.capabilityId} v${e.version}`,size:`compact`,tone:e.state===`available`?`positive`:`neutral`},`${e.capabilityId}:${e.version}`)),C.permissions.length===0?(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:`No provider operations were negotiated.`}):null]})]}),(0,A.jsxs)(`div`,{className:U.administrationSection,children:[(0,A.jsx)(p,{as:`h4`,variant:`label`,children:`Schedule and freshness`}),(0,A.jsxs)(p,{tone:`secondary`,variant:`meta`,children:[C.schedule.mode===`manual`?`Manual synchronization`:`This provider does not support synchronization`,C.synchronization?.lastSuccessAt===null||C.synchronization?.lastSuccessAt===void 0?` · No successful sync recorded`:` · Last successful sync ${C.synchronization.lastSuccessAt}`]})]}),(0,A.jsxs)(`div`,{className:U.administrationSection,children:[(0,A.jsx)(p,{as:`h4`,variant:`label`,children:`Diagnostics`}),(0,A.jsx)(`div`,{className:U.diagnostics,children:C.diagnostics.map(e=>(0,A.jsxs)(`div`,{className:U.diagnostic,children:[(0,A.jsx)(o,{label:e.severity,size:`compact`,tone:W(e.severity)}),(0,A.jsx)(p,{variant:`meta`,children:e.summary})]},e.code))})]}),t&&C.credentialFields.length>0?(0,A.jsxs)(`form`,{className:U.credentialRecovery,onSubmit:j,children:[(0,A.jsx)(p,{as:`h4`,variant:`label`,children:`Credential recovery`}),(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:`Values are sent directly to the machine-local secret store and are never returned by this page.`}),w.map(e=>(0,A.jsx)(i,{description:e.description,label:e.label,size:`compact`,children:t=>(0,A.jsx)(`input`,{...t,autoComplete:`off`,maxLength:16384,onChange:t=>{let n=t.currentTarget.value;u(t=>new Map(t).set(e.key,n))},type:`password`,value:l.get(e.key)??``})},e.key)),D?(0,A.jsxs)(`div`,{className:U.administrationSection,children:[(0,A.jsx)(p,{variant:`meta`,children:`Atlassian OAuth recovery creates a new machine-local profile and verifies this connection’s existing site and resource before applying it.`}),(0,A.jsx)(r,{loading:m===`starting`,onClick:()=>N(),type:`button`,variant:`secondary`,children:`Sign in with Atlassian`}),m===`configuration-required`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(p,{tone:`secondary`,variant:`meta`,children:[`Configure the OAuth callback URL in Atlassian: `,g]}),(0,A.jsx)(i,{label:`OAuth client ID`,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,onChange:e=>y(e.currentTarget.value),value:v})}),(0,A.jsx)(i,{label:`OAuth client secret`,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,autoComplete:`off`,onChange:e=>x(e.currentTarget.value),type:`password`,value:b})}),(0,A.jsx)(r,{onClick:()=>{let e=v.trim();if(e.length===0||b.length===0){h(`failed`);return}N({clientId:e,clientSecret:b})},type:`button`,variant:`secondary`,children:`Save client and sign in`})]}):null,m===`failed`?(0,A.jsx)(p,{className:U.setupError,role:`alert`,variant:`body`,children:`Atlassian sign-in could not start. Verify the local OAuth client and try again.`}):null]}):null,(0,A.jsxs)(`div`,{className:U.resourceActions,children:[w.length>0?(0,A.jsx)(r,{disabled:d===`revoking`,loading:d===`reauthorizing`,type:`submit`,variant:`secondary`,children:`Replace credentials and test`}):null,(0,A.jsx)(r,{disabled:d===`reauthorizing`,loading:d===`revoking`,onClick:M,type:`button`,variant:`quiet`,children:`Revoke credentials`})]}),d===`failed`?(0,A.jsx)(p,{className:U.setupError,role:`alert`,variant:`body`,children:`The credential change was not applied. Refresh the details and try again.`}):null]}):null]})},K=e=>{switch(e){case`never`:return{label:`Never synchronized`,tone:`neutral`};case`running`:return{label:`Synchronizing`,tone:`progress`};case`synchronized`:return{label:`Synchronized`,tone:`positive`};case`source-unavailable`:return{label:`Source unavailable`,tone:`critical`};case`interrupted`:return{label:`Interrupted`,tone:`critical`}}},q=({isSyncing:e,synchronization:t})=>{let n=e?{label:`Synchronizing…`,tone:`progress`}:K(t.result);return(0,A.jsxs)(`div`,{className:U.syncState,children:[(0,A.jsx)(o,{label:n.label,size:`compact`,tone:n.tone}),(0,A.jsxs)(p,{tone:`secondary`,variant:`meta`,children:[`Last attempt:`,` `,t.lastAttemptAt===null?`never`:h(t.lastAttemptAt),` · Last success: `,t.lastSuccessAt===null?`never`:h(t.lastSuccessAt),` · ${t.pagesCommitted} ${t.pagesCommitted===1?`page`:`pages`}`]})]})},J=({canSynchronize:e,onRefresh:t,onSynchronize:n,state:i})=>{if(i===void 0)return null;let a=i._tag===`syncing`,s=i._tag===`ready`?i.synchronization:i._tag===`syncing`?i.previous:null;return(0,A.jsxs)(`div`,{className:U.synchronization,children:[s===null?a?(0,A.jsx)(o,{label:`Synchronizing…`,size:`compact`,tone:`progress`}):null:(0,A.jsx)(q,{isSyncing:a,synchronization:s}),i._tag===`loading`?(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:`Loading synchronization state…`}):null,i._tag===`failed`?(0,A.jsx)(p,{as:`p`,className:U.setupError,role:`alert`,variant:`body`,children:`Synchronization state is unavailable.`}):null,(0,A.jsxs)(`div`,{className:U.syncActions,children:[(0,A.jsx)(r,{disabled:!e||i._tag===`loading`||i._tag===`syncing`,loading:i._tag===`syncing`,onClick:n,variant:`secondary`,children:`Sync now`}),i._tag===`failed`?(0,A.jsx)(r,{onClick:t,variant:`quiet`,children:`Refresh state`}):null]})]})},ae=(e,t)=>{if(!e.isEnabled)return{label:`Disabled`,tone:`neutral`};if(t?._tag===`testing`)return{label:`Checking`,tone:`progress`};if(t?._tag===`result`)return t.result._tag===`healthy`?{label:`Healthy`,tone:`positive`}:{label:`Unavailable`,tone:`critical`};if(e.health===null)return{label:`Not checked`,tone:`neutral`};switch(e.health._tag){case`healthy`:return{label:`Healthy`,tone:`positive`};case`degraded`:return{label:`Degraded`,tone:`caution`};case`unavailable`:return{label:`Unavailable`,tone:`critical`};case`disabled`:return{label:`Not checked`,tone:`neutral`}}},Y=e=>{switch(e){case`codecommit`:return`Repository`;case`codepipeline`:return`Pipeline`;case`jira`:return`Project`;case`confluence`:return`Space`;case`clockify`:return`Workspace`}},X=e=>{let t=[];return e.resources.some(({providerId:e})=>e===`jira`)&&t.push(`jira`),e.resources.some(({providerId:e})=>e===`confluence`)&&t.push(`confluence`),t.length===0?void 0:t},Z=(e,t,n)=>(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:U.connectionIdentity,children:[(0,A.jsx)(d,{service:e.providerId,size:`compact`}),(0,A.jsxs)(`div`,{className:U.identity,children:[(0,A.jsx)(p,{as:`h3`,variant:`card-title`,children:e.displayName}),(0,A.jsxs)(p,{className:U.identifier,tone:`secondary`,variant:`meta`,children:[Y(e.providerId),` · `,e.providerImmutableId]})]})]}),(0,A.jsxs)(`div`,{className:U.resourceStatus,children:[(0,A.jsx)(o,{label:t.label,size:`compact`,tone:t.tone}),n?(0,A.jsxs)(`span`,{className:U.disclosure,children:[`Controls `,(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`›`})]}):null]})]}),Q=({administrationState:e,atlassianOAuthProviders:t,canConfigure:n,connection:i,enablementState:a,onReauthorize:o,onRefreshSynchronization:s,onRevoke:c,onSetEnabled:l,onStartAtlassianOAuth:u,onSynchronize:d,onTest:f,resource:m,synchronizationState:h,testState:g})=>{let _=ae(i,g),v=g?._tag===`testing`,y=a===`changing`,b=_.tone===`caution`||_.tone===`critical`||_.tone===`progress`,x=(0,E.useRef)(null),S=(0,E.useRef)(!1);return(0,E.useEffect)(()=>{b&&!S.current&&x.current!==null&&(x.current.open=!0),S.current=b},[b]),(0,A.jsxs)(`details`,{className:U.resource,"data-status-tone":_.tone,ref:x,children:[(0,A.jsx)(`summary`,{className:U.resourceSummary,children:Z(m,_,!0)}),(0,A.jsxs)(`div`,{className:U.resourceBody,children:[(0,A.jsx)(ie,{state:g}),(0,A.jsx)(J,{canSynchronize:n&&i.isEnabled,onRefresh:()=>s(i.pluginConnectionId),onSynchronize:()=>d(i.pluginConnectionId),state:h}),(0,A.jsx)(G,{...t===void 0?{}:{atlassianOAuthProviders:t},canConfigure:n,onReauthorize:e=>o(i.pluginConnectionId,e),onRevoke:()=>c(i.pluginConnectionId),onStartAtlassianOAuth:u,state:e}),(0,A.jsxs)(`div`,{className:U.resourceActions,children:[(0,A.jsx)(r,{disabled:!n||y||v||!i.isEnabled,loading:v,onClick:()=>f(i.pluginConnectionId),variant:`secondary`,children:`Test`}),(0,A.jsx)(r,{disabled:!n||y,loading:y,onClick:()=>l(i.pluginConnectionId,!i.isEnabled),variant:`quiet`,children:i.isEnabled?`Disable`:`Enable`})]}),a===`request-failed`?(0,A.jsx)(p,{as:`p`,className:U.setupError,role:`alert`,variant:`body`,children:`Control Center could not change this service. Refresh and try again.`}):null]})]})},oe=({account:e,administrationStates:t,canConfigure:n,connections:a,enablementStates:s,onAdd:c,onReauthorize:l,onRefreshSynchronization:u,onRename:d,onRevoke:m,onSetEnabled:h,onStartAtlassianOAuth:g,onSynchronize:_,onTest:v,synchronizationStates:y,testStates:b})=>{let[x,S]=(0,E.useState)(!1),[C,w]=(0,E.useState)(e.displayName),[T,D]=(0,E.useState)(`idle`);return(0,E.useEffect)(()=>w(e.displayName),[e.displayName]),(0,A.jsxs)(f,{as:`article`,className:U.accountCard,padding:`default`,form:`grouped`,children:[(0,A.jsxs)(`div`,{className:U.accountHeading,children:[(0,A.jsxs)(`div`,{className:U.accountIdentity,children:[(0,A.jsxs)(p,{as:`h2`,variant:`section-title`,children:[e.providerFamily===`aws`?`AWS account`:e.providerFamily===`atlassian`?`Atlassian site`:`Provider account`,` `,e.displayName]}),(0,A.jsxs)(p,{className:U.identifier,tone:`secondary`,variant:`meta`,children:[`Verified identity · `,e.providerImmutableId]})]}),(0,A.jsx)(o,{label:`${e.resources.length} ${e.resources.length===1?`resource`:`resources`}`,size:`compact`,tone:`positive`})]}),n?x?(0,A.jsxs)(`form`,{className:U.accountEdit,onSubmit:e=>{e.preventDefault(),D(`saving`),d(C.trim()).then(e=>{D(e?`idle`:`failed`),e&&S(!1)})},children:[(0,A.jsx)(i,{label:`Account display name`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,maxLength:200,onChange:e=>w(e.currentTarget.value),value:C})}),(0,A.jsxs)(`div`,{className:U.resourceActions,children:[(0,A.jsx)(r,{loading:T===`saving`,type:`submit`,variant:`secondary`,children:`Save account name`}),(0,A.jsx)(r,{disabled:T===`saving`,onClick:()=>{w(e.displayName),S(!1),D(`idle`)},type:`button`,variant:`quiet`,children:`Cancel`})]}),T===`failed`?(0,A.jsx)(p,{className:U.setupError,role:`alert`,variant:`body`,children:`The account changed elsewhere. Refresh and try again.`}):null]}):(0,A.jsx)(`div`,{className:U.accountEditAction,children:(0,A.jsx)(r,{onClick:()=>S(!0),variant:`quiet`,children:`Edit account name`})}):null,(0,A.jsx)(`div`,{className:U.resourceList,children:e.resources.map(r=>{let i=a.find(e=>e.followedResourceId===r.followedResourceId),o=i===void 0?void 0:b.get(i.pluginConnectionId),c=i===void 0?void 0:s.get(i.pluginConnectionId),d=i===void 0?{label:`Followed`,tone:`neutral`}:ae(i,o);if(i===void 0)return(0,A.jsx)(`div`,{className:U.resource,"data-status-tone":d.tone,children:(0,A.jsx)(`div`,{className:U.resourceSummary,children:Z(r,d,!1)})},r.followedResourceId);let f=X(e);return(0,E.createElement)(Q,{...f===void 0?{}:{atlassianOAuthProviders:f},canConfigure:n,connection:i,administrationState:t.get(i.pluginConnectionId),enablementState:c,key:r.followedResourceId,onRefreshSynchronization:u,onReauthorize:l,onRevoke:m,onStartAtlassianOAuth:g,onSetEnabled:h,onSynchronize:_,onTest:v,resource:r,synchronizationState:y.get(i.pluginConnectionId),testState:o})})}),e.providerFamily===`aws`?(0,A.jsxs)(`div`,{className:U.accountActions,children:[(0,A.jsx)(r,{disabled:!n,onClick:()=>c(`codecommit`,e.providerImmutableId),variant:`secondary`,children:`Add repository`}),(0,A.jsx)(r,{disabled:!n,onClick:()=>c(`codepipeline`,e.providerImmutableId),variant:`secondary`,children:`Add pipeline`})]}):e.providerFamily===`atlassian`?(0,A.jsxs)(`div`,{className:U.accountActions,children:[(0,A.jsx)(r,{disabled:!n,onClick:()=>c(`jira`,e.providerImmutableId),variant:`secondary`,children:`Add Jira project`}),(0,A.jsx)(r,{disabled:!n,onClick:()=>c(`confluence`,e.providerImmutableId),variant:`secondary`,children:`Add Confluence space`})]}):null]})},se=e=>`${e.catalog.providerId}\0${e.displayName}`,$=[`jira`,`confluence`],ce={preferredProfileId:null,preferredSiteId:null,providers:$,requestedOAuthProviders:$},le=e=>{let t=$.filter(t=>!e.some(e=>e.providerId===t));return t.length===0?$:t},ue=(e,t,n)=>n.length===1&&$.some(r=>!n.includes(r)&&e.some(e=>e.providerId===r)&&t.some(e=>!e.profileId.startsWith(`legacy:`)&&e.providers.includes(r))),de=(e,t)=>t.length===1&&$.some(n=>!t.includes(n)&&e.some(e=>e.providerId===n)),fe=(e,t)=>({preferredProfileId:null,preferredSiteId:null,providers:t!==void 0&&e.some(({providerId:e})=>e===t)?[t]:le(e),requestedOAuthProviders:null}),pe=(e,t,n)=>{if(e.requestedOAuthProviders!==null)return e;let r=de(t,e.providers);if(r&&(n._tag===`idle`||n._tag===`loading`))return e;let i=n._tag===`ready`?n.profiles:[];return{...e,requestedOAuthProviders:r&&n._tag===`failed`||ue(t,i,e.providers)?$:e.providers}},me=({administrationState:e,canConfigure:t,canTest:n,connection:i,enablementState:a,onConfigure:s,onReauthorize:c,onRefreshSynchronization:l,onRevoke:u,onSetEnabled:m,onStartAtlassianOAuth:h,onSynchronize:g,onTest:_,synchronizationState:v,testState:y})=>{let b=y?._tag===`testing`,x=y!==void 0&&y._tag!==`testing`,S=a===`changing`,C=ae(i,y);return(0,A.jsxs)(f,{as:`article`,className:U.card,padding:`default`,form:`grouped`,children:[(0,A.jsxs)(`div`,{className:U.cardHeading,children:[(0,A.jsxs)(`div`,{className:U.connectionIdentity,children:[(0,A.jsx)(d,{service:i.providerId,size:`compact`}),(0,A.jsx)(p,{as:`h2`,variant:`card-title`,children:i.displayName})]}),(0,A.jsx)(o,{label:C.label,size:`compact`,tone:C.tone})]}),(0,A.jsx)(ie,{state:y}),(0,A.jsx)(J,{canSynchronize:t&&i.isEnabled,onRefresh:()=>l(i.pluginConnectionId),onSynchronize:()=>g(i.pluginConnectionId),state:v}),(0,A.jsx)(G,{...i.providerId===`jira`?{atlassianOAuthProviders:[`jira`]}:i.providerId===`confluence`?{atlassianOAuthProviders:[`confluence`]}:{},canConfigure:t,onReauthorize:e=>c(i.pluginConnectionId,e),onRevoke:()=>u(i.pluginConnectionId),onStartAtlassianOAuth:h,state:e}),(0,A.jsxs)(`div`,{className:U.cardAction,children:[(0,A.jsx)(r,{disabled:!n||S||b||!i.isEnabled,loading:b,onClick:()=>_(i.pluginConnectionId),variant:`secondary`,children:x?`Retry test`:`Test connection`}),(0,A.jsx)(r,{disabled:!t,onClick:s,variant:`secondary`,children:`Add connection`}),(0,A.jsx)(r,{disabled:!t||S,loading:S,onClick:()=>m(i.pluginConnectionId,!i.isEnabled),variant:i.isEnabled?`secondary`:`primary`,children:i.isEnabled?`Disable`:`Enable service`}),n?null:(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:`Owner access is required.`})]}),a===`request-failed`?(0,A.jsx)(p,{as:`p`,className:U.setupError,role:`alert`,variant:`body`,children:`Control Center could not change this service. Refresh and try again.`}):null]})},he=({catalog:e,isSubmitting:t,onCancel:n,onSubmit:a})=>{let[o,s]=(0,E.useState)(e.displayName),[c,l]=(0,E.useState)(null),[u,d]=(0,E.useState)(new Map(e.configurationFields.map(e=>[e.key,e.defaultValue??``]))),f=t=>{t.preventDefault(),l(null);let n=e.configurationFields.map(e=>O(e,u.get(e.key)??``));a(o,n).then(t=>{if(!t){l(`Control Center could not create this connection. Check the fields and try again.`);return}d(t=>{let n=new Map(t);for(let t of e.configurationFields)t.kind===`secret`&&n.set(t.key,``);return n})})},m=(e,t)=>{d(n=>new Map(n).set(e,t))};return(0,A.jsxs)(`form`,{className:U.setupForm,onSubmit:f,children:[(0,A.jsx)(i,{label:`Connection name`,required:!0,size:`compact`,children:e=>(0,A.jsx)(`input`,{...e,maxLength:200,onChange:e=>s(e.currentTarget.value),value:o})}),e.configurationFields.map(e=>(0,A.jsx)(i,{description:e.description,label:e.label,required:e.required,size:`compact`,children:t=>(0,A.jsx)(`input`,{...t,autoComplete:e.kind===`secret`?`off`:void 0,disabled:e.isReadOnly,max:e.maximum??void 0,maxLength:e.kind===`integer`?void 0:e.kind===`secret`?16384:4096,min:e.minimum??void 0,onChange:t=>m(e.key,t.currentTarget.value),type:e.kind===`secret`?`password`:e.kind===`integer`?`number`:e.kind===`url`?`url`:`text`,value:u.get(e.key)??``})},e.key)),c===null?null:(0,A.jsx)(p,{as:`p`,className:U.setupError,role:`alert`,variant:`body`,children:c}),(0,A.jsxs)(`div`,{className:U.setupActions,children:[(0,A.jsx)(r,{disabled:t,onClick:n,type:`button`,variant:`secondary`,children:`Cancel`}),(0,A.jsx)(r,{loading:t,type:`submit`,variant:`primary`,children:`Enable and test`})]})]})},ge=({atlassianProfiles:e,atlassianProfilesState:t,atlassianSetupIntent:n,awsProfiles:i,awsProfilesState:a,canConfigure:s,catalog:c,catalogs:l,isAdditional:u,isOpen:m,isRecovery:h,isSubmitting:g,onCancel:_,onDiscoverAws:v,onOpen:y,onStartAtlassianOAuth:b,onSubmit:x,onSubmitAtlassian:S,onSubmitAws:C})=>{let w=c.providerId===`codecommit`||c.providerId===`codepipeline`,T=c.providerId===`jira`||c.providerId===`confluence`;return(0,A.jsxs)(f,{as:`article`,className:U.card,padding:`default`,form:`grouped`,children:[(0,A.jsxs)(`div`,{className:U.cardHeading,children:[(0,A.jsxs)(`div`,{className:U.connectionIdentity,children:[(0,A.jsx)(d,{service:c.providerId,size:`compact`}),(0,A.jsx)(p,{as:`h2`,variant:`card-title`,children:c.displayName})]}),(0,A.jsx)(o,{label:h?`Needs correction`:u?`Add another`:`Not configured`,size:`compact`,tone:h?`critical`:`neutral`})]}),(0,A.jsx)(p,{tone:`secondary`,variant:`body`,children:c.description}),m?w?(0,A.jsx)(H,{awsProfiles:i,awsProfilesState:a,catalogs:l,isSubmitting:g,onCancel:_,onDiscover:v,onSubmit:C}):T?(0,A.jsx)(P,{catalogs:l,isSubmitting:g,onCancel:_,onStartOAuth:b,onSubmit:S,profiles:e,profilesState:t,setupIntent:n}):(0,A.jsx)(he,{catalog:c,isSubmitting:g,onCancel:_,onSubmit:x}):(0,A.jsxs)(`div`,{className:U.cardAction,children:[(0,A.jsx)(r,{disabled:!s,onClick:y,variant:`secondary`,children:w?`Configure AWS account`:u&&c.providerId===`jira`?`Add Jira project`:u&&c.providerId===`confluence`?`Add Confluence space`:T?`Configure Atlassian`:`Enable service`}),s?null:(0,A.jsx)(p,{tone:`secondary`,variant:`meta`,children:`Owner access is required.`})]})]})},_e=({actionLabel:e=`Pair to enable`,isActionDisabled:t=!1,onEnable:n,service:i,statusLabel:a=`Available`,statusTone:s=`positive`})=>(0,A.jsxs)(f,{as:`article`,className:U.card,padding:`default`,form:`grouped`,children:[(0,A.jsxs)(`div`,{className:U.cardHeading,children:[(0,A.jsxs)(`div`,{className:U.connectionIdentity,children:[(0,A.jsx)(d,{service:i.providerId,size:`compact`}),(0,A.jsx)(p,{as:`h2`,variant:`card-title`,children:i.displayName})]}),(0,A.jsx)(o,{label:a,size:`compact`,tone:s})]}),(0,A.jsx)(p,{tone:`secondary`,variant:`body`,children:i.description}),(0,A.jsx)(`div`,{className:U.cardAction,children:(0,A.jsx)(r,{disabled:t,onClick:n,variant:`primary`,children:e})})]}),ve=({transport:e=w}={})=>{let t=n(),[i,o]=c(),{invalidateSession:s,state:d}=l(),f=u(d),[h,T]=(0,E.useState)(0),[D,O]=(0,E.useState)({_tag:`idle`}),[k,j]=(0,E.useState)({_tag:`idle`}),[M,N]=(0,E.useState)({_tag:`idle`}),[P,F]=(0,E.useState)(new Map),[ee,I]=(0,E.useState)(new Map),[te,L]=(0,E.useState)(new Map),[R,z]=(0,E.useState)(new Map),[B,V]=(0,E.useState)(null),[ne,H]=(0,E.useState)(null),[re,ie]=(0,E.useState)(null),W=(0,E.useRef)(new Map),G=(0,E.useRef)(null),K=(0,E.useRef)(new Map),q=(0,E.useRef)(new Map),J=(0,E.useRef)(null),ae=(0,E.useRef)(null),Y=(0,E.useRef)(new Map),X=(0,E.useRef)(new Map),Z=(0,E.useRef)(new Map),Q=(0,E.useRef)(new Map),$=(0,E.useCallback)(t=>{if(f===null||e.administration===void 0)return;X.current.get(t)?.abort();let n=new AbortController;X.current.set(t,n),z(e=>new Map(e).set(t,{_tag:`loading`})),e.administration(t,n.signal).then(e=>{n.signal.aborted||(X.current.delete(t),z(n=>new Map(n).set(t,{_tag:`ready`,administration:e})))},e=>{n.signal.aborted||(X.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(f),z(e=>new Map(e).set(t,{_tag:`failed`})))})},[s,f,e]),le=(0,E.useCallback)(t=>{if(f===null||e.synchronization===void 0)return;Y.current.get(t)?.abort();let n=new AbortController;Y.current.set(t,n),L(e=>new Map(e).set(t,{_tag:`loading`})),e.synchronization(t,n.signal).then(e=>{n.signal.aborted||(Y.current.delete(t),L(n=>new Map(n).set(t,{_tag:`ready`,synchronization:e})))},e=>{n.signal.aborted||(Y.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(f),L(e=>new Map(e).set(t,{_tag:`failed`})))})},[s,f,e]),ue=(0,E.useCallback)(t=>{if(f===null||e.synchronize===void 0)return;Y.current.get(t)?.abort();let n=new AbortController;Y.current.set(t,n),L(e=>{let n=e.get(t),r=n?._tag===`ready`?n.synchronization:null;return new Map(e).set(t,{_tag:`syncing`,previous:r})}),e.synchronize(t,n.signal).then(e=>{n.signal.aborted||(Y.current.delete(t),L(n=>new Map(n).set(t,{_tag:`ready`,synchronization:e})))},e=>{n.signal.aborted||(Y.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(f),L(e=>new Map(e).set(t,{_tag:`failed`})))})},[s,f,e]);(0,E.useEffect)(()=>{if(f===null){O({_tag:`idle`});return}let t=new AbortController;return O({_tag:`loading`}),e.overview(t.signal).then(e=>{t.signal.aborted||O({_tag:`ready`,overview:e})},e=>{t.signal.aborted||(m(`UnauthorizedApiError`)(e)&&s(f),O({_tag:`failed`}))}),()=>t.abort()},[s,h,f,e]),(0,E.useEffect)(()=>{if(D._tag!==`ready`||e.synchronization===void 0)return;let t=D.overview.connections.filter(({supportsSynchronization:e})=>e),n=new Set(t.map(({pluginConnectionId:e})=>e));for(let[e,t]of Y.current)n.has(e)||(t.abort(),Y.current.delete(e));L(e=>{let t=new Map(e),r=!1;for(let e of t.keys())n.has(e)||(t.delete(e),r=!0);return r?t:e});for(let e of t)le(e.pluginConnectionId);return()=>{for(let e of t)Y.current.get(e.pluginConnectionId)?.abort(),Y.current.delete(e.pluginConnectionId)}},[D,le,e.synchronization]),(0,E.useEffect)(()=>{if(D._tag!==`ready`||e.administration===void 0)return;let t=new Set(D.overview.connections.map(({pluginConnectionId:e})=>e));for(let[e,n]of X.current)t.has(e)||(n.abort(),X.current.delete(e));z(e=>{let n=new Map(e),r=!1;for(let e of n.keys())t.has(e)||(n.delete(e),r=!0);return r?n:e});for(let e of t)$(e);return()=>{for(let e of t)X.current.get(e)?.abort(),X.current.delete(e)}},[D,$,e.administration]),(0,E.useEffect)(()=>{if(f===null||B!==`codecommit`&&B!==`codepipeline`)return;J.current?.abort();let t=new AbortController;J.current=t,j({_tag:`loading`});let n=e.discoverAwsProfiles;return n===void 0?(j({_tag:`failed`}),()=>t.abort()):(n(t.signal).then(e=>{t.signal.aborted||j({_tag:`ready`,profiles:e})},e=>{t.signal.aborted||(m(`UnauthorizedApiError`)(e)&&s(f),j({_tag:`failed`}))}),()=>t.abort())},[s,B,f,e]),(0,E.useEffect)(()=>{if(f===null||B!==`jira`&&B!==`confluence`)return;ae.current?.abort();let t=new AbortController;ae.current=t,N({_tag:`loading`});let n=e.discoverAtlassianProfiles;return n===void 0?(N({_tag:`failed`}),()=>t.abort()):(n(t.signal).then(e=>{t.signal.aborted||N({_tag:`ready`,profiles:e})},e=>{t.signal.aborted||(m(`UnauthorizedApiError`)(e)&&s(f),N({_tag:`failed`}))}),()=>t.abort())},[s,B,f,e]),(0,E.useEffect)(()=>(F(new Map),I(new Map),L(new Map),z(new Map),V(null),H(null),ie(null),j({_tag:`idle`}),N({_tag:`idle`}),K.current.clear(),()=>{for(let e of W.current.values())e.abort();W.current.clear(),G.current?.abort(),G.current=null,J.current?.abort(),J.current=null,ae.current?.abort(),ae.current=null;for(let e of Y.current.values())e.abort();Y.current.clear();for(let e of q.current.values())e.abort();q.current.clear();for(let e of X.current.values())e.abort();X.current.clear();for(let e of Z.current.values())e.abort();Z.current.clear();for(let e of Q.current.values())e.abort();Q.current.clear()}),[f]),(0,E.useEffect)(()=>{if(D._tag!==`ready`||d._tag!==`authenticated`||d.session.permission!==`workspace-owner`)return;let e=_(i,`enable`);if(e===null||!D.overview.catalog.some(({providerId:t})=>t===e))return;if(e===`jira`||e===`confluence`){let t=y(i),n=t?.includes(e)===!0;H(n?{preferredProfileId:S(i),preferredSiteId:g(i),providers:t,requestedOAuthProviders:t}:fe(D.overview.connections,e))}V(e);let t=new URLSearchParams(i);t.delete(`enable`),t.delete(`atlassianProfile`),t.delete(`atlassianProvider`),t.delete(`atlassianSite`),o(t,{replace:!0})},[D,i,d,o]);let de=(0,E.useCallback)((t,n=!1)=>{if(f===null)return;W.current.get(t)?.abort();let r=new AbortController;W.current.set(t,r),F(e=>new Map(e).set(t,{_tag:`testing`})),e.test(t,r.signal).then(e=>{r.signal.aborted||(W.current.delete(t),F(n=>new Map(n).set(t,{_tag:`result`,result:e})),$(t),e._tag===`healthy`&&n&&T(e=>e+1))},e=>{r.signal.aborted||(W.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(f),F(e=>new Map(e).set(t,{_tag:`request-failed`})))})},[s,$,f,e]),he=(0,E.useCallback)(async(t,n)=>{if(f===null)return!1;G.current?.abort();let r=new AbortController;G.current=r,ie(n);let i=!1,a=!1,o=!1,c=K.current.get(n)??new Set;K.current.set(n,c);let l=(e,t)=>{c.add(e),i||=t.test._tag!==`healthy`,o||=t.connection.providerAccountId!==null,O(e=>e._tag===`ready`?{_tag:`ready`,overview:{...e.overview,connections:[...e.overview.connections,t.connection]}}:e),F(e=>new Map(e).set(t.connection.pluginConnectionId,{_tag:`result`,result:t.test}))};try{let u=t.filter(e=>!c.has(se(e)));if(e.createBatch!==void 0&&u.length>0){let t=new Map,n=[];for(let r of u){let i=await e.makeConnectionId();t.set(i,se(r)),n.push({pluginConnectionId:i,providerId:r.catalog.providerId,displayName:r.displayName,values:r.values})}let i=await e.createBatch({connections:n},r.signal);if(r.signal.aborted)return!1;let o=new Set;for(let e of i.results){let n=e._tag===`failed`?e.pluginConnectionId:e.response.connection.pluginConnectionId;if(!t.has(n)||o.has(n)){a=!0;continue}if(o.add(n),e._tag===`failed`){a=!0;continue}let r=t.get(e.response.connection.pluginConnectionId);r!==void 0&&l(r,e.response)}a||=o.size!==n.length}else for(let t of u){let n=se(t),i=await e.makeConnectionId(),a=await e.create({pluginConnectionId:i,providerId:t.catalog.providerId,displayName:t.displayName,values:t.values},r.signal);if(r.signal.aborted)return!1;l(n,a)}if(o)try{let t=await e.overview(r.signal);r.signal.aborted||O({_tag:`ready`,overview:t})}catch(e){if(r.signal.aborted)return!1;m(`UnauthorizedApiError`)(e)&&s(f)}return a?K.current.set(n,c):K.current.delete(n),G.current=null,V(i||a?n:null),ie(null),!a}catch(e){return!r.signal.aborted&&(G.current=null,m(`UnauthorizedApiError`)(e)&&s(f),ie(null),!1)}},[s,f,e]),ve=(0,E.useCallback)((e,t,n)=>he([{catalog:e,displayName:t,values:n}],e.providerId),[he]),ye=(0,E.useCallback)((t,n)=>{if(f===null)return;n||(W.current.get(t)?.abort(),W.current.delete(t),F(e=>{let n=new Map(e);return n.delete(t),n})),q.current.get(t)?.abort();let r=new AbortController;q.current.set(t,r),I(e=>new Map(e).set(t,`changing`)),e.setEnabled(t,n,r.signal).then(e=>{r.signal.aborted||(q.current.delete(t),O(n=>n._tag===`ready`?{_tag:`ready`,overview:{...n.overview,connections:n.overview.connections.map(n=>n.pluginConnectionId===t?e:n)}}:n),I(e=>{let n=new Map(e);return n.delete(t),n}),n?de(t):F(e=>{let n=new Map(e);return n.delete(t),n}))},e=>{r.signal.aborted||(q.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(f),I(e=>new Map(e).set(t,`request-failed`)))})},[s,f,de,e]),be=(0,E.useCallback)(async(t,n)=>{if(f===null||e.reauthorize===void 0)return!1;let r=R.get(t);if(r?._tag!==`ready`)return!1;Z.current.get(t)?.abort();let i=new AbortController;Z.current.set(t,i);try{let a=await e.reauthorize(t,r.administration.configuration.revision,n,i.signal);return!i.signal.aborted&&(Z.current.delete(t),O(e=>e._tag===`ready`?{_tag:`ready`,overview:{...e.overview,connections:e.overview.connections.map(e=>e.pluginConnectionId===t?a.connection:e)}}:e),F(e=>new Map(e).set(t,{_tag:`result`,result:a.test})),$(t),!0)}catch(e){return!i.signal.aborted&&(Z.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(f),$(t),!1)}},[R,s,$,f,e]);(0,E.useEffect)(()=>{if(D._tag!==`ready`||d._tag!==`authenticated`||d.session.permission!==`workspace-owner`)return;let e=x(i),t=C(i);if(e===null||t===null)return;let n=D.overview.connections.find(t=>t.pluginConnectionId===e),r=R.get(e),a=r?._tag===`ready`?r.administration.credentialFields.find(({key:e})=>e===`oauthProfileId`):void 0;if(n?.providerId!==`jira`&&n?.providerId!==`confluence`||r?._tag!==`ready`||a===void 0)return;let s=new URLSearchParams(i);s.delete(`atlassianRecoveryConnection`),s.delete(`atlassianRecoveryProfile`),o(s,{replace:!0}),be(e,[{key:a.key,value:t}])},[R,D,be,i,d,o]);let xe=(0,E.useCallback)(async t=>{if(f===null||e.revoke===void 0)return!1;let n=R.get(t);if(n?._tag!==`ready`)return!1;Z.current.get(t)?.abort();let r=new AbortController;Z.current.set(t,r);try{let i=await e.revoke(t,n.administration.configuration.revision,r.signal);return!r.signal.aborted&&(Z.current.delete(t),O(e=>e._tag===`ready`?{_tag:`ready`,overview:{...e.overview,connections:e.overview.connections.map(e=>e.pluginConnectionId===t?i:e)}}:e),F(e=>{let n=new Map(e);return n.delete(t),n}),$(t),!0)}catch(e){return!r.signal.aborted&&(Z.current.delete(t),m(`UnauthorizedApiError`)(e)&&s(f),$(t),!1)}},[R,s,$,f,e]),Se=(0,E.useCallback)(async(t,n)=>{if(f===null||e.patchAccount===void 0||n.length===0)return!1;Q.current.get(t.providerAccountId)?.abort();let r=new AbortController;Q.current.set(t.providerAccountId,r);try{let i=await e.patchAccount(t.providerAccountId,{expectedRevision:t.revision,displayName:n},r.signal);return!r.signal.aborted&&(Q.current.get(t.providerAccountId)===r&&Q.current.delete(t.providerAccountId),O(e=>e._tag===`ready`?{_tag:`ready`,overview:{...e.overview,accounts:e.overview.accounts.map(e=>e.providerAccountId===i.providerAccountId?i:e)}}:e),!0)}catch(e){return!r.signal.aborted&&(Q.current.get(t.providerAccountId)===r&&Q.current.delete(t.providerAccountId),m(`UnauthorizedApiError`)(e)&&s(f),!1)}},[s,f,e]),Ce=d._tag===`authenticated`||d._tag===`storage-unavailable`?d.session:null,we=d._tag===`authenticated`&&d.session.permission===`workspace-owner`;return(0,A.jsxs)(`section`,{"aria-labelledby":`services-title`,className:U.page,children:[(0,A.jsxs)(`header`,{className:U.heading,children:[(0,A.jsx)(p,{as:`h1`,id:`services-title`,variant:`page-title`,children:`Services`}),(0,A.jsx)(p,{tone:`secondary`,variant:`body-large`,children:Ce===null||D._tag===`ready`&&D.overview.connections.length===0?`Choose a service below. Control Center will enable it and verify the exact account before using it.`:`Configure first-party providers and verify the exact account each connection represents.`})]}),Ce===null&&d._tag!==`checking`?(0,A.jsx)(`div`,{className:U.grid,children:v.map(e=>(0,A.jsx)(_e,{onEnable:()=>t(b(e.providerId)),service:e},e.providerId))}):D._tag===`loading`||D._tag===`idle`?(0,A.jsx)(`div`,{className:U.grid,children:v.map(e=>(0,A.jsx)(_e,{actionLabel:`Loading connections`,isActionDisabled:!0,onEnable:()=>void 0,service:e,statusLabel:`Loading`,statusTone:`progress`},e.providerId))}):D._tag===`failed`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{action:(0,A.jsx)(r,{onClick:()=>T(e=>e+1),children:`Try again`}),description:`Control Center could not load connection details. The installed services remain visible below.`,title:`Connections unavailable`}),(0,A.jsx)(`div`,{className:U.grid,children:v.map(e=>(0,A.jsx)(_e,{actionLabel:`Retry connections`,onEnable:()=>T(e=>e+1),service:e,statusLabel:`Installed`,statusTone:`neutral`},e.providerId))})]}):(0,A.jsxs)(A.Fragment,{children:[D.overview.accounts.length===0?null:(0,A.jsxs)(`section`,{"aria-labelledby":`connected-accounts-title`,className:U.accounts,children:[(0,A.jsxs)(`div`,{className:U.sectionHeading,children:[(0,A.jsx)(p,{as:`h2`,id:`connected-accounts-title`,variant:`section-title`,children:`Connected accounts`}),(0,A.jsx)(p,{tone:`secondary`,variant:`body`,children:`One verified provider identity can own several followed resources.`})]}),(0,A.jsx)(`div`,{className:U.accountGrid,children:D.overview.accounts.map(t=>(0,A.jsx)(oe,{account:t,administrationStates:R,canConfigure:we,connections:D.overview.connections,enablementStates:ee,onAdd:(e,t)=>{(e===`jira`||e===`confluence`)&&H({preferredProfileId:null,preferredSiteId:t,providers:[e],requestedOAuthProviders:null}),V(e)},onSetEnabled:ye,onRefreshSynchronization:le,onReauthorize:be,onRename:e=>Se(t,e),onRevoke:xe,onStartAtlassianOAuth:e.startAtlassianOAuthGrant,onSynchronize:ue,synchronizationStates:te,onTest:de,testStates:P},t.providerAccountId))})]}),(0,A.jsx)(`div`,{className:U.grid,children:D.overview.catalog.flatMap(t=>{let n=D.overview.connections.filter(e=>e.providerId===t.providerId),r=new Set(D.overview.accounts.flatMap(({resources:e})=>e.map(({followedResourceId:e})=>e))),i=n.some(({followedResourceId:e})=>e!==null&&r.has(e)),a=n.filter(({followedResourceId:e})=>e===null||!r.has(e)),o=fe(D.overview.connections,t.providerId===`jira`||t.providerId===`confluence`?t.providerId:void 0),c=pe(ne??o,D.overview.connections,M),l=a.map(n=>(0,A.jsx)(me,{administrationState:R.get(n.pluginConnectionId),canConfigure:we,canTest:we,connection:n,enablementState:ee.get(n.pluginConnectionId),onConfigure:()=>{(t.providerId===`jira`||t.providerId===`confluence`)&&H(ce),V(t.providerId)},onSetEnabled:ye,onRefreshSynchronization:le,onReauthorize:be,onRevoke:xe,onStartAtlassianOAuth:e.startAtlassianOAuthGrant,onSynchronize:ue,onTest:e=>de(e,!0),synchronizationState:te.get(n.pluginConnectionId),testState:P.get(n.pluginConnectionId)},n.pluginConnectionId));return n.length>0&&B!==t.providerId&&(i||t.providerId!==`jira`&&t.providerId!==`confluence`)?l:[...l,(0,A.jsx)(ge,{atlassianProfiles:M._tag===`ready`?M.profiles:[],atlassianProfilesState:M._tag,atlassianSetupIntent:c,awsProfiles:k._tag===`ready`?k.profiles:[],awsProfilesState:k._tag,canConfigure:we,catalog:t,catalogs:D.overview.catalog,isAdditional:n.length>0&&(t.providerId===`jira`||t.providerId===`confluence`),isOpen:B===t.providerId,isRecovery:a.length>0,isSubmitting:re===t.providerId,onCancel:()=>{K.current.delete(t.providerId),H(null),V(null)},onDiscoverAws:(t,n)=>{let r=e.discoverAwsResources;return r===void 0?Promise.reject(Error(`AWS resource discovery is unavailable`)):r(t,n).catch(e=>(f!==null&&m(`UnauthorizedApiError`)(e)&&s(f),Promise.reject(e)))},onOpen:()=>{B!==t.providerId&&K.current.delete(t.providerId),(t.providerId===`jira`||t.providerId===`confluence`)&&H(o),V(t.providerId)},onStartAtlassianOAuth:(t,n,r)=>{let i=e.startAtlassianOAuthGrant;return i===void 0?Promise.reject(Error(`Atlassian OAuth is unavailable`)):i(t,n,r)},onSubmit:(e,n)=>ve(t,e,n),onSubmitAtlassian:e=>he(e,t.providerId),onSubmitAws:e=>he(e,t.providerId)},`${t.providerId}-catalog`)]})})]})]})};export{ve as ServicesPage};
|
|
2
|
+
//# sourceMappingURL=ServicesPage-6G9OTRDn.js.map
|