decocms 2.175.2 → 2.175.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CnfwZdxb.js → AlertCircle-BCDqbXXS.js} +1 -1
- package/dist/client/assets/{AlignLeft-zj1VrWVO.js → AlignLeft-BtdVdG2m.js} +1 -1
- package/dist/client/assets/{ArrowDown-BnnQhLmg.js → ArrowDown-qfJtx-dv.js} +1 -1
- package/dist/client/assets/{ArrowLeft-C3_bzjZf.js → ArrowLeft-Del7wDOT.js} +1 -1
- package/dist/client/assets/{ArrowUp-BuKX1RSZ.js → ArrowUp-ETVB6cdy.js} +1 -1
- package/dist/client/assets/{Check-7kB05ju_.js → Check-DsclgHfU.js} +1 -1
- package/dist/client/assets/{CheckCircle-DrGaevdP.js → CheckCircle-CQGSbCTG.js} +1 -1
- package/dist/client/assets/{CheckDone01-CVJEgdwq.js → CheckDone01-v1xPuIIg.js} +1 -1
- package/dist/client/assets/{CheckVerified02-DmV5dzDn.js → CheckVerified02-DhH8-7Z6.js} +1 -1
- package/dist/client/assets/{ChevronDown-DHeagNGb.js → ChevronDown-CIjXFJfV.js} +1 -1
- package/dist/client/assets/{ChevronLeft-W2gkpjgL.js → ChevronLeft-tQ1_QiuA.js} +1 -1
- package/dist/client/assets/{ChevronRight-Blv21S_7.js → ChevronRight-DmvbXNWu.js} +1 -1
- package/dist/client/assets/{ChevronUp-J7upZD3-.js → ChevronUp-C8129itH.js} +1 -1
- package/dist/client/assets/{Clock-9Mm0U0Dg.js → Clock-CQzMyEYR.js} +1 -1
- package/dist/client/assets/{Code01-DDbKsccR.js → Code01-Cq3-F_YX.js} +1 -1
- package/dist/client/assets/{Coins01-DTz6uYyF.js → Coins01-D4l1LRdX.js} +1 -1
- package/dist/client/assets/{Container-Ci_1Xm4L.js → Container-C_pBhYQm.js} +1 -1
- package/dist/client/assets/{Copy01-BexEalI-.js → Copy01-CFr3FQ5x.js} +1 -1
- package/dist/client/assets/{Dataflow03-CKfLDuKw.js → Dataflow03-OPkwvxOZ.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-3xIvFzgk.js → DotsHorizontal-7V70FVQq.js} +1 -1
- package/dist/client/assets/{DotsVertical-7N_NB6wt.js → DotsVertical-ZHHEIIAw.js} +1 -1
- package/dist/client/assets/{Download01-D-oC1d8d.js → Download01-CYaxYM2W.js} +1 -1
- package/dist/client/assets/{Edit01-gYPHsLoC.js → Edit01-y_ign3HR.js} +1 -1
- package/dist/client/assets/{Edit05-BA2Lz_6R.js → Edit05-DW3L1ev9.js} +1 -1
- package/dist/client/assets/{Eye-Cn6YseXl.js → Eye-Dq2YmoWs.js} +1 -1
- package/dist/client/assets/{EyeOff-L-SLicw9.js → EyeOff-CpKFKNjY.js} +1 -1
- package/dist/client/assets/{File02-Dx1Iz50W.js → File02-BsdZFaU2.js} +1 -1
- package/dist/client/assets/{File06-Dqc-K1-5.js → File06-BpsmzbhK.js} +1 -1
- package/dist/client/assets/{FilterLines-DCrzLWfV.js → FilterLines-BFSA7yHa.js} +1 -1
- package/dist/client/assets/{Globe01-DW2rHI0i.js → Globe01-C5-PYqjH.js} +1 -1
- package/dist/client/assets/{Globe02-CyGtzZ8k.js → Globe02-BLXYb9br.js} +1 -1
- package/dist/client/assets/{Grid01-Dqz--q3o.js → Grid01-BSBJv9eJ.js} +1 -1
- package/dist/client/assets/{Hash02-pqCZ_ykD.js → Hash02-zbrPaDCt.js} +1 -1
- package/dist/client/assets/{Home02-D2W6xjpZ.js → Home02-DtwXSs3k.js} +1 -1
- package/dist/client/assets/{Image01-U7ZIAIPc.js → Image01-NzJP6iMs.js} +1 -1
- package/dist/client/assets/{Inbox01-DpRIO4ZY.js → Inbox01-BqBxWaFX.js} +1 -1
- package/dist/client/assets/{InfoCircle-CvSmMU6H.js → InfoCircle-8bpl-KKl.js} +1 -1
- package/dist/client/assets/{Key01-Dq5b7fdA.js → Key01-yVAqC10q.js} +1 -1
- package/dist/client/assets/{LayersTwo01-Li6JqY2K.js → LayersTwo01-T6ICoMvs.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BAk65lFq.js → LayoutLeft-B8jrj3eE.js} +1 -1
- package/dist/client/assets/{Link01-NJWLnzFs.js → Link01-2qS2xckB.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B8e_Oa3I.js → LinkExternal01-CBG098kX.js} +1 -1
- package/dist/client/assets/{List-Cc_Ri6eQ.js → List-LffcVOLG.js} +1 -1
- package/dist/client/assets/{Loading01-Cbk1oNZ2.js → Loading01-CSUxQOK0.js} +1 -1
- package/dist/client/assets/{Lock01-dP10fLup.js → Lock01-CjY0LR2m.js} +1 -1
- package/dist/client/assets/{Play-DqxAqUbl.js → Play-D223AznW.js} +1 -1
- package/dist/client/assets/{Plus-CqWob4tu.js → Plus-CGe5wBcS.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-B6R5Js1R.js → RefreshCcw01-CxVqRnRx.js} +1 -1
- package/dist/client/assets/{Save01-BfieBu6m.js → Save01-CYi2R4Ht.js} +1 -1
- package/dist/client/assets/{SearchMd-DJI6OMcD.js → SearchMd-CrngVZhh.js} +1 -1
- package/dist/client/assets/{Settings01-BWkL3Bf9.js → Settings01-Dujhf9RE.js} +1 -1
- package/dist/client/assets/{Shield01-DMT1motk.js → Shield01-BqSRHTNN.js} +1 -1
- package/dist/client/assets/{Terminal-zNrinv6B.js → Terminal-ieofo8yI.js} +1 -1
- package/dist/client/assets/{Tool01-CUx5BAY-.js → Tool01-DImlld_g.js} +1 -1
- package/dist/client/assets/{Trash01-C0891dQq.js → Trash01-DPMbpRnj.js} +1 -1
- package/dist/client/assets/{Upload01-ngHWsp64.js → Upload01-DgCnYplh.js} +1 -1
- package/dist/client/assets/{Users03-FsZwQwZq.js → Users03-C-Jr0LW_.js} +1 -1
- package/dist/client/assets/{X-CeRZ6ROs.js → X-CuPyb-Ex.js} +1 -1
- package/dist/client/assets/{XAxis-B4Pxztvn.js → XAxis-BmVXiq6v.js} +1 -1
- package/dist/client/assets/{XCircle-X3Ds2fko.js → XCircle-DIW-x13c.js} +1 -1
- package/dist/client/assets/{XClose-BieEiV6P.js → XClose-ndXrBTVc.js} +1 -1
- package/dist/client/assets/{Zap-B-qa654H.js → Zap-Ctmk6j5l.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-BXeLz6mJ.js → agent-connections-preview-Vgh7fOJI.js} +1 -1
- package/dist/client/assets/{agent-detail-2cFCKx9t.js → agent-detail-C36fDm_v.js} +1 -1
- package/dist/client/assets/{agents-DS-16MLo.js → agents-DYiHQBsI.js} +1 -1
- package/dist/client/assets/{ai-providers-logos-Bb5LHAPU.js → ai-providers-logos-D3xG95Si.js} +1 -1
- package/dist/client/assets/{alert-dialog-DgTufZ_p.js → alert-dialog-BoQV9ycw.js} +1 -1
- package/dist/client/assets/{auth-catchall-zO2o6cw1.js → auth-catchall-D434eF_Q.js} +1 -1
- package/dist/client/assets/{automation-detail-CyiDphKi.js → automation-detail-3RIJVSzC.js} +1 -1
- package/dist/client/assets/{automations-CBvKrAy1.js → automations-CsNPJGVV.js} +1 -1
- package/dist/client/assets/{avatar-w6QMWHVj.js → avatar-CkCU2Fe6.js} +1 -1
- package/dist/client/assets/{badge-B-_hRtCy.js → badge-7TJrkuyd.js} +1 -1
- package/dist/client/assets/{binder-BEJ4wRzw.js → binder-qGS3hkzV.js} +1 -1
- package/dist/client/assets/{breadcrumb-Dk9kRV2t.js → breadcrumb-7YipRD-p.js} +1 -1
- package/dist/client/assets/{card-BSGld6G2.js → card-D9sP6AvS.js} +1 -1
- package/dist/client/assets/{chart-CEfru1MQ.js → chart-DtzgRcs7.js} +1 -1
- package/dist/client/assets/{checkbox-COsQJsO9.js → checkbox-BRXa8FNh.js} +1 -1
- package/dist/client/assets/{collapsible-BCGKc4Wz.js → collapsible-Dl714J5i.js} +1 -1
- package/dist/client/assets/{collection-detail-BimbOEiL.js → collection-detail-BU5tC6bR.js} +1 -1
- package/dist/client/assets/{collection-display-button-CuyLh-NC.js → collection-display-button-CPJ0Uvih.js} +1 -1
- package/dist/client/assets/{collection-search-aJlY7LHs.js → collection-search-BeqmTWUU.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CcbJTCba.js → collection-table-wrapper-DU2xJaVV.js} +1 -1
- package/dist/client/assets/{collection-tabs-B2Xeppc1.js → collection-tabs-CBTc1SAx.js} +1 -1
- package/dist/client/assets/{command-CyHipwcz.js → command-DVQ8NWzo.js} +1 -1
- package/dist/client/assets/{connect-3nC8bK4k.js → connect-BVkZJKoj.js} +1 -1
- package/dist/client/assets/{connection-card-iA_b7WBI.js → connection-card-D3SNWej3.js} +1 -1
- package/dist/client/assets/connection-detail-C4SImbSn.js +1 -0
- package/dist/client/assets/{connection-status-BddpcBJZ.js → connection-status-B9duDm-X.js} +1 -1
- package/dist/client/assets/connections-iR6Y0Kp3.js +1 -0
- package/dist/client/assets/{constants-CDL9XClm.js → constants-4hZfe-FX.js} +1 -1
- package/dist/client/assets/constants-CXKG1Tp4.js +1 -0
- package/dist/client/assets/{context-DDV_uL9a.js → context-D-2OkzTq.js} +2 -2
- package/dist/client/assets/{create-organization-dialog-CG01zre5.js → create-organization-dialog-C8OjRm9O.js} +1 -1
- package/dist/client/assets/{create-project-dialog-5e-piQzY.js → create-project-dialog-C6OTQ8lU.js} +1 -1
- package/dist/client/assets/{danger-_ZcnVgTL.js → danger-BESOuFS9.js} +1 -1
- package/dist/client/assets/{danger-zone-e3foS_su.js → danger-zone-Dr5J9bxx.js} +1 -1
- package/dist/client/assets/{dependencies-DUviAtSp.js → dependencies-CTIlIG34.js} +1 -1
- package/dist/client/assets/{dialog-DxTRqiug.js → dialog-1RTimACw.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CdjuOUR6.js → dropdown-menu-ur1Ui41o.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DszdejBu.js → dynamic-plugin-layout-De3JUiCe.js} +1 -1
- package/dist/client/assets/{editable-task-title-44X_8A19.js → editable-task-title-DPKxqM1E.js} +1 -1
- package/dist/client/assets/{empty-state-Bj_isc1T.js → empty-state-BLWznTIL.js} +1 -1
- package/dist/client/assets/{empty-state-v8jdj56V.js → empty-state-COoAU6KF.js} +1 -1
- package/dist/client/assets/{env-vars-editor-Bs6jziXp.js → env-vars-editor-UXVlMJFO.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Cyjq-Q5I.js → extract-connection-data-6RfUcjze.js} +1 -1
- package/dist/client/assets/{file-browser-4NMlO2k_.js → file-browser-BHUGJprt.js} +2 -2
- package/dist/client/assets/{form-BV3tSlED.js → form-RbK75Dit.js} +1 -1
- package/dist/client/assets/{general-LSfgt8-y.js → general-DQk46kRh.js} +1 -1
- package/dist/client/assets/{grid-view-BD9vYk3H.js → grid-view-RxDrBxoP.js} +1 -1
- package/dist/client/assets/{home-Ck605SqF.js → home-CnM3BkZT.js} +1 -1
- package/dist/client/assets/{index-DlhaGZnK.js → index-3d9-dYhc.js} +1 -1
- package/dist/client/assets/{index-uQDoUdMq.js → index-B4bICiSz.js} +1 -1
- package/dist/client/assets/{index-BE93ZIdg.js → index-B5Wny992.js} +1 -1
- package/dist/client/assets/{index-Dg_kVhT7.js → index-CElzn9PI.js} +1 -1
- package/dist/client/assets/{index-BXUNq6d7.js → index-DJtnEPc7.js} +3 -3
- package/dist/client/assets/{index-B70G5L15.js → index-DTrW0n62.js} +1 -1
- package/dist/client/assets/{index-zJEaoyYS.js → index-DqU0CNB5.js} +1 -1
- package/dist/client/assets/{index-CZ7yh8sQ.js → index-FmcHS0n7.js} +1 -1
- package/dist/client/assets/{index-L6huQtcJ.js → index-biN0aic_.js} +1 -1
- package/dist/client/assets/{index-rWegviRE.js → index-qxqsMecG.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DXFe0xIV.js → infiniteQueryObserver-DPmZK5SE.js} +1 -1
- package/dist/client/assets/{input-BFH8rk50.js → input-j_5WJy1c.js} +1 -1
- package/dist/client/assets/{integration-icon-D6SJHU0f.js → integration-icon-DrTDJ354.js} +1 -1
- package/dist/client/assets/{label-DE7vX487.js → label-Dmque-mN.js} +1 -1
- package/dist/client/assets/{layout-B_GGomJW.js → layout-BgLVGdMB.js} +1 -1
- package/dist/client/assets/{layout-B2GnF_Vp.js → layout-Cyh0KCTx.js} +1 -1
- package/dist/client/assets/{login-CgzRmuxY.js → login-CEJuPXz8.js} +1 -1
- package/dist/client/assets/{logo-upload-Bfzj_LQV.js → logo-upload-D_X-eua0.js} +1 -1
- package/dist/client/assets/{markdown-Da-6gcG9.js → markdown-BjeAfn6Q.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CNc9yMN5.js → mcp-app-renderer-BjIiENx_.js} +1 -1
- package/dist/client/assets/{mcp-server-card-s9NGsKpt.js → mcp-server-card-hwjTnxKa.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-fMXGyX4W.js → mcp-server-detail-fOqjCDsy.js} +2 -2
- package/dist/client/assets/{members-BvBWfv9e.js → members-BUIvlCPj.js} +1 -1
- package/dist/client/assets/{monaco-editor-VspAvYbk.js → monaco-editor-BI48gu97.js} +1 -1
- package/dist/client/assets/{monitoring-B1jfqgQN.js → monitoring-cvfFeG45.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-Bdujw4Ym.js → monitoring-dashboard-edit-BOzMfOYa.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-CSfkxnkl.js → monitoring-dashboard-view-Da1aDoKV.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Ds_uiyYJ.js → monitoring-stats-row-Bk2P-uOc.js} +1 -1
- package/dist/client/assets/{oauth-callback-BNPNdlSW.js → oauth-callback-DrDtRQei.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CODmoIp9.js → oauth-callback-ai-provider-AqyT7OAy.js} +1 -1
- package/dist/client/assets/{org-ai-providers-CQKU4ds_.js → org-ai-providers-CYV2m0oE.js} +1 -1
- package/dist/client/assets/{page-BfphKBfj.js → page-CBVSkVrr.js} +1 -1
- package/dist/client/assets/{page-Bbbh0c0Z.js → page-CjM0cJ2H.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Cx_CuKe3.js → plugin-empty-state-CzxAWw66.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BWhKyfJ8.js → plugin-empty-state-DGepiILI.js} +1 -1
- package/dist/client/assets/{plugin-header-ncr8MkbN.js → plugin-header-BHxHz9n0.js} +1 -1
- package/dist/client/assets/{plugin-header-ET8DV5kQ.js → plugin-header-mOLE86wJ.js} +1 -1
- package/dist/client/assets/plugins-DoHvFK9w.js +1 -0
- package/dist/client/assets/{popover-BcyJids_.js → popover-B_9jK9T6.js} +1 -1
- package/dist/client/assets/{project-app-view-BdLdOYqG.js → project-app-view-BOeJqLvY.js} +1 -1
- package/dist/client/assets/{project-layout-DReK69oR.js → project-layout-BoHZ9uLC.js} +1 -1
- package/dist/client/assets/{project-plugins-CXWguN_r.js → project-plugins-BOxyaluG.js} +1 -1
- package/dist/client/assets/{projects-list-CZANuMq5.js → projects-list-DP4hhCRm.js} +1 -1
- package/dist/client/assets/{registry-layout-CqXQ571U.js → registry-layout-D1uZlucV.js} +1 -1
- package/dist/client/assets/{registry-utils-CaVl1vKg.js → registry-utils-9Z7xkXEW.js} +1 -1
- package/dist/client/assets/{reports-layout-CQyNOFqA.js → reports-layout-_2OT-yHj.js} +1 -1
- package/dist/client/assets/{reset-password-Bt_v8_59.js → reset-password-DbKC8pv7.js} +1 -1
- package/dist/client/assets/{resizable-B4X_WbHf.js → resizable-D2UQg53E.js} +1 -1
- package/dist/client/assets/{save-actions-Py9YKTe0.js → save-actions-DRE_2Nh6.js} +1 -1
- package/dist/client/assets/{scroll-area-R7PT492V.js → scroll-area-DXeQheGE.js} +1 -1
- package/dist/client/assets/{select-B-f7jgVG.js → select-roICowiz.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-YanYQUBn.js → select-virtual-mcp-CFEExN2T.js} +1 -1
- package/dist/client/assets/{sheet-7nFLkS7G.js → sheet-D0UV-Fr7.js} +1 -1
- package/dist/client/assets/{shell-layout-Dp8xiQMR.js → shell-layout-BzGvbbd1.js} +2 -2
- package/dist/client/assets/{sidebar-settings-w0p27D0n.js → sidebar-settings-Bqi6Lp6h.js} +1 -1
- package/dist/client/assets/{skeleton-CK2-6UkT.js → skeleton-Cy7jej-7.js} +1 -1
- package/dist/client/assets/{spinner-B1-EIDBS.js → spinner-qX5-Mz-A.js} +1 -1
- package/dist/client/assets/{store-invite-DVPM6U-x.js → store-invite-CMn4A-jT.js} +1 -1
- package/dist/client/assets/{switch-4UL4iV3X.js → switch-7_yekA3p.js} +1 -1
- package/dist/client/assets/{table-Bu98B5a-.js → table-Cd-wCYBh.js} +1 -1
- package/dist/client/assets/{tabs-Cif80TZ4.js → tabs-T6eq77EC.js} +1 -1
- package/dist/client/assets/{task-status-BWKjAgiX.js → task-status-DSYWex9b.js} +1 -1
- package/dist/client/assets/tasks-CaWtJ_wZ.js +1 -0
- package/dist/client/assets/{tasks-panel-D6Bb-wiS.js → tasks-panel-Cpm18hI4.js} +1 -1
- package/dist/client/assets/{textarea-DPLd5P1K.js → textarea-BJkI1dfy.js} +1 -1
- package/dist/client/assets/{time-range-picker-FJd_w9AH.js → time-range-picker-DKvAeQX-.js} +1 -1
- package/dist/client/assets/{toggle-group-B4QQy8X1.js → toggle-group-O3ssRQZp.js} +1 -1
- package/dist/client/assets/{tools-list-BgmW-tI4.js → tools-list-DfrxfnU8.js} +1 -1
- package/dist/client/assets/{tooltip-BGPUMzDS.js → tooltip-Bms1Xn3i.js} +1 -1
- package/dist/client/assets/{topbar-portal-CLOTo-7w.js → topbar-portal-C9r1D7L2.js} +1 -1
- package/dist/client/assets/{types-DZ5M-eMJ.js → types-BTzo08LL.js} +1 -1
- package/dist/client/assets/{use-automations-D7j59hRT.js → use-automations-DQ0Wvn7B.js} +1 -1
- package/dist/client/assets/{use-binding-CZ8osTa1.js → use-binding-CidrckI6.js} +1 -1
- package/dist/client/assets/{use-collections-yY78nnLx.js → use-collections-uyyRdHl8.js} +1 -1
- package/dist/client/assets/{use-connection-lXrlfojY.js → use-connection-2T7CNTjX.js} +1 -1
- package/dist/client/assets/{use-copy-DZJI58oZ.js → use-copy-CnWGIrpr.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DK_WDS9Y.js → use-create-virtual-mcp-BqiAP0hG.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C-TK62Eo.js → use-infinite-scroll-BZWlWT4v.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-C24f0cqa.js → use-install-from-registry-BGTf0OMo.js} +1 -1
- package/dist/client/assets/{use-list-state-D6LU1koz.js → use-list-state-Dn3PYXZc.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DT9l3i02.js → use-mcp-prompts-Bvq8o_wk.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-DhBJVSsg.js → use-mcp-resources-INpGwYsS.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CwVNqTmj.js → use-mcp-tools-CoXbW9dQ.js} +1 -1
- package/dist/client/assets/{use-members-fpZqw1dy.js → use-members-CKrsZLkR.js} +1 -1
- package/dist/client/assets/{use-mobile-B0lEbMk3.js → use-mobile-BgetcADk.js} +1 -1
- package/dist/client/assets/{use-project-BnRSDoVD.js → use-project-CCY4E3rU.js} +1 -1
- package/dist/client/assets/{use-store-discovery-C9fJhQ4Y.js → use-store-discovery-B92mIOto.js} +1 -1
- package/dist/client/assets/{use-view-mode-0w9n1sJ-.js → use-view-mode-U3Y0emnO.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CyoGC0aH.js → use-virtual-mcp-B8_wDvx9.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dbe2YK49.js +1 -0
- package/dist/client/assets/{useMutation-CkdHuTyE.js → useMutation-D77LVetF.js} +1 -1
- package/dist/client/assets/useQuery-DLey6Pvf.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-lgWDbCQ9.js +1 -0
- package/dist/client/assets/{user-sbKkVV9F.js → user-D3_ltBdu.js} +1 -1
- package/dist/client/assets/{workflow-CpP3zoVI.js → workflow-df54tmZt.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +252 -252
- package/dist/server/migrate.js +1 -1
- package/dist/server/node_modules/pg-int8/LICENSE +13 -0
- package/dist/server/node_modules/pg-int8/README.md +16 -0
- package/dist/server/node_modules/pg-int8/index.js +100 -0
- package/dist/server/node_modules/pg-int8/package.json +24 -0
- package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
- package/dist/server/node_modules/postgres-array/index.js +97 -0
- package/dist/server/node_modules/{pg/LICENSE → postgres-array/license} +6 -6
- package/dist/server/node_modules/postgres-array/package.json +35 -0
- package/dist/server/node_modules/postgres-array/readme.md +43 -0
- package/dist/server/node_modules/postgres-bytea/index.js +33 -0
- package/dist/server/node_modules/postgres-bytea/license +21 -0
- package/dist/server/node_modules/postgres-bytea/package.json +34 -0
- package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/postgres-interval/license +21 -0
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/server.js +230 -230
- package/package.json +1 -1
- package/dist/client/assets/connection-detail-B4CoR-IH.js +0 -1
- package/dist/client/assets/connections-B-zXLcDP.js +0 -1
- package/dist/client/assets/constants-DxY-8FrK.js +0 -1
- package/dist/client/assets/plugins-BdyM0ZUw.js +0 -1
- package/dist/client/assets/tasks-tenjlvFT.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BlrmUHYA.js +0 -1
- package/dist/client/assets/useQuery-Bmc4jnG2.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DD4jjrsx.js +0 -1
- package/dist/server/node_modules/pg/README.md +0 -95
- package/dist/server/node_modules/pg/esm/index.mjs +0 -20
- package/dist/server/node_modules/pg/lib/client.js +0 -743
- package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
- package/dist/server/node_modules/pg/lib/connection.js +0 -221
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
- package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
- package/dist/server/node_modules/pg/lib/defaults.js +0 -91
- package/dist/server/node_modules/pg/lib/index.js +0 -73
- package/dist/server/node_modules/pg/lib/native/client.js +0 -323
- package/dist/server/node_modules/pg/lib/native/index.js +0 -2
- package/dist/server/node_modules/pg/lib/native/query.js +0 -165
- package/dist/server/node_modules/pg/lib/query.js +0 -252
- package/dist/server/node_modules/pg/lib/result.js +0 -109
- package/dist/server/node_modules/pg/lib/stream.js +0 -83
- package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
- package/dist/server/node_modules/pg/lib/utils.js +0 -217
- package/dist/server/node_modules/pg/package.json +0 -76
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,c as O,f as st,j as s,y as me,w as Je,o as us,n as Ge,e as at,u as ue,x as kt,t as fs,q as ps,K as ut,B as de,c5 as Pt,O as Ie,P as It,S as Ze,g as xs,av as hs}from"./index-BXUNq6d7.js";import{u as Et}from"./use-project-BnRSDoVD.js";import{D as Ot,a as gs,b as vs,c as Dt,d as Lt}from"./dialog-DxTRqiug.js";import{i as ys}from"./X-CeRZ6ROs.js";import{S as ie}from"./skeleton-CK2-6UkT.js";import{i as bs,u as js,a as Ns,O as Ss}from"./org-ai-providers-CQKU4ds_.js";import{A as Tt}from"./avatar-w6QMWHVj.js";import{t as ws,i as rt}from"./Coins01-DTz6uYyF.js";import{t as Cs}from"./Settings01-BWkL3Bf9.js";import{t as As}from"./Users03-FsZwQwZq.js";import{i as _s}from"./Zap-B-qa654H.js";import{a as ks,b as Ps,c as Is,T as Es}from"./tooltip-BGPUMzDS.js";import{i as Os}from"./Check-7kB05ju_.js";import{a as Ds}from"./Copy01-BexEalI-.js";import{S as De}from"./switch-4UL4iV3X.js";import{S as Ls,a as Ts,d as We,c as zs}from"./select-B-f7jgVG.js";import{i as $s}from"./Code01-DDbKsccR.js";import{s as zt}from"./RefreshCcw01-B6R5Js1R.js";import{i as Ms}from"./Shield01-DMT1motk.js";import{u as Bs}from"./useMutation-CkdHuTyE.js";import{a as Gs,F as Fe,b as Re,c as Ue,d as Ke,f as Ve,e as Ws}from"./form-BV3tSlED.js";import{I as Pe}from"./input-BFH8rk50.js";import{L as Fs}from"./logo-upload-Bfzj_LQV.js";import{P as Rs}from"./project-plugins-CXWguN_r.js";import{ag as Us,ah as Ks,ai as Vs,M as ne,r as lt,D as $t,u as Me,t as fe,aj as ft,ak as pt,Z as Mt,al as Bt,am as Gt,H as it,c as Be,s as nt,an as Ys,ao as Hs,e as Wt,ap as ot,aq as ct,f as Ft,ar as qs,i as Rt,h as xt,g as Xs,as as Qs,p as Js,R as Zs,S as ea,j as ta,at as sa,k as Ut,l as aa,n as ra,q as la,au as ia,m as na,o as oa,v as ca,L as Le,G as da,w as ht,x as gt,z as ma,a6 as Kt,J as ua,A as Ne,y as fa,av as pa,B as xa,E as ha,F as ga,aw as Ye,ax as Te,ay as J,a2 as Vt,az as va,aA as ya,aB as ba,aa as ja,aC as Na,aD as Sa,ab as wa,aE as Ca,aF as Aa,aG as _a,af as ka,I as Pa,K as Ia,C as Ea,a as Oa,b as Da}from"./chart-CEfru1MQ.js";import{L as _e}from"./label-DE7vX487.js";import{B as La}from"./badge-B-_hRtCy.js";import{a as Ta,T as He,b as qe,c as za}from"./tabs-Cif80TZ4.js";import{i as $a}from"./AlertCircle-CnfwZdxb.js";import{s as Yt}from"./Plus-CqWob4tu.js";import{u as Ae,a as dt,K as Ma}from"./constants-CDL9XClm.js";import{b as Ba}from"./use-connection-lXrlfojY.js";import{b as oe,a as Ht}from"./use-mcp-tools-CwVNqTmj.js";import{u as Ga}from"./use-members-fpZqw1dy.js";import{c as Wa,A as Fa}from"./use-binding-CZ8osTa1.js";import{a as qt,d as ke,g as Ra,A as vt,D as Ua,b as Ka,C as Va,X as Ya}from"./XAxis-B4Pxztvn.js";import Ha from"./members-BvBWfv9e.js";import"./useQuery-Bmc4jnG2.js";import"./index-rWegviRE.js";import"./EyeOff-L-SLicw9.js";import"./Eye-Cn6YseXl.js";import"./Key01-Dq5b7fdA.js";import"./Trash01-C0891dQq.js";import"./card-BSGld6G2.js";import"./popover-BcyJids_.js";import"./ai-providers-logos-Bb5LHAPU.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./index-L6huQtcJ.js";import"./ChevronUp-J7upZD3-.js";import"./ChevronDown-DHeagNGb.js";import"./Upload01-ngHWsp64.js";import"./Container-Ci_1Xm4L.js";import"./use-install-from-registry-C24f0cqa.js";import"./extract-connection-data-Cyjq-Q5I.js";import"./constants-DxY-8FrK.js";import"./registry-utils-CaVl1vKg.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-Cbk1oNZ2.js";import"./index-BE93ZIdg.js";import"./use-collections-yY78nnLx.js";import"./binder-BEJ4wRzw.js";import"./collection-display-button-CuyLh-NC.js";import"./dropdown-menu-CdjuOUR6.js";import"./ChevronRight-Blv21S_7.js";import"./ArrowDown-BnnQhLmg.js";import"./ArrowUp-BuKX1RSZ.js";import"./Grid01-Dqz--q3o.js";import"./List-Cc_Ri6eQ.js";import"./collection-search-aJlY7LHs.js";import"./SearchMd-DJI6OMcD.js";import"./breadcrumb-Dk9kRV2t.js";import"./collection-table-wrapper-CcbJTCba.js";import"./table-Bu98B5a-.js";import"./integration-icon-D6SJHU0f.js";import"./checkbox-COsQJsO9.js";import"./ArrowLeft-C3_bzjZf.js";import"./alert-dialog-DgTufZ_p.js";import"./DotsHorizontal-3xIvFzgk.js";import"./Lock01-dP10fLup.js";import"./empty-state-v8jdj56V.js";import"./textarea-DPLd5P1K.js";import"./DotsVertical-7N_NB6wt.js";import"./XClose-BieEiV6P.js";import"./command-CyHipwcz.js";import"./index-DlhaGZnK.js";const Xt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));Xt.displayName="Bell01";function qa(t){const e=O.c(27),{activeSection:r,onNavigate:a}=t,{data:l}=st.useSession(),i=l?.user,n=i?.image,o=i?.name??"Profile",d=i?.name??"U";let u;e[0]!==d||e[1]!==n?(u=s.jsx(Tt,{url:n,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=n,e[2]=u):u=e[2];let c;e[3]!==o||e[4]!==u?(c={key:"account.profile",label:o,icon:u},e[3]=o,e[4]=u,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={key:"account.preferences",label:"Preferences",icon:s.jsx(Cs,{size:14})},e[6]=m):m=e[6];let f;e[7]!==c?(f=[c,m],e[7]=c,e[8]=f):f=e[8];const h=f;let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x={key:"org.general",label:"General",icon:s.jsx(ws,{size:14})},e[9]=x):x=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.plugins",label:"Features",icon:s.jsx(_s,{size:14})},e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g={key:"org.ai-providers",label:"AI Providers",icon:s.jsx(bs,{size:14})},e[11]=g):g=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y={key:"org.members",label:"Members",icon:s.jsx(As,{size:14})},e[12]=y):y=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=[x,p,g,y,{key:"org.billing",label:"Billing",icon:s.jsx(rt,{size:14})}],e[13]=N):N=e[13];const S=N;let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[14]=b):b=e[14];let j;e[15]!==h||e[16]!==r||e[17]!==a?(j=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[b,h.map(k=>s.jsxs("button",{type:"button",onClick:()=>a(k.key),className:me("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===k.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:k.icon}),s.jsx("span",{className:"truncate",children:k.label})]},k.key))]}),e[15]=h,e[16]=r,e[17]=a,e[18]=j):j=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[19]=w):w=e[19];let C;e[20]!==r||e[21]!==a?(C=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[w,S.map(k=>s.jsxs("button",{type:"button",onClick:()=>a(k.key),className:me("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===k.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:k.icon}),s.jsx("span",{className:"truncate",children:k.label})]},k.key))]}),e[20]=r,e[21]=a,e[22]=C):C=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.175.2"]})}),e[23]=_):_=e[23];let A;return e[24]!==j||e[25]!==C?(A=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[j,C,_]}),e[24]=j,e[25]=C,e[26]=A):A=e[26],A}function Xa(){const t=O.c(32),{data:e}=st.useSession(),[r,a]=v.useState(!1),l=e?.user,i=l?.image;let n;t[0]!==l?(n=()=>{l?.id&&navigator.clipboard.writeText(l.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=l,t[1]=n):n=t[1];const o=n;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const u=l?.name??"U";let c;t[3]!==u||t[4]!==i?(c=s.jsx(Tt,{url:i,fallback:u,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=u,t[4]=i,t[5]=c):c=t[5];const m=l?.name??"User";let f;t[6]!==m?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:m}),t[6]=m,t[7]=f):f=t[7];const h=l?.email;let x;t[8]!==h?(x=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),t[8]=h,t[9]=x):x=t[9];let p;t[10]!==f||t[11]!==x?(p=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,x]}),t[10]=f,t[11]=x,t[12]=p):p=t[12];let g;t[13]!==c||t[14]!==p?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,p]}),t[13]=c,t[14]=p,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let N;t[17]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=N):N=t[17];const S=l?.id;let b;t[18]!==S?(b=s.jsx("span",{className:"font-mono text-sm",children:S}),t[18]=S,t[19]=b):b=t[19];let j;t[20]!==r?(j=r?s.jsx(Os,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Ds,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=j):j=t[21];let w;t[22]!==o||t[23]!==b||t[24]!==j?(w=s.jsx(ks,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,j]})}),t[22]=o,t[23]=b,t[24]=j,t[25]=w):w=t[25];let C;t[26]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ps,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=C):C=t[26];let _;t[27]!==w?(_=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[N,s.jsx(Is,{children:s.jsxs(Es,{children:[w,C]})})]})]}),t[27]=w,t[28]=_):_=t[28];let A;return t[29]!==_||t[30]!==g?(A=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,_]}),t[29]=_,t[30]=g,t[31]=A):A=t[31],A}function Oe(t){const e=O.c(27),{icon:r,label:a,description:l,control:i,onClick:n,disabled:o}=t,d=o?void 0:n,u=n?"button":void 0,c=n&&!o?0:void 0;let m;e[0]!==o||e[1]!==n?(m=n&&!o?j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),n())}:void 0,e[0]=o,e[1]=n,e[2]=m):m=e[2];const f=n&&!o?"pointer":void 0;let h;e[3]!==f?(h={cursor:f},e[3]=f,e[4]=h):h=e[4];let x;e[5]!==r?(x=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=x):x=e[6];let p;e[7]!==a?(p=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=p):p=e[8];let g;e[9]!==l?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[9]=l,e[10]=g):g=e[10];let y;e[11]!==p||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[p,g]}),e[11]=p,e[12]=g,e[13]=y):y=e[13];let N;e[14]!==y||e[15]!==x?(N=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[x,y]}),e[14]=y,e[15]=x,e[16]=N):N=e[16];let S;e[17]!==i?(S=s.jsx("div",{onClick:Qa,className:"shrink-0",children:i}),e[17]=i,e[18]=S):S=e[18];let b;return e[19]!==d||e[20]!==N||e[21]!==S||e[22]!==u||e[23]!==c||e[24]!==m||e[25]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:u,tabIndex:c,onKeyDown:m,style:h,children:[N,S]}),e[19]=d,e[20]=N,e[21]=S,e[22]=u,e[23]=c,e[24]=m,e[25]=h,e[26]=b):b=e[26],b}function Qa(t){return t.stopPropagation()}function yt(){const t=O.c(47),[e,r]=js();let a;t[0]!==r?(a=async P=>{if(P&&await Notification.requestPermission()!=="granted"){Je.error("Notifications denied. Please enable them in your browser settings."),r(er);return}r(E=>({...E,enableNotifications:P}))},t[0]=r,t[1]=a):a=t[1];const l=a;let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=i):i=t[2];let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx($s,{size:16}),t[3]=n):n=t[3];let o;t[4]!==r?(o=()=>r(Za),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=P=>r(E=>({...E,devMode:P})),t[6]=r,t[7]=d):d=t[7];let u;t[8]!==e.devMode||t[9]!==d?(u=s.jsx(De,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=u):u=t[10];let c;t[11]!==o||t[12]!==u?(c=s.jsx(Oe,{icon:n,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:u}),t[11]=o,t[12]=u,t[13]=c):c=t[13];let m;t[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Xt,{size:16}),t[14]=m):m=t[14];let f;t[15]!==l||t[16]!==e.enableNotifications?(f=s.jsx(Oe,{icon:m,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>l(!e.enableNotifications),control:s.jsx(De,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:l})}),t[15]=l,t[16]=e.enableNotifications,t[17]=f):f=t[17];let h;t[18]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(zt,{size:16}),t[18]=h):h=t[18];let x;t[19]!==r?(x=()=>r(Ja),t[19]=r,t[20]=x):x=t[20];let p;t[21]!==r?(p=P=>r(E=>({...E,experimentalAutomations:P})),t[21]=r,t[22]=p):p=t[22];let g;t[23]!==e.experimentalAutomations||t[24]!==p?(g=s.jsx(De,{checked:e.experimentalAutomations,onCheckedChange:p}),t[23]=e.experimentalAutomations,t[24]=p,t[25]=g):g=t[25];let y;t[26]!==x||t[27]!==g?(y=s.jsx(Oe,{icon:h,label:"Experimental: Automations",description:"Enable the Automations feature in the sidebar. This is an experimental feature under active development.",onClick:x,control:g}),t[26]=x,t[27]=g,t[28]=y):y=t[28];let N;t[29]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Ms,{size:16}),t[29]=N):N=t[29];let S;t[30]!==r?(S=P=>r(E=>({...E,toolApprovalLevel:P})),t[30]=r,t[31]=S):S=t[31];let b;t[32]===Symbol.for("react.memo_cache_sentinel")?(b={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[32]=b):b=t[32];const j=b[e.toolApprovalLevel];let w;t[33]!==j?(w=s.jsx(Ts,{className:"w-36",children:s.jsx("span",{children:j})}),t[33]=j,t[34]=w):w=t[34];let C;t[35]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(We,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[35]=C):C=t[35];let _;t[36]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(We,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[36]=_):_=t[36];let A;t[37]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsxs(zs,{children:[C,_,s.jsx(We,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[37]=A):A=t[37];let k;t[38]!==e.toolApprovalLevel||t[39]!==S||t[40]!==w?(k=s.jsx(Oe,{icon:N,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Ls,{value:e.toolApprovalLevel,onValueChange:S,children:[w,A]})}),t[38]=e.toolApprovalLevel,t[39]=S,t[40]=w,t[41]=k):k=t[41];let D;return t[42]!==y||t[43]!==k||t[44]!==c||t[45]!==f?(D=s.jsxs("div",{className:"flex flex-col gap-6",children:[i,s.jsxs("div",{className:"flex flex-col",children:[c,f,y,k]})]}),t[42]=y,t[43]=k,t[44]=c,t[45]=f,t[46]=D):D=t[46],D}function Ja(t){return{...t,experimentalAutomations:!t.experimentalAutomations}}function Za(t){return{...t,devMode:!t.devMode}}function er(t){return{...t,enableNotifications:!1}}const tr=us({name:Ge().min(1,"Name is required").max(255,"Name is too long"),slug:Ge().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Ge().optional()});function sr(){const t=at(),{org:e,project:r}=ue(),a=kt(),[l,i]=v.useState(!1),n=fs({resolver:ps(tr),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Bs({mutationFn:async c=>{const m={name:c.name,slug:c.slug};c.logo&&(m.logo=c.logo);const f=await st.organization.update({organizationId:e.id,data:m});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:ut.organizations()}),a.invalidateQueries({queryKey:ut.activeOrganization(e.slug)}),Je.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Je.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{i(!1)}}),d=c=>{i(!0),o.mutate(c)},u=n.formState.isDirty;return s.jsx(Gs,{...n,children:s.jsxs("form",{onSubmit:n.handleSubmit(d),className:"space-y-6",children:[s.jsx(Fe,{control:n.control,name:"name",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Organization Name"}),s.jsx(Ke,{children:s.jsx(Pe,{placeholder:"My Organization",...c,disabled:l})}),s.jsx(Ve,{})]})}),s.jsx(Fe,{control:n.control,name:"slug",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Organization Slug"}),s.jsx(Ke,{children:s.jsx(Pe,{placeholder:"my-organization",...c,disabled:l,onChange:m=>{const f=m.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx(Ws,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(Ve,{})]})}),s.jsx(Fe,{control:n.control,name:"logo",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Logo"}),s.jsx(Ke,{children:s.jsx(Fs,{value:c.value,onChange:c.onChange,name:n.watch("name"),disabled:l})}),s.jsx(Ve,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(de,{type:"submit",disabled:!u||l,className:"min-w-24",children:l?"Saving...":"Save Changes"}),u&&s.jsx(de,{type:"button",variant:"outline",onClick:()=>n.reset(),disabled:l,children:"Cancel"})]})]})})}function ar(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(sr,{})]}),t[0]=e):e=t[0],e}var bt=function(e,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),i=2;i<a;i++)l[i-2]=arguments[i];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var n=0;console.warn(r.replace(/%s/g,()=>l[n++]))}},rr=["x1","y1","x2","y2","key"],lr=["offset"],ir=["xAxisId","yAxisId"],nr=["xAxisId","yAxisId"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(a){or(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function or(t,e,r){return(e=cr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cr(t){var e=dr(t,"string");return typeof e=="symbol"?e:e+""}function dr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function ze(t,e){if(t==null)return{};var r,a,l=mr(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function mr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var ur=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:l,width:i,height:n,ry:o}=t;return v.createElement("rect",{x:a,y:l,ry:o,width:i,height:n,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Qt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var l,{x1:i,y1:n,x2:o,y2:d,key:u}=r,c=ze(r,rr),m=(l=it(c))!==null&&l!==void 0?l:{},{offset:f}=m,h=ze(m,lr);a=v.createElement("line",pe({},h,{x1:i,y1:n,x2:o,y2:d,fill:"none",key:u}))}return a}function fr(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:i,yAxisId:n}=t,o=ze(t,ir),d=l.map((u,c)=>{var m=Z(Z({},o),{},{x1:e,y1:u,x2:e+r,y2:u,key:"line-".concat(c),index:c});return v.createElement(Qt,{key:"line-".concat(c),option:a,lineItemProps:m})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function pr(t){var{y:e,height:r,vertical:a=!0,verticalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:i,yAxisId:n}=t,o=ze(t,nr),d=l.map((u,c)=>{var m=Z(Z({},o),{},{x1:u,y1:e,x2:u,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Qt,{option:a,lineItemProps:m,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function xr(t){var{horizontalFill:e,fillOpacity:r,x:a,y:l,width:i,height:n,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var u=o.map(m=>Math.round(m+l-l)).sort((m,f)=>m-f);l!==u[0]&&u.unshift(0);var c=u.map((m,f)=>{var h=u[f+1],x=h==null,p=x?l+n-m:h-m;if(p<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:m,x:a,height:p,width:i,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function hr(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:l,y:i,width:n,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var u=d.map(m=>Math.round(m+l-l)).sort((m,f)=>m-f);l!==u[0]&&u.unshift(0);var c=u.map((m,f)=>{var h=u[f+1],x=h==null,p=x?l+n-m:h-m;if(p<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:m,y:i,width:p,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var gr=(t,e)=>{var{xAxis:r,width:a,height:l,offset:i}=t;return Bt(qt(Z(Z(Z({},ke),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),i.left,i.left+i.width,e)},vr=(t,e)=>{var{yAxis:r,width:a,height:l,offset:i}=t;return Bt(qt(Z(Z(Z({},ke),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),i.top,i.top+i.height,e)},yr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:$t.grid};function Jt(t){var e=Us(),r=Ks(),a=Vs(),l=Z(Z({},lt(t,yr)),{},{x:ne(t.x)?t.x:a.left,y:ne(t.y)?t.y:a.top,width:ne(t.width)?t.width:a.width,height:ne(t.height)?t.height:a.height}),{xAxisId:i,yAxisId:n,x:o,y:d,width:u,height:c,syncWithTicks:m,horizontalValues:f,verticalValues:h}=l,x=Me(),p=fe(A=>ft(A,"xAxis",i,x)),g=fe(A=>ft(A,"yAxis",n,x));if(!pt(u)||!pt(c)||!ne(o)||!ne(d))return null;var y=l.verticalCoordinatesGenerator||gr,N=l.horizontalCoordinatesGenerator||vr,{horizontalPoints:S,verticalPoints:b}=l;if((!S||!S.length)&&typeof N=="function"){var j=f&&f.length,w=N({yAxis:g?Z(Z({},g),{},{ticks:j?f:g.ticks}):void 0,width:e??u,height:r??c,offset:a},j?!0:m);bt(Array.isArray(w),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof w,"]")),Array.isArray(w)&&(S=w)}if((!b||!b.length)&&typeof y=="function"){var C=h&&h.length,_=y({xAxis:p?Z(Z({},p),{},{ticks:C?h:p.ticks}):void 0,width:e??u,height:r??c,offset:a},C?!0:m);bt(Array.isArray(_),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof _,"]")),Array.isArray(_)&&(b=_)}return v.createElement(Mt,{zIndex:l.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(ur,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),v.createElement(xr,pe({},l,{horizontalPoints:S})),v.createElement(hr,pe({},l,{verticalPoints:b})),v.createElement(fr,pe({},l,{offset:a,horizontalPoints:S,xAxis:p,yAxis:g})),v.createElement(pr,pe({},l,{offset:a,verticalPoints:b,xAxis:p,yAxis:g}))))}Jt.displayName="CartesianGrid";var Zt=(t,e,r)=>Wt(t,"xAxis",ot(t,e),r),es=(t,e,r)=>Ft(t,"xAxis",ot(t,e),r),ts=(t,e,r)=>Wt(t,"yAxis",ct(t,e),r),ss=(t,e,r)=>Ft(t,"yAxis",ct(t,e),r),br=Be([nt,Zt,ts,es,ss],(t,e,r,a,l)=>Rt(t,"xAxis")?xt(e,a,!1):xt(r,l,!1)),jr=(t,e)=>e,as=Be([Xs,jr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),rs=t=>{var e=nt(t),r=Rt(e,"xAxis");return r?"yAxis":"xAxis"},Nr=(t,e)=>{var r=rs(t);return r==="yAxis"?ct(t,e):ot(t,e)},Sr=(t,e,r)=>Qs(t,rs(t),Nr(t,e),r),wr=Be([as,Sr],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,l=qs(t);if(!(a==null||l==null)){var i=(r=e[a])===null||r===void 0?void 0:r.stackedData,n=i?.find(o=>o.key===l);if(n!=null)return n.map(o=>[o[0],o[1]])}}}),Cr=Be([nt,Zt,ts,es,ss,wr,Ys,br,as,Hs],(t,e,r,a,l,i,n,o,d,u)=>{var{chartData:c,dataStartIndex:m,dataEndIndex:f}=n;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||l==null||a.length===0||l.length===0||o==null)){var{data:h}=d,x;if(h&&h.length>0?x=h:x=c?.slice(m,f+1),x!=null)return Kr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:l,dataStartIndex:m,areaSettings:d,stackedData:i,displayedData:x,chartBaseValue:u,bandSize:o})}}),Ar=["id"],_r=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function ls(t,e){if(t==null)return{};var r,a,l=kr(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function kr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){Pr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Pr(t,e,r){return(e=Ir(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ir(t){var e=Er(t,"string");return typeof e=="symbol"?e:e+""}function Er(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $e(t,e){return t&&t!=="none"?t:e}var Or=t=>{var{dataKey:e,name:r,stroke:a,fill:l,legendType:i,hide:n}=t;return[{inactive:n,dataKey:e,type:i,color:$e(a,l),value:Ut(r,e),payload:t}]},Dr=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:l,fill:i,name:n,hide:o,unit:d,tooltipType:u,id:c}=t,m={dataDefinedOnItem:r,getPosition:ra,settings:{stroke:a,strokeWidth:l,fill:i,dataKey:e,nameKey:void 0,name:Ut(n,e),hide:o,type:u,color:$e(a,i),unit:d,graphicalItemId:c}};return v.createElement(aa,{tooltipEntrySettings:m})});function Lr(t){var{clipPathId:e,points:r,props:a}=t,{needClip:l,dot:i,dataKey:n}=a,o=it(a);return v.createElement(Ua,{points:r,dot:i,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:n,baseProps:o,needClip:l,clipPathId:e})}function Tr(t){var{showLabels:e,children:r,points:a}=t,l=a.map(i=>{var n,o,d={x:(n=i.x)!==null&&n!==void 0?n:0,y:(o=i.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:i.value,payload:i.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(ha,{value:e?l:void 0},r)}function St(t){var{points:e,baseLine:r,needClip:a,clipPathId:l,props:i}=t,{layout:n,type:o,stroke:d,connectNulls:u,isRange:c}=i,{id:m}=i,f=ls(i,Ar),h=it(f),x=ga(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(Le,{clipPath:a?"url(#clipPath-".concat(l,")"):void 0},v.createElement(Ye,xe({},x,{id:m,points:e,connectNulls:u,type:o,baseLine:r,layout:n,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Ye,xe({},h,{className:"recharts-area-curve",layout:n,type:o,connectNulls:u,fill:"none",points:e})),d!=="none"&&c&&Array.isArray(r)&&v.createElement(Ye,xe({},h,{className:"recharts-area-curve",layout:n,type:o,connectNulls:u,fill:"none",points:r}))),v.createElement(Lr,{points:e,props:f,clipPathId:l}))}function zr(t){var e,r,{alpha:a,baseLine:l,points:i,strokeWidth:n}=t,o=(e=i[0])===null||e===void 0?void 0:e.y,d=(r=i[i.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(d))return null;var u=a*Math.abs(o-d),c=Math.max(...i.map(m=>m.x||0));return ne(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(m=>m.x||0),c)),ne(c)?v.createElement("rect",{x:0,y:o<d?o:o-u,width:c+(n?parseInt("".concat(n),10):1),height:Math.floor(u)}):null}function $r(t){var e,r,{alpha:a,baseLine:l,points:i,strokeWidth:n}=t,o=(e=i[0])===null||e===void 0?void 0:e.x,d=(r=i[i.length-1])===null||r===void 0?void 0:r.x;if(!Te(o)||!Te(d))return null;var u=a*Math.abs(o-d),c=Math.max(...i.map(m=>m.y||0));return ne(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(m=>m.y||0),c)),ne(c)?v.createElement("rect",{x:o<d?o:o-u,y:0,width:u,height:Math.floor(c+(n?parseInt("".concat(n),10):1))}):null}function Mr(t){var{alpha:e,layout:r,points:a,baseLine:l,strokeWidth:i}=t;return r==="vertical"?v.createElement(zr,{alpha:e,points:a,baseLine:l,strokeWidth:i}):v.createElement($r,{alpha:e,points:a,baseLine:l,strokeWidth:i})}function Br(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:i}=t,{points:n,baseLine:o,isAnimationActive:d,animationBegin:u,animationDuration:c,animationEasing:m,onAnimationStart:f,onAnimationEnd:h}=a,x=v.useMemo(()=>({points:n,baseLine:o}),[n,o]),p=ma(x,"recharts-area-"),g=Kt(),[y,N]=v.useState(!1),S=!y,b=v.useCallback(()=>{typeof h=="function"&&h(),N(!1)},[h]),j=v.useCallback(()=>{typeof f=="function"&&f(),N(!0)},[f]);if(g==null)return null;var w=l.current,C=i.current;return v.createElement(Tr,{showLabels:S,points:n},a.children,v.createElement(ua,{animationId:p,begin:u,duration:c,isActive:d,easing:m,onAnimationEnd:b,onAnimationStart:j,key:p},_=>{if(w){var A=w.length/n.length,k=_===1?n:n.map((P,E)=>{var T=Math.floor(E*A);if(w[T]){var L=w[T];return Se(Se({},P),{},{x:Ne(L.x,P.x,_),y:Ne(L.y,P.y,_)})}return P}),D;return ne(o)?D=Ne(C,o,_):fa(o)||pa(o)?D=Ne(C,0,_):D=o.map((P,E)=>{var T=Math.floor(E*A);if(Array.isArray(C)&&C[T]){var L=C[T];return Se(Se({},P),{},{x:Ne(L.x,P.x,_),y:Ne(L.y,P.y,_)})}return P}),_>0&&(l.current=k,i.current=D),v.createElement(St,{points:k,baseLine:D,needClip:e,clipPathId:r,props:a})}return _>0&&(l.current=n,i.current=o),v.createElement(Le,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(Mr,{alpha:_,points:n,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(Le,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(St,{points:n,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(xa,{label:a.label}))}function Gr(t){var{needClip:e,clipPathId:r,props:a}=t,l=v.useRef(null),i=v.useRef();return v.createElement(Br,{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:i})}class Wr extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:l,top:i,left:n,needClip:o,xAxisId:d,yAxisId:u,width:c,height:m,id:f,baseLine:h,zIndex:x}=this.props;if(e)return null;var p=Pt("recharts-area",l),g=f,{r:y,strokeWidth:N}=Ra(r),S=ca(r),b=y*2+N,j=o?"url(#clipPath-".concat(S?"":"dots-").concat(g,")"):void 0;return v.createElement(Mt,{zIndex:x},v.createElement(Le,{className:p},o&&v.createElement("defs",null,v.createElement(da,{clipPathId:g,xAxisId:d,yAxisId:u}),!S&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:n-b/2,y:i-b/2,width:c+b,height:m+b}))),v.createElement(Gr,{needClip:o,clipPathId:g,props:this.props})),v.createElement(vt,{points:a,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:j}),this.props.isRange&&Array.isArray(h)&&v.createElement(vt,{points:h,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:j}))}}var Fr={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:$t.area};function Rr(t){var e,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:i,connectNulls:n,dot:o,fill:d,fillOpacity:u,hide:c,isAnimationActive:m,legendType:f,stroke:h,xAxisId:x,yAxisId:p}=t,g=ls(t,_r),y=la(),N=ia(),{needClip:S}=na(x,p),b=Me(),{points:j,isRange:w,baseLine:C}=(e=fe(E=>Cr(E,t.id,b)))!==null&&e!==void 0?e:{},_=oa();if(y!=="horizontal"&&y!=="vertical"||_==null||N!=="AreaChart"&&N!=="ComposedChart")return null;var{height:A,width:k,x:D,y:P}=_;return!j||!j.length?null:v.createElement(Wr,xe({},g,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:i,baseLine:C,connectNulls:n,dot:o,fill:d,fillOpacity:u,height:A,hide:c,layout:y,isAnimationActive:m,isRange:w,legendType:f,needClip:S,points:j,stroke:h,width:k,left:D,top:P,xAxisId:x,yAxisId:p}))}var Ur=(t,e,r,a,l)=>{var i=r??e;if(ne(i))return i;var n=t==="horizontal"?l:a,o=n.scale.domain();if(n.type==="number"){var d=Math.max(o[0],o[1]),u=Math.min(o[0],o[1]);return i==="dataMin"?u:i==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return i==="dataMin"?o[0]:i==="dataMax"?o[1]:o[0]};function Kr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:l,layout:i,chartBaseValue:n,xAxis:o,yAxis:d,displayedData:u,dataStartIndex:c,xAxisTicks:m,yAxisTicks:f,bandSize:h}=t,x=l&&l.length,p=Ur(i,n,r,o,d),g=i==="horizontal",y=!1,N=u.map((b,j)=>{var w,C,_,A;if(x)A=l[c+j];else{var k=ht(b,a);Array.isArray(k)?(A=k,y=!0):A=[p,k]}var D=(w=(C=A)===null||C===void 0?void 0:C[1])!==null&&w!==void 0?w:null,P=D==null||x&&!e&&ht(b,a)==null;if(g){var E;return{x:gt({axis:o,ticks:m,bandSize:h,entry:b,index:j}),y:P?null:(E=d.scale.map(D))!==null&&E!==void 0?E:null,value:A,payload:b}}return{x:P?null:(_=o.scale.map(D))!==null&&_!==void 0?_:null,y:gt({axis:d,ticks:f,bandSize:h,entry:b,index:j}),value:A,payload:b}}),S;return x||y?S=N.map(b=>{var j,w=Array.isArray(b.value)?b.value[0]:null;if(g){var C;return{x:b.x,y:w!=null&&b.y!=null&&(C=d.scale.map(w))!==null&&C!==void 0?C:null,payload:b.payload}}return{x:w!=null&&(j=o.scale.map(w))!==null&&j!==void 0?j:null,y:b.y,payload:b.payload}}):S=g?d.scale.map(p):o.scale.map(p),{points:N,baseLine:S??0,isRange:y}}function Vr(t){var e=lt(t,Fr),r=Me();return v.createElement(Zs,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(ea,{legendPayload:Or(e)}),v.createElement(Dr,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(ta,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:sa(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Rr,xe({},e,{id:a}))))}var is=v.memo(Vr,Js);is.displayName="Area";var Yr=["type"],Hr=["dangerouslySetInnerHTML","ticks","scale"],qr=["id","scale"];function et(){return et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},et.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(a){Xr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Xr(t,e,r){return(e=Qr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qr(t){var e=Jr(t,"string");return typeof e=="symbol"?e:e+""}function Jr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tt(t,e){if(t==null)return{};var r,a,l=Zr(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Zr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function el(t){var e=Vt(),r=v.useRef(null),a=Kt(),{type:l}=t,i=tt(t,Yr),n=ka(a,"yAxis",l),o=v.useMemo(()=>{if(n!=null)return Ct(Ct({},i),{},{type:n})},[n,i]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(va(o)):r.current!==o&&e(ya({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ba(r.current)),r.current=null)},[e]),null}function tl(t){var{yAxisId:e,className:r,width:a,label:l}=t,i=v.useRef(null),n=v.useRef(null),o=fe(ja),d=Me(),u=Vt(),c="yAxis",m=fe(w=>Na(w,e)),f=fe(w=>Sa(w,e)),h=fe(w=>wa(w,c,e,d)),x=fe(w=>Ca(w,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!m||Aa(l)||v.isValidElement(l)||x==null)){var w=i.current;if(w){var C=w.getCalculatedWidth();Math.round(m.width)!==Math.round(C)&&u(_a({id:e,width:C}))}}},[h,m,u,l,e,a,x]),m==null||f==null||x==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:y}=t,N=tt(t,Hr),{id:S,scale:b}=x,j=tt(x,qr);return v.createElement(Va,et({},N,j,{ref:i,labelRef:n,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:m.width,height:m.height,className:Pt("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:h,axisType:c,axisId:e}))}var sl={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:ke.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:ke.tickLine,tickSize:ke.tickSize,type:J.type,niceTicks:J.niceTicks,width:J.width,yAxisId:0},al=t=>{var e=lt(t,sl);return v.createElement(v.Fragment,null,v.createElement(el,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter,niceTicks:e.niceTicks}),v.createElement(tl,e))},ns=v.memo(al,Ka);ns.displayName="YAxis";var rl=["axis"],ll=v.forwardRef((t,e)=>v.createElement(Pa,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:rl,tooltipPayloadSearcher:Ia,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function mt(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const l=new Date(r),i=t==="7d"?7:t==="30d"?30:90;return l.setDate(l.getDate()-i),{startDate:l.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function K(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const os="gateway-chip-period";function il(){try{const t=localStorage.getItem(os);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function nl(t){try{localStorage.setItem(os,t)}catch{}}const ol={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},cl={daily:"daily",weekly:"weekly",monthly:"monthly"},dl=[5,10,25,50,100],ml=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function ul(t){const e=O.c(51),{open:r,onOpenChange:a,connectionId:l,currentLimitUsd:i,billingMode:n,currentLimitPeriod:o}=t,{org:d}=ue(),[u,c]=v.useState(null),[m,f]=v.useState(""),[h,x]=v.useState(null),[p,g]=v.useState(null),[y,N]=v.useState(o??"none");let S;e[0]!==l||e[1]!==d.id?(S={connectionId:l,orgId:d.id},e[0]=l,e[1]=d.id,e[2]=S):S=e[2];const b=Ae(S);let j;e[3]!==b?(j={client:b},e[3]=b,e[4]=j):j=e[4];const{mutate:w,isPending:C}=Ht(j),_=kt(),A=n==="postpaid";let k;e[5]!==m?(k=m?Number.parseFloat(m):null,e[5]=m,e[6]=k):k=e[6];const P=u??k,E=y==="none"?null:y,T=A&&P!=null&&P===i&&E===o;let L;e[7]!==b?(L=Ma.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=L):L=e[8];const G=L;let V;e[9]!==G||e[10]!==_?(V=async()=>{await _.invalidateQueries({queryKey:G,exact:!0}),await _.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=_,e[11]=V):V=e[11];const R=V;let z,$;e[12]!==n||e[13]!==o||e[14]!==i||e[15]!==P||e[16]!==A||e[17]!==y||e[18]!==w||e[19]!==a||e[20]!==R?($=()=>{if(!P||P<=0)return;const B=A?P:i+P;g(null);const ae={limit_usd:B,billing_mode:n,return_url:window.location.href};A&&(ae.limit_period=y),w({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await R(),te?.checkout_url?x(te.checkout_url):z()},onError:re=>{g(re.message??"Failed to update limit.")}})},z=()=>{c(null),f(""),x(null),g(null),N(o??"none"),a(!1)},e[12]=n,e[13]=o,e[14]=i,e[15]=P,e[16]=A,e[17]=y,e[18]=w,e[19]=a,e[20]=R,e[21]=z,e[22]=$):(z=e[21],$=e[22]);const Y=A?"Configure Spending Limit":"Add Credit",H=A?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=A?"New limit":"Select amount",U=A?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(Ot,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(gs,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let W;e[27]!==q||e[28]!==ee?(W=s.jsxs(vs,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=W):W=e[29];let F;e[30]!==M||e[31]!==h||e[32]!==U||e[33]!==i||e[34]!==m||e[35]!==P||e[36]!==p||e[37]!==$||e[38]!==C||e[39]!==A||e[40]!==T||e[41]!==y||e[42]!==u?(F=h?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(de,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:h,children:[s.jsx(rt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:dl.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:me("rounded-md border px-3 py-2 text-sm font-medium transition-colors",u===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:A?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Pe,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:m,onChange:B=>{f(B.target.value),c(null)}})]})]}),A&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:ml.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>N(ae),className:me("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),p&&s.jsx("p",{className:"text-xs text-destructive",children:p}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:A?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:i>0?K(i):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:K(i)})]})}),s.jsx(de,{onClick:$,disabled:C||!P||P<=0||T,className:"gap-2",children:C?"Updating...":U})]})]}),e[30]=M,e[31]=h,e[32]=U,e[33]=i,e[34]=m,e[35]=P,e[36]=p,e[37]=$,e[38]=C,e[39]=A,e[40]=T,e[41]=y,e[42]=u,e[43]=F):F=e[43];let X;e[44]!==W||e[45]!==F?(X=s.jsxs(Dt,{className:"sm:max-w-md",children:[W,F]}),e[44]=W,e[45]=F,e[46]=X):X=e[46];let se;return e[47]!==z||e[48]!==r||e[49]!==X?(se=s.jsx(Lt,{open:r,onOpenChange:z,children:X}),e[47]=z,e[48]=r,e[49]=X,e[50]=se):se=e[50],se}function fl(t){const e=O.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:l,avgDailySpend:i}=r;if(a==null)return null;let n;e[0]!==l?(n=l?new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=l,e[1]=n):n=e[1];const o=n,d=a!==1?"s":"";let u;e[2]!==a||e[3]!==d?(u=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=u):u=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=m):m=e[7];let f;e[8]!==i?(f=K(i),e[8]=i,e[9]=f):f=e[9];let h;e[10]!==f?(h=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=h):h=e[11];let x;e[12]!==r.resetsBeforeDepletion?(x=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=x):x=e[13];const p=ol[r.confidence];let g;e[14]!==p?(g=s.jsx(La,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:p}),e[14]=p,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==u||e[18]!==c||e[19]!==h||e[20]!==x?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[u,c,m,h,x,g]}),e[16]=g,e[17]=u,e[18]=c,e[19]=h,e[20]=x,e[21]=y):y=e[21],y}function pl(t){const e=O.c(37),{usage:r,limit:a,limitPeriod:l,onConfigureLimit:i,connectionId:n,alert:o}=t,d=a.total!=null&&a.total>0;let u;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(u=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=u):u=e[3];const c=u;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=m):m=e[4];let f;e[5]!==r.total?(f=K(r.total),e[5]=r.total,e[6]=f):f=e[6];let h;e[7]!==f?(h=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=h):h=e[8];let x;e[9]!==d||e[10]!==a.total||e[11]!==l?(x=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a.total)," limit",l&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(zt,{size:10}),cl[l]]})]}),e[9]=d,e[10]=a.total,e[11]=l,e[12]=x):x=e[12];let p;e[13]!==d?(p=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=p):p=e[14];let g;e[15]!==h||e[16]!==x||e[17]!==p?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,h,x,p]}),e[15]=h,e[16]=x,e[17]=p,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Yt,{size:16}),e[19]=y):y=e[19];const N=d?"Configure Limit":"Set Limit";let S;e[20]!==i||e[21]!==N?(S=s.jsxs(de,{onClick:i,variant:"outline",className:"gap-2",children:[y,N]}),e[20]=i,e[21]=N,e[22]=S):S=e[22];let b;e[23]!==S||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),e[23]=S,e[24]=g,e[25]=b):b=e[25];let j;e[26]!==d||e[27]!==a.reset||e[28]!==c?(j=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:me("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=j):j=e[29];let w;e[30]!==o||e[31]!==n?(w=s.jsx(cs,{connectionId:n,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=n,e[32]=w):w=e[32];let C;return e[33]!==b||e[34]!==j||e[35]!==w?(C=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,j,w]}),e[33]=b,e[34]=j,e[35]=w,e[36]=C):C=e[36],C}function xl(t){const e=O.c(30),{available:r,total:a,estimation:l,onAddCredit:i,connectionId:n,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=u):u=e[0];let c;e[1]!==r?(c=K(r),e[1]=r,e[2]=c):c=e[2];let m;e[3]!==c?(m=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=m):m=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let h;e[7]!==m||e[8]!==f?(h=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,m,f]}),e[7]=m,e[8]=f,e[9]=h):h=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Yt,{size:16}),e[10]=x):x=e[10];let p;e[11]!==i?(p=s.jsxs(de,{onClick:i,className:"gap-2 px-5",children:[x,"Add Credit"]}),e[11]=i,e[12]=p):p=e[12];let g;e[13]!==h||e[14]!==p?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[h,p]}),e[13]=h,e[14]=p,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[K(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let N;e[20]!==l?(N=s.jsx(fl,{estimation:l}),e[20]=l,e[21]=N):N=e[21];let S;e[22]!==o||e[23]!==n?(S=s.jsx(cs,{connectionId:n,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=n,e[24]=S):S=e[24];let b;return e[25]!==N||e[26]!==S||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,N,S]}),e[25]=N,e[26]=S,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function cs(t){const e=O.c(78),{connectionId:r,alert:a,billingMode:l}=t,{org:i}=ue(),[n,o]=v.useState(!1),[d,u]=v.useState(a.enabled),[c,m]=v.useState(String(a.threshold_usd)),[f,h]=v.useState(a.email??""),[x,p]=v.useState(!1),[g,y]=v.useState(null);let N;e[0]!==r||e[1]!==i.id?(N={connectionId:r,orgId:i.id},e[0]=r,e[1]=i.id,e[2]=N):N=e[2];const S=Ae(N);let b;e[3]!==S?(b={client:S},e[3]=S,e[4]=b):b=e[4];const{mutate:j,isPending:w}=Ht(b),C=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let _;e[5]!==f||e[6]!==d||e[7]!==j||e[8]!==c?(_=()=>{y(null),p(!1);const Q=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(Q)||Q<=0){y("Threshold must be a positive number.");return}j({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:Q,...f?{email:f}:{}}},{onSuccess:()=>{p(!0),setTimeout(()=>p(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=j,e[8]=c,e[9]=_):_=e[9];const A=_,k=l==="postpaid"?"Usage Alert":"Low-Balance Alert",D=l==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!n){let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>o(!0),e[10]=Q):Q=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx($a,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==k?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:k}),e[12]=k,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==l?(ve=a.enabled?l==="postpaid"?`Enabled · Alert at ${K(a.threshold_usd)}`:`Enabled · Alert below ${K(a.threshold_usd)}`:l==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=l,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Ee;return e[25]!==je||e[26]!==be?(Ee=s.jsxs("button",{type:"button",onClick:Q,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Ee):Ee=e[27],Ee}let P;e[28]!==k?(P=s.jsx("p",{className:"text-xs font-medium text-foreground",children:k}),e[28]=k,e[29]=P):P=e[29];let E;e[30]!==D?(E=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:D}),e[30]=D,e[31]=E):E=e[31];let T;e[32]!==P||e[33]!==E?(T=s.jsxs("div",{children:[P,E]}),e[32]=P,e[33]=E,e[34]=T):T=e[34];let L;e[35]!==d?(L=s.jsx(De,{checked:d,onCheckedChange:u}),e[35]=d,e[36]=L):L=e[36];let G;e[37]!==T||e[38]!==L?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[T,L]}),e[37]=T,e[38]=L,e[39]=G):G=e[39];const V=!d&&"opacity-50 pointer-events-none";let R;e[40]!==V?(R=me("flex flex-col gap-3 transition-opacity",V),e[40]=V,e[41]=R):R=e[41];const z=l==="postpaid"?"Notify at":"Notify below";let $;e[42]!==z?($=s.jsx(_e,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:z}),e[42]=z,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=Q=>m(Q.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Pe,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(_e,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=Q=>h(Q.target.value),e[52]=ee):ee=e[52];let W;e[53]!==f?(W=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Pe,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=W):W=e[54];let F;e[55]!==U||e[56]!==W?(F=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,W]}),e[55]=U,e[56]=W,e[57]=F):F=e[57];let X;e[58]!==g?(X=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=X):X=e[59];let se;e[60]!==R||e[61]!==F||e[62]!==X?(se=s.jsxs("div",{className:R,children:[F,X]}),e[60]=R,e[61]=F,e[62]=X,e[63]=se):se=e[63];let B;e[64]!==x?(B=x&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=x,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(de,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=w||!C,te=w?"Saving...":"Save Alert";let le;e[67]!==A||e[68]!==re||e[69]!==te?(le=s.jsx(de,{size:"sm",className:"h-7 text-xs",onClick:A,disabled:re,children:te}),e[67]=A,e[68]=re,e[69]=te,e[70]=le):le=e[70];let ce;e[71]!==B||e[72]!==le?(ce=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=ce):ce=e[73];let I;return e[74]!==se||e[75]!==ce||e[76]!==G?(I=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,ce]}),e[74]=se,e[75]=ce,e[76]=G,e[77]=I):I=e[77],I}const hl={cost:{label:"Cost",color:"var(--chart-1)"}};function gl(){const t=O.c(54),{org:e}=ue(),[r,a]=v.useState("7d");let l;t[0]!==r?(l=mt(r),t[0]=r,t[1]=l):l=t[1];const i=l;let n;t[2]!==e.id?(n={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=n):n=t[3];const o=Ae(n);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let u;t[5]!==i?(u={widget:d,timeRange:i,skipCount:!0},t[5]=i,t[6]=u):u=t[6];let c;t[7]!==o||t[8]!==u?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:u,staleTime:6e4,select:Ce},t[7]=o,t[8]=u,t[9]=c):c=t[9];const{data:m}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let h;t[11]!==i?(h={widget:f,timeRange:i,skipCount:!0},t[11]=i,t[12]=h):h=t[12];let x;t[13]!==o||t[14]!==h?(x={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:h,staleTime:6e4,select:Ce},t[13]=o,t[14]=h,t[15]=x):x=t[15];const{data:p}=oe(x);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title",limit:10}},t[16]=g):g=t[16];let y;t[17]!==i?(y={widget:g,timeRange:i,skipCount:!0},t[17]=i,t[18]=y):y=t[18];let N;t[19]!==o||t[20]!==y?(N={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=N):N=t[21];const{data:S}=oe(N);let b;t[22]!==m?.timeseries?(b=m?.timeseries??[],t[22]=m?.timeseries,t[23]=b):b=t[23];let j;t[24]!==b?(j=b.map(Sl),t[24]=b,t[25]=j):j=t[25];const w=j;let C;if(t[26]!==p?.value||t[27]!==w||t[28]!==S?.groups||t[29]!==m?.timeseries||t[30]!==r){const _=(m?.timeseries??[]).reduce(Nl,0),A=p?.value??0,k=(S?.groups??[]).filter(jl).sort(bl).slice(0,5),D=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let P;t[32]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=P):P=t[32];const E=K(_);let T;t[33]!==E?(T=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:E}),t[33]=E,t[34]=T):T=t[34];let L;t[35]!==D?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:D}),t[35]=D,t[36]=L):L=t[36];let G;t[37]!==T||t[38]!==L?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[T,L]}),t[37]=T,t[38]=L,t[39]=G):G=t[39];let V;t[40]!==A?(V=A.toLocaleString(),t[40]=A,t[41]=V):V=t[41];let R;t[42]!==V?(R=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[V," tool calls"]}),t[42]=V,t[43]=R):R=t[43];let z;t[44]!==G||t[45]!==R?(z=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[P,G,R]}),t[44]=G,t[45]=R,t[46]=z):z=t[46];let $;t[47]!==r?($=s.jsx(ds,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==z||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[z,$]}),t[49]=z,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==w?(H=w.length>0?s.jsx(Ea,{config:hl,className:"h-[200px] w-full",children:s.jsxs(ll,{data:w,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(Jt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(Ya,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(ns,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:yl}),s.jsx(Oa,{content:s.jsx(Da,{formatter:vl})}),s.jsx(is,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=w,t[53]=H):H=t[53],C=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,k.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:k.map((M,U)=>{const q=_>0?Math.min(M.value/_*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:K(M.value)})]},M.key)})})]})]}),t[26]=p?.value,t[27]=w,t[28]=S?.groups,t[29]=m?.timeseries,t[30]=r,t[31]=C}else C=t[31];return C}function vl(t){return K(t)}function yl(t){return`$${t}`}function bl(t,e){return e.value-t.value}function jl(t){return t.value>0}function Nl(t,e){return t+e.value}function Sl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function wl(){const t=O.c(6),[e,r]=v.useState(il);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=u=>{r(u),nl(u)},t[0]=a):a=t[0];const l=a;let i,n;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),n=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=i,t[2]=n):(i=t[1],n=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[i,n,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(u=>s.jsx("button",{type:"button",onClick:()=>l(u),className:me("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===u?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:u},u))})]}),t[4]=e,t[5]=d):d=t[5],d}function Xe(t){const e=O.c(20),{label:r,value:a,subValue:l,maxValue:i,color:n}=t,o=n===void 0?"bg-chart-1":n;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const u=d,c=i>0?Math.min(u/i*100,100):0;let m;e[2]!==r?(m=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=m):m=e[3];let f;e[4]!==o?(f=me("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const h=`${c}%`;let x;e[6]!==h?(x={width:h},e[6]=h,e[7]=x):x=e[7];let p;e[8]!==f||e[9]!==x?(p=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:x})}),e[8]=f,e[9]=x,e[10]=p):p=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==l?(y=l&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:l}),e[13]=l,e[14]=y):y=e[14];let N;return e[15]!==m||e[16]!==p||e[17]!==g||e[18]!==y?(N=s.jsxs("div",{className:"flex items-center gap-2",children:[m,p,g,y]}),e[15]=m,e[16]=p,e[17]=g,e[18]=y,e[19]=N):N=e[19],N}function Qe(t){const e=O.c(8),{title:r,children:a,empty:l}=t;let i;e[0]!==r?(i=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=i):i=e[1];let n;e[2]!==a||e[3]!==l?(n=l?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=l,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[i,n]}),e[5]=i,e[6]=n,e[7]=o):o=e[7],o}const At={"7d":"7 days","30d":"30 days","90d":"90 days"};function ds(t){const e=O.c(4),{period:r,onPeriodChange:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.keys(At),e[0]=l):l=e[0];let i;return e[1]!==a||e[2]!==r?(i=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:l.map(n=>s.jsx("button",{type:"button",onClick:()=>a(n),className:me("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:At[n]},n))}),e[1]=a,e[2]=r,e[3]=i):i=e[3],i}function _t(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,l)=>l.cost-a.cost)}function Cl(){const t=O.c(27),{org:e}=ue(),[r,a]=v.useState("7d"),l=mt(r),{data:i}=Ga(),n=i?.data?.members??[],o=new Map(n.map(El));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const u=Ae(d),c=I=>({client:u,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:I.fn,...I.groupByColumn&&{groupByColumn:I.groupByColumn},...I.limit&&{limit:I.limit}}},timeRange:l,skipCount:!0},staleTime:6e4,select:Ce}),{data:m,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title",limit:20})),{data:h,isLoading:x}=oe(c({fn:"count_all",groupByColumn:"connection_title",limit:20})),{data:p,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id",limit:20})),{data:y,isLoading:N}=oe(c({fn:"count_all",groupByColumn:"user_id",limit:20})),{data:S,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name",limit:20}));let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j={fn:"count_all",groupByColumn:"tool_name",limit:20},t[2]=j):j=t[2];const{data:w,isLoading:C}=oe(c(j));if(f||x||g||N||b||C){let I;t[3]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ie,{className:"h-8 w-48"}),t[3]=I):I=t[3];let Q;return t[4]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsxs("div",{className:"flex flex-col gap-4",children:[I,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(Il)})]}),t[4]=Q):Q=t[4],Q}const A=_t(m?.groups??[],h?.groups??[]),k=_t(p?.groups??[],y?.groups??[]).map(I=>({...I,key:o.get(I.key)??I.key})),D=w?.groups??[],P=new Map((S?.groups??[]).map(Pl)),E=D.map(I=>({name:I.key,calls:I.value,cost:P.get(I.key)??0})).sort(kl).slice(0,20),T=A.reduce(_l,0),L=A.reduce(Al,0),G=A[0]?.cost??1,V=k[0]?.cost??1,R=E[0]?.calls??1;let z;t[5]!==r?(z=s.jsx(ds,{period:r,onPeriodChange:a}),t[5]=r,t[6]=z):z=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=A.length===0,H=A.slice(0,8).map(I=>s.jsx(Xe,{label:I.key,value:K(I.cost),subValue:`${I.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},I.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Qe,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=k.length===0,ee=k.slice(0,8).map(I=>s.jsx(Xe,{label:I.key,value:K(I.cost),subValue:`${I.calls.toLocaleString()} calls`,maxValue:V,color:"bg-chart-4"},I.key));let W;t[12]!==ee?(W=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=W):W=t[13];let F;t[14]!==W||t[15]!==q?(F=s.jsx(Qe,{title:"Cost by User",empty:q,children:W}),t[14]=W,t[15]=q,t[16]=F):F=t[16];const X=Qe,se="Top Tools",B=E.length===0,ae="space-y-2.5",re=E.slice(0,8).map(I=>s.jsx(Xe,{label:I.name,value:I.calls.toLocaleString(),subValue:I.cost>0?K(I.cost):void 0,maxValue:R,color:"bg-chart-3"},I.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==X||t[20]!==B||t[21]!==te?(le=s.jsx(X,{title:se,empty:B,children:te}),t[19]=X,t[20]=B,t[21]=te,t[22]=le):le=t[22];let ce;return t[23]!==F||t[24]!==le||t[25]!==U?(ce=s.jsxs("div",{className:$,children:[U,F,le]}),t[23]=F,t[24]=le,t[25]=U,t[26]=ce):ce=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:K(T)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:L.toLocaleString()})]})]}),z]}),ce]})}function Al(t,e){return t+e.calls}function _l(t,e){return t+e.cost}function kl(t,e){return e.calls-t.calls}function Pl(t){return[t.key,t.value]}function Il(t,e){return s.jsx(ie,{className:"h-40 rounded-xl"},e)}function El(t){return[t.userId,t.user.name??t.user.email]}function Ol(t,e){const r=new Map;for(const a of t){const i=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),n=r.get(i)??{cost:0,calls:0};r.set(i,{cost:n.cost+a.value,calls:n.calls})}for(const a of e){const i=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),n=r.get(i)??{cost:0,calls:0};r.set(i,{cost:n.cost,calls:n.calls+a.value})}return Array.from(r.entries()).map(([a,l])=>({month:a,...l})).reverse()}function Dl(){const t=O.c(27),{org:e}=ue();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=mt("90d"),t[0]=r):r=t[0];const a=r;let l;t[1]!==e.id?(l={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=l):l=t[2];const i=Ae(l);let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a,skipCount:!0},t[3]=n):n=t[3];let o;t[4]!==i?(o={client:i,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:n,staleTime:6e4,select:Ce},t[4]=i,t[5]=o):o=t[5];const{data:d,isLoading:u}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a,skipCount:!0},t[6]=c):c=t[6];let m;t[7]!==i?(m={client:i,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=i,t[8]=m):m=t[8];const{data:f,isLoading:h}=oe(m);if(u||h){let j;return t[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ie,{className:"h-8 w-48"}),s.jsx(ie,{className:"h-48 rounded-xl"})]}),t[9]=j):j=t[9],j}let x,p,g,y,N;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const j=Ol(d?.timeseries??[],f?.timeseries??[]);N="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=x):x=t[17],p="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=j.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:j.map(Ll)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=x,t[13]=p,t[14]=g,t[15]=y,t[16]=N}else x=t[12],p=t[13],g=t[14],y=t[15],N=t[16];let S;t[19]!==p||t[20]!==g||t[21]!==y?(S=s.jsxs("div",{className:p,children:[g,y]}),t[19]=p,t[20]=g,t[21]=y,t[22]=S):S=t[22];let b;return t[23]!==x||t[24]!==S||t[25]!==N?(b=s.jsxs("div",{className:N,children:[x,S]}),t[23]=x,t[24]=S,t[25]=N,t[26]=b):b=t[26],b}function Ll(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:K(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function Tl(t){const e=O.c(31),{connectionId:r}=t,{org:a}=ue(),[l,i]=v.useState(!1);let n;e[0]!==r||e[1]!==a.id?(n={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=n):n=e[2];const o=Ae(n);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let u;e[4]!==o?(u={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:zl},e[4]=o,e[5]=u):u=e[5];const{data:c,isLoading:m}=oe(u);if(m){let k;return e[6]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ie,{className:"h-36 rounded-xl"}),e[6]=k):k=e[6],k}if(!c)return null;const f=c.limit.remaining??0,h=c.limit.total??0,x=c.usage,p=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let N;e[7]!==c.alert?(N=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=N):N=e[8];const S=N,b=c.limit,j=p==="postpaid"&&(h==null||h===0);let w;e[9]!==S||e[10]!==f||e[11]!==p||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==h||e[17]!==x?(w=p==="postpaid"?s.jsx(pl,{usage:x,limit:b,limitPeriod:g,onConfigureLimit:()=>i(!0),connectionId:r,alert:S}):s.jsx(xl,{available:f,total:h,estimation:y,onAddCredit:()=>i(!0),connectionId:r,alert:S}),e[9]=S,e[10]=f,e[11]=p,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=h,e[17]=x,e[18]=w):w=e[18];let C;e[19]!==j?(C=j&&s.jsx(wl,{}),e[19]=j,e[20]=C):C=e[20];let _;e[21]!==p||e[22]!==r||e[23]!==l||e[24]!==g||e[25]!==h?(_=s.jsx(ul,{open:l,onOpenChange:i,connectionId:r,currentLimitUsd:h,billingMode:p,currentLimitPeriod:g}),e[21]=p,e[22]=r,e[23]=l,e[24]=g,e[25]=h,e[26]=_):_=e[26];let A;return e[27]!==w||e[28]!==C||e[29]!==_?(A=s.jsxs(s.Fragment,{children:[w,C,_]}),e[27]=w,e[28]=C,e[29]=_,e[30]=A):A=e[30],A}function zl(t){return t.structuredContent}function $l(t){const e=O.c(20),{gatewayConnectionId:r}=t,[a,l]=v.useState("summary");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=i):i=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(Ta,{variant:"underline",children:[s.jsx(He,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(He,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(He,{value:"history",variant:"underline",children:"History"})]}),e[1]=n):n=e[1];let o;e[2]!==r?(o=r&&s.jsx(Tl,{connectionId:r}),e[2]=r,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(gl,{}),e[4]=d):d=e[4];let u;e[5]!==o?(u=s.jsxs(qe,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[o,d]}),e[5]=o,e[6]=u):u=e[6];let c;e[7]!==a?(c=a==="breakdown"&&s.jsx(Cl,{}),e[7]=a,e[8]=c):c=e[8];let m;e[9]!==c?(m=s.jsx(qe,{value:"breakdown",className:"pt-2",children:c}),e[9]=c,e[10]=m):m=e[10];let f;e[11]!==a?(f=a==="history"&&s.jsx(Dl,{}),e[11]=a,e[12]=f):f=e[12];let h;e[13]!==f?(h=s.jsx(qe,{value:"history",className:"pt-2",children:f}),e[13]=f,e[14]=h):h=e[14];let x;return e[15]!==a||e[16]!==u||e[17]!==m||e[18]!==h?(x=s.jsxs(s.Fragment,{children:[i,s.jsxs(za,{value:a,onValueChange:l,variant:"underline",children:[n,u,m,h]})]}),e[15]=a,e[16]=u,e[17]=m,e[18]=h,e[19]=x):x=e[19],x}function Ml(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ie,{className:"h-5 w-32"}),s.jsx(ie,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ie,{className:"h-28 rounded-xl"}),s.jsx(ie,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Bl(){const t=O.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class Gl extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx(Bl,{}):this.props.children}}function Wl(){const t=O.c(4),e=Ba();let r;t[0]!==e?(r=e.find(Fl),t[0]=e,t[1]=r):r=t[1];const l=r?.id??null;let i;return t[2]!==l?(i=s.jsx($l,{gatewayConnectionId:l}),t[2]=l,t[3]=i):i=t[3],i}function Fl(t){return Wa(t,Fa)}function Rl(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx(Gl,{children:s.jsx(v.Suspense,{fallback:s.jsx(Ml,{}),children:s.jsx(Wl,{})})})}),t[0]=e):e=t[0],e}function Ul(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ha,{}),t[0]=e):e=t[0],e}function ms(){const t=O.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ie,{className:"h-6 w-48"}),r=s.jsx(ie,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ie,{className:"h-12 w-full"}),s.jsx(ie,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Kl(t){const e=O.c(14),{projectSlug:r,children:a}=t,{org:l}=ue(),{data:i,isLoading:n}=Et(l.id,r);if(n||!i){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ms,{}),e[0]=m):m=e[0],m}const o=r===Ie;let d;e[1]!==i.description||e[2]!==i.enabledPlugins||e[3]!==i.id||e[4]!==i.name||e[5]!==i.organizationId||e[6]!==i.slug||e[7]!==i.ui||e[8]!==o?(d={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:o},e[1]=i.description,e[2]=i.enabledPlugins,e[3]=i.id,e[4]=i.name,e[5]=i.organizationId,e[6]=i.slug,e[7]=i.ui,e[8]=o,e[9]=d):d=e[9];const u=d;let c;return e[10]!==a||e[11]!==u||e[12]!==l?(c=s.jsx(It,{org:l,project:u,children:a}),e[10]=a,e[11]=u,e[12]=l,e[13]=c):c=e[13],c}function Vl(t){const e=O.c(8),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Xa,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"org.general":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ar,{}),e[2]=a):a=e[2],a}case"org.plugins":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Kl,{projectSlug:Ie,children:s.jsx(Rs,{})}),e[3]=a):a=e[3],a}case"org.ai-providers":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ss,{}),e[4]=a):a=e[4],a}case"org.billing":{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Rl,{}),e[5]=a):a=e[5],a}case"org.members":{let a;return e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ul,{}),e[6]=a):a=e[6],a}default:{let a;return e[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[7]=a):a=e[7],a}}}function Yl(){const t=O.c(24),{isOpen:e,activeSection:r,open:a,close:l}=Ns();let i;t[0]!==l?(i=y=>!y&&l(),t[0]=l,t[1]=i):i=t[1];let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ot,{className:"sr-only",children:"Settings"}),t[2]=n):n=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[3]=o):o=t[3];let d;t[4]!==r||t[5]!==a?(d=s.jsx(v.Suspense,{fallback:o,children:s.jsx(qa,{activeSection:r,onNavigate:a})}),t[4]=r,t[5]=a,t[6]=d):d=t[6];let u,c;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ys,{size:16}),c=s.jsx("span",{className:"sr-only",children:"Close"}),t[7]=u,t[8]=c):(u=t[7],c=t[8]);let m;t[9]!==l?(m=s.jsxs("button",{type:"button",onClick:l,className:"absolute top-4 right-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[u,c]}),t[9]=l,t[10]=m):m=t[10];let f;t[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ms,{}),t[11]=f):f=t[11];let h;t[12]!==r?(h=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:f,children:s.jsx(Vl,{section:r})})}),t[12]=r,t[13]=h):h=t[13];let x;t[14]!==m||t[15]!==h?(x=s.jsxs("div",{className:"flex-1 min-w-0 overflow-y-auto relative flex flex-col overflow-hidden",children:[m,h]}),t[14]=m,t[15]=h,t[16]=x):x=t[16];let p;t[17]!==d||t[18]!==x?(p=s.jsxs(Dt,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:[n,s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[d,x]})]}),t[17]=d,t[18]=x,t[19]=p):p=t[19];let g;return t[20]!==e||t[21]!==i||t[22]!==p?(g=s.jsx(Lt,{open:e,onOpenChange:i,children:p}),t[20]=e,t[21]=i,t[22]=p,t[23]=g):g=t[23],g}function Hl(t){const e=O.c(12),{projectSlug:r,orgSlug:a,error:l}=t,i=at();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=n):n=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==l.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:l.message}),e[3]=l.message,e[4]=d):d=e[4];let u;e[5]!==i||e[6]!==a?(u=s.jsx(de,{variant:"link",onClick:()=>i({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[5]=i,e[6]=a,e[7]=u):u=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==u?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[n,o,d,u]}),e[8]=o,e[9]=d,e[10]=u,e[11]=c):c=e[11],c}function ql(t){const e=O.c(9),{projectSlug:r,orgSlug:a}=t,l=at();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=i):i=e[0];let n;e[1]!==r?(n=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=n):n=e[2];let o;e[3]!==l||e[4]!==a?(o=s.jsx(de,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[3]=l,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==n||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,n,o]}),e[6]=n,e[7]=o,e[8]=d):d=e[8],d}function Xl(){const t=O.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=xs(e),{org:a}=ue(),l=r.org,i=r.project,{data:n,isLoading:o,error:d}=Et(a.id,i);if(o){let p;return t[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ze,{}),t[1]=p):p=t[1],p}if(d){let p;return t[2]!==d||t[3]!==l||t[4]!==i?(p=s.jsx(Hl,{projectSlug:i,orgSlug:l,error:d}),t[2]=d,t[3]=l,t[4]=i,t[5]=p):p=t[5],p}if(!n){let p;return t[6]!==l||t[7]!==i?(p=s.jsx(ql,{projectSlug:i,orgSlug:l}),t[6]=l,t[7]=i,t[8]=p):p=t[8],p}const u=n.slug===Ie;let c;t[9]!==n.description||t[10]!==n.enabledPlugins||t[11]!==n.id||t[12]!==n.name||t[13]!==n.organizationId||t[14]!==n.slug||t[15]!==n.ui||t[16]!==u?(c={id:n.id,organizationId:n.organizationId,slug:n.slug,name:n.name,description:n.description,enabledPlugins:n.enabledPlugins,ui:n.ui,isOrgAdmin:u},t[9]=n.description,t[10]=n.enabledPlugins,t[11]=n.id,t[12]=n.name,t[13]=n.organizationId,t[14]=n.slug,t[15]=n.ui,t[16]=u,t[17]=c):c=t[17];const m=c;let f,h;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(Ze,{}),children:s.jsx(hs,{})}),h=s.jsx(Yl,{}),t[18]=f,t[19]=h):(f=t[18],h=t[19]);let x;return t[20]!==m||t[21]!==a?(x=s.jsxs(It,{org:a,project:m,children:[f,h]}),t[20]=m,t[21]=a,t[22]=x):x=t[22],x}function In(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(Ze,{}),children:s.jsx(Xl,{})}),t[0]=e):e=t[0],e}export{In as default};
|
|
1
|
+
import{r as v,c as O,f as st,j as s,y as me,w as Je,o as us,n as Ge,e as at,u as ue,x as kt,t as fs,q as ps,K as ut,B as de,c5 as Pt,O as Ie,P as It,S as Ze,g as xs,av as hs}from"./index-DJtnEPc7.js";import{u as Et}from"./use-project-CCY4E3rU.js";import{D as Ot,a as gs,b as vs,c as Dt,d as Lt}from"./dialog-1RTimACw.js";import{i as ys}from"./X-CuPyb-Ex.js";import{S as ie}from"./skeleton-Cy7jej-7.js";import{i as bs,u as js,a as Ns,O as Ss}from"./org-ai-providers-CYV2m0oE.js";import{A as Tt}from"./avatar-CkCU2Fe6.js";import{t as ws,i as rt}from"./Coins01-D4l1LRdX.js";import{t as Cs}from"./Settings01-Dujhf9RE.js";import{t as As}from"./Users03-C-Jr0LW_.js";import{i as _s}from"./Zap-Ctmk6j5l.js";import{a as ks,b as Ps,c as Is,T as Es}from"./tooltip-Bms1Xn3i.js";import{i as Os}from"./Check-DsclgHfU.js";import{a as Ds}from"./Copy01-CFr3FQ5x.js";import{S as De}from"./switch-7_yekA3p.js";import{S as Ls,a as Ts,d as We,c as zs}from"./select-roICowiz.js";import{i as $s}from"./Code01-Cq3-F_YX.js";import{s as zt}from"./RefreshCcw01-CxVqRnRx.js";import{i as Ms}from"./Shield01-BqSRHTNN.js";import{u as Bs}from"./useMutation-D77LVetF.js";import{a as Gs,F as Fe,b as Re,c as Ue,d as Ke,f as Ve,e as Ws}from"./form-RbK75Dit.js";import{I as Pe}from"./input-j_5WJy1c.js";import{L as Fs}from"./logo-upload-D_X-eua0.js";import{P as Rs}from"./project-plugins-BOxyaluG.js";import{ag as Us,ah as Ks,ai as Vs,M as ne,r as lt,D as $t,u as Me,t as fe,aj as ft,ak as pt,Z as Mt,al as Bt,am as Gt,H as it,c as Be,s as nt,an as Ys,ao as Hs,e as Wt,ap as ot,aq as ct,f as Ft,ar as qs,i as Rt,h as xt,g as Xs,as as Qs,p as Js,R as Zs,S as ea,j as ta,at as sa,k as Ut,l as aa,n as ra,q as la,au as ia,m as na,o as oa,v as ca,L as Le,G as da,w as ht,x as gt,z as ma,a6 as Kt,J as ua,A as Ne,y as fa,av as pa,B as xa,E as ha,F as ga,aw as Ye,ax as Te,ay as J,a2 as Vt,az as va,aA as ya,aB as ba,aa as ja,aC as Na,aD as Sa,ab as wa,aE as Ca,aF as Aa,aG as _a,af as ka,I as Pa,K as Ia,C as Ea,a as Oa,b as Da}from"./chart-DtzgRcs7.js";import{L as _e}from"./label-Dmque-mN.js";import{B as La}from"./badge-7TJrkuyd.js";import{a as Ta,T as He,b as qe,c as za}from"./tabs-T6eq77EC.js";import{i as $a}from"./AlertCircle-BCDqbXXS.js";import{s as Yt}from"./Plus-CGe5wBcS.js";import{u as Ae,a as dt,K as Ma}from"./constants-4hZfe-FX.js";import{b as Ba}from"./use-connection-2T7CNTjX.js";import{b as oe,a as Ht}from"./use-mcp-tools-CoXbW9dQ.js";import{u as Ga}from"./use-members-CKrsZLkR.js";import{c as Wa,A as Fa}from"./use-binding-CidrckI6.js";import{a as qt,d as ke,g as Ra,A as vt,D as Ua,b as Ka,C as Va,X as Ya}from"./XAxis-BmVXiq6v.js";import Ha from"./members-BUIvlCPj.js";import"./useQuery-DLey6Pvf.js";import"./index-qxqsMecG.js";import"./EyeOff-CpKFKNjY.js";import"./Eye-Dq2YmoWs.js";import"./Key01-yVAqC10q.js";import"./Trash01-DPMbpRnj.js";import"./card-D9sP6AvS.js";import"./popover-B_9jK9T6.js";import"./ai-providers-logos-D3xG95Si.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./index-biN0aic_.js";import"./ChevronUp-C8129itH.js";import"./ChevronDown-CIjXFJfV.js";import"./Upload01-DgCnYplh.js";import"./Container-C_pBhYQm.js";import"./use-install-from-registry-BGTf0OMo.js";import"./extract-connection-data-6RfUcjze.js";import"./constants-CXKG1Tp4.js";import"./registry-utils-9Z7xkXEW.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-CSUxQOK0.js";import"./index-B5Wny992.js";import"./use-collections-uyyRdHl8.js";import"./binder-qGS3hkzV.js";import"./collection-display-button-CPJ0Uvih.js";import"./dropdown-menu-ur1Ui41o.js";import"./ChevronRight-DmvbXNWu.js";import"./ArrowDown-qfJtx-dv.js";import"./ArrowUp-ETVB6cdy.js";import"./Grid01-BSBJv9eJ.js";import"./List-LffcVOLG.js";import"./collection-search-BeqmTWUU.js";import"./SearchMd-CrngVZhh.js";import"./breadcrumb-7YipRD-p.js";import"./collection-table-wrapper-DU2xJaVV.js";import"./table-Cd-wCYBh.js";import"./integration-icon-DrTDJ354.js";import"./checkbox-BRXa8FNh.js";import"./ArrowLeft-Del7wDOT.js";import"./alert-dialog-BoQV9ycw.js";import"./DotsHorizontal-7V70FVQq.js";import"./Lock01-CjY0LR2m.js";import"./empty-state-COoAU6KF.js";import"./textarea-BJkI1dfy.js";import"./DotsVertical-ZHHEIIAw.js";import"./XClose-ndXrBTVc.js";import"./command-DVQ8NWzo.js";import"./index-3d9-dYhc.js";const Xt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));Xt.displayName="Bell01";function qa(t){const e=O.c(27),{activeSection:r,onNavigate:a}=t,{data:l}=st.useSession(),i=l?.user,n=i?.image,o=i?.name??"Profile",d=i?.name??"U";let u;e[0]!==d||e[1]!==n?(u=s.jsx(Tt,{url:n,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=n,e[2]=u):u=e[2];let c;e[3]!==o||e[4]!==u?(c={key:"account.profile",label:o,icon:u},e[3]=o,e[4]=u,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={key:"account.preferences",label:"Preferences",icon:s.jsx(Cs,{size:14})},e[6]=m):m=e[6];let f;e[7]!==c?(f=[c,m],e[7]=c,e[8]=f):f=e[8];const h=f;let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x={key:"org.general",label:"General",icon:s.jsx(ws,{size:14})},e[9]=x):x=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.plugins",label:"Features",icon:s.jsx(_s,{size:14})},e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g={key:"org.ai-providers",label:"AI Providers",icon:s.jsx(bs,{size:14})},e[11]=g):g=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y={key:"org.members",label:"Members",icon:s.jsx(As,{size:14})},e[12]=y):y=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=[x,p,g,y,{key:"org.billing",label:"Billing",icon:s.jsx(rt,{size:14})}],e[13]=N):N=e[13];const S=N;let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[14]=b):b=e[14];let j;e[15]!==h||e[16]!==r||e[17]!==a?(j=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[b,h.map(k=>s.jsxs("button",{type:"button",onClick:()=>a(k.key),className:me("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===k.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:k.icon}),s.jsx("span",{className:"truncate",children:k.label})]},k.key))]}),e[15]=h,e[16]=r,e[17]=a,e[18]=j):j=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[19]=w):w=e[19];let C;e[20]!==r||e[21]!==a?(C=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[w,S.map(k=>s.jsxs("button",{type:"button",onClick:()=>a(k.key),className:me("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===k.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:k.icon}),s.jsx("span",{className:"truncate",children:k.label})]},k.key))]}),e[20]=r,e[21]=a,e[22]=C):C=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.175.4"]})}),e[23]=_):_=e[23];let A;return e[24]!==j||e[25]!==C?(A=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[j,C,_]}),e[24]=j,e[25]=C,e[26]=A):A=e[26],A}function Xa(){const t=O.c(32),{data:e}=st.useSession(),[r,a]=v.useState(!1),l=e?.user,i=l?.image;let n;t[0]!==l?(n=()=>{l?.id&&navigator.clipboard.writeText(l.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=l,t[1]=n):n=t[1];const o=n;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const u=l?.name??"U";let c;t[3]!==u||t[4]!==i?(c=s.jsx(Tt,{url:i,fallback:u,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=u,t[4]=i,t[5]=c):c=t[5];const m=l?.name??"User";let f;t[6]!==m?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:m}),t[6]=m,t[7]=f):f=t[7];const h=l?.email;let x;t[8]!==h?(x=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),t[8]=h,t[9]=x):x=t[9];let p;t[10]!==f||t[11]!==x?(p=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,x]}),t[10]=f,t[11]=x,t[12]=p):p=t[12];let g;t[13]!==c||t[14]!==p?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,p]}),t[13]=c,t[14]=p,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let N;t[17]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=N):N=t[17];const S=l?.id;let b;t[18]!==S?(b=s.jsx("span",{className:"font-mono text-sm",children:S}),t[18]=S,t[19]=b):b=t[19];let j;t[20]!==r?(j=r?s.jsx(Os,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Ds,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=j):j=t[21];let w;t[22]!==o||t[23]!==b||t[24]!==j?(w=s.jsx(ks,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,j]})}),t[22]=o,t[23]=b,t[24]=j,t[25]=w):w=t[25];let C;t[26]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ps,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=C):C=t[26];let _;t[27]!==w?(_=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[N,s.jsx(Is,{children:s.jsxs(Es,{children:[w,C]})})]})]}),t[27]=w,t[28]=_):_=t[28];let A;return t[29]!==_||t[30]!==g?(A=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,_]}),t[29]=_,t[30]=g,t[31]=A):A=t[31],A}function Oe(t){const e=O.c(27),{icon:r,label:a,description:l,control:i,onClick:n,disabled:o}=t,d=o?void 0:n,u=n?"button":void 0,c=n&&!o?0:void 0;let m;e[0]!==o||e[1]!==n?(m=n&&!o?j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),n())}:void 0,e[0]=o,e[1]=n,e[2]=m):m=e[2];const f=n&&!o?"pointer":void 0;let h;e[3]!==f?(h={cursor:f},e[3]=f,e[4]=h):h=e[4];let x;e[5]!==r?(x=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=x):x=e[6];let p;e[7]!==a?(p=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=p):p=e[8];let g;e[9]!==l?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[9]=l,e[10]=g):g=e[10];let y;e[11]!==p||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[p,g]}),e[11]=p,e[12]=g,e[13]=y):y=e[13];let N;e[14]!==y||e[15]!==x?(N=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[x,y]}),e[14]=y,e[15]=x,e[16]=N):N=e[16];let S;e[17]!==i?(S=s.jsx("div",{onClick:Qa,className:"shrink-0",children:i}),e[17]=i,e[18]=S):S=e[18];let b;return e[19]!==d||e[20]!==N||e[21]!==S||e[22]!==u||e[23]!==c||e[24]!==m||e[25]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:u,tabIndex:c,onKeyDown:m,style:h,children:[N,S]}),e[19]=d,e[20]=N,e[21]=S,e[22]=u,e[23]=c,e[24]=m,e[25]=h,e[26]=b):b=e[26],b}function Qa(t){return t.stopPropagation()}function yt(){const t=O.c(47),[e,r]=js();let a;t[0]!==r?(a=async P=>{if(P&&await Notification.requestPermission()!=="granted"){Je.error("Notifications denied. Please enable them in your browser settings."),r(er);return}r(E=>({...E,enableNotifications:P}))},t[0]=r,t[1]=a):a=t[1];const l=a;let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=i):i=t[2];let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx($s,{size:16}),t[3]=n):n=t[3];let o;t[4]!==r?(o=()=>r(Za),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=P=>r(E=>({...E,devMode:P})),t[6]=r,t[7]=d):d=t[7];let u;t[8]!==e.devMode||t[9]!==d?(u=s.jsx(De,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=u):u=t[10];let c;t[11]!==o||t[12]!==u?(c=s.jsx(Oe,{icon:n,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:u}),t[11]=o,t[12]=u,t[13]=c):c=t[13];let m;t[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Xt,{size:16}),t[14]=m):m=t[14];let f;t[15]!==l||t[16]!==e.enableNotifications?(f=s.jsx(Oe,{icon:m,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>l(!e.enableNotifications),control:s.jsx(De,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:l})}),t[15]=l,t[16]=e.enableNotifications,t[17]=f):f=t[17];let h;t[18]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(zt,{size:16}),t[18]=h):h=t[18];let x;t[19]!==r?(x=()=>r(Ja),t[19]=r,t[20]=x):x=t[20];let p;t[21]!==r?(p=P=>r(E=>({...E,experimentalAutomations:P})),t[21]=r,t[22]=p):p=t[22];let g;t[23]!==e.experimentalAutomations||t[24]!==p?(g=s.jsx(De,{checked:e.experimentalAutomations,onCheckedChange:p}),t[23]=e.experimentalAutomations,t[24]=p,t[25]=g):g=t[25];let y;t[26]!==x||t[27]!==g?(y=s.jsx(Oe,{icon:h,label:"Experimental: Automations",description:"Enable the Automations feature in the sidebar. This is an experimental feature under active development.",onClick:x,control:g}),t[26]=x,t[27]=g,t[28]=y):y=t[28];let N;t[29]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Ms,{size:16}),t[29]=N):N=t[29];let S;t[30]!==r?(S=P=>r(E=>({...E,toolApprovalLevel:P})),t[30]=r,t[31]=S):S=t[31];let b;t[32]===Symbol.for("react.memo_cache_sentinel")?(b={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[32]=b):b=t[32];const j=b[e.toolApprovalLevel];let w;t[33]!==j?(w=s.jsx(Ts,{className:"w-36",children:s.jsx("span",{children:j})}),t[33]=j,t[34]=w):w=t[34];let C;t[35]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(We,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[35]=C):C=t[35];let _;t[36]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(We,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[36]=_):_=t[36];let A;t[37]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsxs(zs,{children:[C,_,s.jsx(We,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[37]=A):A=t[37];let k;t[38]!==e.toolApprovalLevel||t[39]!==S||t[40]!==w?(k=s.jsx(Oe,{icon:N,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Ls,{value:e.toolApprovalLevel,onValueChange:S,children:[w,A]})}),t[38]=e.toolApprovalLevel,t[39]=S,t[40]=w,t[41]=k):k=t[41];let D;return t[42]!==y||t[43]!==k||t[44]!==c||t[45]!==f?(D=s.jsxs("div",{className:"flex flex-col gap-6",children:[i,s.jsxs("div",{className:"flex flex-col",children:[c,f,y,k]})]}),t[42]=y,t[43]=k,t[44]=c,t[45]=f,t[46]=D):D=t[46],D}function Ja(t){return{...t,experimentalAutomations:!t.experimentalAutomations}}function Za(t){return{...t,devMode:!t.devMode}}function er(t){return{...t,enableNotifications:!1}}const tr=us({name:Ge().min(1,"Name is required").max(255,"Name is too long"),slug:Ge().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Ge().optional()});function sr(){const t=at(),{org:e,project:r}=ue(),a=kt(),[l,i]=v.useState(!1),n=fs({resolver:ps(tr),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Bs({mutationFn:async c=>{const m={name:c.name,slug:c.slug};c.logo&&(m.logo=c.logo);const f=await st.organization.update({organizationId:e.id,data:m});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:ut.organizations()}),a.invalidateQueries({queryKey:ut.activeOrganization(e.slug)}),Je.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Je.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{i(!1)}}),d=c=>{i(!0),o.mutate(c)},u=n.formState.isDirty;return s.jsx(Gs,{...n,children:s.jsxs("form",{onSubmit:n.handleSubmit(d),className:"space-y-6",children:[s.jsx(Fe,{control:n.control,name:"name",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Organization Name"}),s.jsx(Ke,{children:s.jsx(Pe,{placeholder:"My Organization",...c,disabled:l})}),s.jsx(Ve,{})]})}),s.jsx(Fe,{control:n.control,name:"slug",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Organization Slug"}),s.jsx(Ke,{children:s.jsx(Pe,{placeholder:"my-organization",...c,disabled:l,onChange:m=>{const f=m.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx(Ws,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(Ve,{})]})}),s.jsx(Fe,{control:n.control,name:"logo",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Logo"}),s.jsx(Ke,{children:s.jsx(Fs,{value:c.value,onChange:c.onChange,name:n.watch("name"),disabled:l})}),s.jsx(Ve,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(de,{type:"submit",disabled:!u||l,className:"min-w-24",children:l?"Saving...":"Save Changes"}),u&&s.jsx(de,{type:"button",variant:"outline",onClick:()=>n.reset(),disabled:l,children:"Cancel"})]})]})})}function ar(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(sr,{})]}),t[0]=e):e=t[0],e}var bt=function(e,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),i=2;i<a;i++)l[i-2]=arguments[i];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var n=0;console.warn(r.replace(/%s/g,()=>l[n++]))}},rr=["x1","y1","x2","y2","key"],lr=["offset"],ir=["xAxisId","yAxisId"],nr=["xAxisId","yAxisId"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(a){or(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function or(t,e,r){return(e=cr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cr(t){var e=dr(t,"string");return typeof e=="symbol"?e:e+""}function dr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function ze(t,e){if(t==null)return{};var r,a,l=mr(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function mr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var ur=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:l,width:i,height:n,ry:o}=t;return v.createElement("rect",{x:a,y:l,ry:o,width:i,height:n,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Qt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var l,{x1:i,y1:n,x2:o,y2:d,key:u}=r,c=ze(r,rr),m=(l=it(c))!==null&&l!==void 0?l:{},{offset:f}=m,h=ze(m,lr);a=v.createElement("line",pe({},h,{x1:i,y1:n,x2:o,y2:d,fill:"none",key:u}))}return a}function fr(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:i,yAxisId:n}=t,o=ze(t,ir),d=l.map((u,c)=>{var m=Z(Z({},o),{},{x1:e,y1:u,x2:e+r,y2:u,key:"line-".concat(c),index:c});return v.createElement(Qt,{key:"line-".concat(c),option:a,lineItemProps:m})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function pr(t){var{y:e,height:r,vertical:a=!0,verticalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:i,yAxisId:n}=t,o=ze(t,nr),d=l.map((u,c)=>{var m=Z(Z({},o),{},{x1:u,y1:e,x2:u,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Qt,{option:a,lineItemProps:m,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function xr(t){var{horizontalFill:e,fillOpacity:r,x:a,y:l,width:i,height:n,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var u=o.map(m=>Math.round(m+l-l)).sort((m,f)=>m-f);l!==u[0]&&u.unshift(0);var c=u.map((m,f)=>{var h=u[f+1],x=h==null,p=x?l+n-m:h-m;if(p<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:m,x:a,height:p,width:i,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function hr(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:l,y:i,width:n,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var u=d.map(m=>Math.round(m+l-l)).sort((m,f)=>m-f);l!==u[0]&&u.unshift(0);var c=u.map((m,f)=>{var h=u[f+1],x=h==null,p=x?l+n-m:h-m;if(p<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:m,y:i,width:p,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var gr=(t,e)=>{var{xAxis:r,width:a,height:l,offset:i}=t;return Bt(qt(Z(Z(Z({},ke),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),i.left,i.left+i.width,e)},vr=(t,e)=>{var{yAxis:r,width:a,height:l,offset:i}=t;return Bt(qt(Z(Z(Z({},ke),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),i.top,i.top+i.height,e)},yr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:$t.grid};function Jt(t){var e=Us(),r=Ks(),a=Vs(),l=Z(Z({},lt(t,yr)),{},{x:ne(t.x)?t.x:a.left,y:ne(t.y)?t.y:a.top,width:ne(t.width)?t.width:a.width,height:ne(t.height)?t.height:a.height}),{xAxisId:i,yAxisId:n,x:o,y:d,width:u,height:c,syncWithTicks:m,horizontalValues:f,verticalValues:h}=l,x=Me(),p=fe(A=>ft(A,"xAxis",i,x)),g=fe(A=>ft(A,"yAxis",n,x));if(!pt(u)||!pt(c)||!ne(o)||!ne(d))return null;var y=l.verticalCoordinatesGenerator||gr,N=l.horizontalCoordinatesGenerator||vr,{horizontalPoints:S,verticalPoints:b}=l;if((!S||!S.length)&&typeof N=="function"){var j=f&&f.length,w=N({yAxis:g?Z(Z({},g),{},{ticks:j?f:g.ticks}):void 0,width:e??u,height:r??c,offset:a},j?!0:m);bt(Array.isArray(w),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof w,"]")),Array.isArray(w)&&(S=w)}if((!b||!b.length)&&typeof y=="function"){var C=h&&h.length,_=y({xAxis:p?Z(Z({},p),{},{ticks:C?h:p.ticks}):void 0,width:e??u,height:r??c,offset:a},C?!0:m);bt(Array.isArray(_),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof _,"]")),Array.isArray(_)&&(b=_)}return v.createElement(Mt,{zIndex:l.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(ur,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),v.createElement(xr,pe({},l,{horizontalPoints:S})),v.createElement(hr,pe({},l,{verticalPoints:b})),v.createElement(fr,pe({},l,{offset:a,horizontalPoints:S,xAxis:p,yAxis:g})),v.createElement(pr,pe({},l,{offset:a,verticalPoints:b,xAxis:p,yAxis:g}))))}Jt.displayName="CartesianGrid";var Zt=(t,e,r)=>Wt(t,"xAxis",ot(t,e),r),es=(t,e,r)=>Ft(t,"xAxis",ot(t,e),r),ts=(t,e,r)=>Wt(t,"yAxis",ct(t,e),r),ss=(t,e,r)=>Ft(t,"yAxis",ct(t,e),r),br=Be([nt,Zt,ts,es,ss],(t,e,r,a,l)=>Rt(t,"xAxis")?xt(e,a,!1):xt(r,l,!1)),jr=(t,e)=>e,as=Be([Xs,jr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),rs=t=>{var e=nt(t),r=Rt(e,"xAxis");return r?"yAxis":"xAxis"},Nr=(t,e)=>{var r=rs(t);return r==="yAxis"?ct(t,e):ot(t,e)},Sr=(t,e,r)=>Qs(t,rs(t),Nr(t,e),r),wr=Be([as,Sr],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,l=qs(t);if(!(a==null||l==null)){var i=(r=e[a])===null||r===void 0?void 0:r.stackedData,n=i?.find(o=>o.key===l);if(n!=null)return n.map(o=>[o[0],o[1]])}}}),Cr=Be([nt,Zt,ts,es,ss,wr,Ys,br,as,Hs],(t,e,r,a,l,i,n,o,d,u)=>{var{chartData:c,dataStartIndex:m,dataEndIndex:f}=n;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||l==null||a.length===0||l.length===0||o==null)){var{data:h}=d,x;if(h&&h.length>0?x=h:x=c?.slice(m,f+1),x!=null)return Kr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:l,dataStartIndex:m,areaSettings:d,stackedData:i,displayedData:x,chartBaseValue:u,bandSize:o})}}),Ar=["id"],_r=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function ls(t,e){if(t==null)return{};var r,a,l=kr(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function kr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){Pr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Pr(t,e,r){return(e=Ir(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ir(t){var e=Er(t,"string");return typeof e=="symbol"?e:e+""}function Er(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $e(t,e){return t&&t!=="none"?t:e}var Or=t=>{var{dataKey:e,name:r,stroke:a,fill:l,legendType:i,hide:n}=t;return[{inactive:n,dataKey:e,type:i,color:$e(a,l),value:Ut(r,e),payload:t}]},Dr=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:l,fill:i,name:n,hide:o,unit:d,tooltipType:u,id:c}=t,m={dataDefinedOnItem:r,getPosition:ra,settings:{stroke:a,strokeWidth:l,fill:i,dataKey:e,nameKey:void 0,name:Ut(n,e),hide:o,type:u,color:$e(a,i),unit:d,graphicalItemId:c}};return v.createElement(aa,{tooltipEntrySettings:m})});function Lr(t){var{clipPathId:e,points:r,props:a}=t,{needClip:l,dot:i,dataKey:n}=a,o=it(a);return v.createElement(Ua,{points:r,dot:i,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:n,baseProps:o,needClip:l,clipPathId:e})}function Tr(t){var{showLabels:e,children:r,points:a}=t,l=a.map(i=>{var n,o,d={x:(n=i.x)!==null&&n!==void 0?n:0,y:(o=i.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:i.value,payload:i.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(ha,{value:e?l:void 0},r)}function St(t){var{points:e,baseLine:r,needClip:a,clipPathId:l,props:i}=t,{layout:n,type:o,stroke:d,connectNulls:u,isRange:c}=i,{id:m}=i,f=ls(i,Ar),h=it(f),x=ga(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(Le,{clipPath:a?"url(#clipPath-".concat(l,")"):void 0},v.createElement(Ye,xe({},x,{id:m,points:e,connectNulls:u,type:o,baseLine:r,layout:n,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Ye,xe({},h,{className:"recharts-area-curve",layout:n,type:o,connectNulls:u,fill:"none",points:e})),d!=="none"&&c&&Array.isArray(r)&&v.createElement(Ye,xe({},h,{className:"recharts-area-curve",layout:n,type:o,connectNulls:u,fill:"none",points:r}))),v.createElement(Lr,{points:e,props:f,clipPathId:l}))}function zr(t){var e,r,{alpha:a,baseLine:l,points:i,strokeWidth:n}=t,o=(e=i[0])===null||e===void 0?void 0:e.y,d=(r=i[i.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(d))return null;var u=a*Math.abs(o-d),c=Math.max(...i.map(m=>m.x||0));return ne(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(m=>m.x||0),c)),ne(c)?v.createElement("rect",{x:0,y:o<d?o:o-u,width:c+(n?parseInt("".concat(n),10):1),height:Math.floor(u)}):null}function $r(t){var e,r,{alpha:a,baseLine:l,points:i,strokeWidth:n}=t,o=(e=i[0])===null||e===void 0?void 0:e.x,d=(r=i[i.length-1])===null||r===void 0?void 0:r.x;if(!Te(o)||!Te(d))return null;var u=a*Math.abs(o-d),c=Math.max(...i.map(m=>m.y||0));return ne(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(m=>m.y||0),c)),ne(c)?v.createElement("rect",{x:o<d?o:o-u,y:0,width:u,height:Math.floor(c+(n?parseInt("".concat(n),10):1))}):null}function Mr(t){var{alpha:e,layout:r,points:a,baseLine:l,strokeWidth:i}=t;return r==="vertical"?v.createElement(zr,{alpha:e,points:a,baseLine:l,strokeWidth:i}):v.createElement($r,{alpha:e,points:a,baseLine:l,strokeWidth:i})}function Br(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:i}=t,{points:n,baseLine:o,isAnimationActive:d,animationBegin:u,animationDuration:c,animationEasing:m,onAnimationStart:f,onAnimationEnd:h}=a,x=v.useMemo(()=>({points:n,baseLine:o}),[n,o]),p=ma(x,"recharts-area-"),g=Kt(),[y,N]=v.useState(!1),S=!y,b=v.useCallback(()=>{typeof h=="function"&&h(),N(!1)},[h]),j=v.useCallback(()=>{typeof f=="function"&&f(),N(!0)},[f]);if(g==null)return null;var w=l.current,C=i.current;return v.createElement(Tr,{showLabels:S,points:n},a.children,v.createElement(ua,{animationId:p,begin:u,duration:c,isActive:d,easing:m,onAnimationEnd:b,onAnimationStart:j,key:p},_=>{if(w){var A=w.length/n.length,k=_===1?n:n.map((P,E)=>{var T=Math.floor(E*A);if(w[T]){var L=w[T];return Se(Se({},P),{},{x:Ne(L.x,P.x,_),y:Ne(L.y,P.y,_)})}return P}),D;return ne(o)?D=Ne(C,o,_):fa(o)||pa(o)?D=Ne(C,0,_):D=o.map((P,E)=>{var T=Math.floor(E*A);if(Array.isArray(C)&&C[T]){var L=C[T];return Se(Se({},P),{},{x:Ne(L.x,P.x,_),y:Ne(L.y,P.y,_)})}return P}),_>0&&(l.current=k,i.current=D),v.createElement(St,{points:k,baseLine:D,needClip:e,clipPathId:r,props:a})}return _>0&&(l.current=n,i.current=o),v.createElement(Le,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(Mr,{alpha:_,points:n,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(Le,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(St,{points:n,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(xa,{label:a.label}))}function Gr(t){var{needClip:e,clipPathId:r,props:a}=t,l=v.useRef(null),i=v.useRef();return v.createElement(Br,{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:i})}class Wr extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:l,top:i,left:n,needClip:o,xAxisId:d,yAxisId:u,width:c,height:m,id:f,baseLine:h,zIndex:x}=this.props;if(e)return null;var p=Pt("recharts-area",l),g=f,{r:y,strokeWidth:N}=Ra(r),S=ca(r),b=y*2+N,j=o?"url(#clipPath-".concat(S?"":"dots-").concat(g,")"):void 0;return v.createElement(Mt,{zIndex:x},v.createElement(Le,{className:p},o&&v.createElement("defs",null,v.createElement(da,{clipPathId:g,xAxisId:d,yAxisId:u}),!S&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:n-b/2,y:i-b/2,width:c+b,height:m+b}))),v.createElement(Gr,{needClip:o,clipPathId:g,props:this.props})),v.createElement(vt,{points:a,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:j}),this.props.isRange&&Array.isArray(h)&&v.createElement(vt,{points:h,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:j}))}}var Fr={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:$t.area};function Rr(t){var e,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:i,connectNulls:n,dot:o,fill:d,fillOpacity:u,hide:c,isAnimationActive:m,legendType:f,stroke:h,xAxisId:x,yAxisId:p}=t,g=ls(t,_r),y=la(),N=ia(),{needClip:S}=na(x,p),b=Me(),{points:j,isRange:w,baseLine:C}=(e=fe(E=>Cr(E,t.id,b)))!==null&&e!==void 0?e:{},_=oa();if(y!=="horizontal"&&y!=="vertical"||_==null||N!=="AreaChart"&&N!=="ComposedChart")return null;var{height:A,width:k,x:D,y:P}=_;return!j||!j.length?null:v.createElement(Wr,xe({},g,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:i,baseLine:C,connectNulls:n,dot:o,fill:d,fillOpacity:u,height:A,hide:c,layout:y,isAnimationActive:m,isRange:w,legendType:f,needClip:S,points:j,stroke:h,width:k,left:D,top:P,xAxisId:x,yAxisId:p}))}var Ur=(t,e,r,a,l)=>{var i=r??e;if(ne(i))return i;var n=t==="horizontal"?l:a,o=n.scale.domain();if(n.type==="number"){var d=Math.max(o[0],o[1]),u=Math.min(o[0],o[1]);return i==="dataMin"?u:i==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return i==="dataMin"?o[0]:i==="dataMax"?o[1]:o[0]};function Kr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:l,layout:i,chartBaseValue:n,xAxis:o,yAxis:d,displayedData:u,dataStartIndex:c,xAxisTicks:m,yAxisTicks:f,bandSize:h}=t,x=l&&l.length,p=Ur(i,n,r,o,d),g=i==="horizontal",y=!1,N=u.map((b,j)=>{var w,C,_,A;if(x)A=l[c+j];else{var k=ht(b,a);Array.isArray(k)?(A=k,y=!0):A=[p,k]}var D=(w=(C=A)===null||C===void 0?void 0:C[1])!==null&&w!==void 0?w:null,P=D==null||x&&!e&&ht(b,a)==null;if(g){var E;return{x:gt({axis:o,ticks:m,bandSize:h,entry:b,index:j}),y:P?null:(E=d.scale.map(D))!==null&&E!==void 0?E:null,value:A,payload:b}}return{x:P?null:(_=o.scale.map(D))!==null&&_!==void 0?_:null,y:gt({axis:d,ticks:f,bandSize:h,entry:b,index:j}),value:A,payload:b}}),S;return x||y?S=N.map(b=>{var j,w=Array.isArray(b.value)?b.value[0]:null;if(g){var C;return{x:b.x,y:w!=null&&b.y!=null&&(C=d.scale.map(w))!==null&&C!==void 0?C:null,payload:b.payload}}return{x:w!=null&&(j=o.scale.map(w))!==null&&j!==void 0?j:null,y:b.y,payload:b.payload}}):S=g?d.scale.map(p):o.scale.map(p),{points:N,baseLine:S??0,isRange:y}}function Vr(t){var e=lt(t,Fr),r=Me();return v.createElement(Zs,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(ea,{legendPayload:Or(e)}),v.createElement(Dr,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(ta,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:sa(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Rr,xe({},e,{id:a}))))}var is=v.memo(Vr,Js);is.displayName="Area";var Yr=["type"],Hr=["dangerouslySetInnerHTML","ticks","scale"],qr=["id","scale"];function et(){return et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},et.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(a){Xr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Xr(t,e,r){return(e=Qr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qr(t){var e=Jr(t,"string");return typeof e=="symbol"?e:e+""}function Jr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tt(t,e){if(t==null)return{};var r,a,l=Zr(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Zr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function el(t){var e=Vt(),r=v.useRef(null),a=Kt(),{type:l}=t,i=tt(t,Yr),n=ka(a,"yAxis",l),o=v.useMemo(()=>{if(n!=null)return Ct(Ct({},i),{},{type:n})},[n,i]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(va(o)):r.current!==o&&e(ya({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ba(r.current)),r.current=null)},[e]),null}function tl(t){var{yAxisId:e,className:r,width:a,label:l}=t,i=v.useRef(null),n=v.useRef(null),o=fe(ja),d=Me(),u=Vt(),c="yAxis",m=fe(w=>Na(w,e)),f=fe(w=>Sa(w,e)),h=fe(w=>wa(w,c,e,d)),x=fe(w=>Ca(w,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!m||Aa(l)||v.isValidElement(l)||x==null)){var w=i.current;if(w){var C=w.getCalculatedWidth();Math.round(m.width)!==Math.round(C)&&u(_a({id:e,width:C}))}}},[h,m,u,l,e,a,x]),m==null||f==null||x==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:y}=t,N=tt(t,Hr),{id:S,scale:b}=x,j=tt(x,qr);return v.createElement(Va,et({},N,j,{ref:i,labelRef:n,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:m.width,height:m.height,className:Pt("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:h,axisType:c,axisId:e}))}var sl={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:ke.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:ke.tickLine,tickSize:ke.tickSize,type:J.type,niceTicks:J.niceTicks,width:J.width,yAxisId:0},al=t=>{var e=lt(t,sl);return v.createElement(v.Fragment,null,v.createElement(el,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter,niceTicks:e.niceTicks}),v.createElement(tl,e))},ns=v.memo(al,Ka);ns.displayName="YAxis";var rl=["axis"],ll=v.forwardRef((t,e)=>v.createElement(Pa,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:rl,tooltipPayloadSearcher:Ia,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function mt(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const l=new Date(r),i=t==="7d"?7:t==="30d"?30:90;return l.setDate(l.getDate()-i),{startDate:l.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function K(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const os="gateway-chip-period";function il(){try{const t=localStorage.getItem(os);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function nl(t){try{localStorage.setItem(os,t)}catch{}}const ol={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},cl={daily:"daily",weekly:"weekly",monthly:"monthly"},dl=[5,10,25,50,100],ml=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function ul(t){const e=O.c(51),{open:r,onOpenChange:a,connectionId:l,currentLimitUsd:i,billingMode:n,currentLimitPeriod:o}=t,{org:d}=ue(),[u,c]=v.useState(null),[m,f]=v.useState(""),[h,x]=v.useState(null),[p,g]=v.useState(null),[y,N]=v.useState(o??"none");let S;e[0]!==l||e[1]!==d.id?(S={connectionId:l,orgId:d.id},e[0]=l,e[1]=d.id,e[2]=S):S=e[2];const b=Ae(S);let j;e[3]!==b?(j={client:b},e[3]=b,e[4]=j):j=e[4];const{mutate:w,isPending:C}=Ht(j),_=kt(),A=n==="postpaid";let k;e[5]!==m?(k=m?Number.parseFloat(m):null,e[5]=m,e[6]=k):k=e[6];const P=u??k,E=y==="none"?null:y,T=A&&P!=null&&P===i&&E===o;let L;e[7]!==b?(L=Ma.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=L):L=e[8];const G=L;let V;e[9]!==G||e[10]!==_?(V=async()=>{await _.invalidateQueries({queryKey:G,exact:!0}),await _.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=_,e[11]=V):V=e[11];const R=V;let z,$;e[12]!==n||e[13]!==o||e[14]!==i||e[15]!==P||e[16]!==A||e[17]!==y||e[18]!==w||e[19]!==a||e[20]!==R?($=()=>{if(!P||P<=0)return;const B=A?P:i+P;g(null);const ae={limit_usd:B,billing_mode:n,return_url:window.location.href};A&&(ae.limit_period=y),w({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await R(),te?.checkout_url?x(te.checkout_url):z()},onError:re=>{g(re.message??"Failed to update limit.")}})},z=()=>{c(null),f(""),x(null),g(null),N(o??"none"),a(!1)},e[12]=n,e[13]=o,e[14]=i,e[15]=P,e[16]=A,e[17]=y,e[18]=w,e[19]=a,e[20]=R,e[21]=z,e[22]=$):(z=e[21],$=e[22]);const Y=A?"Configure Spending Limit":"Add Credit",H=A?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=A?"New limit":"Select amount",U=A?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(Ot,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(gs,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let W;e[27]!==q||e[28]!==ee?(W=s.jsxs(vs,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=W):W=e[29];let F;e[30]!==M||e[31]!==h||e[32]!==U||e[33]!==i||e[34]!==m||e[35]!==P||e[36]!==p||e[37]!==$||e[38]!==C||e[39]!==A||e[40]!==T||e[41]!==y||e[42]!==u?(F=h?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(de,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:h,children:[s.jsx(rt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:dl.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:me("rounded-md border px-3 py-2 text-sm font-medium transition-colors",u===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:A?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Pe,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:m,onChange:B=>{f(B.target.value),c(null)}})]})]}),A&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:ml.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>N(ae),className:me("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),p&&s.jsx("p",{className:"text-xs text-destructive",children:p}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:A?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:i>0?K(i):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:K(i)})]})}),s.jsx(de,{onClick:$,disabled:C||!P||P<=0||T,className:"gap-2",children:C?"Updating...":U})]})]}),e[30]=M,e[31]=h,e[32]=U,e[33]=i,e[34]=m,e[35]=P,e[36]=p,e[37]=$,e[38]=C,e[39]=A,e[40]=T,e[41]=y,e[42]=u,e[43]=F):F=e[43];let X;e[44]!==W||e[45]!==F?(X=s.jsxs(Dt,{className:"sm:max-w-md",children:[W,F]}),e[44]=W,e[45]=F,e[46]=X):X=e[46];let se;return e[47]!==z||e[48]!==r||e[49]!==X?(se=s.jsx(Lt,{open:r,onOpenChange:z,children:X}),e[47]=z,e[48]=r,e[49]=X,e[50]=se):se=e[50],se}function fl(t){const e=O.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:l,avgDailySpend:i}=r;if(a==null)return null;let n;e[0]!==l?(n=l?new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=l,e[1]=n):n=e[1];const o=n,d=a!==1?"s":"";let u;e[2]!==a||e[3]!==d?(u=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=u):u=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=m):m=e[7];let f;e[8]!==i?(f=K(i),e[8]=i,e[9]=f):f=e[9];let h;e[10]!==f?(h=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=h):h=e[11];let x;e[12]!==r.resetsBeforeDepletion?(x=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=x):x=e[13];const p=ol[r.confidence];let g;e[14]!==p?(g=s.jsx(La,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:p}),e[14]=p,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==u||e[18]!==c||e[19]!==h||e[20]!==x?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[u,c,m,h,x,g]}),e[16]=g,e[17]=u,e[18]=c,e[19]=h,e[20]=x,e[21]=y):y=e[21],y}function pl(t){const e=O.c(37),{usage:r,limit:a,limitPeriod:l,onConfigureLimit:i,connectionId:n,alert:o}=t,d=a.total!=null&&a.total>0;let u;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(u=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=u):u=e[3];const c=u;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=m):m=e[4];let f;e[5]!==r.total?(f=K(r.total),e[5]=r.total,e[6]=f):f=e[6];let h;e[7]!==f?(h=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=h):h=e[8];let x;e[9]!==d||e[10]!==a.total||e[11]!==l?(x=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a.total)," limit",l&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(zt,{size:10}),cl[l]]})]}),e[9]=d,e[10]=a.total,e[11]=l,e[12]=x):x=e[12];let p;e[13]!==d?(p=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=p):p=e[14];let g;e[15]!==h||e[16]!==x||e[17]!==p?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,h,x,p]}),e[15]=h,e[16]=x,e[17]=p,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Yt,{size:16}),e[19]=y):y=e[19];const N=d?"Configure Limit":"Set Limit";let S;e[20]!==i||e[21]!==N?(S=s.jsxs(de,{onClick:i,variant:"outline",className:"gap-2",children:[y,N]}),e[20]=i,e[21]=N,e[22]=S):S=e[22];let b;e[23]!==S||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),e[23]=S,e[24]=g,e[25]=b):b=e[25];let j;e[26]!==d||e[27]!==a.reset||e[28]!==c?(j=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:me("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=j):j=e[29];let w;e[30]!==o||e[31]!==n?(w=s.jsx(cs,{connectionId:n,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=n,e[32]=w):w=e[32];let C;return e[33]!==b||e[34]!==j||e[35]!==w?(C=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,j,w]}),e[33]=b,e[34]=j,e[35]=w,e[36]=C):C=e[36],C}function xl(t){const e=O.c(30),{available:r,total:a,estimation:l,onAddCredit:i,connectionId:n,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=u):u=e[0];let c;e[1]!==r?(c=K(r),e[1]=r,e[2]=c):c=e[2];let m;e[3]!==c?(m=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=m):m=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let h;e[7]!==m||e[8]!==f?(h=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,m,f]}),e[7]=m,e[8]=f,e[9]=h):h=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Yt,{size:16}),e[10]=x):x=e[10];let p;e[11]!==i?(p=s.jsxs(de,{onClick:i,className:"gap-2 px-5",children:[x,"Add Credit"]}),e[11]=i,e[12]=p):p=e[12];let g;e[13]!==h||e[14]!==p?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[h,p]}),e[13]=h,e[14]=p,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[K(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let N;e[20]!==l?(N=s.jsx(fl,{estimation:l}),e[20]=l,e[21]=N):N=e[21];let S;e[22]!==o||e[23]!==n?(S=s.jsx(cs,{connectionId:n,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=n,e[24]=S):S=e[24];let b;return e[25]!==N||e[26]!==S||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,N,S]}),e[25]=N,e[26]=S,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function cs(t){const e=O.c(78),{connectionId:r,alert:a,billingMode:l}=t,{org:i}=ue(),[n,o]=v.useState(!1),[d,u]=v.useState(a.enabled),[c,m]=v.useState(String(a.threshold_usd)),[f,h]=v.useState(a.email??""),[x,p]=v.useState(!1),[g,y]=v.useState(null);let N;e[0]!==r||e[1]!==i.id?(N={connectionId:r,orgId:i.id},e[0]=r,e[1]=i.id,e[2]=N):N=e[2];const S=Ae(N);let b;e[3]!==S?(b={client:S},e[3]=S,e[4]=b):b=e[4];const{mutate:j,isPending:w}=Ht(b),C=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let _;e[5]!==f||e[6]!==d||e[7]!==j||e[8]!==c?(_=()=>{y(null),p(!1);const Q=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(Q)||Q<=0){y("Threshold must be a positive number.");return}j({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:Q,...f?{email:f}:{}}},{onSuccess:()=>{p(!0),setTimeout(()=>p(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=j,e[8]=c,e[9]=_):_=e[9];const A=_,k=l==="postpaid"?"Usage Alert":"Low-Balance Alert",D=l==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!n){let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>o(!0),e[10]=Q):Q=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx($a,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==k?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:k}),e[12]=k,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==l?(ve=a.enabled?l==="postpaid"?`Enabled · Alert at ${K(a.threshold_usd)}`:`Enabled · Alert below ${K(a.threshold_usd)}`:l==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=l,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Ee;return e[25]!==je||e[26]!==be?(Ee=s.jsxs("button",{type:"button",onClick:Q,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Ee):Ee=e[27],Ee}let P;e[28]!==k?(P=s.jsx("p",{className:"text-xs font-medium text-foreground",children:k}),e[28]=k,e[29]=P):P=e[29];let E;e[30]!==D?(E=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:D}),e[30]=D,e[31]=E):E=e[31];let T;e[32]!==P||e[33]!==E?(T=s.jsxs("div",{children:[P,E]}),e[32]=P,e[33]=E,e[34]=T):T=e[34];let L;e[35]!==d?(L=s.jsx(De,{checked:d,onCheckedChange:u}),e[35]=d,e[36]=L):L=e[36];let G;e[37]!==T||e[38]!==L?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[T,L]}),e[37]=T,e[38]=L,e[39]=G):G=e[39];const V=!d&&"opacity-50 pointer-events-none";let R;e[40]!==V?(R=me("flex flex-col gap-3 transition-opacity",V),e[40]=V,e[41]=R):R=e[41];const z=l==="postpaid"?"Notify at":"Notify below";let $;e[42]!==z?($=s.jsx(_e,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:z}),e[42]=z,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=Q=>m(Q.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Pe,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(_e,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=Q=>h(Q.target.value),e[52]=ee):ee=e[52];let W;e[53]!==f?(W=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Pe,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=W):W=e[54];let F;e[55]!==U||e[56]!==W?(F=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,W]}),e[55]=U,e[56]=W,e[57]=F):F=e[57];let X;e[58]!==g?(X=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=X):X=e[59];let se;e[60]!==R||e[61]!==F||e[62]!==X?(se=s.jsxs("div",{className:R,children:[F,X]}),e[60]=R,e[61]=F,e[62]=X,e[63]=se):se=e[63];let B;e[64]!==x?(B=x&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=x,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(de,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=w||!C,te=w?"Saving...":"Save Alert";let le;e[67]!==A||e[68]!==re||e[69]!==te?(le=s.jsx(de,{size:"sm",className:"h-7 text-xs",onClick:A,disabled:re,children:te}),e[67]=A,e[68]=re,e[69]=te,e[70]=le):le=e[70];let ce;e[71]!==B||e[72]!==le?(ce=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=ce):ce=e[73];let I;return e[74]!==se||e[75]!==ce||e[76]!==G?(I=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,ce]}),e[74]=se,e[75]=ce,e[76]=G,e[77]=I):I=e[77],I}const hl={cost:{label:"Cost",color:"var(--chart-1)"}};function gl(){const t=O.c(54),{org:e}=ue(),[r,a]=v.useState("7d");let l;t[0]!==r?(l=mt(r),t[0]=r,t[1]=l):l=t[1];const i=l;let n;t[2]!==e.id?(n={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=n):n=t[3];const o=Ae(n);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let u;t[5]!==i?(u={widget:d,timeRange:i,skipCount:!0},t[5]=i,t[6]=u):u=t[6];let c;t[7]!==o||t[8]!==u?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:u,staleTime:6e4,select:Ce},t[7]=o,t[8]=u,t[9]=c):c=t[9];const{data:m}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let h;t[11]!==i?(h={widget:f,timeRange:i,skipCount:!0},t[11]=i,t[12]=h):h=t[12];let x;t[13]!==o||t[14]!==h?(x={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:h,staleTime:6e4,select:Ce},t[13]=o,t[14]=h,t[15]=x):x=t[15];const{data:p}=oe(x);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title",limit:10}},t[16]=g):g=t[16];let y;t[17]!==i?(y={widget:g,timeRange:i,skipCount:!0},t[17]=i,t[18]=y):y=t[18];let N;t[19]!==o||t[20]!==y?(N={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=N):N=t[21];const{data:S}=oe(N);let b;t[22]!==m?.timeseries?(b=m?.timeseries??[],t[22]=m?.timeseries,t[23]=b):b=t[23];let j;t[24]!==b?(j=b.map(Sl),t[24]=b,t[25]=j):j=t[25];const w=j;let C;if(t[26]!==p?.value||t[27]!==w||t[28]!==S?.groups||t[29]!==m?.timeseries||t[30]!==r){const _=(m?.timeseries??[]).reduce(Nl,0),A=p?.value??0,k=(S?.groups??[]).filter(jl).sort(bl).slice(0,5),D=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let P;t[32]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=P):P=t[32];const E=K(_);let T;t[33]!==E?(T=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:E}),t[33]=E,t[34]=T):T=t[34];let L;t[35]!==D?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:D}),t[35]=D,t[36]=L):L=t[36];let G;t[37]!==T||t[38]!==L?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[T,L]}),t[37]=T,t[38]=L,t[39]=G):G=t[39];let V;t[40]!==A?(V=A.toLocaleString(),t[40]=A,t[41]=V):V=t[41];let R;t[42]!==V?(R=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[V," tool calls"]}),t[42]=V,t[43]=R):R=t[43];let z;t[44]!==G||t[45]!==R?(z=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[P,G,R]}),t[44]=G,t[45]=R,t[46]=z):z=t[46];let $;t[47]!==r?($=s.jsx(ds,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==z||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[z,$]}),t[49]=z,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==w?(H=w.length>0?s.jsx(Ea,{config:hl,className:"h-[200px] w-full",children:s.jsxs(ll,{data:w,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(Jt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(Ya,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(ns,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:yl}),s.jsx(Oa,{content:s.jsx(Da,{formatter:vl})}),s.jsx(is,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=w,t[53]=H):H=t[53],C=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,k.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:k.map((M,U)=>{const q=_>0?Math.min(M.value/_*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:K(M.value)})]},M.key)})})]})]}),t[26]=p?.value,t[27]=w,t[28]=S?.groups,t[29]=m?.timeseries,t[30]=r,t[31]=C}else C=t[31];return C}function vl(t){return K(t)}function yl(t){return`$${t}`}function bl(t,e){return e.value-t.value}function jl(t){return t.value>0}function Nl(t,e){return t+e.value}function Sl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function wl(){const t=O.c(6),[e,r]=v.useState(il);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=u=>{r(u),nl(u)},t[0]=a):a=t[0];const l=a;let i,n;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),n=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=i,t[2]=n):(i=t[1],n=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[i,n,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(u=>s.jsx("button",{type:"button",onClick:()=>l(u),className:me("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===u?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:u},u))})]}),t[4]=e,t[5]=d):d=t[5],d}function Xe(t){const e=O.c(20),{label:r,value:a,subValue:l,maxValue:i,color:n}=t,o=n===void 0?"bg-chart-1":n;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const u=d,c=i>0?Math.min(u/i*100,100):0;let m;e[2]!==r?(m=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=m):m=e[3];let f;e[4]!==o?(f=me("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const h=`${c}%`;let x;e[6]!==h?(x={width:h},e[6]=h,e[7]=x):x=e[7];let p;e[8]!==f||e[9]!==x?(p=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:x})}),e[8]=f,e[9]=x,e[10]=p):p=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==l?(y=l&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:l}),e[13]=l,e[14]=y):y=e[14];let N;return e[15]!==m||e[16]!==p||e[17]!==g||e[18]!==y?(N=s.jsxs("div",{className:"flex items-center gap-2",children:[m,p,g,y]}),e[15]=m,e[16]=p,e[17]=g,e[18]=y,e[19]=N):N=e[19],N}function Qe(t){const e=O.c(8),{title:r,children:a,empty:l}=t;let i;e[0]!==r?(i=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=i):i=e[1];let n;e[2]!==a||e[3]!==l?(n=l?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=l,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[i,n]}),e[5]=i,e[6]=n,e[7]=o):o=e[7],o}const At={"7d":"7 days","30d":"30 days","90d":"90 days"};function ds(t){const e=O.c(4),{period:r,onPeriodChange:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.keys(At),e[0]=l):l=e[0];let i;return e[1]!==a||e[2]!==r?(i=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:l.map(n=>s.jsx("button",{type:"button",onClick:()=>a(n),className:me("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:At[n]},n))}),e[1]=a,e[2]=r,e[3]=i):i=e[3],i}function _t(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,l)=>l.cost-a.cost)}function Cl(){const t=O.c(27),{org:e}=ue(),[r,a]=v.useState("7d"),l=mt(r),{data:i}=Ga(),n=i?.data?.members??[],o=new Map(n.map(El));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const u=Ae(d),c=I=>({client:u,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:I.fn,...I.groupByColumn&&{groupByColumn:I.groupByColumn},...I.limit&&{limit:I.limit}}},timeRange:l,skipCount:!0},staleTime:6e4,select:Ce}),{data:m,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title",limit:20})),{data:h,isLoading:x}=oe(c({fn:"count_all",groupByColumn:"connection_title",limit:20})),{data:p,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id",limit:20})),{data:y,isLoading:N}=oe(c({fn:"count_all",groupByColumn:"user_id",limit:20})),{data:S,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name",limit:20}));let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j={fn:"count_all",groupByColumn:"tool_name",limit:20},t[2]=j):j=t[2];const{data:w,isLoading:C}=oe(c(j));if(f||x||g||N||b||C){let I;t[3]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ie,{className:"h-8 w-48"}),t[3]=I):I=t[3];let Q;return t[4]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsxs("div",{className:"flex flex-col gap-4",children:[I,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(Il)})]}),t[4]=Q):Q=t[4],Q}const A=_t(m?.groups??[],h?.groups??[]),k=_t(p?.groups??[],y?.groups??[]).map(I=>({...I,key:o.get(I.key)??I.key})),D=w?.groups??[],P=new Map((S?.groups??[]).map(Pl)),E=D.map(I=>({name:I.key,calls:I.value,cost:P.get(I.key)??0})).sort(kl).slice(0,20),T=A.reduce(_l,0),L=A.reduce(Al,0),G=A[0]?.cost??1,V=k[0]?.cost??1,R=E[0]?.calls??1;let z;t[5]!==r?(z=s.jsx(ds,{period:r,onPeriodChange:a}),t[5]=r,t[6]=z):z=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=A.length===0,H=A.slice(0,8).map(I=>s.jsx(Xe,{label:I.key,value:K(I.cost),subValue:`${I.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},I.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Qe,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=k.length===0,ee=k.slice(0,8).map(I=>s.jsx(Xe,{label:I.key,value:K(I.cost),subValue:`${I.calls.toLocaleString()} calls`,maxValue:V,color:"bg-chart-4"},I.key));let W;t[12]!==ee?(W=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=W):W=t[13];let F;t[14]!==W||t[15]!==q?(F=s.jsx(Qe,{title:"Cost by User",empty:q,children:W}),t[14]=W,t[15]=q,t[16]=F):F=t[16];const X=Qe,se="Top Tools",B=E.length===0,ae="space-y-2.5",re=E.slice(0,8).map(I=>s.jsx(Xe,{label:I.name,value:I.calls.toLocaleString(),subValue:I.cost>0?K(I.cost):void 0,maxValue:R,color:"bg-chart-3"},I.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==X||t[20]!==B||t[21]!==te?(le=s.jsx(X,{title:se,empty:B,children:te}),t[19]=X,t[20]=B,t[21]=te,t[22]=le):le=t[22];let ce;return t[23]!==F||t[24]!==le||t[25]!==U?(ce=s.jsxs("div",{className:$,children:[U,F,le]}),t[23]=F,t[24]=le,t[25]=U,t[26]=ce):ce=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:K(T)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:L.toLocaleString()})]})]}),z]}),ce]})}function Al(t,e){return t+e.calls}function _l(t,e){return t+e.cost}function kl(t,e){return e.calls-t.calls}function Pl(t){return[t.key,t.value]}function Il(t,e){return s.jsx(ie,{className:"h-40 rounded-xl"},e)}function El(t){return[t.userId,t.user.name??t.user.email]}function Ol(t,e){const r=new Map;for(const a of t){const i=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),n=r.get(i)??{cost:0,calls:0};r.set(i,{cost:n.cost+a.value,calls:n.calls})}for(const a of e){const i=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),n=r.get(i)??{cost:0,calls:0};r.set(i,{cost:n.cost,calls:n.calls+a.value})}return Array.from(r.entries()).map(([a,l])=>({month:a,...l})).reverse()}function Dl(){const t=O.c(27),{org:e}=ue();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=mt("90d"),t[0]=r):r=t[0];const a=r;let l;t[1]!==e.id?(l={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=l):l=t[2];const i=Ae(l);let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a,skipCount:!0},t[3]=n):n=t[3];let o;t[4]!==i?(o={client:i,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:n,staleTime:6e4,select:Ce},t[4]=i,t[5]=o):o=t[5];const{data:d,isLoading:u}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a,skipCount:!0},t[6]=c):c=t[6];let m;t[7]!==i?(m={client:i,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=i,t[8]=m):m=t[8];const{data:f,isLoading:h}=oe(m);if(u||h){let j;return t[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ie,{className:"h-8 w-48"}),s.jsx(ie,{className:"h-48 rounded-xl"})]}),t[9]=j):j=t[9],j}let x,p,g,y,N;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const j=Ol(d?.timeseries??[],f?.timeseries??[]);N="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=x):x=t[17],p="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=j.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:j.map(Ll)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=x,t[13]=p,t[14]=g,t[15]=y,t[16]=N}else x=t[12],p=t[13],g=t[14],y=t[15],N=t[16];let S;t[19]!==p||t[20]!==g||t[21]!==y?(S=s.jsxs("div",{className:p,children:[g,y]}),t[19]=p,t[20]=g,t[21]=y,t[22]=S):S=t[22];let b;return t[23]!==x||t[24]!==S||t[25]!==N?(b=s.jsxs("div",{className:N,children:[x,S]}),t[23]=x,t[24]=S,t[25]=N,t[26]=b):b=t[26],b}function Ll(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:K(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function Tl(t){const e=O.c(31),{connectionId:r}=t,{org:a}=ue(),[l,i]=v.useState(!1);let n;e[0]!==r||e[1]!==a.id?(n={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=n):n=e[2];const o=Ae(n);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let u;e[4]!==o?(u={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:zl},e[4]=o,e[5]=u):u=e[5];const{data:c,isLoading:m}=oe(u);if(m){let k;return e[6]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ie,{className:"h-36 rounded-xl"}),e[6]=k):k=e[6],k}if(!c)return null;const f=c.limit.remaining??0,h=c.limit.total??0,x=c.usage,p=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let N;e[7]!==c.alert?(N=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=N):N=e[8];const S=N,b=c.limit,j=p==="postpaid"&&(h==null||h===0);let w;e[9]!==S||e[10]!==f||e[11]!==p||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==h||e[17]!==x?(w=p==="postpaid"?s.jsx(pl,{usage:x,limit:b,limitPeriod:g,onConfigureLimit:()=>i(!0),connectionId:r,alert:S}):s.jsx(xl,{available:f,total:h,estimation:y,onAddCredit:()=>i(!0),connectionId:r,alert:S}),e[9]=S,e[10]=f,e[11]=p,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=h,e[17]=x,e[18]=w):w=e[18];let C;e[19]!==j?(C=j&&s.jsx(wl,{}),e[19]=j,e[20]=C):C=e[20];let _;e[21]!==p||e[22]!==r||e[23]!==l||e[24]!==g||e[25]!==h?(_=s.jsx(ul,{open:l,onOpenChange:i,connectionId:r,currentLimitUsd:h,billingMode:p,currentLimitPeriod:g}),e[21]=p,e[22]=r,e[23]=l,e[24]=g,e[25]=h,e[26]=_):_=e[26];let A;return e[27]!==w||e[28]!==C||e[29]!==_?(A=s.jsxs(s.Fragment,{children:[w,C,_]}),e[27]=w,e[28]=C,e[29]=_,e[30]=A):A=e[30],A}function zl(t){return t.structuredContent}function $l(t){const e=O.c(20),{gatewayConnectionId:r}=t,[a,l]=v.useState("summary");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=i):i=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(Ta,{variant:"underline",children:[s.jsx(He,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(He,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(He,{value:"history",variant:"underline",children:"History"})]}),e[1]=n):n=e[1];let o;e[2]!==r?(o=r&&s.jsx(Tl,{connectionId:r}),e[2]=r,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(gl,{}),e[4]=d):d=e[4];let u;e[5]!==o?(u=s.jsxs(qe,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[o,d]}),e[5]=o,e[6]=u):u=e[6];let c;e[7]!==a?(c=a==="breakdown"&&s.jsx(Cl,{}),e[7]=a,e[8]=c):c=e[8];let m;e[9]!==c?(m=s.jsx(qe,{value:"breakdown",className:"pt-2",children:c}),e[9]=c,e[10]=m):m=e[10];let f;e[11]!==a?(f=a==="history"&&s.jsx(Dl,{}),e[11]=a,e[12]=f):f=e[12];let h;e[13]!==f?(h=s.jsx(qe,{value:"history",className:"pt-2",children:f}),e[13]=f,e[14]=h):h=e[14];let x;return e[15]!==a||e[16]!==u||e[17]!==m||e[18]!==h?(x=s.jsxs(s.Fragment,{children:[i,s.jsxs(za,{value:a,onValueChange:l,variant:"underline",children:[n,u,m,h]})]}),e[15]=a,e[16]=u,e[17]=m,e[18]=h,e[19]=x):x=e[19],x}function Ml(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ie,{className:"h-5 w-32"}),s.jsx(ie,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ie,{className:"h-28 rounded-xl"}),s.jsx(ie,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Bl(){const t=O.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class Gl extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx(Bl,{}):this.props.children}}function Wl(){const t=O.c(4),e=Ba();let r;t[0]!==e?(r=e.find(Fl),t[0]=e,t[1]=r):r=t[1];const l=r?.id??null;let i;return t[2]!==l?(i=s.jsx($l,{gatewayConnectionId:l}),t[2]=l,t[3]=i):i=t[3],i}function Fl(t){return Wa(t,Fa)}function Rl(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx(Gl,{children:s.jsx(v.Suspense,{fallback:s.jsx(Ml,{}),children:s.jsx(Wl,{})})})}),t[0]=e):e=t[0],e}function Ul(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ha,{}),t[0]=e):e=t[0],e}function ms(){const t=O.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ie,{className:"h-6 w-48"}),r=s.jsx(ie,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ie,{className:"h-12 w-full"}),s.jsx(ie,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Kl(t){const e=O.c(14),{projectSlug:r,children:a}=t,{org:l}=ue(),{data:i,isLoading:n}=Et(l.id,r);if(n||!i){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ms,{}),e[0]=m):m=e[0],m}const o=r===Ie;let d;e[1]!==i.description||e[2]!==i.enabledPlugins||e[3]!==i.id||e[4]!==i.name||e[5]!==i.organizationId||e[6]!==i.slug||e[7]!==i.ui||e[8]!==o?(d={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:o},e[1]=i.description,e[2]=i.enabledPlugins,e[3]=i.id,e[4]=i.name,e[5]=i.organizationId,e[6]=i.slug,e[7]=i.ui,e[8]=o,e[9]=d):d=e[9];const u=d;let c;return e[10]!==a||e[11]!==u||e[12]!==l?(c=s.jsx(It,{org:l,project:u,children:a}),e[10]=a,e[11]=u,e[12]=l,e[13]=c):c=e[13],c}function Vl(t){const e=O.c(8),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Xa,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"org.general":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ar,{}),e[2]=a):a=e[2],a}case"org.plugins":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Kl,{projectSlug:Ie,children:s.jsx(Rs,{})}),e[3]=a):a=e[3],a}case"org.ai-providers":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ss,{}),e[4]=a):a=e[4],a}case"org.billing":{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Rl,{}),e[5]=a):a=e[5],a}case"org.members":{let a;return e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ul,{}),e[6]=a):a=e[6],a}default:{let a;return e[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[7]=a):a=e[7],a}}}function Yl(){const t=O.c(24),{isOpen:e,activeSection:r,open:a,close:l}=Ns();let i;t[0]!==l?(i=y=>!y&&l(),t[0]=l,t[1]=i):i=t[1];let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ot,{className:"sr-only",children:"Settings"}),t[2]=n):n=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[3]=o):o=t[3];let d;t[4]!==r||t[5]!==a?(d=s.jsx(v.Suspense,{fallback:o,children:s.jsx(qa,{activeSection:r,onNavigate:a})}),t[4]=r,t[5]=a,t[6]=d):d=t[6];let u,c;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ys,{size:16}),c=s.jsx("span",{className:"sr-only",children:"Close"}),t[7]=u,t[8]=c):(u=t[7],c=t[8]);let m;t[9]!==l?(m=s.jsxs("button",{type:"button",onClick:l,className:"absolute top-4 right-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[u,c]}),t[9]=l,t[10]=m):m=t[10];let f;t[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ms,{}),t[11]=f):f=t[11];let h;t[12]!==r?(h=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:f,children:s.jsx(Vl,{section:r})})}),t[12]=r,t[13]=h):h=t[13];let x;t[14]!==m||t[15]!==h?(x=s.jsxs("div",{className:"flex-1 min-w-0 overflow-y-auto relative flex flex-col overflow-hidden",children:[m,h]}),t[14]=m,t[15]=h,t[16]=x):x=t[16];let p;t[17]!==d||t[18]!==x?(p=s.jsxs(Dt,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:[n,s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[d,x]})]}),t[17]=d,t[18]=x,t[19]=p):p=t[19];let g;return t[20]!==e||t[21]!==i||t[22]!==p?(g=s.jsx(Lt,{open:e,onOpenChange:i,children:p}),t[20]=e,t[21]=i,t[22]=p,t[23]=g):g=t[23],g}function Hl(t){const e=O.c(12),{projectSlug:r,orgSlug:a,error:l}=t,i=at();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=n):n=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==l.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:l.message}),e[3]=l.message,e[4]=d):d=e[4];let u;e[5]!==i||e[6]!==a?(u=s.jsx(de,{variant:"link",onClick:()=>i({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[5]=i,e[6]=a,e[7]=u):u=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==u?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[n,o,d,u]}),e[8]=o,e[9]=d,e[10]=u,e[11]=c):c=e[11],c}function ql(t){const e=O.c(9),{projectSlug:r,orgSlug:a}=t,l=at();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=i):i=e[0];let n;e[1]!==r?(n=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=n):n=e[2];let o;e[3]!==l||e[4]!==a?(o=s.jsx(de,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[3]=l,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==n||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,n,o]}),e[6]=n,e[7]=o,e[8]=d):d=e[8],d}function Xl(){const t=O.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=xs(e),{org:a}=ue(),l=r.org,i=r.project,{data:n,isLoading:o,error:d}=Et(a.id,i);if(o){let p;return t[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ze,{}),t[1]=p):p=t[1],p}if(d){let p;return t[2]!==d||t[3]!==l||t[4]!==i?(p=s.jsx(Hl,{projectSlug:i,orgSlug:l,error:d}),t[2]=d,t[3]=l,t[4]=i,t[5]=p):p=t[5],p}if(!n){let p;return t[6]!==l||t[7]!==i?(p=s.jsx(ql,{projectSlug:i,orgSlug:l}),t[6]=l,t[7]=i,t[8]=p):p=t[8],p}const u=n.slug===Ie;let c;t[9]!==n.description||t[10]!==n.enabledPlugins||t[11]!==n.id||t[12]!==n.name||t[13]!==n.organizationId||t[14]!==n.slug||t[15]!==n.ui||t[16]!==u?(c={id:n.id,organizationId:n.organizationId,slug:n.slug,name:n.name,description:n.description,enabledPlugins:n.enabledPlugins,ui:n.ui,isOrgAdmin:u},t[9]=n.description,t[10]=n.enabledPlugins,t[11]=n.id,t[12]=n.name,t[13]=n.organizationId,t[14]=n.slug,t[15]=n.ui,t[16]=u,t[17]=c):c=t[17];const m=c;let f,h;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(Ze,{}),children:s.jsx(hs,{})}),h=s.jsx(Yl,{}),t[18]=f,t[19]=h):(f=t[18],h=t[19]);let x;return t[20]!==m||t[21]!==a?(x=s.jsxs(It,{org:a,project:m,children:[f,h]}),t[20]=m,t[21]=a,t[22]=x):x=t[22],x}function In(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(Ze,{}),children:s.jsx(Xl,{})}),t[0]=e):e=t[0],e}export{In as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as _,j as n,y as J,B as G,u as V,x as W,w as M,K as q,bh as D,bj as $,c as Q}from"./index-
|
|
1
|
+
import{r as _,j as n,y as J,B as G,u as V,x as W,w as M,K as q,bh as D,bj as $,c as Q}from"./index-DJtnEPc7.js";import{u as Y}from"./useQuery-DLey6Pvf.js";import{u as H}from"./useMutation-D77LVetF.js";import{u as X,a as Z}from"./constants-4hZfe-FX.js";import{S as ee}from"./switch-7_yekA3p.js";import{L as te}from"./label-Dmque-mN.js";import{n as ne}from"./Container-C_pBhYQm.js";import{b as se}from"./use-connection-2T7CNTjX.js";import{a as ie,c as re}from"./use-binding-CidrckI6.js";import{u as oe}from"./use-install-from-registry-BGTf0OMo.js";import{i as le}from"./Loading01-CSUxQOK0.js";import{s as ae}from"./Plus-CGe5wBcS.js";import{S as ce,a as de,b as ue,c as me,d as z}from"./select-roICowiz.js";function ge({value:o,onValueChange:e,placeholder:r="Select a connection...",binding:l,bindingType:a,onAddNew:y,className:x,disabled:h=!1}){const[j,d]=_.useState(!1),{installByBinding:N,isInstalling:S}=oe(),b=j||S,u=se(),w=ie({connections:u,binding:typeof l=="string"?l:void 0}),C=!l||!u?u??[]:typeof l=="string"?w:Array.isArray(l)&&l.length>0?u.filter(t=>re(t,l)):u,m=(()=>{if(!a?.startsWith("@"))return null;const[t,s]=a.replace("@","").split("/");return t&&s?{scope:t,appName:s}:null})(),P=(()=>{let t=C;const s=Array.isArray(l)&&l.length>0;if(m&&!s&&(t=t.filter(i=>{const c=i.app_name,p=i.metadata?.scopeName;return c===m.appName&&p===m.scope})),o&&!t.some(i=>i.id===o)){const i=u?.find(c=>c.id===o);if(i)return[i,...t]}return t})(),v=a?.startsWith("@"),A=async()=>{if(v&&a){d(!0);try{const t=await N(a);t&&e(t.id)}finally{d(!1)}return}y?.()},g=P.find(t=>t.id===o);return n.jsxs(ce,{value:o??"none",onValueChange:t=>e(t==="none"?null:t),disabled:h,children:[n.jsx(de,{size:"sm",className:J("w-[200px]",x),children:n.jsx(ue,{placeholder:r,children:g?n.jsxs("div",{className:"flex items-center gap-2",children:[g.icon?n.jsx("img",{src:g.icon,alt:g.title,className:"w-4 h-4 rounded shrink-0"}):n.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:g.title.slice(0,1).toUpperCase()}),n.jsx("span",{className:"truncate",children:g.title})]}):r})}),n.jsxs(me,{children:[n.jsx(z,{value:"none",children:"No connection"}),P.length===0?n.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(t=>n.jsx(z,{value:t.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?n.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):n.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),n.jsx("span",{children:t.title})]})},t.id)),(y||v)&&n.jsx("div",{className:"border-t border-border",children:n.jsx(G,{onPointerDown:t=>t.stopPropagation(),onClick:t=>{t.preventDefault(),t.stopPropagation(),A()},disabled:b||h,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:b?n.jsxs(n.Fragment,{children:[n.jsx(le,{size:16,className:"animate-spin"}),n.jsx("span",{children:"Connecting..."})]}):n.jsxs(n.Fragment,{children:[n.jsx(ae,{size:16}),n.jsx("span",{children:"Add Connection"})]})})})]})]})}const pe=o=>{if(!o||typeof o!="object")return!1;const e=o;return e.type==="text"&&typeof e.text=="string"&&e.text.trim().toLowerCase().startsWith("error")},K=o=>{const e=o.structuredContent??o,r=e&&typeof e=="object"?e:null,l=r?.content?.[0]?.text&&typeof r.content[0].text=="string"?r.content[0].text:null;if(r?.isError)throw new Error(l??"Tool call failed");if(pe(e))throw new Error(e.text);return e};function fe(o){return o.requiresMcpBinding===!0?!0:o.binding!==void 0}function xe(o){const e=Q.c(57),{plugin:r,isEnabled:l,isSaving:a,pendingBinding:y,description:x,label:h,icon:j,projectId:d,client:N,onBindingChange:S,onToggle:b}=o;let u;e[0]!==r?(u=fe(r),e[0]=r,e[1]=u):u=e[1];const w=u;let C;e[2]!==r.id||e[3]!==d?(C=q.projectPluginConfig(d??"",r.id),e[2]=r.id,e[3]=d,e[4]=C):C=e[4];let m;e[5]!==N||e[6]!==r.id||e[7]!==d?(m=async()=>{if(!d)throw new Error("Project ID is required to load plugin config.");const O=await N.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:d,pluginId:r.id}});return K(O)},e[5]=N,e[6]=r.id,e[7]=d,e[8]=m):m=e[8];const P=!!d&&w;let v;e[9]!==C||e[10]!==m||e[11]!==P?(v={queryKey:C,queryFn:m,enabled:P},e[9]=C,e[10]=m,e[11]=P,e[12]=v):v=e[12];const{data:A,isLoading:g}=Y(v),t=A?.config?.connectionId??null,s=y!==void 0?y:t;let i;e[13]!==l||e[14]!==a||e[15]!==b||e[16]!==r.id?(i=()=>!a&&b(r.id,!l),e[13]=l,e[14]=a,e[15]=b,e[16]=r.id,e[17]=i):i=e[17];const c=a?void 0:"pointer";let p;e[18]!==c?(p={cursor:c},e[18]=c,e[19]=p):p=e[19];let f;e[20]!==j?(f=j&&n.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:j}),e[20]=j,e[21]=f):f=e[21];let I;e[22]!==h?(I=n.jsx("p",{className:"text-sm font-medium text-foreground",children:h}),e[22]=h,e[23]=I):I=e[23];let E;e[24]!==x?(E=x&&n.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:x}),e[24]=x,e[25]=E):E=e[25];let B;e[26]!==I||e[27]!==E?(B=n.jsxs("div",{className:"min-w-0",children:[I,E]}),e[26]=I,e[27]=E,e[28]=B):B=e[28];let k;e[29]!==B||e[30]!==f?(k=n.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[f,B]}),e[29]=B,e[30]=f,e[31]=k):k=e[31];let T;e[32]!==b||e[33]!==r.id?(T=O=>b(r.id,O),e[32]=b,e[33]=r.id,e[34]=T):T=e[34];let F;e[35]!==l||e[36]!==a||e[37]!==T?(F=n.jsx("div",{onClick:je,className:"shrink-0",children:n.jsx(ee,{checked:l,onCheckedChange:T,disabled:a})}),e[35]=l,e[36]=a,e[37]=T,e[38]=F):F=e[38];let L;e[39]!==k||e[40]!==F?(L=n.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[k,F]}),e[39]=k,e[40]=F,e[41]=L):L=e[41];let U;e[42]!==g||e[43]!==l||e[44]!==a||e[45]!==w||e[46]!==S||e[47]!==r.binding||e[48]!==r.id||e[49]!==s||e[50]!==t?(U=l&&w&&n.jsx("div",{className:"pb-4 pl-7 space-y-2",onClick:he,children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),n.jsx(ge,{value:s??null,onValueChange:O=>S(r.id,O,t),binding:r.binding,placeholder:"Select connection...",className:"w-56",disabled:a||g})]})}),e[42]=g,e[43]=l,e[44]=a,e[45]=w,e[46]=S,e[47]=r.binding,e[48]=r.id,e[49]=s,e[50]=t,e[51]=U):U=e[51];let R;return e[52]!==L||e[53]!==U||e[54]!==i||e[55]!==p?(R=n.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:i,style:p,children:[L,U]}),e[52]=L,e[53]=U,e[54]=i,e[55]=p,e[56]=R):R=e[56],R}function he(o){return o.stopPropagation()}function je(o){return o.stopPropagation()}function be(){const{org:o,project:e}=V(),r=W(),l=X({connectionId:Z,orgId:o.id}),[a,y]=_.useState({}),[x,h]=_.useState({}),[j,d]=_.useState(!1),N=e.enabledPlugins??[],S=t=>{const s=a[t];return s!==void 0?s:N.includes(t)},b=()=>{const t=new Set(N);for(const[s,i]of Object.entries(a))i?t.add(s):t.delete(s);return Array.from(t)},u=Object.keys(a).length>0||Object.keys(x).length>0,w=(t,s)=>{const i=N.includes(t);y(s===i?c=>{const{[t]:p,...f}=c;return f}:c=>({...c,[t]:s}))},C=(t,s,i)=>{if(s===i){h(c=>{const{[t]:p,...f}=c;return f});return}h(c=>({...c,[t]:s}))},m=H({mutationFn:async t=>{const s=[];if(t.updatePlugins){const i=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:e.id,enabledPlugins:t.enabledPlugins}});s.push(K(i))}if(t.bindingUpdates.length>0){const i=await Promise.all(t.bindingUpdates.map(async({pluginId:c,connectionId:p,settings:f})=>{const I=await l.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:e.id,pluginId:c,connectionId:p,settings:f}});return K(I)}));s.push(...i)}return s},onSuccess:(t,s)=>{s.updatePlugins&&(r.invalidateQueries({queryKey:q.project(o.id,e.slug)}),r.invalidateQueries({queryKey:q.projects(o.id)})),s.bindingUpdates.forEach(({pluginId:i})=>{r.invalidateQueries({queryKey:q.projectPluginConfig(e.id??"",i)})}),y({}),h({}),M.success("Plugins updated successfully")},onError:t=>{M.error("Failed to update plugins: "+(t instanceof Error?t.message:"Unknown error"))},onSettled:()=>{d(!1)}}),P=()=>{d(!0);const t=Object.keys(x).map(s=>{const i=x[s];return{pluginId:s,connectionId:i!==void 0?i:void 0}});m.mutate({enabledPlugins:b(),updatePlugins:Object.keys(a).length>0,bindingUpdates:t})},v=()=>{y({}),h({})},A=t=>{const s=$.find(i=>i.pluginId===t);return s?{label:s.label,icon:s.items[0]?.icon}:null},g=t=>D.find(i=>i.id===t)?.description??null;return D.length===0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-col",children:D.map(t=>{const s=A(t.id),i=g(t.id),c=S(t.id);return n.jsx(xe,{plugin:t,isEnabled:c,isSaving:j,pendingBinding:x[t.id],description:i,label:s?.label??t.id,icon:s?.icon??n.jsx(ne,{size:14}),projectId:e.id,client:l,onBindingChange:C,onToggle:w},t.id)})}),n.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[n.jsx(G,{variant:"outline",onClick:v,disabled:!u||j,children:"Cancel"}),n.jsx(G,{onClick:P,disabled:!u||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}function Le(){const o=Q.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Features"}),n.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Extend your project with built-in capabilities that activate automatically on any connection that supports them."})]}),n.jsx(be,{})]}),o[0]=e):e=o[0],e}export{Le as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bi as G,c as O,u as H,y as J,j as s,J as M,r as I,e as V,B as R,O as U}from"./index-
|
|
1
|
+
import{bi as G,c as O,u as H,y as J,j as s,J as M,r as I,e as V,B as R,O as U}from"./index-DJtnEPc7.js";import{a as q}from"./use-project-CCY4E3rU.js";import{P as D}from"./index-qxqsMecG.js";import{C as F}from"./collection-search-BeqmTWUU.js";import{A as K}from"./avatar-CkCU2Fe6.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as T}from"./empty-state-COoAU6KF.js";import{C as W}from"./create-project-dialog-C6OTQ8lU.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-7YipRD-p.js";import"./useQuery-DLey6Pvf.js";import"./constants-4hZfe-FX.js";import"./useMutation-D77LVetF.js";import"./tooltip-Bms1Xn3i.js";import"./index-biN0aic_.js";import"./Loading01-CSUxQOK0.js";import"./SearchMd-CrngVZhh.js";import"./input-j_5WJy1c.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-1RTimACw.js";import"./X-CuPyb-Ex.js";import"./form-RbK75Dit.js";import"./label-Dmque-mN.js";import"./textarea-BJkI1dfy.js";import"./Check-DsclgHfU.js";import"./ChevronRight-DmvbXNWu.js";const te=G("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=J("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=Q(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let C;e[25]!==a||e[26]!==j?(C=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=C):C=e[27];let N;e[28]!==n||e[29]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,C]}),e[28]=n,e[29]=C,e[30]=N):N=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(K,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==N||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[N,L]}),e[49]=N,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let E;return e[55]!==A||e[56]!==u?(E=s.jsx(M,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=E):E=e[57],E}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function Ae(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=V();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const N=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/projects/$slug/settings/general",params:{org:e.slug,project:U,slug:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=D;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(D.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(D.Header,{children:[w,s.jsx(D.Header.Right,{children:s.jsx(R,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=D.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&N.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(T,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&N.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(T,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(R,{onClick:z,children:"Create new project"})})}),p=!c&&N.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:N.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(W,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let C;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(C=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=C):C=t[39],C}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==U}export{Ae as default};
|