decocms 3.18.9 → 3.18.11
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-BHVtmqg5.js → AlertCircle-BPLBHL4z.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BjNBbpmV.js → ArrowUpRight-BZM2WIfu.js} +1 -1
- package/dist/client/assets/{Check-B0P5hodH.js → Check-DwxWAe_A.js} +1 -1
- package/dist/client/assets/{CheckCircle-Bdqev0nO.js → CheckCircle-B9Dg9VMf.js} +1 -1
- package/dist/client/assets/{ChevronDown-BLvS4ToG.js → ChevronDown-DmPW0EFR.js} +1 -1
- package/dist/client/assets/{ChevronLeft-DkNaQH3V.js → ChevronLeft-De4cWQ2U.js} +1 -1
- package/dist/client/assets/{ChevronRight-4ehX8OPq.js → ChevronRight-vQ97Lphi.js} +1 -1
- package/dist/client/assets/{ChevronUp-BPS-J5rQ.js → ChevronUp-CFKEoO3S.js} +1 -1
- package/dist/client/assets/{Container-BgS7rK8J.js → Container-CGX8gjQO.js} +1 -1
- package/dist/client/assets/{DotsVertical-J6xX8bRK.js → DotsVertical-CMNXuxac.js} +1 -1
- package/dist/client/assets/{Eye-B4txmFQS.js → Eye-CouYr8Kp.js} +1 -1
- package/dist/client/assets/{FilterLines-BTMjQgiq.js → FilterLines-pL0W8Z1S.js} +1 -1
- package/dist/client/assets/{Globe01-xi-0s299.js → Globe01-AF0aVf58.js} +1 -1
- package/dist/client/assets/{HardDrive-Cw5wbzfr.js → HardDrive-B5t2ShDK.js} +1 -1
- package/dist/client/assets/{Key01-CIFx1b27.js → Key01-PpEZMCXn.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DoTZR2dr.js → LayoutLeft-B5MqBU8K.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BUo_Z2Ai.js → LinkExternal01-C9lE7bqK.js} +1 -1
- package/dist/client/assets/{Monitor01-CU2IldL2.js → Monitor01-659PEtN5.js} +1 -1
- package/dist/client/assets/{Palette-C1x3Xgx8.js → Palette-z1uB5Qcc.js} +1 -1
- package/dist/client/assets/{Play-cC3e0aRw.js → Play-Bj3fPStO.js} +1 -1
- package/dist/client/assets/{Plus-C-omi-dN.js → Plus-CXI6DYsL.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-BRsF38y3.js → RefreshCcw01-CFdSHPj-.js} +1 -1
- package/dist/client/assets/{SearchMd-B0_Yf3yk.js → SearchMd-M3oAe2yo.js} +1 -1
- package/dist/client/assets/{Settings02-BAzPyCQK.js → Settings02-FDGyPWfA.js} +1 -1
- package/dist/client/assets/{Shield01-D-Ka40fc.js → Shield01-CiQJomFU.js} +1 -1
- package/dist/client/assets/{Star01-BTZ2441m.js → Star01-C9s5EBdt.js} +1 -1
- package/dist/client/assets/{Stars01-BvMjy7DM.js → Stars01-DwRIvNMi.js} +1 -1
- package/dist/client/assets/{Stars02-D5yjx9l2.js → Stars02-Xh71bZ8J.js} +1 -1
- package/dist/client/assets/{Sun-CU5c1BQU.js → Sun-DRvqv83H.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CI__ZFHo.js → SwitchHorizontal01-Co7U9zZ9.js} +1 -1
- package/dist/client/assets/{Tool01-jh5OdcD_.js → Tool01-W8F7AzYr.js} +1 -1
- package/dist/client/assets/{Trash01-CY-IoFVl.js → Trash01-CgOGDFfp.js} +1 -1
- package/dist/client/assets/{Upload01-Dws98jTe.js → Upload01-B_kwcwAX.js} +1 -1
- package/dist/client/assets/{User01-CsfdlOo_.js → User01-Dgc45Veo.js} +1 -1
- package/dist/client/assets/{Users01-KgnDENeu.js → Users01-BNC9Bd-m.js} +1 -1
- package/dist/client/assets/{Users03-B1-zgOdp.js → Users03-CITbL542.js} +1 -1
- package/dist/client/assets/{X-wAJMKsDG.js → X-CA12oOt8.js} +1 -1
- package/dist/client/assets/{XCircle-C5XzBzrQ.js → XCircle-oElWmNA3.js} +1 -1
- package/dist/client/assets/{XClose-Wh4jKrco.js → XClose-CiNjOJj2.js} +1 -1
- package/dist/client/assets/{Zap-Cd9ypkMC.js → Zap-DLhCOSk9.js} +1 -1
- package/dist/client/assets/{ZapSquare-BdJ-x7Vi.js → ZapSquare-Cm_bfF8f.js} +1 -1
- package/dist/client/assets/{ZoomOut-DnPCWp9x.js → ZoomOut-BLhsYj6d.js} +1 -1
- package/dist/client/assets/{access-gate-CNsIQ_vY.js → access-gate-5nomG59L.js} +1 -1
- package/dist/client/assets/{accordion-CCq9lsEc.js → accordion-1EStVhCm.js} +1 -1
- package/dist/client/assets/{add-section-modal-DRe-XbIV.js → add-section-modal-DRhuVxRC.js} +1 -1
- package/dist/client/assets/{agent-capabilities-Dk3tx7gd.js → agent-capabilities-wKA4LBVJ.js} +1 -1
- package/dist/client/assets/{agent-icon-Dr1bpYZ_.js → agent-icon-DjUyM2GK.js} +1 -1
- package/dist/client/assets/{agent-icons-CzC15bIN.js → agent-icons-DRz2SdAx.js} +1 -1
- package/dist/client/assets/{agents-list-DWy0GtDE.js → agents-list-5OPy3rHr.js} +1 -1
- package/dist/client/assets/{ai-providers-BmFmfBdt.js → ai-providers-YxoO9_iw.js} +1 -1
- package/dist/client/assets/{alert-BYbunVHe.js → alert-Cay8MzxC.js} +1 -1
- package/dist/client/assets/{alert-dialog-B_G3fFis.js → alert-dialog-CA-7j9GK.js} +1 -1
- package/dist/client/assets/app-editor-DGYIjV94.js +1 -0
- package/dist/client/assets/{auth-catchall-DbEVklo6.js → auth-catchall-CXSJfqc4.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DuWIkei5.js → auth-split-layout-B7aIG_Y0.js} +1 -1
- package/dist/client/assets/{automation-list-row-Ca7Xhucl.js → automation-list-row-BAzOudP_.js} +1 -1
- package/dist/client/assets/{automation-runs-hyU42Y3D.js → automation-runs-BRn-zWCB.js} +1 -1
- package/dist/client/assets/{automations-2cAsHwG9.js → automations-DMHN6Bxi.js} +1 -1
- package/dist/client/assets/{avatar-DhzY0Eh2.js → avatar-D24kACpT.js} +1 -1
- package/dist/client/assets/{badge-bZNUWBV_.js → badge-CPz8lLAV.js} +1 -1
- package/dist/client/assets/{brand-context-D0vg5dZK.js → brand-context-Cl54vpVI.js} +1 -1
- package/dist/client/assets/{buckets-DBovtxB9.js → buckets-C2EgbILm.js} +1 -1
- package/dist/client/assets/{calendar-BLg-8LXk.js → calendar-CjJD_oz1.js} +1 -1
- package/dist/client/assets/{capability-load-error-DBKsDtKJ.js → capability-load-error-DVwjhCeN.js} +1 -1
- package/dist/client/assets/{card-BDlh34z0.js → card-DB7Bse8h.js} +1 -1
- package/dist/client/assets/{chat-context-n64-vv_1.js → chat-context-yFtmoeub.js} +1 -1
- package/dist/client/assets/{checkbox-X6v3rKHo.js → checkbox-iBP5ppXv.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CQVq7_y_.js → cli-auth-success-Bc9v3nGT.js} +1 -1
- package/dist/client/assets/{collection-detail-C5P4CU7T.js → collection-detail-CO54U1Mm.js} +1 -1
- package/dist/client/assets/{collection-display-button-BV3ToLFg.js → collection-display-button-4WX43uoY.js} +1 -1
- package/dist/client/assets/{collection-search-B7dmZ18T.js → collection-search-C-2x8kfV.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B0Cp6x2U.js → collection-table-wrapper-B97EMGCQ.js} +1 -1
- package/dist/client/assets/{collection-tabs-IXoyjsqg.js → collection-tabs-C3f-lxbw.js} +1 -1
- package/dist/client/assets/{collections-Ca9cgdYF.js → collections-DeSkD82x.js} +1 -1
- package/dist/client/assets/{command-eM0_ztLa.js → command-D0ww2Igv.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BnrR7FIp.js → connect-desktop-dialog-mw47OvUe.js} +1 -1
- package/dist/client/assets/{connection-card-BNhxgt1r.js → connection-card-BgNZe3SM.js} +1 -1
- package/dist/client/assets/{connection-detail-BfklQCKA.js → connection-detail-CclYVQsY.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-E666kWj7.js → connection-form-helpers-ztgaVher.js} +1 -1
- package/dist/client/assets/{connections-Bayyg13Q.js → connections-DPKwlOPR.js} +1 -1
- package/dist/client/assets/{constants-CNZvm1cO.js → constants-CwxhhJva.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BbXhLnto.js → decopilot-sse-pool-I31A1Pzr.js} +1 -1
- package/dist/client/assets/{dialog-B25EnfSZ.js → dialog-B109gCE4.js} +1 -1
- package/dist/client/assets/{domain-settings-DeaBF1NN.js → domain-settings-4xq8OTPG.js} +1 -1
- package/dist/client/assets/{drawer-fSMBE52Q.js → drawer-BLP-m8Z0.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CqB2EneR.js → dropdown-menu-DI-Jgf22.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Hd9w0NQy.js → dynamic-plugin-layout-P4rTHusN.js} +1 -1
- package/dist/client/assets/{empty-state-ntjfA1V-.js → empty-state-BCZtVi-n.js} +1 -1
- package/dist/client/assets/{empty-state-BZ5IbUpC.js → empty-state-CyjruiTL.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DtUMTD6M.js → extract-connection-data-DfGwPk2j.js} +1 -1
- package/dist/client/assets/{features-Do_DYvUG.js → features-mFHOHXOD.js} +1 -1
- package/dist/client/assets/{file-explorer-CzHWiTKa.js → file-explorer-DkoAmNvF.js} +1 -1
- package/dist/client/assets/{file-type-icon-vEyv3GKo.js → file-type-icon-_BUuCWpD.js} +1 -1
- package/dist/client/assets/{files-CqHDF15j.js → files-CWePv7yr.js} +1 -1
- package/dist/client/assets/{form-Ck7oM85d.js → form-CF-wg7fJ.js} +1 -1
- package/dist/client/assets/{general-CiySELJl.js → general-CSG63ZiS.js} +1 -1
- package/dist/client/assets/{generate-id-DFeI4rCP.js → generate-id-C3DU72xl.js} +1 -1
- package/dist/client/assets/{github-repo-picker-C8SuJIC3.js → github-repo-picker-DrUEn5Is.js} +1 -1
- package/dist/client/assets/{header-tab-button-ByTfW4d9.js → header-tab-button-BxwKdHub.js} +1 -1
- package/dist/client/assets/{hover-card-Bs_VQXY_.js → hover-card-Bd5-01SZ.js} +1 -1
- package/dist/client/assets/{image-field-DsGhzGiD.js → image-field-CMMojave.js} +1 -1
- package/dist/client/assets/{index-CF0CDpUh.js → index-BMAjLnZs.js} +1 -1
- package/dist/client/assets/{index-DllrVy9q.js → index-BNPsKULo.js} +1 -1
- package/dist/client/assets/{index-B9ljcRCy.js → index-BxjEOpBp.js} +1 -1
- package/dist/client/assets/{index-DFwf5_Tj.js → index-CVQlEG7Z.js} +1 -1
- package/dist/client/assets/{index-CCsVvAb0.js → index-CZOoxbux.js} +1 -1
- package/dist/client/assets/{index-BicGKvEo.js → index-CjS7yEti.js} +4 -4
- package/dist/client/assets/{index-BNuieAvN.js → index-DAIAIjrI.js} +1 -1
- package/dist/client/assets/{index-DjvTsn28.js → index-DWtvHiKf.js} +1 -1
- package/dist/client/assets/{index-IIM93U8v.js → index-D_d1nTRq.js} +1 -1
- package/dist/client/assets/{index-DJZidEIe.js → index-DlJ1CAZi.js} +1 -1
- package/dist/client/assets/{index-BHIyMqy_.js → index-Duj0G-k0.js} +1 -1
- package/dist/client/assets/{index-B6C3Resz.js → index-MoSYdJ5P.js} +1 -1
- package/dist/client/assets/{index-BaZaX52j.js → index-YxbzX2gx.js} +1 -1
- package/dist/client/assets/{index-BraUXQtj.js → index-qCFYlQXM.js} +1 -1
- package/dist/client/assets/{index-redirect-DwG4UFJN.js → index-redirect-BK_4ZZrn.js} +1 -1
- package/dist/client/assets/{index-B7tMIGCq.js → index-zyABZOuD.js} +3 -3
- package/dist/client/assets/{infiniteQueryObserver-GqeTL4E_.js → infiniteQueryObserver-vYj_bKq_.js} +1 -1
- package/dist/client/assets/{input-DwlCJ28N.js → input-CDcrM9F5.js} +1 -1
- package/dist/client/assets/{integration-icon-BI887rQg.js → integration-icon-BdLUFe5T.js} +1 -1
- package/dist/client/assets/{label-Cp7h2a1f.js → label-Dr9kjoUG.js} +1 -1
- package/dist/client/assets/{layout-CHqfnKZ0.js → layout-B1iHolsK.js} +1 -1
- package/dist/client/assets/{login-CxERd25A.js → login-DZkEvKtq.js} +1 -1
- package/dist/client/assets/{members-BIU1EAnp.js → members-CE7R4u9R.js} +1 -1
- package/dist/client/assets/{monaco-editor-4zJKgWND.js → monaco-editor-Bv0pswaY.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Ckcrs5bU.js → monitoring-stats-row-DoWoTeso.js} +1 -1
- package/dist/client/assets/{oauth-callback-C1wSOpSi.js → oauth-callback-DGjiNPsS.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CIslKnkJ.js → oauth-callback-ai-provider-DYRECTwL.js} +1 -1
- package/dist/client/assets/{onboarding-DzOFbPHY.js → onboarding-C7TvS-L4.js} +1 -1
- package/dist/client/assets/{org-install-DkWUqjZM.js → org-install-DvtnrEoj.js} +1 -1
- package/dist/client/assets/{org-layout-D9qKjB7L.js → org-layout-BY4k6lQj.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-CQA5014y.js → org-plugin-layout-w9tADobq.js} +1 -1
- package/dist/client/assets/{page-seo-form-CCHdZJVC.js → page-seo-form-PX4CZBRs.js} +1 -1
- package/dist/client/assets/page-seo-sheet-D8HJkZue.js +1 -0
- package/dist/client/assets/{pair-DbyXobZ6.js → pair-Cy-O7asH.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-ClBAOxte.js → plugin-empty-state-DzXKOwMS.js} +1 -1
- package/dist/client/assets/{plugin-header-0fc0DfDo.js → plugin-header-BY57uep0.js} +1 -1
- package/dist/client/assets/{plugin-layout-CQ-ZS4on.js → plugin-layout-DBohmMr9.js} +1 -1
- package/dist/client/assets/{popover-BpkFIRrC.js → popover-GeFr7_oh.js} +1 -1
- package/dist/client/assets/{post-editor-B4qR5gjS.js → post-editor-BgHRwT3m.js} +1 -1
- package/dist/client/assets/{primitives-C0xseebZ.js → primitives-CHABHDzo.js} +1 -1
- package/dist/client/assets/{profile-j_YIrPxD.js → profile-CxJLSwNL.js} +1 -1
- package/dist/client/assets/project-app-view-C26ekkbZ.js +1 -0
- package/dist/client/assets/record-editor-CZuj7q7z.js +1 -0
- package/dist/client/assets/registry-B1bxOGSs.js +2 -0
- package/dist/client/assets/{registry-layout-DVn6I6vz.js → registry-layout-BWwixiAa.js} +1 -1
- package/dist/client/assets/{require-capability-DfrpjX-u.js → require-capability-DXLg9oHp.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D-bn_J69.js → required-auth-layout-C09G6Jq4.js} +1 -1
- package/dist/client/assets/{reset-password-CiNms6Sr.js → reset-password-s5NRCTho.js} +1 -1
- package/dist/client/assets/{resizable-v_bPD4vg.js → resizable-Dgkt9WLc.js} +1 -1
- package/dist/client/assets/{roles-A-J3RPs5.js → roles-D3XFw9FM.js} +1 -1
- package/dist/client/assets/{save-status-caXPf-sW.js → save-status-C5Jrjm-8.js} +1 -1
- package/dist/client/assets/{schema-form-OP25FipI.js → schema-form-xHOniAgD.js} +1 -1
- package/dist/client/assets/{scroll-area-DfF1DGTO.js → scroll-area-CoDX1NiP.js} +1 -1
- package/dist/client/assets/{search-input-D2vapx7T.js → search-input-C792V54k.js} +1 -1
- package/dist/client/assets/{secrets-D9MKTymT.js → secrets-CilUvwZC.js} +1 -1
- package/dist/client/assets/{sections-editor-7GVJxDWw.js → sections-editor-OXCx9TpZ.js} +1 -1
- package/dist/client/assets/{select-D6NiWcOv.js → select-DctRFe2b.js} +1 -1
- package/dist/client/assets/{select-model-TEFtvtVK.js → select-model-Hf7hJQdT.js} +1 -1
- package/dist/client/assets/{seo-editor-CxuXRBUg.js → seo-editor-irqINDWO.js} +1 -1
- package/dist/client/assets/settings-layout-Bqje-A1l.js +1 -0
- package/dist/client/assets/{settings-section-BhG1oXRm.js → settings-section-BjN2myxJ.js} +1 -1
- package/dist/client/assets/{sheet-CA-bu41g.js → sheet-B47SStDa.js} +1 -1
- package/dist/client/assets/{shell-controls-_xZFFXXO.js → shell-controls-R9HXFbSX.js} +1 -1
- package/dist/client/assets/{shell-layout-BJmtvdOF.js → shell-layout-BdfarDBD.js} +1 -1
- package/dist/client/assets/shell-route-loading-D4bOkWJX.js +1 -0
- package/dist/client/assets/{sidebar-MAITYPYL.js → sidebar-B-1Eb4CM.js} +1 -1
- package/dist/client/assets/{skeleton-B3z9RhFw.js → skeleton-Bd8kPi36.js} +1 -1
- package/dist/client/assets/{sortable.esm-ChXSQgk4.js → sortable.esm-D-dVzWNK.js} +1 -1
- package/dist/client/assets/{spinner-u4N4s9Z6.js → spinner-wrYa3rBM.js} +1 -1
- package/dist/client/assets/{sso-QXpS_be1.js → sso-BSn_LV78.js} +1 -1
- package/dist/client/assets/{store-D0VBS3Tx.js → store-8q_XO9PM.js} +1 -1
- package/dist/client/assets/store-registry-DmJ93Lqq.js +2 -0
- package/dist/client/assets/{switch-B-X7IR6_.js → switch-CAxQPLyA.js} +1 -1
- package/dist/client/assets/{tab-id-D4XtWZcv.js → tab-id-B-kIZoBW.js} +1 -1
- package/dist/client/assets/{table-CUgkm7T_.js → table-2TvOOTyl.js} +1 -1
- package/dist/client/assets/{tabs-CxIIMzaj.js → tabs-DW34WfdD.js} +1 -1
- package/dist/client/assets/{task-status-4rr9cZ7d.js → task-status-Cxhenjjq.js} +1 -1
- package/dist/client/assets/{textarea-AHMya-Yu.js → textarea-BI2lwl3S.js} +1 -1
- package/dist/client/assets/{toggle-group-B_TX0y3P.js → toggle-group-C8HVaLZk.js} +1 -1
- package/dist/client/assets/{toolbar-BNPhEiqF.js → toolbar-FfjyIkw0.js} +1 -1
- package/dist/client/assets/{tools-list-ASCoS6LU.js → tools-list-D7MOIvdE.js} +1 -1
- package/dist/client/assets/{tooltip-VoacnTKM.js → tooltip-B5fnRxsz.js} +1 -1
- package/dist/client/assets/{types-DGaPEJ11.js → types-B5c8nvjk.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B08Dfztq.js → use-ai-providers-C_IYHgI4.js} +1 -1
- package/dist/client/assets/{use-automations-D6JWA2qr.js → use-automations-YduxJQuL.js} +1 -1
- package/dist/client/assets/{use-capability-CD7uDLwB.js → use-capability-0eHJrBnH.js} +1 -1
- package/dist/client/assets/{use-collections-DEYzPSLv.js → use-collections-BEXrnaW6.js} +1 -1
- package/dist/client/assets/{use-connection-DY59WvYT.js → use-connection-HsaENIHj.js} +1 -1
- package/dist/client/assets/{use-copy-DAGbC1GA.js → use-copy-W4IazqW3.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BXxjk7k6.js → use-create-virtual-mcp-CW8Va3LD.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BOriK1WA.js → use-debounced-autosave-DueSHS3l.js} +1 -1
- package/dist/client/assets/{use-delete-connection-wvPOAsuG.js → use-delete-connection-Jz5LwIOm.js} +1 -1
- package/dist/client/assets/{use-file-configs-c_8gPz9N.js → use-file-configs-BWQSu2CQ.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-2beLt-Er.js → use-infinite-scroll-DIgKhwnF.js} +1 -1
- package/dist/client/assets/{use-list-state-ZOMnKb9E.js → use-list-state-DxdeZHyY.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Z9l1A0Zz.js → use-mcp-prompts-CtFkmDVc.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Da-abucn.js → use-mcp-tools-CpjckPZ3.js} +1 -1
- package/dist/client/assets/{use-members-BbxKUa81.js → use-members-Bq_2zcti.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D4fCB-ku.js → use-navigate-to-agent-BuiMoyxW.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-D8pwkohW.js → use-org-auth-client-CIxt5K02.js} +1 -1
- package/dist/client/assets/{use-org-sso-Z-KrfZMw.js → use-org-sso-BSILZLbv.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BPbcrovc.js → use-organization-roles-Dig47H0y.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DK19F2g9.js → use-organization-settings-B5ihCN3e.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BT5RIBa1.js → use-registry-connections-BfE1grR0.js} +1 -1
- package/dist/client/assets/{use-secrets-HKPmUn7b.js → use-secrets-C4jjXpkz.js} +1 -1
- package/dist/client/assets/{use-status-sounds-bkoIBdSr.js → use-status-sounds-BrsDTW7t.js} +1 -1
- package/dist/client/assets/{use-view-mode-DTI3AORs.js → use-view-mode-C2SE3DWk.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C0J6vZOy.js → use-virtual-mcp-DsQdohZI.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DzyeLTn8.js +1 -0
- package/dist/client/assets/{useRouterState-BpN6uFWZ.js → useRouterState-B3abCKb4.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cny-Kgzr.js +1 -0
- package/dist/client/assets/{user-DICnku4_.js → user-BM0cs7af.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CbsM9RpS.js → view-mode-toggle-e3EYesO4.js} +1 -1
- package/dist/client/assets/{workflow-3MM_iKc4.js → workflow-BKpQCgPs.js} +1 -1
- package/dist/client/assets/workflow-detail-CFNmXb4a.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +413 -407
- package/dist/server/server.js +283 -277
- package/package.json +1 -1
- package/dist/client/assets/app-editor-eVQHoVzV.js +0 -1
- package/dist/client/assets/page-seo-sheet-muZrfYn9.js +0 -1
- package/dist/client/assets/project-app-view-BIOfOBLG.js +0 -1
- package/dist/client/assets/record-editor-DF21NWvv.js +0 -1
- package/dist/client/assets/registry-BiWmGi9J.js +0 -2
- package/dist/client/assets/settings-layout-q8E9c9E2.js +0 -1
- package/dist/client/assets/shell-route-loading-kYHtFyzE.js +0 -1
- package/dist/client/assets/store-registry-xnI7S9bB.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BYU0zu4v.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CsscVl3c.js +0 -1
- package/dist/client/assets/workflow-detail-Nu0x63kt.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as P,aU as Qe,e as W,j as s,T as Te,W as re,q as le,G as fe,I as ze,H as Re,a as de,K as te,o as Q,B as ee,t as X,u as Je,c as ue,n as Ze,f as et,E as tt,v as st}from"./index-
|
|
1
|
+
import{r as P,aU as Qe,e as W,j as s,T as Te,W as re,q as le,G as fe,I as ze,H as Re,a as de,K as te,o as Q,B as ee,t as X,u as Je,c as ue,n as Ze,f as et,E as tt,v as st}from"./index-zyABZOuD.js";import{C as it}from"./checkbox-iBP5ppXv.js";import{I as ne}from"./input-CDcrM9F5.js";import{d as nt,S as lt,a as ot,b as rt,c as at}from"./select-DctRFe2b.js";import{S as q}from"./skeleton-Bd8kPi36.js";import{a as Le,i as Pe,b as ct,s as dt}from"./RefreshCcw01-CFdSHPj-.js";import{b as ut,a as mt,c as ht,d as ft}from"./Tool01-W8F7AzYr.js";import{i as pt}from"./Key01-PpEZMCXn.js";import{i as $e}from"./SearchMd-M3oAe2yo.js";import{a as xt}from"./Settings02-FDGyPWfA.js";import{c as pe,u as gt,b as vt}from"./use-ai-providers-C_IYHgI4.js";import{u as bt,c as yt}from"./chat-context-yFtmoeub.js";import{g as xe}from"./ai-providers-logos-DD3qZ33J.js";import{i as jt}from"./Monitor01-659PEtN5.js";import{i as St}from"./AlertCircle-BPLBHL4z.js";import{d as Fe,D as Nt,a as kt,b as wt,c as _t,e as Ct}from"./dialog-B109gCE4.js";import{S as be}from"./spinner-wrYa3rBM.js";import{S as me,u as he}from"./constants-CwxhhJva.js";import{i as It}from"./ChevronRight-vQ97Lphi.js";import{A as Mt}from"./avatar-D24kACpT.js";import{S as ye,a as je,b as Ke}from"./settings-section-BjN2myxJ.js";import{s as De}from"./Eye-CouYr8Kp.js";import{u as Et}from"./unwrap-tool-result-BYXdCQMg.js";import{C as Ot}from"./connect-desktop-dialog-mw47OvUe.js";import{t as Se}from"./ChevronDown-DmPW0EFR.js";import{t as At}from"./Stars01-DwRIvNMi.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const p=i();if(!(p.length!==n.length||p.some((v,g)=>n[g]!==v)))return l;n=p;let h;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(h=Date.now()),l=e(...p),t.key&&((d=t.debug)!=null&&d.call(t))){const v=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-h)*100)/100,S=g/16,j=(w,_)=>{for(w=String(w);w.length<_;)w=" "+w;return w};console.info(`%c⏱ ${j(g,5)} /${j(v,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(l),o=!1,l}return r.updateDeps=a=>{n=a},r}function Ne(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Tt=(i,e)=>Math.abs(i-e)<1.01,zt=(i,e,t)=>{let n;return function(...l){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,l),t)}},ke=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Rt=i=>i,Lt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let l=e;l<=t;l++)n.push(l);return n},Pt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const l=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(l(ke(t)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){l({width:d.inlineSize,height:d.blockSize});return}}l(ke(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},we={passive:!0},_e=typeof window>"u"?!0:"onscrollend"in window,$t=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let l=0;const o=i.options.useScrollendEvent&&_e?()=>{}:zt(n,()=>{e(l,!1)},i.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:p,isRtl:f}=i.options;l=p?t.scrollLeft*(f&&-1||1):t.scrollTop,o(),e(l,u)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,we);const d=i.options.useScrollendEvent&&_e;return d&&t.addEventListener("scrollend",c,we),()=>{t.removeEventListener("scroll",a),d&&t.removeEventListener("scrollend",c)}},Ft=(i,e,t)=>{if(e?.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Kt=(i,{adjustments:e=0,behavior:t},n)=>{var l,o;const r=i+e;(o=(l=n.scrollElement)==null?void 0:l.scrollTo)==null||o.call(l,{[n.options.horizontal?"left":"top"]:r,behavior:t})};class Dt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,n,l;return((l=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:l.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(l=>{l.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var l;(l=n())==null||l.disconnect(),t=null},observe:l=>{var o;return(o=n())==null?void 0:o.observe(l,{box:"border-box"})},unobserve:l=>{var o;return(o=n())==null?void 0:o.unobserve(l)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,l])=>{typeof l>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Rt,rangeExtractor:Lt,onChange:()=>{},measureElement:Ft,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var n,l;(l=(n=this.options).onChange)==null||l.call(n,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const l=new Map,o=new Map;for(let r=n-1;r>=0;r--){const a=t[r];if(l.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&l.set(a.lane,!0),l.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,n,l,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const h of this.laneAssignments.keys())h>=t&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,u),f=new Array(a).fill(void 0);for(let h=0;h<u;h++){const v=p[h];v&&(f[v.lane]=h)}for(let h=u;h<t;h++){const v=o(h),g=this.laneAssignments.get(h);let S,j;const w=c==="estimate"||d.has(v);if(g!==void 0&&this.options.lanes>1){S=g;const x=f[S],N=x!==void 0?p[x]:void 0;j=N?N.end+this.options.gap:n+l}else{const x=this.options.lanes===1?p[h-1]:this.getFurthestMeasurement(p,h);j=x?x.end+this.options.gap:n+l,S=x?x.lane:h%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(h,S)}const _=d.get(v),k=typeof _=="number"?_:this.options.estimateSize(h),T=j+k;p[h]={index:h,start:j,size:k,end:T,key:v,lane:S},f[S]=h}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,l,o)=>this.range=t.length>0&&n>0?Ut({measurements:t,outerSize:n,scrollOffset:l,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,n=null;const l=this.calculateRange();return l&&(t=l.startIndex,n=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,l,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:n,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,l=t.getAttribute(n);return l?parseInt(l,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const l=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(l!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,l-o),a=Math.min(this.options.count-1,l+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const n=this.indexFromElement(t),l=this.options.getItemKey(n),o=this.elementsCache.get(l);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(l,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var l;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=n-r;a!==0&&(((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const l=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=n[a];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return Ne(n[Ue(0,n.length-1,l=>Ne(n[l]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,n,l=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=t>=r+o?"end":"start"),n==="center"?t+=(l-o)/2:n==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(n==="auto")if(r.end>=o+l-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const a=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,r.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:l="auto"}={})=>{const o=this.getOffsetForAlignment(t,n),r=this.now();this.scrollState={index:null,align:n,behavior:l,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:l="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,n);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:l,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const l=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:o,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let l;if(n.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((t=n[n.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&o.some(a=>a===null);){const a=n[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}l=Math.max(...o.filter(a=>a!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:l})=>{this.options.scrollToFn(t,{behavior:l,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,l=n?n[0]:this.scrollState.lastTargetOffset,o=1,r=l!==this.scrollState.lastTargetOffset;if(!r&&Tt(l,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=l,this.scrollState.behavior="auto",this._scrollToOffset(l,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ue=(i,e,t,n)=>{for(;i<=e;){const l=(i+e)/2|0,o=t(l);if(o<n)i=l+1;else if(o>n)e=l-1;else return l}return i>0?i-1:0};function Ut({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const l=i.length-1,o=c=>i[c].start;if(i.length<=n)return{startIndex:0,endIndex:l};let r=Ue(0,l,o,t),a=r;if(n===1)for(;a<l&&i[a].end<t+e;)a++;else if(n>1){const c=Array(n).fill(0);for(;a<l&&c.some(u=>u<t+e);){const u=i[a];c[u.lane]=u.end,a++}const d=Array(n).fill(t+e);for(;r>=0&&d.some(u=>u>=t);){const u=i[r];d[u.lane]=u.start,r--}r=Math.max(0,r-r%n),a=Math.min(l,a+(n-1-a%n))}return{startIndex:r,endIndex:a}}const Ce=typeof document<"u"?P.useLayoutEffect:P.useEffect;function Bt({useFlushSync:i=!0,...e}){const t=P.useReducer(()=>({}),{})[1],n={...e,onChange:(o,r)=>{var a;i&&r?Qe.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[l]=P.useState(()=>new Dt(n));return l.setOptions(n),Ce(()=>l._didMount(),[]),Ce(()=>l._willUpdate()),l}function Wt(i){return Bt({observeElementRect:Pt,observeElementOffset:$t,scrollToFn:Kt,...i})}const ae=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function Ie(i){if(i)return ae.find(e=>e.id===i)}const Me=4;function oe(i){const e=W.c(8),{logo:t,name:n,description:l,onClick:o}=i;let r;e[0]!==t||e[1]!==n?(r=t?s.jsx("img",{src:t,alt:n,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Mt,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=n,e[2]=r):r=e[2];let a;return e[3]!==l||e[4]!==n||e[5]!==o||e[6]!==r?(a=s.jsx(Ke,{onClick:o,icon:r,title:n,description:l}),e[3]=l,e[4]=n,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function Be(i){const e=W.c(32),{providers:t,onSelect:n,onShowAll:l}=i;let o;e[0]!==t?(o=t.find(Yt),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,anthropic:1,google:2},e[2]=a):a=e[2];const c=a;let d;if(e[3]!==n||e[4]!==t){let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=(b,A)=>{const M=c[b.id]??Number.MAX_SAFE_INTEGER,O=c[A.id]??Number.MAX_SAFE_INTEGER;return M-O},e[6]=_):_=e[6];const k=t.filter(Gt).sort(_);let T;e[7]!==t?(T=t.find(qt),e[7]=t,e[8]=T):T=e[8];const x=T;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=ae.find(Ht),e[9]=N):N=e[9];const C=N;let I;e[10]!==n?(I=b=>s.jsx(oe,{logo:b.logo,name:b.name,description:b.description,onClick:()=>n({kind:"provider",provider:b})},b.id),e[10]=n,e[11]=I):I=e[11];let m,y;e[12]!==n||e[13]!==x?(m=x&&C?[s.jsx(oe,{logo:C.logo,name:C.name,description:C.description,onClick:()=>n({kind:"openai-compatible",provider:x,preset:C})},C.id)]:[],y=x?[...ae.filter(Vt).map(b=>s.jsx(oe,{logo:b.logo,name:b.name,description:b.description,onClick:()=>n({kind:"openai-compatible",provider:x,preset:b})},b.id)),s.jsx(oe,{logo:x.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>n({kind:"openai-compatible",provider:x,preset:null})},"custom")]:[],e[12]=n,e[13]=x,e[14]=m,e[15]=y):(m=e[14],y=e[15]),d=[...k.map(I),...m,...y],e[3]=n,e[4]=t,e[5]=d}else d=e[5];const u=d,p=u.length-Me,f=!!l&&p>0;let h;e[16]!==u||e[17]!==f?(h=f?u.slice(0,Me):u,e[16]=u,e[17]=f,e[18]=h):h=e[18];const v=h;let g;e[19]!==r||e[20]!==n?(g=r&&s.jsx(ye,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(je,{className:"relative",children:s.jsx(oe,{logo:r.logo,name:r.name,description:r.description,onClick:()=>n({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=n,e[21]=g):g=e[21];let S;e[22]!==p||e[23]!==l||e[24]!==f?(S=f&&s.jsx(Ke,{onClick:l,title:`${p} more provider${p===1?"":"s"}`,action:s.jsx(It,{size:16,className:"text-muted-foreground"})}),e[22]=p,e[23]=l,e[24]=f,e[25]=S):S=e[25];let j;e[26]!==S||e[27]!==v?(j=s.jsx(ye,{children:s.jsxs(je,{children:[v,S]})}),e[26]=S,e[27]=v,e[28]=j):j=e[28];let w;return e[29]!==g||e[30]!==j?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[g,j]}),e[29]=g,e[30]=j,e[31]=w):w=e[31],w}function Vt(i){return i.id!=="openai"}function Ht(i){return i.id==="openai"}function qt(i){return i.id==="openai-compatible"}function Gt(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function Yt(i){return i.id==="deco"}const Xt=Te({label:re().optional(),apiKey:re().min(1,"API key is required")});function Qt(i){const e=W.c(62),{providerId:t,onCancel:n,onSuccess:l}=i,{org:o}=le();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:me,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=he(r),c=fe(),[d,u]=P.useState(!1);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={resolver:ze(Xt),defaultValues:{label:"",apiKey:""}},e[3]=p):p=e[3];const{register:f,handleSubmit:h,formState:v}=Re(p),{errors:g}=v;let S;e[4]!==a||e[5]!==t?(S=async H=>{await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:t,label:H.label||"Personal key",apiKey:H.apiKey}})},e[4]=a,e[5]=t,e[6]=S):S=e[6];let j;e[7]!==l||e[8]!==o.id||e[9]!==c?(j=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:te.aiProviders(o.id)}),Q.success("Key saved successfully"),l()},e[7]=l,e[8]=o.id,e[9]=c,e[10]=j):j=e[10];let w;e[11]!==S||e[12]!==j?(w={mutationFn:S,onSuccess:j,onError:Jt},e[11]=S,e[12]=j,e[13]=w):w=e[13];const{mutate:_,isPending:k,error:T}=de(w);let x;e[14]!==_?(x=H=>_(H),e[14]=_,e[15]=x):x=e[15];let N;e[16]!==h||e[17]!==x?(N=h(x),e[16]=h,e[17]=x,e[18]=N):N=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[19]=C):C=e[19];let I;e[20]!==f?(I=f("label"),e[20]=f,e[21]=I):I=e[21];let m;e[22]!==I?(m=s.jsxs("div",{className:"space-y-1",children:[C,s.jsx(ne,{placeholder:"e.g. Personal key",...I,className:"h-8 text-sm"})]}),e[22]=I,e[23]=m):m=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[24]=y):y=e[24];const b=d?"text":"password";let A;e[25]!==f?(A=f("apiKey"),e[25]=f,e[26]=A):A=e[26];let M;e[27]!==b||e[28]!==A?(M=s.jsx(ne,{type:b,placeholder:"sk-...",...A,className:"ph-no-capture h-8 text-sm pr-8"}),e[27]=b,e[28]=A,e[29]=M):M=e[29];let O;e[30]!==d?(O=()=>u(!d),e[30]=d,e[31]=O):O=e[31];let z;e[32]!==d?(z=d?s.jsx(Le,{size:14}):s.jsx(De,{size:14}),e[32]=d,e[33]=z):z=e[33];let F;e[34]!==O||e[35]!==z?(F=s.jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:z}),e[34]=O,e[35]=z,e[36]=F):F=e[36];let B;e[37]!==M||e[38]!==F?(B=s.jsxs("div",{className:"relative",children:[M,F]}),e[37]=M,e[38]=F,e[39]=B):B=e[39];let R;e[40]!==g.apiKey?(R=g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message}),e[40]=g.apiKey,e[41]=R):R=e[41];let K;e[42]!==B||e[43]!==R?(K=s.jsxs("div",{className:"space-y-1",children:[y,B,R]}),e[42]=B,e[43]=R,e[44]=K):K=e[44];let $;e[45]!==T?($=T&&s.jsx("p",{className:"text-xs text-destructive",children:T.message}),e[45]=T,e[46]=$):$=e[46];let D;e[47]!==k||e[48]!==n?(D=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:k,children:"Cancel"}),e[47]=k,e[48]=n,e[49]=D):D=e[49];const V=k?"Saving...":"Save Key";let L;e[50]!==k||e[51]!==V?(L=s.jsx(ee,{type:"submit",size:"sm",disabled:k,children:V}),e[50]=k,e[51]=V,e[52]=L):L=e[52];let U;e[53]!==D||e[54]!==L?(U=s.jsxs(Fe,{children:[D,L]}),e[53]=D,e[54]=L,e[55]=U):U=e[55];let E;return e[56]!==m||e[57]!==K||e[58]!==$||e[59]!==U||e[60]!==N?(E=s.jsxs("form",{onSubmit:N,className:"space-y-3",children:[m,K,$,U]}),e[56]=m,e[57]=K,e[58]=$,e[59]=U,e[60]=N,e[61]=E):E=e[61],E}function Jt(i){Q.error(`Failed to save key: ${i.message}`)}const Zt=Te({label:re().optional(),baseUrl:re().min(1,"Base URL is required"),apiKey:re().optional()});function es(i){const e=W.c(73),{preset:t,onCancel:n,onSuccess:l}=i,{org:o}=le();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:me,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=he(r),c=fe(),[d,u]=P.useState(!1);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=ze(Zt),e[3]=p):p=e[3];const f=t?.defaultBaseUrl??"";let h;e[4]!==f?(h={resolver:p,defaultValues:{label:"",baseUrl:f,apiKey:""}},e[4]=f,e[5]=h):h=e[5];const{register:v,handleSubmit:g,formState:S}=Re(h),{errors:j}=S;let w;e[6]!==a||e[7]!==t?(w=async se=>{const Xe=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:Xe,...t?{presetId:t.id}:{}}})},e[6]=a,e[7]=t,e[8]=w):w=e[8];let _;e[9]!==l||e[10]!==o.id||e[11]!==c?(_=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:te.aiProviders(o.id)}),Q.success("Connection saved successfully"),l()},e[9]=l,e[10]=o.id,e[11]=c,e[12]=_):_=e[12];let k;e[13]!==w||e[14]!==_?(k={mutationFn:w,onSuccess:_,onError:ts},e[13]=w,e[14]=_,e[15]=k):k=e[15];const{mutate:T,isPending:x,error:N}=de(k),C=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",I=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let m;e[16]!==T?(m=se=>T(se),e[16]=T,e[17]=m):m=e[17];let y;e[18]!==g||e[19]!==m?(y=g(m),e[18]=g,e[19]=m,e[20]=y):y=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[21]=b):b=e[21];let A;e[22]!==v?(A=v("label"),e[22]=v,e[23]=A):A=e[23];let M;e[24]!==C||e[25]!==A?(M=s.jsxs("div",{className:"space-y-1",children:[b,s.jsx(ne,{placeholder:C,...A,className:"h-8 text-sm"})]}),e[24]=C,e[25]=A,e[26]=M):M=e[26];let O;e[27]!==I||e[28]!==j||e[29]!==t?.defaultBaseUrl||e[30]!==v?(O=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...v("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ne,{type:"url",placeholder:I,...v("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[27]=I,e[28]=j,e[29]=t?.defaultBaseUrl,e[30]=v,e[31]=O):O=e[31];const z=t?.apiKeyRecommended?"recommended":"optional";let F;e[32]!==z?(F=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[32]=z,e[33]=F):F=e[33];const B=d?"text":"password";let R;e[34]!==v?(R=v("apiKey"),e[34]=v,e[35]=R):R=e[35];let K;e[36]!==B||e[37]!==R?(K=s.jsx(ne,{type:B,placeholder:"sk-...",...R,className:"ph-no-capture h-8 text-sm pr-8"}),e[36]=B,e[37]=R,e[38]=K):K=e[38];let $;e[39]!==d?($=()=>u(!d),e[39]=d,e[40]=$):$=e[40];let D;e[41]!==d?(D=d?s.jsx(Le,{size:14}):s.jsx(De,{size:14}),e[41]=d,e[42]=D):D=e[42];let V;e[43]!==$||e[44]!==D?(V=s.jsx("button",{type:"button",onClick:$,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:D}),e[43]=$,e[44]=D,e[45]=V):V=e[45];let L;e[46]!==K||e[47]!==V?(L=s.jsxs("div",{className:"relative",children:[K,V]}),e[46]=K,e[47]=V,e[48]=L):L=e[48];let U;e[49]!==F||e[50]!==L?(U=s.jsxs("div",{className:"space-y-1",children:[F,L]}),e[49]=F,e[50]=L,e[51]=U):U=e[51];let E;e[52]!==t?(E=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[52]=t,e[53]=E):E=e[53];let H;e[54]!==N?(H=N&&s.jsx("p",{className:"text-xs text-destructive",children:N.message}),e[54]=N,e[55]=H):H=e[55];let G;e[56]!==x||e[57]!==n?(G=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:x,children:"Cancel"}),e[56]=x,e[57]=n,e[58]=G):G=e[58];const J=x?"Saving...":"Save Connection";let Y;e[59]!==x||e[60]!==J?(Y=s.jsx(ee,{type:"submit",size:"sm",disabled:x,children:J}),e[59]=x,e[60]=J,e[61]=Y):Y=e[61];let Z;e[62]!==G||e[63]!==Y?(Z=s.jsxs(Fe,{children:[G,Y]}),e[62]=G,e[63]=Y,e[64]=Z):Z=e[64];let ce;return e[65]!==y||e[66]!==M||e[67]!==O||e[68]!==U||e[69]!==E||e[70]!==H||e[71]!==Z?(ce=s.jsxs("form",{onSubmit:y,className:"space-y-3",children:[M,O,U,E,H,Z]}),e[65]=y,e[66]=M,e[67]=O,e[68]=U,e[69]=E,e[70]=H,e[71]=Z,e[72]=ce):ce=e[72],ce}function ts(i){Q.error(`Failed to save connection: ${i.message}`)}const ss={kind:"closed"};function is(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function ns(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ls({open:i,onOpenChange:e,initialProvider:t}){const l=pe()?.providers??[],{org:o}=le(),r=he({connectionId:me,orgId:o.id,orgSlug:o.slug}),a=fe(),[c,d]=P.useReducer(is,ss),u=P.useRef(!1);P.useEffect(()=>{i&&c.kind==="closed"?d({type:"open"}):!i&&c.kind!=="closed"&&d({type:"close"})},[i,c.kind]);const p=()=>{u.current=!1,d({type:"close"}),e(!1)},f=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)})},{mutate:h}=de({mutationFn:async({providerId:m,code:y,stateToken:b,label:A})=>{const M=await r.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:m,code:y,stateToken:b,label:A}});if(M?.isError)throw new Error(M.content?.[0]?.text??"OAuth exchange failed");return m},onSuccess:m=>{X("ai_provider_oauth_succeeded",{provider_id:m}),f();const y=l.find(b=>b.id===m);Q.success(`${y?.name??"Provider"} connected successfully`),p()},onError:(m,y)=>{X("ai_provider_oauth_failed",{provider_id:y.providerId,error:m.message}),Q.error(`OAuth connection failed: ${m.message}`),d({type:"oauth-failed"})}}),{mutate:v}=de({mutationFn:async m=>{const y=await r.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:m}});if(y?.isError)throw new Error(y.content?.[0]?.text??"Key provisioning failed");return m},onSuccess:m=>{X("ai_provider_provision_succeeded",{provider_id:m}),f();const y=l.find(b=>b.id===m);Q.success(`${y?.name??"Provider"} connected successfully`),p()},onError:(m,y)=>{X("ai_provider_provision_failed",{provider_id:y,error:m.message}),d({type:"provision-error",error:m.message})}}),g=async m=>{const{provider:y}=m,b=m.kind==="openai-compatible"?m.preset?.id??null:null,A=y.supportedMethods.includes("oauth-pkce"),M=y.supportedMethods.includes("api-key");if(y.supportsProvision===!0){X("ai_provider_connect_clicked",{provider_id:y.id,method:"provision"}),d({type:"select-provision",providerId:y.id}),v(y.id);return}if(A){X("ai_provider_connect_clicked",{provider_id:y.id,method:"oauth-pkce"});try{const z=await r.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:y.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(!z.structuredContent)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");d({type:"select-oauth",providerId:y.id,stateToken:z.structuredContent.stateToken}),window.open(z.structuredContent.url,"AiProviderOAuth","width=600,height=700")}catch(z){Q.error(`Failed to start OAuth: ${z instanceof Error?z.message:String(z)}`)}return}M&&(X("ai_provider_connect_clicked",{provider_id:y.id,...b!==null?{preset_id:b}:{},method:"api-key"}),d({type:"select-form",providerId:y.id,presetId:b}))},S=P.useRef(g);S.current=g;const j=P.useRef(t);j.current=t,P.useEffect(()=>{!j.current||c.kind!=="grid"||u.current||(u.current=!0,S.current(j.current))},[c.kind]);const w=c.kind==="oauth-pending"?c.stateToken:null,_=c.kind==="oauth-pending"?c.providerId:null;P.useEffect(()=>{if(c.kind!=="oauth-pending")return;let m=!1;const y=c.stateToken,b=c.providerId,A=O=>{if(O.origin!==window.location.origin||O.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:z,stateToken:F}=O.data;if(F!==y){Q.error("Security check failed: State token mismatch"),d({type:"oauth-failed"});return}m=!0;const B=l.find(R=>R.id===b);h({providerId:b,code:z,stateToken:y,label:B?.name??b})};window.addEventListener("message",A);const M=setTimeout(()=>{m||(X("ai_provider_oauth_timeout",{provider_id:b}),d({type:"oauth-failed"}),Q.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",A),clearTimeout(M)}},[c.kind,w,_,h]);const k=ns(c),T=k?l.find(m=>m.id===k):null,N=(c.kind==="form"&&c.presetId?ae.find(m=>m.id===c.presetId):null)?.name??T?.name??"Connect an AI provider",C=c.kind!=="grid"&&c.kind!=="closed",I=()=>{t?p():d({type:"back"})};return s.jsx(Nt,{open:c.kind!=="closed",onOpenChange:m=>!m&&p(),children:s.jsxs(kt,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(wt,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[C&&s.jsx(ee,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:I,children:s.jsx(Pe,{size:16})}),s.jsx(_t,{children:N})]}),c.kind==="grid"&&!t&&s.jsx(Ct,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(Be,{providers:l,onSelect:g}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(es,{preset:c.presetId?ae.find(m=>m.id===c.presetId):void 0,onCancel:()=>d({type:"back"}),onSuccess:()=>{f(),p()}}):s.jsx(Qt,{providerId:c.providerId,onCancel:()=>d({type:"back"}),onSuccess:()=>{f(),p()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(be,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(be,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(St,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>d({type:"back"}),children:"Back"}),s.jsx(ee,{size:"sm",onClick:()=>{d({type:"retry-provision"}),v(c.providerId)},children:"Retry"})]})]})]})})}function os(){const i=W.c(10),{org:e}=le();let t;i[0]!==e.id||i[1]!==e.slug?(t={connectionId:me,orgId:e.id,orgSlug:e.slug},i[0]=e.id,i[1]=e.slug,i[2]=t):t=i[2];const n=he(t);let l;i[3]!==e.id?(l=te.defaultBrand(e.id),i[3]=e.id,i[4]=l):l=i[4];let o;i[5]!==n?(o=async()=>{const c=await n.callTool({name:"BRAND_CONTEXT_LIST",arguments:{}}),d=Et(c);return(Array.isArray(d?.items)?d.items:[]).find(rs)??null},i[5]=n,i[6]=o):o=i[6];let r;i[7]!==l||i[8]!==o?(r={queryKey:l,queryFn:o},i[7]=l,i[8]=o,i[9]=r):r=i[9];const{data:a}=Ze(r);return a??null}function rs(i){return i.isDefault&&!i.archivedAt}function as(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(l=>typeof l=="object"&&l!==null&&"label"in l&&/primary|brand|main/i.test(l.label)),n=t?t.value:e[0]?.value;return typeof n=="string"?n:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function cs(i){const e=W.c(39);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:n,description:l}=t,{org:o}=le(),{localMode:r}=Je(),a=os(),c=bt(),[d,u]=P.useState(null),[p,f]=P.useState(!1),[h,v]=P.useState(!1),g=pe();let S;e[2]!==g?.providers?(S=g?.providers??[],e[2]=g?.providers,e[3]=S):S=e[3];const j=S,w=o.name;let _;e[4]!==a?(_=a?as(a):null,e[4]=a,e[5]=_):_=e[5];const k=_,T=a?.favicon??a?.logo??null,x=n??(w?`${w} is ready for agents`:"Your agents are almost ready"),N=l??(r?"Connect a provider, or run `bunx decocms link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms link` on your desktop to use Claude Code, Codex, or your local files."),C=!!(T||k);let I;e[6]!==k?(I=k?{backgroundColor:`${k}18`,borderColor:`${k}30`}:void 0,e[6]=k,e[7]=I):I=e[7];const m=I,y=C?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let b;e[8]!==y||e[9]!==m||e[10]!==T||e[11]!==c||e[12]!==k?(b=T?s.jsx("div",{className:y,style:m,children:s.jsx("img",{src:T,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>v(!0),"aria-label":c.online?"Desktop linked":"Connect your desktop",className:ue(y,"cursor-pointer transition-colors hover:bg-accent"),style:m,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(jt,{size:24,style:k?{color:k}:void 0,className:ue(!k&&"text-muted-foreground")}),c.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[8]=y,e[9]=m,e[10]=T,e[11]=c,e[12]=k,e[13]=b):b=e[13];let A;e[14]!==x?(A=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:x}),e[14]=x,e[15]=A):A=e[15];let M;e[16]!==N?(M=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:N}),e[16]=N,e[17]=M):M=e[17];let O;e[18]!==A||e[19]!==M?(O=s.jsxs("div",{className:"space-y-2",children:[A,M]}),e[18]=A,e[19]=M,e[20]=O):O=e[20];let z;e[21]!==b||e[22]!==O?(z=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[b,O]}),e[21]=b,e[22]=O,e[23]=z):z=e[23];let F,B;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=E=>u(E),B=()=>f(!0),e[24]=F,e[25]=B):(F=e[24],B=e[25]);let R;e[26]!==j?(R=s.jsx("div",{className:"w-full",children:s.jsx(Be,{providers:j,onSelect:F,onShowAll:B})}),e[26]=j,e[27]=R):R=e[27];const K=d!==null||p;let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=E=>{E||(u(null),f(!1))},e[28]=$):$=e[28];const D=d??void 0;let V;e[29]!==K||e[30]!==D?(V=s.jsx(ls,{open:K,onOpenChange:$,initialProvider:D}),e[29]=K,e[30]=D,e[31]=V):V=e[31];let L;e[32]!==h?(L=s.jsx(Ot,{open:h,onOpenChange:v}),e[32]=h,e[33]=L):L=e[33];let U;return e[34]!==R||e[35]!==V||e[36]!==L||e[37]!==z?(U=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[z,R,V,L]}),e[34]=R,e[35]=V,e[36]=L,e[37]=z,e[38]=U):U=e[38],U}function ge(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function ds(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const us=["bg-destructive","bg-warning","bg-success","bg-success"],ms=["text-success","text-warning","text-warning","text-destructive"];function hs(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function fs(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const ps={text:{icon:s.jsx(ht,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(mt,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(ct,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(ut,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(At,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx($e,{className:"size-3.5"}),label:"Web search"}};function xs(i){const e=W.c(5),{capability:t}=i;let n;e[0]!==t?(n=ps[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=n):n=e[1];const l=n;let o;return e[2]!==l.icon||e[3]!==l.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[l.icon,l.label]}),e[2]=l.icon,e[3]=l.label,e[4]=o):o=e[4],o}function gs(i){const e=W.c(49),{model:t,compact:n}=i,l=n===void 0?!1:n;if(!t){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=x):x=e[0],x}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=ge(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:d}=a;if(l){let x;e[3]!==t.limits?(x=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=x):x=e[4];let N;e[5]!==o?(N=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=N):N=e[6];let C;e[7]!==r?(C=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=C):C=e[8];let I;e[9]!==t.limits?(I=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=I):I=e[10];let m;return e[11]!==x||e[12]!==N||e[13]!==C||e[14]!==I?(m=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,N,C,I]}),e[11]=x,e[12]=N,e[13]=C,e[14]=I,e[15]=m):m=e[15],m}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let p;e[18]!==t.logo||e[19]!==t.title?(p=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=p):p=e[20];let f;e[21]!==d?(f=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=f):f=e[22];let h;e[23]!==p||e[24]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2.5",children:[p,f]}),e[23]=p,e[24]=f,e[25]=h):h=e[25];let v;e[26]!==t.modelId?(v=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=v):v=e[27];let g;e[28]!==u||e[29]!==h||e[30]!==v?(g=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,h,v]}),e[28]=u,e[29]=h,e[30]=v,e[31]=g):g=e[31];let S;e[32]!==t.capabilities?(S=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(vs)}),e[32]=t.capabilities,e[33]=S):S=e[33];let j;e[34]!==t.limits?(j=t.limits?.contextWindow&&(()=>{const{level:x,label:N,description:C}=ds(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(I=>s.jsx("div",{className:ue("w-2 h-2 rounded-full",I<=x?us[x-1]:"bg-muted")},I))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",C]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=j):j=e[35];let w;e[36]!==t.limits?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:hs(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=w):w=e[37];let _;e[38]!==o||e[39]!==r?(_=(o!=null||r!=null)&&(()=>{const{level:x,label:N}=o!=null?fs(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>s.jsx("span",{className:ue("text-sm font-bold leading-none",C<=x?ms[x-1]:"text-muted-foreground/20"),children:"$"},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=_):_=e[40];let k;e[41]!==j||e[42]!==w||e[43]!==_?(k=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,w,_]}),e[41]=j,e[42]=w,e[43]=_,e[44]=k):k=e[44];let T;return e[45]!==k||e[46]!==g||e[47]!==S?(T=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[g,S,k]}),e[45]=k,e[46]=g,e[47]=S,e[48]=T):T=e[48],T}function vs(i){return s.jsx(xs,{capability:i},i)}function fi(i){const e=W.c(19),{model:t,placeholder:n,isLoading:l}=i,o=n===void 0?"Select model":n;if(l===void 0?!1:l){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(q,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(q,{className:"w-16 h-3 hidden md:block"})]}),e[0]=g):g=e[0],g}if(!t){let g;e[1]!==o?(g=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=g):g=e[2];let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Se,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=S):S=e[3];let j;return e[4]!==g?(j=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,S]}),e[4]=g,e[5]=j):j=e[5],j}let a;e[6]!==t?(a=ge(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let d;e[8]!==t?(d=xe(t),e[8]=t,e[9]=d):d=e[9];const u=d;let p;e[10]!==t.title||e[11]!==u?(p=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=p):p=e[12];let f;e[13]!==c?(f=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=f):f=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Se,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=h):h=e[15];let v;return e[16]!==p||e[17]!==f?(v=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[p,f,h]}),e[16]=p,e[17]=f,e[18]=v):v=e[18],v}const bs=["vision","image","file","audio","video"],We=["image/png","image/jpeg","image/gif","image/webp"],Ve=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function ve(i){const e=i?.capabilities;return e?bs.some(t=>e.includes(t)):!1}function pi(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],n=t.includes("vision")||t.includes("image"),l=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(n&&We.includes(i)||l&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||ve(e)&&Ve.includes(i))}function xi(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...We),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),ve(i)&&t.push(...Ve),t.join(",")}function gi(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),ve(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const He=["smarter","faster","cheaper"],qe={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},ys=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],js=ys.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),Ss=new Set(["google/gemini-2.5-pro"]),Ee=new Map;function Ns(i){const e=Ee.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else e:for(const{tier:n,prefix:l}of js)if(i.startsWith(l)){if(Ss.has(l)&&i.length>l.length&&i[l.length]==="-"){const r=i[l.length+1];if(!r||!/\d/.test(r))continue e}t=n;break}return Ee.set(i,t),t}function Oe(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const n=Ns(t.modelId);e[n??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((n,l)=>n.title.localeCompare(l.title));return e}const Ge="mesh:model-shortlist:",ks=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function ws(i){try{const e=localStorage.getItem(Ge+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function _s(i,e){localStorage.setItem(Ge+i,JSON.stringify([...e]))}function Cs(i){const e=W.c(21),{model:t,onHover:n}=i;let l;e[0]!==t?(l=ge(t),e[0]=t,e[1]=l):l=e[1];const{displayName:o,provider:r}=l;let a;e[2]!==t?(a=xe(t),e[2]=t,e[3]=a):a=e[3];const c=a;let d;e[4]!==t||e[5]!==n?(d=()=>n(t),e[4]=t,e[5]=n,e[6]=d):d=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=u):u=e[9];let p;e[10]!==o?(p=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=p):p=e[11];let f;e[12]!==r?(f=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=f):f=e[13];let h;e[14]!==p||e[15]!==f?(h=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[p,f]}),e[14]=p,e[15]=f,e[16]=h):h=e[16];let v;return e[17]!==d||e[18]!==u||e[19]!==h?(v=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[u,h]}),e[17]=d,e[18]=u,e[19]=h,e[20]=v):v=e[20],v}function Is(i){const e=W.c(10),{error:t,onRetry:n}=i;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(st,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(dt,{className:"size-3.5"}),e[4]=c):c=e[4];let d;e[5]!==n?(d=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(ee,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=n,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,a,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9],u}function Ms(){const i=W.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Es)}),i[0]=e):e=i[0],e}function Es(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(q,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(q,{className:"flex-1 h-4"}),s.jsx(q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Ae(i){const e=W.c(12),{label:t,models:n,onSelect:l,onHover:o}=i;if(n.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==n||e[3]!==o||e[4]!==l){let d;e[6]!==o||e[7]!==l?(d=u=>s.jsx("div",{onClick:()=>l(u),className:"cursor-pointer",children:s.jsx(Cs,{model:u,onHover:o})},u.modelId),e[6]=o,e[7]=l,e[8]=d):d=e[8],a=n.map(d),e[2]=n,e[3]=o,e[4]=l,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Os(i){const e=W.c(21),{model:t,isChecked:n,onToggle:l,onHover:o}=i,[r,a]=P.useState(n);r!==n&&a(n);let c;e[0]!==t?(c=xe(t),e[0]=t,e[1]=c):c=e[1];const d=c;let u;e[2]!==t||e[3]!==o?(u=()=>o(t),e[2]=t,e[3]=o,e[4]=u):u=e[4];let p;e[5]!==t.modelId||e[6]!==l?(p=()=>{a(As),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==r||e[9]!==p?(f=s.jsx(it,{checked:r,onCheckedChange:p}),e[8]=r,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==d||e[12]!==t.title?(h=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=h):h=e[13];let v;e[14]!==t.title?(v=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=v):v=e[15];let g;return e[16]!==u||e[17]!==f||e[18]!==h||e[19]!==v?(g=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[f,h,v]}),e[16]=u,e[17]=f,e[18]=h,e[19]=v,e[20]=g):g=e[20],g}function As(i){return!i}function Ts(i){const e=[];for(const t of He)if(i[t].length>0){e.push({type:"header",label:qe[t]});for(const n of i[t])e.push({type:"model",model:n})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function zs({items:i,shortlistSet:e,onToggle:t,onHover:n}){const l=P.useRef(null),o=Wt({count:i.length,getScrollElement:()=>l.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Os,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:n})},r.key):null})})})}function Rs(i){const e=W.c(23),{keyId:t,searchTerm:n,onHover:l,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:d}=vt(t),u=c?d.filter(c):d.filter(Ls);let p;e[0]!==t?(p=()=>(t?ws(t):null)??ks,e[0]=t,e[1]=p):p=e[1];const[f,h]=P.useState(p),[,v]=P.useTransition();let g;e[2]!==t||e[3]!==v?(g=m=>{t&&v(()=>{h(y=>{const b=new Set(y);return b.has(m)?b.delete(m):b.add(m),_s(t,b),b})})},e[2]=t,e[3]=v,e[4]=g):g=e[4];const S=g,j=n.toLowerCase().trim(),w=m=>j?m.filter(y=>y.title.toLowerCase().includes(j)||y.modelId.toLowerCase().includes(j)):m;if(r){const m=Oe(w(u)),y=Ts(m);let b;e[5]!==f?(b=z=>f.has(z.modelId),e[5]=f,e[6]=b):b=e[6];const A=u.filter(b).length;let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Pe,{size:14}),e[7]=M):M=e[7];let O;return e[8]!==a?(O=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[M,"Back"]}),e[8]=a,e[9]=O):O=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[O,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[A," selected"]})]}),s.jsx(zs,{items:y,shortlistSet:f,onToggle:S,onHover:l})]})}let _;e[10]!==f?(_=m=>f.has(m.modelId),e[10]=f,e[11]=_):_=e[11];const k=u.filter(_),T=k.length>0?k:u,x=Oe(w(T));let N;e[12]!==x||e[13]!==l||e[14]!==o?(N=He.map(m=>s.jsx(Ae,{label:qe[m],models:x[m],onSelect:o,onHover:l},m)),e[12]=x,e[13]=l,e[14]=o,e[15]=N):N=e[15];let C;e[16]!==x.other||e[17]!==l||e[18]!==o?(C=s.jsx(Ae,{label:"Other",models:x.other,onSelect:o,onHover:l}),e[16]=x.other,e[17]=l,e[18]=o,e[19]=C):C=e[19];let I;return e[20]!==N||e[21]!==C?(I=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,C]}),e[20]=N,e[21]=C,e[22]=I):I=e[22],I}function Ls(i){return i.asyncResearch!==!0}function vi(){const i=W.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(q,{className:"size-4 shrink-0"}),s.jsx(q,{className:"flex-1 h-6"}),s.jsx(q,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Ps)})]}),i[1]=t):t=i[1];let n;i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(q,{className:"size-6 shrink-0"}),s.jsx(q,{className:"h-6 w-32"})]}),i[2]=n):n=i[2];let l;i[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[n,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(q,{className:"h-6 w-20 rounded-md"}),s.jsx(q,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=l):l=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(q,{className:"h-4 w-24"}),s.jsx(q,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[l,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(q,{className:"h-4 w-16"}),s.jsx(q,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function Ps(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(q,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(q,{className:"flex-1 h-4"}),s.jsx(q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Ye(i){const e=W.c(49),{onClose:t,credentialId:n,onCredentialChange:l,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,d]=P.useState(null),[u,p]=P.useState(""),[f,h]=P.useState(!1),v=P.useRef(null),g=pe(),S=gt();let j;e[0]!==g?.providers?(j=Object.fromEntries((g?.providers??[]).map(Ks)),e[0]=g?.providers,e[1]=j):j=e[1];const w=j,_=et(),{org:k}=le();let T;e[2]!==l?(T=E=>{l(E),d(null)},e[2]=l,e[3]=T):T=e[3];const x=T;let N;e[4]!==n||e[5]!==t||e[6]!==r?(N=E=>{n&&(r(E),p(""),t())},e[4]=n,e[5]=t,e[6]=r,e[7]=N):N=e[7];const C=N;if(S.length===0){let E;return e[8]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(cs,{})}),e[8]=E):E=e[8],E}let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx($e,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=I):I=e[9];const m=f?"Search all models...":"Search for a model...";let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=E=>p(E.target.value),e[10]=y):y=e[10];let b;e[11]!==u||e[12]!==m?(b=s.jsx(ne,{ref:v,type:"text",placeholder:m,value:u,onChange:y,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=u,e[12]=m,e[13]=b):b=e[13];let A;e[14]!==n||e[15]!==x||e[16]!==S||e[17]!==w?(A=S.length>0&&s.jsxs(nt,{value:n??"",onValueChange:x,children:[s.jsxs(lt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Fs,children:[s.jsx(ot,{placeholder:"Key",children:(()=>{const E=S.find(Z=>Z.id===n),H=E?w[E.providerId]:void 0,G=Ie(E?.presetId),J=G?.logo??H?.logo,Y=G?.name??H?.name??E?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[J?s.jsx("img",{src:J,alt:Y,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:Y.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:Y})]})})()}),s.jsx(ft,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(rt,{children:S.map(E=>{const H=w[E.providerId],G=Ie(E.presetId),J=G?.logo??H?.logo,Y=G?.name??H?.name??E.providerId;return s.jsx(at,{value:E.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[J?s.jsx("img",{src:J,alt:Y,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:Y.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[Y," — ",E.label]})]})},E.id)})})]}),e[14]=n,e[15]=x,e[16]=S,e[17]=w,e[18]=A):A=e[18];let M;e[19]!==b||e[20]!==A?(M=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[I,b,A]})}),e[19]=b,e[20]=A,e[21]=M):M=e[21];let O;e[22]!==n?(O=E=>{const{error:H,resetError:G}=E;return s.jsx(Is,{error:H,onRetry:G,credentialId:n??void 0})},e[22]=n,e[23]=O):O=e[23];let z;e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ms,{}),e[24]=z):z=e[24];const F=n??void 0;let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=()=>h($s),e[25]=B):B=e[25];let R;e[26]!==a||e[27]!==C||e[28]!==f||e[29]!==u||e[30]!==F?(R=s.jsx(P.Suspense,{fallback:z,children:s.jsx(Rs,{keyId:F,searchTerm:u,onHover:d,onModelSelect:C,managing:f,onToggleManage:B,filterModels:a})}),e[26]=a,e[27]=C,e[28]=f,e[29]=u,e[30]=F,e[31]=R):R=e[31];let K;e[32]!==n||e[33]!==O||e[34]!==R?(K=s.jsx(tt,{fallback:O,children:R},n),e[32]=n,e[33]=O,e[34]=R,e[35]=K):K=e[35];let $;e[36]!==f||e[37]!==_||e[38]!==k?($=!f&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>P.startTransition(()=>h(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(xt,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>_({to:"/$org/settings/ai-providers",params:{org:k.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(pt,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=f,e[37]=_,e[38]=k,e[39]=$):$=e[39];let D;e[40]!==K||e[41]!==$||e[42]!==M?(D=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[M,K,$]}),e[40]=K,e[41]=$,e[42]=M,e[43]=D):D=e[43];const V=c??o??null;let L;e[44]!==V?(L=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(gs,{model:V})}),e[44]=V,e[45]=L):L=e[45];let U;return e[46]!==D||e[47]!==L?(U=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[D,L]}),e[46]=D,e[47]=L,e[48]=U):U=e[48],U}function $s(i){return!i}function Fs(i){return i.stopPropagation()}function Ks(i){return[i.id,i]}function Ds(i){const e=W.c(12),{onClose:t}=i,{credentialId:n,setCredentialId:l,selectedModel:o,setModel:r}=yt();let a;e[0]!==l?(a=u=>{X("chat_credential_changed",{credential_id:u}),l(u)},e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n||e[3]!==o?.modelId||e[4]!==r?(c=u=>{n&&(X("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:n}),r({...u,keyId:n}))},e[2]=n,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==n||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsx(Ye,{onClose:t,credentialId:n,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=n,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function bi(i){const e=W.c(2),{onClose:t}=i;let n;return e[0]!==t?(n=s.jsx(Ds,{onClose:t}),e[0]=t,e[1]=n):n=e[1],n}function yi(i){const e=W.c(2);let t;return e[0]!==i?(t=s.jsx(Ye,{...i}),e[0]=i,e[1]=t):t=e[1],t}function ji(i){const e=W.c(3),{size:t}=i,n=t===void 0?16:t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=l):l=e[0];let o;return e[1]!==n?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:n,height:n,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l}),e[1]=n,e[2]=o):o=e[2],o}function Si(i){const e=W.c(3),{size:t}=i,n=t===void 0?16:t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=l):l=e[0];let o;return e[1]!==n?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:n,height:n,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:l}),e[1]=n,e[2]=o):o=e[2],o}export{ji as C,yi as D,vi as M,cs as N,ae as O,Be as P,fi as S,Si as a,xi as b,ls as c,bi as d,gi as g,pi as i,ve as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as se,j as s,B as Z,q as me,r as Y,t as v,o as de}from"./index-B7tMIGCq.js";import{c as k,b as ne,a as ee,D as te}from"./dropdown-menu-CqB2EneR.js";import{s as pe}from"./Star01-BTZ2441m.js";import{a as fe}from"./Users03-B1-zgOdp.js";import{S as ge,G as ue,u as he,H as ie,W as oe,a as xe,I as je}from"./github-repo-picker-C8SuJIC3.js";import{a as _e,b as Ce,c as be}from"./use-virtual-mcp-C0J6vZOy.js";import{P as q}from"./index-DJZidEIe.js";import{i as ye}from"./DotsVertical-J6xX8bRK.js";import{a as Ne}from"./Settings02-BAzPyCQK.js";import{s as Se}from"./Trash01-CY-IoFVl.js";import{A as De,ao as ve}from"./agent-icon-Dr1bpYZ_.js";import{k as Ae}from"./use-navigate-to-agent-D4fCB-ku.js";import{C as ke}from"./card-BDlh34z0.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as we}from"./use-capability-CD7uDLwB.js";import{E as Te}from"./empty-state-BZ5IbUpC.js";import{u as ze}from"./use-create-virtual-mcp-BXxjk7k6.js";import{c as Ie,b as Pe,d as He,f as Ee,e as Me,g as Oe,a as Be,A as Ge}from"./alert-dialog-B_G3fFis.js";import{S as $e}from"./search-input-D2vapx7T.js";import{s as le}from"./Plus-C-omi-dN.js";import"./Check-B0P5hodH.js";import"./ChevronRight-4ehX8OPq.js";import"./use-connection-DY59WvYT.js";import"./use-collections-DEYzPSLv.js";import"./constants-CNZvm1cO.js";import"./dialog-B25EnfSZ.js";import"./X-wAJMKsDG.js";import"./RefreshCcw01-BRsF38y3.js";import"./collection-search-B7dmZ18T.js";import"./SearchMd-B0_Yf3yk.js";import"./checkbox-X6v3rKHo.js";import"./use-mcp-tools-Da-abucn.js";import"./extract-connection-data-DtUMTD6M.js";import"./generate-id-DFeI4rCP.js";import"./collections-Ca9cgdYF.js";import"./sidebar-MAITYPYL.js";import"./LayoutLeft-DoTZR2dr.js";import"./tooltip-VoacnTKM.js";import"./sheet-CA-bu41g.js";import"./AlertCircle-BHVtmqg5.js";import"./Tool01-jh5OdcD_.js";import"./SwitchHorizontal01-CI__ZFHo.js";import"./XCircle-C5XzBzrQ.js";import"./ArrowUpRight-BjNBbpmV.js";import"./ZapSquare-BdJ-x7Vi.js";import"./CheckCircle-Bdqev0nO.js";import"./ChevronDown-BLvS4ToG.js";import"./ChevronLeft-DkNaQH3V.js";import"./ChevronUp-BPS-J5rQ.js";import"./Container-BgS7rK8J.js";import"./Eye-B4txmFQS.js";import"./ZoomOut-DnPCWp9x.js";import"./Globe01-xi-0s299.js";import"./FilterLines-BTMjQgiq.js";import"./Palette-C1x3Xgx8.js";import"./HardDrive-Cw5wbzfr.js";import"./Stars02-D5yjx9l2.js";import"./Key01-CIFx1b27.js";import"./LinkExternal01-BUo_Z2Ai.js";import"./Monitor01-CU2IldL2.js";import"./Sun-CU5c1BQU.js";import"./Play-cC3e0aRw.js";import"./Shield01-D-Ka40fc.js";import"./Stars01-BvMjy7DM.js";import"./Upload01-Dws98jTe.js";import"./User01-CsfdlOo_.js";import"./Users01-KgnDENeu.js";import"./XClose-Wh4jKrco.js";import"./Zap-Cd9ypkMC.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(k,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(k,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:ge,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(k,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ue,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(k,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(k,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(k,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(k,{variant:"destructive",onClick:w=>{w.stopPropagation(),l(w)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function rs(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=he(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=we("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=q,A=q,w=q;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(q.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const K=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==w.Body||t[19]!==I||t[20]!==K?(P=s.jsxs(w.Body,{children:[I,K,J]}),t[17]=J,t[18]=w.Body,t[19]=I,t[20]=K,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(xe,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{rs as default};
|
|
1
|
+
import{e as se,j as s,B as Z,q as me,r as Y,t as v,o as de}from"./index-zyABZOuD.js";import{c as k,b as ne,a as ee,D as te}from"./dropdown-menu-DI-Jgf22.js";import{s as pe}from"./Star01-C9s5EBdt.js";import{a as fe}from"./Users03-CITbL542.js";import{S as ge,G as ue,u as he,H as ie,W as oe,a as xe,I as je}from"./github-repo-picker-DrUEn5Is.js";import{a as _e,b as Ce,c as be}from"./use-virtual-mcp-DsQdohZI.js";import{P as q}from"./index-DlJ1CAZi.js";import{i as ye}from"./DotsVertical-CMNXuxac.js";import{a as Ne}from"./Settings02-FDGyPWfA.js";import{s as Se}from"./Trash01-CgOGDFfp.js";import{A as De,ao as ve}from"./agent-icon-DjUyM2GK.js";import{k as Ae}from"./use-navigate-to-agent-BuiMoyxW.js";import{C as ke}from"./card-DB7Bse8h.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as we}from"./use-capability-0eHJrBnH.js";import{E as Te}from"./empty-state-CyjruiTL.js";import{u as ze}from"./use-create-virtual-mcp-CW8Va3LD.js";import{c as Ie,b as Pe,d as He,f as Ee,e as Me,g as Oe,a as Be,A as Ge}from"./alert-dialog-CA-7j9GK.js";import{S as $e}from"./search-input-C792V54k.js";import{s as le}from"./Plus-CXI6DYsL.js";import"./Check-DwxWAe_A.js";import"./ChevronRight-vQ97Lphi.js";import"./use-connection-HsaENIHj.js";import"./use-collections-BEXrnaW6.js";import"./constants-CwxhhJva.js";import"./dialog-B109gCE4.js";import"./X-CA12oOt8.js";import"./RefreshCcw01-CFdSHPj-.js";import"./collection-search-C-2x8kfV.js";import"./SearchMd-M3oAe2yo.js";import"./checkbox-iBP5ppXv.js";import"./use-mcp-tools-CpjckPZ3.js";import"./extract-connection-data-DfGwPk2j.js";import"./generate-id-C3DU72xl.js";import"./collections-DeSkD82x.js";import"./sidebar-B-1Eb4CM.js";import"./LayoutLeft-B5MqBU8K.js";import"./tooltip-B5fnRxsz.js";import"./sheet-B47SStDa.js";import"./AlertCircle-BPLBHL4z.js";import"./Tool01-W8F7AzYr.js";import"./SwitchHorizontal01-Co7U9zZ9.js";import"./XCircle-oElWmNA3.js";import"./ArrowUpRight-BZM2WIfu.js";import"./ZapSquare-Cm_bfF8f.js";import"./CheckCircle-B9Dg9VMf.js";import"./ChevronDown-DmPW0EFR.js";import"./ChevronLeft-De4cWQ2U.js";import"./ChevronUp-CFKEoO3S.js";import"./Container-CGX8gjQO.js";import"./Eye-CouYr8Kp.js";import"./ZoomOut-BLhsYj6d.js";import"./Globe01-AF0aVf58.js";import"./FilterLines-pL0W8Z1S.js";import"./Palette-z1uB5Qcc.js";import"./HardDrive-B5t2ShDK.js";import"./Stars02-Xh71bZ8J.js";import"./Key01-PpEZMCXn.js";import"./LinkExternal01-C9lE7bqK.js";import"./Monitor01-659PEtN5.js";import"./Sun-DRvqv83H.js";import"./Play-Bj3fPStO.js";import"./Shield01-CiQJomFU.js";import"./Stars01-DwRIvNMi.js";import"./Upload01-B_kwcwAX.js";import"./User01-Dgc45Veo.js";import"./Users01-BNC9Bd-m.js";import"./XClose-CiNjOJj2.js";import"./Zap-DLhCOSk9.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(k,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(k,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:ge,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(k,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ue,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(k,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(k,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(k,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(k,{variant:"destructive",onClick:w=>{w.stopPropagation(),l(w)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function rs(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=he(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=we("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=q,A=q,w=q;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(q.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const K=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==w.Body||t[19]!==I||t[20]!==K?(P=s.jsxs(w.Body,{children:[I,K,J]}),t[17]=J,t[18]=w.Body,t[19]=I,t[20]=K,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(xe,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{rs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as B,W as C,aH as ce,aJ as ae,aK as be,aI as ye,ba as pe,e as M,I as ve,H as je,r as T,j as s,D as $e,o as Q,C as _e,q as H,G as ne,a as ee,K as G,n as Ie,c as ge,B as V,t as Se,E as Te}from"./index-B7tMIGCq.js";import{i as Oe}from"./AlertCircle-BHVtmqg5.js";import{P as oe}from"./index-DJZidEIe.js";import{S as de}from"./skeleton-B3z9RhFw.js";import{b as ke,a as me,S as ue,c as Me}from"./settings-section-BhG1oXRm.js";import{u as te,b as re,c as Ce}from"./use-ai-providers-B08Dfztq.js";import{i as Ue}from"./CheckCircle-Bdqev0nO.js";import{p as ze}from"./chat-context-n64-vv_1.js";import{e as Le,f as qe}from"./use-organization-settings-DK19F2g9.js";import{M as Ve}from"./select-model-TEFtvtVK.js";import{u as Be}from"./use-debounced-autosave-BOriK1WA.js";import{I as le}from"./input-DwlCJ28N.js";import{a as he,T as Ge}from"./toggle-group-B_TX0y3P.js";import{b as Ne,c as we,d as Pe,f as Ae,a as De,e as Ke,g as Ee,A as Fe}from"./alert-dialog-B_G3fFis.js";import{S as J,u as X}from"./constants-CNZvm1cO.js";import{s as Qe}from"./Plus-C-omi-dN.js";import{i as We}from"./Tool01-jh5OdcD_.js";import{s as Ye}from"./Trash01-CY-IoFVl.js";import{A as He}from"./avatar-DhzY0Eh2.js";import{O as Re,P as Je,c as xe}from"./agent-icons-CzC15bIN.js";import{a as Xe}from"./RefreshCcw01-BRsF38y3.js";import{s as Ze}from"./Eye-B4txmFQS.js";import{d as et,b as tt,c as st,a as it,D as ot}from"./dialog-B25EnfSZ.js";import{S as rt}from"./spinner-u4N4s9Z6.js";import{f as lt}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as nt}from"./require-capability-DfrpjX-u.js";import"./sidebar-MAITYPYL.js";import"./LayoutLeft-DoTZR2dr.js";import"./tooltip-VoacnTKM.js";import"./sheet-CA-bu41g.js";import"./X-wAJMKsDG.js";import"./card-BDlh34z0.js";import"./ArrowUpRight-BjNBbpmV.js";import"./tab-id-D4XtWZcv.js";import"./decopilot-sse-pool-BbXhLnto.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-C0J6vZOy.js";import"./use-collections-DEYzPSLv.js";import"./drawer-fSMBE52Q.js";import"./User01-CsfdlOo_.js";import"./checkbox-X6v3rKHo.js";import"./Check-B0P5hodH.js";import"./select-D6NiWcOv.js";import"./ChevronDown-BLvS4ToG.js";import"./ChevronUp-BPS-J5rQ.js";import"./Key01-CIFx1b27.js";import"./SearchMd-B0_Yf3yk.js";import"./Settings02-BAzPyCQK.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-CU2IldL2.js";import"./ChevronRight-4ehX8OPq.js";import"./connect-desktop-dialog-BnrR7FIp.js";import"./Stars01-BvMjy7DM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-CD7uDLwB.js";import"./access-gate-CNsIQ_vY.js";import"./capability-load-error-DBKsDtKJ.js";B({title:C(),url:C(),icon:C()});B({registries:ae(C(),B({enabled:be()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ce(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const Z=B({keyId:C(),modelId:C(),title:C().optional()}).nullable();ye(["fast","smart","thinking","image","web_research"]);ye(["fast","smart","thinking"]);const at=B({tiers:B({fast:Z,smart:Z,thinking:Z,image:Z,web_research:Z})});B({ids:ce(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:B({heading:C().optional().describe("Font family for headings"),body:C().optional().describe("Font family for body text"),code:C().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:C().optional().describe("Primary brand color (hex)"),secondary:C().optional().describe("Secondary brand color (hex)"),accent:C().optional().describe("Accent / highlight color (hex)"),background:C().optional().describe("Background color (hex)"),foreground:C().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ce(ae(C(),pe())).nullable().optional().describe("Brand images"),metadata:ae(C(),pe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:be().optional().describe("Whether this is the default brand for the organization")});const ct=e=>e.capabilities?.includes("image")===!0,dt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:ct},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:dt}];function ut(e){const t=M.c(20),{slot:i,onSlotChange:l,filterModels:o,defaultKeyId:a}=e,r=te(),[n,p]=T.useState(i?.keyId??a);let y;t[0]!==i?(y=()=>{i?.keyId&&p(i.keyId)},t[0]=i,t[1]=y):y=t[1];const I=i?.keyId;let h;t[2]!==I?(h=[I],t[2]=I,t[3]=h):h=t[3],T.useEffect(y,h);const c=n??a;let u;t[4]!==c||t[5]!==r?(u=c?r.find(d=>d.id===c):null,t[4]=c,t[5]=r,t[6]=u):u=t[6];const k=u,{models:m,isLoading:S}=re(o?c??void 0:void 0),v=o?S||m.some(o):!0;let g;t[7]!==i||t[8]!==k?.providerId?(g=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:k?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=k?.providerId,t[9]=g):g=t[9];const x=g;if(o&&!v){let d;return t[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=d):d=t[10],d}let b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=d=>p(d),t[11]=b):b=t[11];let j;t[12]!==c||t[13]!==l?(j=d=>{const w=d.keyId??c??"";p(w),l({keyId:w,modelId:d.modelId,title:d.title})},t[12]=c,t[13]=l,t[14]=j):j=t[14];let f;return t[15]!==c||t[16]!==o||t[17]!==x||t[18]!==j?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:x,credentialId:c,filterModels:o,onCredentialChange:b,onModelChange:j}),t[15]=c,t[16]=o,t[17]=x,t[18]=j,t[19]=f):f=t[19],f}function ft(e){const t=M.c(2),{isPending:i,showSaved:l}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(_e,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(l){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Ue,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function pt(){const e=M.c(42),t=te(),i=Le(),l=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ve(at),e[0]=o):o=e[0];let a;e[1]!==i?(a={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=a):a=e[2];const r=je(a),{mutate:n,isPending:p,isSuccess:y}=qe(),I=r.formState.isDirty;let h;e[3]!==r||e[4]!==i||e[5]!==n?(h={delayMs:250,save:async()=>{const _=r.getValues();n(_,{onSuccess:()=>r.reset(_,{keepValues:!0}),onError:F=>{r.reset(i),Q.error(`Failed to save: ${F.message}`)}})}},e[3]=r,e[4]=i,e[5]=n,e[6]=h):h=e[6];const{schedule:c}=Be(h),u=t[0],k=t[1],m=t[2],{models:S}=re(u?.id),{models:v}=re(k?.id),{models:g}=re(m?.id);let x,b;e[7]!==r||e[8]!==l?(x=()=>{l||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},b=[l,r],e[7]=r,e[8]=l,e[9]=x,e[10]=b):(x=e[9],b=e[10]),T.useEffect(x,b);let j;e[11]!==t||e[12]!==r||e[13]!==u||e[14]!==k||e[15]!==m||e[16]!==S||e[17]!==v||e[18]!==g?(j=()=>{const _=r.getValues(),F=new Set(t.map(gt)),P={};u?.id&&(P[u.id]=S),k?.id&&(P[k.id]=v),m?.id&&(P[m.id]=g);const E=W=>W!=null&&!F.has(W.keyId),N={fast:E(_.tiers.fast)?null:_.tiers.fast,smart:E(_.tiers.smart)?null:_.tiers.smart,thinking:E(_.tiers.thinking)?null:_.tiers.thinking,image:E(_.tiers.image)?null:_.tiers.image,web_research:E(_.tiers.web_research)?null:_.tiers.web_research},L=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,q=N.fast===_.tiers.fast&&N.smart===_.tiers.smart&&N.thinking===_.tiers.thinking&&N.image===_.tiers.image&&N.web_research===_.tiers.web_research;if(!L&&q)return;const R=ze(t,P);r.reset({tiers:{fast:N.fast??R.chat.fast,smart:N.smart??R.chat.smart,thinking:N.thinking??R.chat.thinking,image:N.image??R.image,web_research:N.web_research??R.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=u,e[14]=k,e[15]=m,e[16]=S,e[17]=v,e[18]=g,e[19]=j):j=e[19];const f=u?.id,d=k?.id,w=m?.id;let U;e[20]!==t||e[21]!==r||e[22]!==S||e[23]!==v||e[24]!==g||e[25]!==f||e[26]!==d||e[27]!==w?(U=[r,t,S,v,g,f,d,w],e[20]=t,e[21]=r,e[22]=S,e[23]=v,e[24]=g,e[25]=f,e[26]=d,e[27]=w,e[28]=U):U=e[28],T.useEffect(j,U);let O;e[29]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=O):O=e[29];const z=y&&!I;let A;e[30]!==p||e[31]!==z?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[O,s.jsx(ft,{isPending:p,showSaved:z})]}),e[30]=p,e[31]=z,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==c?(D=mt.map(_=>s.jsx($e,{control:r.control,name:`tiers.${_.key}`,render:F=>{const{field:P}=F;return s.jsx(ke,{title:_.label,description:_.description,action:s.jsx(ut,{slot:P.value,defaultKeyId:t[0]?.id??null,filterModels:_.filter,onSlotChange:E=>{P.onChange(E),c()}})})}},_.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=c,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(me,{children:D}),e[37]=D,e[38]=K):K=e[38];let $;return e[39]!==A||e[40]!==K?($=s.jsxs(ue,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=$):$=e[41],$}function gt(e){return e.id}const ht={usd:[10,20,100],brl:[50,100,500]};function xt(){const e=M.c(29),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),[o,a]=T.useState(!1),{mutate:r,isPending:n}=ee({mutationFn:async d=>{const w=await l.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:d,currency:c}});if(w?.isError)throw new Error(w.content?.[0]?.text??"Failed to get top-up URL");return w.structuredContent?.url},onSuccess:yt,onError:bt}),[p,y]=T.useState(""),[I,h]=T.useState("usd"),c=I,u=parseFloat(p),k=!isNaN(u)&&u>=1,m=c==="brl"?"R$":"$";let S;e[3]!==h?(S=d=>{d&&h(d)},e[3]=h,e[4]=S):S=e[4];let v,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(he,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),g=s.jsx(he,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[5]=v,e[6]=g):(v=e[5],g=e[6]);let x;e[7]!==c||e[8]!==S?(x=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:c,onValueChange:S,children:[v,g]}),e[7]=c,e[8]=S,e[9]=x):x=e[9];let b;e[10]!==c||e[11]!==m||e[12]!==o||e[13]!==n||e[14]!==r?(b=!o&&s.jsxs(s.Fragment,{children:[ht[c].map(d=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:n,onClick:()=>r(d*100),children:[m,d]},d)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:n,children:"Custom"})]}),e[10]=c,e[11]=m,e[12]=o,e[13]=n,e[14]=r,e[15]=b):b=e[15];let j;e[16]!==m||e[17]!==p||e[18]!==u||e[19]!==o||e[20]!==k||e[21]!==n||e[22]!==y||e[23]!==r?(j=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:m}),s.jsx(le,{type:"number",min:"1",step:"1",placeholder:"50",value:p,onChange:d=>y(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!k||n,onClick:()=>r(Math.round(u*100)),children:n?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),y("")},children:"Cancel"})]}),e[16]=m,e[17]=p,e[18]=u,e[19]=o,e[20]=k,e[21]=n,e[22]=y,e[23]=r,e[24]=j):j=e[24];let f;return e[25]!==x||e[26]!==b||e[27]!==j?(f=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x,b,j]})}),e[25]=x,e[26]=b,e[27]=j,e[28]=f):f=e[28],f}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=M.c(61),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),o=ne(),a=te();let r;e[3]!==a?(r=a.find(It),e[3]=a,e[4]=r):r=e[4];const n=r,[p,y]=T.useState(!1);let I;e[5]!==l||e[6]!==n?(I=async()=>{n&&await l.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:n.id}})},e[5]=l,e[6]=n,e[7]=I):I=e[7];let h;e[8]!==t.id||e[9]!==o?(h=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),y(!1)},e[8]=t.id,e[9]=o,e[10]=h):h=e[10];let c;e[11]!==I||e[12]!==h?(c={mutationFn:I,onSuccess:h,onError:_t},e[11]=I,e[12]=h,e[13]=c):c=e[13];const{mutate:u,isPending:k}=ee(c);let m;e[14]!==t.id?(m=G.aiProviderCredits(t.id,"deco"),e[14]=t.id,e[15]=m):m=e[15];const S=!!n;let v;e[16]!==l?(v=async()=>{const fe=await l.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return fe?.isError?null:fe.structuredContent??null},e[16]=l,e[17]=v):v=e[17];let g;e[18]!==m||e[19]!==S||e[20]!==v?(g={queryKey:m,enabled:S,staleTime:6e4,queryFn:v},e[18]=m,e[19]=S,e[20]=v,e[21]=g):g=e[21];const{data:x,isLoading:b,refetch:j,isFetching:f}=Ie(g);if(!n)return null;const d=x?.balanceCents!=null?x.balanceCents/100:null;let w;e[22]!==d?(w=d!=null?`$${d.toFixed(2)}`:"—",e[22]=d,e[23]=w):w=e[23];const U=w;let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[24]=O):O=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=()=>y(!0),e[25]=z):z=e[25];let A;e[26]!==k?(A=s.jsxs("div",{className:"flex items-center justify-between",children:[O,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:k,children:"Disconnect"})]}),e[26]=k,e[27]=A):A=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(Ne,{children:[s.jsx(we,{children:"Disconnect Deco AI Gateway"}),s.jsx(Pe,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[28]=D):D=e[28];let K;e[29]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ae,{children:"Cancel"}),e[29]=K):K=e[29];let $;e[30]!==u?($=s.jsxs(De,{children:[D,s.jsxs(Ke,{children:[K,s.jsx(Ee,{onClick:()=>u(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[30]=u,e[31]=$):$=e[31];let _;e[32]!==p||e[33]!==$?(_=s.jsx(Fe,{open:p,onOpenChange:y,children:$}),e[32]=p,e[33]=$,e[34]=_):_=e[34];let F;e[35]!==d||e[36]!==U||e[37]!==f||e[38]!==b?(F=b||f?s.jsx(de,{className:"h-9 w-24"}):s.jsx("span",{className:ge("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&vt(d)),children:U}),e[35]=d,e[36]=U,e[37]=f,e[38]=b,e[39]=F):F=e[39];let P;e[40]!==j?(P=()=>j(),e[40]=j,e[41]=P):P=e[41];const E=f&&"animate-spin";let N;e[42]!==E?(N=ge(E),e[42]=E,e[43]=N):N=e[43];let L;e[44]!==N?(L=s.jsx(_e,{size:14,className:N}),e[44]=N,e[45]=L):L=e[45];let q;e[46]!==f||e[47]!==P||e[48]!==L?(q=s.jsx("button",{type:"button",onClick:P,disabled:f,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:L}),e[46]=f,e[47]=P,e[48]=L,e[49]=q):q=e[49];let R;e[50]!==F||e[51]!==q?(R=s.jsxs("div",{className:"flex items-baseline gap-2",children:[F,q]}),e[50]=F,e[51]=q,e[52]=R):R=e[52];let W;e[53]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[53]=W):W=e[53];let Y;e[54]!==R?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[R,W]}),e[54]=R,e[55]=Y):Y=e[55];let se;e[56]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(xt,{})]}),e[56]=se):se=e[56];let ie;return e[57]!==A||e[58]!==_||e[59]!==Y?(ie=s.jsx(ue,{title:"Deco AI Gateway",children:s.jsx(me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[A,_,Y,se]})})}),e[57]=A,e[58]=_,e[59]=Y,e[60]=ie):ie=e[60],ie}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function It(e){return e.providerId==="deco"}function St(){const e=M.c(11),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),o=ne();let a;e[3]!==l?(a=async()=>{const p=await l.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:"deco"}});if(p?.isError)throw new Error(p.content?.[0]?.text??"Key provisioning failed")},e[3]=l,e[4]=a):a=e[4];let r;e[5]!==t.id||e[6]!==o?(r=()=>{Se("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[5]=t.id,e[6]=o,e[7]=r):r=e[7];let n;return e[8]!==a||e[9]!==r?(n={mutationFn:a,onSuccess:r,onError:kt},e[8]=a,e[9]=r,e[10]=n):n=e[10],ee(n)}function kt(e){Se("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=M.c(10),{mutate:t,isPending:i}=St();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:l.join(", ")}}),e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=a):a=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let n;e[4]!==t?(n=()=>t(),e[4]=t,e[5]=n):n=e[5];const p=i?"Connecting…":"Connect Deco";let y;return e[6]!==i||e[7]!==n||e[8]!==p?(y=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[a,r,s.jsx(V,{variant:"outline",disabled:i,onClick:n,children:p})]})]}),e[6]=i,e[7]=n,e[8]=p,e[9]=y):y=e[9],y}const Nt=B({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function wt({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:o,currentBaseUrl:a,onCancel:r,onSuccess:n}){const{org:p}=H(),y=X({connectionId:J,orgId:p.id,orgSlug:p.slug}),I=ne(),[h,c]=T.useState(!1),u=t.id==="openai-compatible",k=t.supportedMethods.includes("api-key"),{register:m,handleSubmit:S,watch:v,formState:{errors:g}}=je({resolver:ve(Nt),defaultValues:{label:o,apiKey:"",baseUrl:a??""}}),x=v("apiKey")??"",{mutate:b,isPending:j}=ee({mutationFn:async f=>{let d;f.apiKey?u?d=JSON.stringify({baseUrl:f.baseUrl||a||"",apiKey:f.apiKey}):d=f.apiKey:u&&f.baseUrl&&f.baseUrl!==a&&(d=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await y.callTool({name:"AI_PROVIDER_KEY_UPDATE",arguments:{keyId:e.id,label:f.label,...d!==void 0?{apiKey:d}:{}}})},onSuccess:()=>{I.invalidateQueries({queryKey:G.aiProviderKeys(p.id)}),I.invalidateQueries({queryKey:G.aiProviders(p.id)}),Q.success("Provider updated"),n()},onError:f=>Q.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:S(f=>b(f)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(le,{placeholder:"e.g. Personal key",...m("label"),className:"h-8 text-sm"}),g.label&&s.jsx("p",{className:"text-xs text-destructive",children:g.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...m("baseUrl"),className:"h-8 text-sm"})]}),k&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(le,{type:h&&x?"text":"password",placeholder:l,...m("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),x&&s.jsx("button",{type:"button",onClick:()=>c(!h),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:h?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:j,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:j,children:j?"Saving...":"Save"})]})]})}function Pt(e){const t=M.c(31),{providerKey:i,provider:l,open:o,onOpenChange:a}=e,{org:r}=H();let n;t[0]!==r.id||t[1]!==r.slug?(n={connectionId:J,orgId:r.id,orgSlug:r.slug},t[0]=r.id,t[1]=r.slug,t[2]=n):n=t[2];const p=X(n);let y;t[3]!==l.id||t[4]!==i.presetId?(y=l.id==="openai-compatible"&&i.presetId?Re.find(j=>j.id===i.presetId):void 0,t[3]=l.id,t[4]=i.presetId,t[5]=y):y=t[5];const I=y,h=I?.name??l.name;let c;t[6]!==i.id?(c=G.aiProviderKeyPreview(i.id),t[6]=i.id,t[7]=c):c=t[7];let u;t[8]!==p||t[9]!==i.id?(u=async()=>(await p.callTool({name:"AI_PROVIDER_KEY_PREVIEW",arguments:{keyId:i.id}})).structuredContent,t[8]=p,t[9]=i.id,t[10]=u):u=t[10];let k;t[11]!==o||t[12]!==c||t[13]!==u?(k={queryKey:c,queryFn:u,enabled:o,staleTime:0},t[11]=o,t[12]=c,t[13]=u,t[14]=k):k=t[14];const{data:m,isLoading:S}=Ie(k);let v;t[15]!==h?(v=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",h]})}),t[15]=h,t[16]=v):v=t[16];let g;t[17]!==S||t[18]!==a||t[19]!==I||t[20]!==m||t[21]!==l||t[22]!==i?(g=S||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(rt,{})}):s.jsx(wt,{providerKey:i,provider:l,preset:I,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[17]=S,t[18]=a,t[19]=I,t[20]=m,t[21]=l,t[22]=i,t[23]=g):g=t[23];let x;t[24]!==v||t[25]!==g?(x=s.jsxs(it,{className:"sm:max-w-md",children:[v,g]}),t[24]=v,t[25]=g,t[26]=x):x=t[26];let b;return t[27]!==a||t[28]!==o||t[29]!==x?(b=s.jsx(ot,{open:o,onOpenChange:a,children:x}),t[27]=a,t[28]=o,t[29]=x,t[30]=b):b=t[30],b}function At(e){const t=M.c(51),{providerKey:i,provider:l}=e,{org:o}=H();let a;t[0]!==o.id||t[1]!==o.slug?(a={connectionId:J,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=a):a=t[2];const r=X(a),n=ne(),[p,y]=T.useState(!1),[I,h]=T.useState(!1),c=l.id==="openai-compatible";let u;t[3]!==c||t[4]!==i.presetId?(u=c&&i.presetId?Re.find(q=>q.id===i.presetId):void 0,t[3]=c,t[4]=i.presetId,t[5]=u):u=t[5];const k=u,m=k?k.name:c?"Custom OpenAI-compatible":l.name,S=k?.logo??l.logo;let v;e:{if(c){v=i.label;break e}const q=i.label;let R;t[6]!==i.createdAt?(R=lt(new Date(i.createdAt)),t[6]=i.createdAt,t[7]=R):R=t[7],v=`${q} · added ${R} ago`}const g=v;let x;t[8]!==r||t[9]!==i.id?(x=async()=>{await r.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:i.id}})},t[8]=r,t[9]=i.id,t[10]=x):x=t[10];let b;t[11]!==o.id||t[12]!==i.id||t[13]!==n?(b=()=>{n.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),n.invalidateQueries({queryKey:G.aiProviders(o.id)}),n.invalidateQueries({queryKey:G.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),y(!1)},t[11]=o.id,t[12]=i.id,t[13]=n,t[14]=b):b=t[14];let j;t[15]!==x||t[16]!==b?(j={mutationFn:x,onSuccess:b,onError:Dt},t[15]=x,t[16]=b,t[17]=j):j=t[17];const{mutate:f,isPending:d}=ee(j);let w;t[18]!==m||t[19]!==S?(w=S?s.jsx("img",{src:S,alt:m,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:m.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[18]=m,t[19]=S,t[20]=w):w=t[20];let U;t[21]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>h(!0),children:s.jsx(We,{size:14})}),t[21]=U):U=t[21];let O,z;t[22]===Symbol.for("react.memo_cache_sentinel")?(z=()=>y(!0),O=s.jsx(Ye,{size:14}),t[22]=O,t[23]=z):(O=t[22],z=t[23]);let A;t[24]!==d?(A=s.jsxs("div",{className:"flex items-center gap-0.5",children:[U,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:d,onClick:z,children:O})]}),t[24]=d,t[25]=A):A=t[25];let D;t[26]!==g||t[27]!==m||t[28]!==A||t[29]!==w?(D=s.jsx(ke,{icon:w,title:m,description:g,action:A}),t[26]=g,t[27]=m,t[28]=A,t[29]=w,t[30]=D):D=t[30];let K;t[31]!==I||t[32]!==l||t[33]!==i?(K=s.jsx(Pt,{providerKey:i,provider:l,open:I,onOpenChange:h}),t[31]=I,t[32]=l,t[33]=i,t[34]=K):K=t[34];let $;t[35]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(we,{children:"Delete API key"}),t[35]=$):$=t[35];let _;t[36]!==i.label?(_=s.jsxs(Ne,{children:[$,s.jsxs(Pe,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[36]=i.label,t[37]=_):_=t[37];let F;t[38]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Ae,{children:"Cancel"}),t[38]=F):F=t[38];let P;t[39]!==f?(P=s.jsxs(Ke,{children:[F,s.jsx(Ee,{onClick:()=>f(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[39]=f,t[40]=P):P=t[40];let E;t[41]!==_||t[42]!==P?(E=s.jsxs(De,{children:[_,P]}),t[41]=_,t[42]=P,t[43]=E):E=t[43];let N;t[44]!==p||t[45]!==E?(N=s.jsx(Fe,{open:p,onOpenChange:y,children:E}),t[44]=p,t[45]=E,t[46]=N):N=t[46];let L;return t[47]!==D||t[48]!==K||t[49]!==N?(L=s.jsxs(s.Fragment,{children:[D,K,N]}),t[47]=D,t[48]=K,t[49]=N,t[50]=L):L=t[50],L}function Dt(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=M.c(11),{onConnectClick:i}=e,l=te(),o=Ce();let a;t[0]!==o?.providers?(a=o?.providers??[],t[0]=o?.providers,t[1]=a):a=t[1];const r=a;let n;if(t[2]!==l||t[3]!==i||t[4]!==r){let p;t[6]!==r?(p=c=>({key:c,provider:r.find(u=>u.id===c.providerId)}),t[6]=r,t[7]=p):p=t[7];const y=l.filter(Rt).map(p).filter(Ft);let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Qe,{size:14}),t[8]=I):I=t[8];let h;t[9]!==i?(h=s.jsxs(V,{size:"sm",onClick:i,children:[I,"Connect provider"]}),t[9]=i,t[10]=h):h=t[10],n=s.jsx(ue,{title:"Connected providers",headerClassName:"px-0",actions:h,children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(me,{children:y.map(Et)})}),t[2]=l,t[3]=i,t[4]=r,t[5]=n}else n=t[5];return n}function Et(e){const{key:t,provider:i}=e;return s.jsx(At,{providerKey:t,provider:i},t.id)}function Ft(e){return e.provider!==void 0}function Rt(e){return e.providerId!=="deco"}function $t(e){const t=M.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Oe,{size:16}),t[0]=l):l=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Tt(){const e=M.c(23),t=te();let i;e[0]!==t?(i=t.some(Ot),e[0]=t,e[1]=i):i=e[1];const l=i,o=t.length>0,[a,r]=T.useState(!1),[n,p]=T.useState(null),y=Ce();let I;e[2]!==y?.providers?(I=y?.providers??[],e[2]=y?.providers,e[3]=I):I=e[3];const h=I;if(!o){let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=()=>r(!0),e[4]=v):v=e[4];let g;e[5]!==h?(g=s.jsx(Je,{providers:h,onSelect:p,onShowAll:v}),e[5]=h,e[6]=g):g=e[6];const x=n!==null||a;let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=w=>{w||(p(null),r(!1))},e[7]=b):b=e[7];const j=n??void 0;let f;e[8]!==x||e[9]!==j?(f=s.jsx(xe,{open:x,onOpenChange:b,initialProvider:j}),e[8]=x,e[9]=j,e[10]=f):f=e[10];let d;return e[11]!==g||e[12]!==f?(d=s.jsxs(s.Fragment,{children:[g,f]}),e[11]=g,e[12]=f,e[13]=d):d=e[13],d}let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(T.Suspense,{fallback:s.jsx(de,{className:"h-16 w-full"}),children:s.jsx(pt,{})}),e[14]=c):c=e[14];let u;e[15]!==l?(u=l?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=l,e[16]=u):u=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Kt,{onConnectClick:()=>r(!0)}),e[17]=k):k=e[17];let m;e[18]!==a?(m=s.jsx(xe,{open:a,onOpenChange:r}),e[18]=a,e[19]=m):m=e[19];let S;return e[20]!==u||e[21]!==m?(S=s.jsxs(s.Fragment,{children:[c,u,k,m]}),e[20]=u,e[21]=m,e[22]=S):S=e[22],S}function Ot(e){return e.providerId==="deco"}function Mt(){const e=M.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(oe.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(oe,{children:s.jsx(oe.Content,{children:s.jsx(oe.Body,{children:s.jsxs(Me,{children:[t,s.jsx(Te,{fallback:Ut,children:s.jsx(T.Suspense,{fallback:s.jsx(de,{className:"h-64 w-full"}),children:s.jsx(Tt,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx($t,{error:t??new Error("Failed to load AI providers")})}function Bs(){const e=M.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(nt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Mt,{})}),e[0]=t):t=e[0],t}export{Bs as default};
|
|
1
|
+
import{T as B,W as C,aH as ce,aJ as ae,aK as be,aI as ye,ba as pe,e as M,I as ve,H as je,r as T,j as s,D as $e,o as Q,C as _e,q as H,G as ne,a as ee,K as G,n as Ie,c as ge,B as V,t as Se,E as Te}from"./index-zyABZOuD.js";import{i as Oe}from"./AlertCircle-BPLBHL4z.js";import{P as oe}from"./index-DlJ1CAZi.js";import{S as de}from"./skeleton-Bd8kPi36.js";import{b as ke,a as me,S as ue,c as Me}from"./settings-section-BjN2myxJ.js";import{u as te,b as re,c as Ce}from"./use-ai-providers-C_IYHgI4.js";import{i as Ue}from"./CheckCircle-B9Dg9VMf.js";import{p as ze}from"./chat-context-yFtmoeub.js";import{e as Le,f as qe}from"./use-organization-settings-B5ihCN3e.js";import{M as Ve}from"./select-model-Hf7hJQdT.js";import{u as Be}from"./use-debounced-autosave-DueSHS3l.js";import{I as le}from"./input-CDcrM9F5.js";import{a as he,T as Ge}from"./toggle-group-C8HVaLZk.js";import{b as Ne,c as we,d as Pe,f as Ae,a as De,e as Ke,g as Ee,A as Fe}from"./alert-dialog-CA-7j9GK.js";import{S as J,u as X}from"./constants-CwxhhJva.js";import{s as Qe}from"./Plus-CXI6DYsL.js";import{i as We}from"./Tool01-W8F7AzYr.js";import{s as Ye}from"./Trash01-CgOGDFfp.js";import{A as He}from"./avatar-D24kACpT.js";import{O as Re,P as Je,c as xe}from"./agent-icons-DRz2SdAx.js";import{a as Xe}from"./RefreshCcw01-CFdSHPj-.js";import{s as Ze}from"./Eye-CouYr8Kp.js";import{d as et,b as tt,c as st,a as it,D as ot}from"./dialog-B109gCE4.js";import{S as rt}from"./spinner-wrYa3rBM.js";import{f as lt}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as nt}from"./require-capability-DXLg9oHp.js";import"./sidebar-B-1Eb4CM.js";import"./LayoutLeft-B5MqBU8K.js";import"./tooltip-B5fnRxsz.js";import"./sheet-B47SStDa.js";import"./X-CA12oOt8.js";import"./card-DB7Bse8h.js";import"./ArrowUpRight-BZM2WIfu.js";import"./tab-id-B-kIZoBW.js";import"./decopilot-sse-pool-I31A1Pzr.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-DsQdohZI.js";import"./use-collections-BEXrnaW6.js";import"./drawer-BLP-m8Z0.js";import"./User01-Dgc45Veo.js";import"./checkbox-iBP5ppXv.js";import"./Check-DwxWAe_A.js";import"./select-DctRFe2b.js";import"./ChevronDown-DmPW0EFR.js";import"./ChevronUp-CFKEoO3S.js";import"./Key01-PpEZMCXn.js";import"./SearchMd-M3oAe2yo.js";import"./Settings02-FDGyPWfA.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-659PEtN5.js";import"./ChevronRight-vQ97Lphi.js";import"./connect-desktop-dialog-mw47OvUe.js";import"./Stars01-DwRIvNMi.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-0eHJrBnH.js";import"./access-gate-5nomG59L.js";import"./capability-load-error-DVwjhCeN.js";B({title:C(),url:C(),icon:C()});B({registries:ae(C(),B({enabled:be()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ce(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const Z=B({keyId:C(),modelId:C(),title:C().optional()}).nullable();ye(["fast","smart","thinking","image","web_research"]);ye(["fast","smart","thinking"]);const at=B({tiers:B({fast:Z,smart:Z,thinking:Z,image:Z,web_research:Z})});B({ids:ce(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:B({heading:C().optional().describe("Font family for headings"),body:C().optional().describe("Font family for body text"),code:C().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:C().optional().describe("Primary brand color (hex)"),secondary:C().optional().describe("Secondary brand color (hex)"),accent:C().optional().describe("Accent / highlight color (hex)"),background:C().optional().describe("Background color (hex)"),foreground:C().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ce(ae(C(),pe())).nullable().optional().describe("Brand images"),metadata:ae(C(),pe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:be().optional().describe("Whether this is the default brand for the organization")});const ct=e=>e.capabilities?.includes("image")===!0,dt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:ct},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:dt}];function ut(e){const t=M.c(20),{slot:i,onSlotChange:l,filterModels:o,defaultKeyId:a}=e,r=te(),[n,p]=T.useState(i?.keyId??a);let y;t[0]!==i?(y=()=>{i?.keyId&&p(i.keyId)},t[0]=i,t[1]=y):y=t[1];const I=i?.keyId;let h;t[2]!==I?(h=[I],t[2]=I,t[3]=h):h=t[3],T.useEffect(y,h);const c=n??a;let u;t[4]!==c||t[5]!==r?(u=c?r.find(d=>d.id===c):null,t[4]=c,t[5]=r,t[6]=u):u=t[6];const k=u,{models:m,isLoading:S}=re(o?c??void 0:void 0),v=o?S||m.some(o):!0;let g;t[7]!==i||t[8]!==k?.providerId?(g=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:k?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=k?.providerId,t[9]=g):g=t[9];const x=g;if(o&&!v){let d;return t[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=d):d=t[10],d}let b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=d=>p(d),t[11]=b):b=t[11];let j;t[12]!==c||t[13]!==l?(j=d=>{const w=d.keyId??c??"";p(w),l({keyId:w,modelId:d.modelId,title:d.title})},t[12]=c,t[13]=l,t[14]=j):j=t[14];let f;return t[15]!==c||t[16]!==o||t[17]!==x||t[18]!==j?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:x,credentialId:c,filterModels:o,onCredentialChange:b,onModelChange:j}),t[15]=c,t[16]=o,t[17]=x,t[18]=j,t[19]=f):f=t[19],f}function ft(e){const t=M.c(2),{isPending:i,showSaved:l}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(_e,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(l){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Ue,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function pt(){const e=M.c(42),t=te(),i=Le(),l=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ve(at),e[0]=o):o=e[0];let a;e[1]!==i?(a={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=a):a=e[2];const r=je(a),{mutate:n,isPending:p,isSuccess:y}=qe(),I=r.formState.isDirty;let h;e[3]!==r||e[4]!==i||e[5]!==n?(h={delayMs:250,save:async()=>{const _=r.getValues();n(_,{onSuccess:()=>r.reset(_,{keepValues:!0}),onError:F=>{r.reset(i),Q.error(`Failed to save: ${F.message}`)}})}},e[3]=r,e[4]=i,e[5]=n,e[6]=h):h=e[6];const{schedule:c}=Be(h),u=t[0],k=t[1],m=t[2],{models:S}=re(u?.id),{models:v}=re(k?.id),{models:g}=re(m?.id);let x,b;e[7]!==r||e[8]!==l?(x=()=>{l||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},b=[l,r],e[7]=r,e[8]=l,e[9]=x,e[10]=b):(x=e[9],b=e[10]),T.useEffect(x,b);let j;e[11]!==t||e[12]!==r||e[13]!==u||e[14]!==k||e[15]!==m||e[16]!==S||e[17]!==v||e[18]!==g?(j=()=>{const _=r.getValues(),F=new Set(t.map(gt)),P={};u?.id&&(P[u.id]=S),k?.id&&(P[k.id]=v),m?.id&&(P[m.id]=g);const E=W=>W!=null&&!F.has(W.keyId),N={fast:E(_.tiers.fast)?null:_.tiers.fast,smart:E(_.tiers.smart)?null:_.tiers.smart,thinking:E(_.tiers.thinking)?null:_.tiers.thinking,image:E(_.tiers.image)?null:_.tiers.image,web_research:E(_.tiers.web_research)?null:_.tiers.web_research},L=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,q=N.fast===_.tiers.fast&&N.smart===_.tiers.smart&&N.thinking===_.tiers.thinking&&N.image===_.tiers.image&&N.web_research===_.tiers.web_research;if(!L&&q)return;const R=ze(t,P);r.reset({tiers:{fast:N.fast??R.chat.fast,smart:N.smart??R.chat.smart,thinking:N.thinking??R.chat.thinking,image:N.image??R.image,web_research:N.web_research??R.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=u,e[14]=k,e[15]=m,e[16]=S,e[17]=v,e[18]=g,e[19]=j):j=e[19];const f=u?.id,d=k?.id,w=m?.id;let U;e[20]!==t||e[21]!==r||e[22]!==S||e[23]!==v||e[24]!==g||e[25]!==f||e[26]!==d||e[27]!==w?(U=[r,t,S,v,g,f,d,w],e[20]=t,e[21]=r,e[22]=S,e[23]=v,e[24]=g,e[25]=f,e[26]=d,e[27]=w,e[28]=U):U=e[28],T.useEffect(j,U);let O;e[29]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=O):O=e[29];const z=y&&!I;let A;e[30]!==p||e[31]!==z?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[O,s.jsx(ft,{isPending:p,showSaved:z})]}),e[30]=p,e[31]=z,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==c?(D=mt.map(_=>s.jsx($e,{control:r.control,name:`tiers.${_.key}`,render:F=>{const{field:P}=F;return s.jsx(ke,{title:_.label,description:_.description,action:s.jsx(ut,{slot:P.value,defaultKeyId:t[0]?.id??null,filterModels:_.filter,onSlotChange:E=>{P.onChange(E),c()}})})}},_.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=c,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(me,{children:D}),e[37]=D,e[38]=K):K=e[38];let $;return e[39]!==A||e[40]!==K?($=s.jsxs(ue,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=$):$=e[41],$}function gt(e){return e.id}const ht={usd:[10,20,100],brl:[50,100,500]};function xt(){const e=M.c(29),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),[o,a]=T.useState(!1),{mutate:r,isPending:n}=ee({mutationFn:async d=>{const w=await l.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:d,currency:c}});if(w?.isError)throw new Error(w.content?.[0]?.text??"Failed to get top-up URL");return w.structuredContent?.url},onSuccess:yt,onError:bt}),[p,y]=T.useState(""),[I,h]=T.useState("usd"),c=I,u=parseFloat(p),k=!isNaN(u)&&u>=1,m=c==="brl"?"R$":"$";let S;e[3]!==h?(S=d=>{d&&h(d)},e[3]=h,e[4]=S):S=e[4];let v,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(he,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),g=s.jsx(he,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[5]=v,e[6]=g):(v=e[5],g=e[6]);let x;e[7]!==c||e[8]!==S?(x=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:c,onValueChange:S,children:[v,g]}),e[7]=c,e[8]=S,e[9]=x):x=e[9];let b;e[10]!==c||e[11]!==m||e[12]!==o||e[13]!==n||e[14]!==r?(b=!o&&s.jsxs(s.Fragment,{children:[ht[c].map(d=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:n,onClick:()=>r(d*100),children:[m,d]},d)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:n,children:"Custom"})]}),e[10]=c,e[11]=m,e[12]=o,e[13]=n,e[14]=r,e[15]=b):b=e[15];let j;e[16]!==m||e[17]!==p||e[18]!==u||e[19]!==o||e[20]!==k||e[21]!==n||e[22]!==y||e[23]!==r?(j=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:m}),s.jsx(le,{type:"number",min:"1",step:"1",placeholder:"50",value:p,onChange:d=>y(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!k||n,onClick:()=>r(Math.round(u*100)),children:n?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),y("")},children:"Cancel"})]}),e[16]=m,e[17]=p,e[18]=u,e[19]=o,e[20]=k,e[21]=n,e[22]=y,e[23]=r,e[24]=j):j=e[24];let f;return e[25]!==x||e[26]!==b||e[27]!==j?(f=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x,b,j]})}),e[25]=x,e[26]=b,e[27]=j,e[28]=f):f=e[28],f}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=M.c(61),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),o=ne(),a=te();let r;e[3]!==a?(r=a.find(It),e[3]=a,e[4]=r):r=e[4];const n=r,[p,y]=T.useState(!1);let I;e[5]!==l||e[6]!==n?(I=async()=>{n&&await l.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:n.id}})},e[5]=l,e[6]=n,e[7]=I):I=e[7];let h;e[8]!==t.id||e[9]!==o?(h=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),y(!1)},e[8]=t.id,e[9]=o,e[10]=h):h=e[10];let c;e[11]!==I||e[12]!==h?(c={mutationFn:I,onSuccess:h,onError:_t},e[11]=I,e[12]=h,e[13]=c):c=e[13];const{mutate:u,isPending:k}=ee(c);let m;e[14]!==t.id?(m=G.aiProviderCredits(t.id,"deco"),e[14]=t.id,e[15]=m):m=e[15];const S=!!n;let v;e[16]!==l?(v=async()=>{const fe=await l.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return fe?.isError?null:fe.structuredContent??null},e[16]=l,e[17]=v):v=e[17];let g;e[18]!==m||e[19]!==S||e[20]!==v?(g={queryKey:m,enabled:S,staleTime:6e4,queryFn:v},e[18]=m,e[19]=S,e[20]=v,e[21]=g):g=e[21];const{data:x,isLoading:b,refetch:j,isFetching:f}=Ie(g);if(!n)return null;const d=x?.balanceCents!=null?x.balanceCents/100:null;let w;e[22]!==d?(w=d!=null?`$${d.toFixed(2)}`:"—",e[22]=d,e[23]=w):w=e[23];const U=w;let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[24]=O):O=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=()=>y(!0),e[25]=z):z=e[25];let A;e[26]!==k?(A=s.jsxs("div",{className:"flex items-center justify-between",children:[O,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:k,children:"Disconnect"})]}),e[26]=k,e[27]=A):A=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(Ne,{children:[s.jsx(we,{children:"Disconnect Deco AI Gateway"}),s.jsx(Pe,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[28]=D):D=e[28];let K;e[29]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ae,{children:"Cancel"}),e[29]=K):K=e[29];let $;e[30]!==u?($=s.jsxs(De,{children:[D,s.jsxs(Ke,{children:[K,s.jsx(Ee,{onClick:()=>u(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[30]=u,e[31]=$):$=e[31];let _;e[32]!==p||e[33]!==$?(_=s.jsx(Fe,{open:p,onOpenChange:y,children:$}),e[32]=p,e[33]=$,e[34]=_):_=e[34];let F;e[35]!==d||e[36]!==U||e[37]!==f||e[38]!==b?(F=b||f?s.jsx(de,{className:"h-9 w-24"}):s.jsx("span",{className:ge("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&vt(d)),children:U}),e[35]=d,e[36]=U,e[37]=f,e[38]=b,e[39]=F):F=e[39];let P;e[40]!==j?(P=()=>j(),e[40]=j,e[41]=P):P=e[41];const E=f&&"animate-spin";let N;e[42]!==E?(N=ge(E),e[42]=E,e[43]=N):N=e[43];let L;e[44]!==N?(L=s.jsx(_e,{size:14,className:N}),e[44]=N,e[45]=L):L=e[45];let q;e[46]!==f||e[47]!==P||e[48]!==L?(q=s.jsx("button",{type:"button",onClick:P,disabled:f,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:L}),e[46]=f,e[47]=P,e[48]=L,e[49]=q):q=e[49];let R;e[50]!==F||e[51]!==q?(R=s.jsxs("div",{className:"flex items-baseline gap-2",children:[F,q]}),e[50]=F,e[51]=q,e[52]=R):R=e[52];let W;e[53]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[53]=W):W=e[53];let Y;e[54]!==R?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[R,W]}),e[54]=R,e[55]=Y):Y=e[55];let se;e[56]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(xt,{})]}),e[56]=se):se=e[56];let ie;return e[57]!==A||e[58]!==_||e[59]!==Y?(ie=s.jsx(ue,{title:"Deco AI Gateway",children:s.jsx(me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[A,_,Y,se]})})}),e[57]=A,e[58]=_,e[59]=Y,e[60]=ie):ie=e[60],ie}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function It(e){return e.providerId==="deco"}function St(){const e=M.c(11),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),o=ne();let a;e[3]!==l?(a=async()=>{const p=await l.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:"deco"}});if(p?.isError)throw new Error(p.content?.[0]?.text??"Key provisioning failed")},e[3]=l,e[4]=a):a=e[4];let r;e[5]!==t.id||e[6]!==o?(r=()=>{Se("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[5]=t.id,e[6]=o,e[7]=r):r=e[7];let n;return e[8]!==a||e[9]!==r?(n={mutationFn:a,onSuccess:r,onError:kt},e[8]=a,e[9]=r,e[10]=n):n=e[10],ee(n)}function kt(e){Se("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=M.c(10),{mutate:t,isPending:i}=St();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:l.join(", ")}}),e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=a):a=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let n;e[4]!==t?(n=()=>t(),e[4]=t,e[5]=n):n=e[5];const p=i?"Connecting…":"Connect Deco";let y;return e[6]!==i||e[7]!==n||e[8]!==p?(y=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[a,r,s.jsx(V,{variant:"outline",disabled:i,onClick:n,children:p})]})]}),e[6]=i,e[7]=n,e[8]=p,e[9]=y):y=e[9],y}const Nt=B({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function wt({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:o,currentBaseUrl:a,onCancel:r,onSuccess:n}){const{org:p}=H(),y=X({connectionId:J,orgId:p.id,orgSlug:p.slug}),I=ne(),[h,c]=T.useState(!1),u=t.id==="openai-compatible",k=t.supportedMethods.includes("api-key"),{register:m,handleSubmit:S,watch:v,formState:{errors:g}}=je({resolver:ve(Nt),defaultValues:{label:o,apiKey:"",baseUrl:a??""}}),x=v("apiKey")??"",{mutate:b,isPending:j}=ee({mutationFn:async f=>{let d;f.apiKey?u?d=JSON.stringify({baseUrl:f.baseUrl||a||"",apiKey:f.apiKey}):d=f.apiKey:u&&f.baseUrl&&f.baseUrl!==a&&(d=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await y.callTool({name:"AI_PROVIDER_KEY_UPDATE",arguments:{keyId:e.id,label:f.label,...d!==void 0?{apiKey:d}:{}}})},onSuccess:()=>{I.invalidateQueries({queryKey:G.aiProviderKeys(p.id)}),I.invalidateQueries({queryKey:G.aiProviders(p.id)}),Q.success("Provider updated"),n()},onError:f=>Q.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:S(f=>b(f)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(le,{placeholder:"e.g. Personal key",...m("label"),className:"h-8 text-sm"}),g.label&&s.jsx("p",{className:"text-xs text-destructive",children:g.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...m("baseUrl"),className:"h-8 text-sm"})]}),k&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(le,{type:h&&x?"text":"password",placeholder:l,...m("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),x&&s.jsx("button",{type:"button",onClick:()=>c(!h),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:h?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:j,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:j,children:j?"Saving...":"Save"})]})]})}function Pt(e){const t=M.c(31),{providerKey:i,provider:l,open:o,onOpenChange:a}=e,{org:r}=H();let n;t[0]!==r.id||t[1]!==r.slug?(n={connectionId:J,orgId:r.id,orgSlug:r.slug},t[0]=r.id,t[1]=r.slug,t[2]=n):n=t[2];const p=X(n);let y;t[3]!==l.id||t[4]!==i.presetId?(y=l.id==="openai-compatible"&&i.presetId?Re.find(j=>j.id===i.presetId):void 0,t[3]=l.id,t[4]=i.presetId,t[5]=y):y=t[5];const I=y,h=I?.name??l.name;let c;t[6]!==i.id?(c=G.aiProviderKeyPreview(i.id),t[6]=i.id,t[7]=c):c=t[7];let u;t[8]!==p||t[9]!==i.id?(u=async()=>(await p.callTool({name:"AI_PROVIDER_KEY_PREVIEW",arguments:{keyId:i.id}})).structuredContent,t[8]=p,t[9]=i.id,t[10]=u):u=t[10];let k;t[11]!==o||t[12]!==c||t[13]!==u?(k={queryKey:c,queryFn:u,enabled:o,staleTime:0},t[11]=o,t[12]=c,t[13]=u,t[14]=k):k=t[14];const{data:m,isLoading:S}=Ie(k);let v;t[15]!==h?(v=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",h]})}),t[15]=h,t[16]=v):v=t[16];let g;t[17]!==S||t[18]!==a||t[19]!==I||t[20]!==m||t[21]!==l||t[22]!==i?(g=S||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(rt,{})}):s.jsx(wt,{providerKey:i,provider:l,preset:I,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[17]=S,t[18]=a,t[19]=I,t[20]=m,t[21]=l,t[22]=i,t[23]=g):g=t[23];let x;t[24]!==v||t[25]!==g?(x=s.jsxs(it,{className:"sm:max-w-md",children:[v,g]}),t[24]=v,t[25]=g,t[26]=x):x=t[26];let b;return t[27]!==a||t[28]!==o||t[29]!==x?(b=s.jsx(ot,{open:o,onOpenChange:a,children:x}),t[27]=a,t[28]=o,t[29]=x,t[30]=b):b=t[30],b}function At(e){const t=M.c(51),{providerKey:i,provider:l}=e,{org:o}=H();let a;t[0]!==o.id||t[1]!==o.slug?(a={connectionId:J,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=a):a=t[2];const r=X(a),n=ne(),[p,y]=T.useState(!1),[I,h]=T.useState(!1),c=l.id==="openai-compatible";let u;t[3]!==c||t[4]!==i.presetId?(u=c&&i.presetId?Re.find(q=>q.id===i.presetId):void 0,t[3]=c,t[4]=i.presetId,t[5]=u):u=t[5];const k=u,m=k?k.name:c?"Custom OpenAI-compatible":l.name,S=k?.logo??l.logo;let v;e:{if(c){v=i.label;break e}const q=i.label;let R;t[6]!==i.createdAt?(R=lt(new Date(i.createdAt)),t[6]=i.createdAt,t[7]=R):R=t[7],v=`${q} · added ${R} ago`}const g=v;let x;t[8]!==r||t[9]!==i.id?(x=async()=>{await r.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:i.id}})},t[8]=r,t[9]=i.id,t[10]=x):x=t[10];let b;t[11]!==o.id||t[12]!==i.id||t[13]!==n?(b=()=>{n.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),n.invalidateQueries({queryKey:G.aiProviders(o.id)}),n.invalidateQueries({queryKey:G.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),y(!1)},t[11]=o.id,t[12]=i.id,t[13]=n,t[14]=b):b=t[14];let j;t[15]!==x||t[16]!==b?(j={mutationFn:x,onSuccess:b,onError:Dt},t[15]=x,t[16]=b,t[17]=j):j=t[17];const{mutate:f,isPending:d}=ee(j);let w;t[18]!==m||t[19]!==S?(w=S?s.jsx("img",{src:S,alt:m,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:m.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[18]=m,t[19]=S,t[20]=w):w=t[20];let U;t[21]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>h(!0),children:s.jsx(We,{size:14})}),t[21]=U):U=t[21];let O,z;t[22]===Symbol.for("react.memo_cache_sentinel")?(z=()=>y(!0),O=s.jsx(Ye,{size:14}),t[22]=O,t[23]=z):(O=t[22],z=t[23]);let A;t[24]!==d?(A=s.jsxs("div",{className:"flex items-center gap-0.5",children:[U,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:d,onClick:z,children:O})]}),t[24]=d,t[25]=A):A=t[25];let D;t[26]!==g||t[27]!==m||t[28]!==A||t[29]!==w?(D=s.jsx(ke,{icon:w,title:m,description:g,action:A}),t[26]=g,t[27]=m,t[28]=A,t[29]=w,t[30]=D):D=t[30];let K;t[31]!==I||t[32]!==l||t[33]!==i?(K=s.jsx(Pt,{providerKey:i,provider:l,open:I,onOpenChange:h}),t[31]=I,t[32]=l,t[33]=i,t[34]=K):K=t[34];let $;t[35]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(we,{children:"Delete API key"}),t[35]=$):$=t[35];let _;t[36]!==i.label?(_=s.jsxs(Ne,{children:[$,s.jsxs(Pe,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[36]=i.label,t[37]=_):_=t[37];let F;t[38]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Ae,{children:"Cancel"}),t[38]=F):F=t[38];let P;t[39]!==f?(P=s.jsxs(Ke,{children:[F,s.jsx(Ee,{onClick:()=>f(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[39]=f,t[40]=P):P=t[40];let E;t[41]!==_||t[42]!==P?(E=s.jsxs(De,{children:[_,P]}),t[41]=_,t[42]=P,t[43]=E):E=t[43];let N;t[44]!==p||t[45]!==E?(N=s.jsx(Fe,{open:p,onOpenChange:y,children:E}),t[44]=p,t[45]=E,t[46]=N):N=t[46];let L;return t[47]!==D||t[48]!==K||t[49]!==N?(L=s.jsxs(s.Fragment,{children:[D,K,N]}),t[47]=D,t[48]=K,t[49]=N,t[50]=L):L=t[50],L}function Dt(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=M.c(11),{onConnectClick:i}=e,l=te(),o=Ce();let a;t[0]!==o?.providers?(a=o?.providers??[],t[0]=o?.providers,t[1]=a):a=t[1];const r=a;let n;if(t[2]!==l||t[3]!==i||t[4]!==r){let p;t[6]!==r?(p=c=>({key:c,provider:r.find(u=>u.id===c.providerId)}),t[6]=r,t[7]=p):p=t[7];const y=l.filter(Rt).map(p).filter(Ft);let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Qe,{size:14}),t[8]=I):I=t[8];let h;t[9]!==i?(h=s.jsxs(V,{size:"sm",onClick:i,children:[I,"Connect provider"]}),t[9]=i,t[10]=h):h=t[10],n=s.jsx(ue,{title:"Connected providers",headerClassName:"px-0",actions:h,children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(me,{children:y.map(Et)})}),t[2]=l,t[3]=i,t[4]=r,t[5]=n}else n=t[5];return n}function Et(e){const{key:t,provider:i}=e;return s.jsx(At,{providerKey:t,provider:i},t.id)}function Ft(e){return e.provider!==void 0}function Rt(e){return e.providerId!=="deco"}function $t(e){const t=M.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Oe,{size:16}),t[0]=l):l=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Tt(){const e=M.c(23),t=te();let i;e[0]!==t?(i=t.some(Ot),e[0]=t,e[1]=i):i=e[1];const l=i,o=t.length>0,[a,r]=T.useState(!1),[n,p]=T.useState(null),y=Ce();let I;e[2]!==y?.providers?(I=y?.providers??[],e[2]=y?.providers,e[3]=I):I=e[3];const h=I;if(!o){let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=()=>r(!0),e[4]=v):v=e[4];let g;e[5]!==h?(g=s.jsx(Je,{providers:h,onSelect:p,onShowAll:v}),e[5]=h,e[6]=g):g=e[6];const x=n!==null||a;let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=w=>{w||(p(null),r(!1))},e[7]=b):b=e[7];const j=n??void 0;let f;e[8]!==x||e[9]!==j?(f=s.jsx(xe,{open:x,onOpenChange:b,initialProvider:j}),e[8]=x,e[9]=j,e[10]=f):f=e[10];let d;return e[11]!==g||e[12]!==f?(d=s.jsxs(s.Fragment,{children:[g,f]}),e[11]=g,e[12]=f,e[13]=d):d=e[13],d}let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(T.Suspense,{fallback:s.jsx(de,{className:"h-16 w-full"}),children:s.jsx(pt,{})}),e[14]=c):c=e[14];let u;e[15]!==l?(u=l?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=l,e[16]=u):u=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Kt,{onConnectClick:()=>r(!0)}),e[17]=k):k=e[17];let m;e[18]!==a?(m=s.jsx(xe,{open:a,onOpenChange:r}),e[18]=a,e[19]=m):m=e[19];let S;return e[20]!==u||e[21]!==m?(S=s.jsxs(s.Fragment,{children:[c,u,k,m]}),e[20]=u,e[21]=m,e[22]=S):S=e[22],S}function Ot(e){return e.providerId==="deco"}function Mt(){const e=M.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(oe.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(oe,{children:s.jsx(oe.Content,{children:s.jsx(oe.Body,{children:s.jsxs(Me,{children:[t,s.jsx(Te,{fallback:Ut,children:s.jsx(T.Suspense,{fallback:s.jsx(de,{className:"h-64 w-full"}),children:s.jsx(Tt,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx($t,{error:t??new Error("Failed to load AI providers")})}function Bs(){const e=M.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(nt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Mt,{})}),e[0]=t):t=e[0],t}export{Bs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as n,c as o,j as c,bt as d}from"./index-
|
|
1
|
+
import{e as n,c as o,j as c,bt as d}from"./index-zyABZOuD.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,bx as m,j as r,de as A,dc as w,dd as T,dz as O,bE as M,a8 as I,cx as z,dA as D,cy as F,dq as L,ag as G,df as k,cz as q,e as n,c as p,dB as v}from"./index-
|
|
1
|
+
import{r as i,bx as m,j as r,de as A,dc as w,dd as T,dz as O,bE as M,a8 as I,cx as z,dA as D,cy as F,dq as L,ag as G,df as k,cz as q,e as n,c as p,dB as v}from"./index-zyABZOuD.js";var x="AlertDialog",[B]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t,modal:!0})};N.displayName=x;var H="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});V.displayName=H;var W="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=W;var Y="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(q,{...o,...a,ref:e})});_.displayName=Y;var f="AlertDialogContent",[J,K]=B(f),Q=L("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as M,r as S,j as o,l as q}from"./index-zyABZOuD.js";import{S as G}from"./scroll-area-CoDX1NiP.js";import{j as H,a4 as J,d as Q}from"./index-CjS7yEti.js";import{S as U}from"./schema-form-xHOniAgD.js";import{S as W}from"./save-status-C5Jrjm-8.js";import"./select-DctRFe2b.js";import"./tooltip-B5fnRxsz.js";import"./Check-DwxWAe_A.js";import"./ChevronDown-DmPW0EFR.js";import"./ChevronUp-CFKEoO3S.js";import"./agent-capabilities-wKA4LBVJ.js";import"./chat-context-yFtmoeub.js";import"./tab-id-B-kIZoBW.js";import"./constants-CwxhhJva.js";import"./decopilot-sse-pool-I31A1Pzr.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-DsQdohZI.js";import"./use-collections-BEXrnaW6.js";import"./use-ai-providers-C_IYHgI4.js";import"./use-organization-settings-B5ihCN3e.js";import"./pair-Cy-O7asH.js";import"./agent-icon-DjUyM2GK.js";import"./AlertCircle-BPLBHL4z.js";import"./Tool01-W8F7AzYr.js";import"./SwitchHorizontal01-Co7U9zZ9.js";import"./RefreshCcw01-CFdSHPj-.js";import"./XCircle-oElWmNA3.js";import"./ArrowUpRight-BZM2WIfu.js";import"./ZapSquare-Cm_bfF8f.js";import"./Users03-CITbL542.js";import"./CheckCircle-B9Dg9VMf.js";import"./ChevronLeft-De4cWQ2U.js";import"./ChevronRight-vQ97Lphi.js";import"./DotsVertical-CMNXuxac.js";import"./Container-CGX8gjQO.js";import"./Eye-CouYr8Kp.js";import"./ZoomOut-BLhsYj6d.js";import"./Globe01-AF0aVf58.js";import"./FilterLines-pL0W8Z1S.js";import"./Star01-C9s5EBdt.js";import"./Palette-z1uB5Qcc.js";import"./HardDrive-B5t2ShDK.js";import"./Stars02-Xh71bZ8J.js";import"./Key01-PpEZMCXn.js";import"./LayoutLeft-B5MqBU8K.js";import"./LinkExternal01-C9lE7bqK.js";import"./Monitor01-659PEtN5.js";import"./Sun-DRvqv83H.js";import"./Play-Bj3fPStO.js";import"./Plus-CXI6DYsL.js";import"./SearchMd-M3oAe2yo.js";import"./Settings02-FDGyPWfA.js";import"./Shield01-CiQJomFU.js";import"./Stars01-DwRIvNMi.js";import"./Trash01-CgOGDFfp.js";import"./Upload01-B_kwcwAX.js";import"./User01-Dgc45Veo.js";import"./Users01-BNC9Bd-m.js";import"./XClose-CiNjOJj2.js";import"./X-CA12oOt8.js";import"./Zap-DLhCOSk9.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-W4IazqW3.js";import"./file-type-icon-_BUuCWpD.js";import"./dialog-B109gCE4.js";import"./content-blocks-o63cs2vh.js";import"./types-B5c8nvjk.js";import"./shell-layout-BdfarDBD.js";import"./avatar-D24kACpT.js";import"./required-auth-layout-C09G6Jq4.js";import"./useRouterState-B3abCKb4.js";import"./use-org-sso-BSILZLbv.js";import"./integration-icon-BdLUFe5T.js";import"./use-navigate-to-agent-BuiMoyxW.js";import"./use-connection-HsaENIHj.js";import"./use-mcp-prompts-CtFkmDVc.js";import"./form-CF-wg7fJ.js";import"./label-Dr9kjoUG.js";import"./input-CDcrM9F5.js";import"./spinner-wrYa3rBM.js";import"./drawer-BLP-m8Z0.js";import"./collection-search-C-2x8kfV.js";import"./tabs-DW34WfdD.js";import"./toggle-group-C8HVaLZk.js";import"./connect-desktop-dialog-mw47OvUe.js";import"./agent-icons-DRz2SdAx.js";import"./checkbox-iBP5ppXv.js";import"./skeleton-Bd8kPi36.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BjN2myxJ.js";import"./card-DB7Bse8h.js";import"./popover-GeFr7_oh.js";import"./command-D0ww2Igv.js";import"./index-qCFYlQXM.js";import"./useInfiniteQuery-DzyeLTn8.js";import"./infiniteQueryObserver-vYj_bKq_.js";import"./sortable.esm-D-dVzWNK.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BgNZe3SM.js";import"./use-registry-connections-BfE1grR0.js";import"./extract-connection-data-DfGwPk2j.js";import"./generate-id-C3DU72xl.js";import"./collections-DeSkD82x.js";import"./collection-tabs-C3f-lxbw.js";import"./badge-CPz8lLAV.js";import"./textarea-BI2lwl3S.js";import"./connection-form-helpers-ztgaVher.js";import"./use-infinite-scroll-DIgKhwnF.js";import"./useSuspenseInfiniteQuery-Cny-Kgzr.js";import"./index-DWtvHiKf.js";import"./dropdown-menu-DI-Jgf22.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-D4bOkWJX.js";import"./sidebar-B-1Eb4CM.js";import"./sheet-B47SStDa.js";import"./toolbar-FfjyIkw0.js";import"./use-create-virtual-mcp-CW8Va3LD.js";import"./github-repo-picker-DrUEn5Is.js";import"./use-mcp-tools-CpjckPZ3.js";import"./alert-dialog-CA-7j9GK.js";import"./index-Duj0G-k0.js";import"./use-org-auth-client-CIxt5K02.js";import"./hover-card-Bd5-01SZ.js";import"./task-status-Cxhenjjq.js";import"./use-status-sounds-BrsDTW7t.js";import"./empty-state-CyjruiTL.js";import"./resizable-Dgkt9WLc.js";import"./use-capability-0eHJrBnH.js";import"./header-tab-button-BxwKdHub.js";import"./index-MoSYdJ5P.js";import"./user-BM0cs7af.js";import"./tools-list-D7MOIvdE.js";import"./switch-CAxQPLyA.js";import"./use-debounced-autosave-DueSHS3l.js";import"./index-DlJ1CAZi.js";import"./search-input-C792V54k.js";import"./use-secrets-C4jjXpkz.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-1EStVhCm.js";import"./view-mode-toggle-e3EYesO4.js";import"./select-model-Hf7hJQdT.js";import"./use-automations-YduxJQuL.js";import"./monaco-editor-Bv0pswaY.js";import"./automation-runs-BRn-zWCB.js";import"./table-2TvOOTyl.js";import"./use-members-Bq_2zcti.js";import"./automation-list-row-BAzOudP_.js";import"./calendar-CjJD_oz1.js";import"./image-field-CMMojave.js";import"./use-file-configs-BWQSu2CQ.js";function qo(g){const t=M.c(38),{orgSlug:N,virtualMcpId:_,branch:k,blockKey:r,block:i,meta:m,title:E,excludeFields:n,schemaPending:C}=g,P=C===void 0?!1:C,e=typeof i?.__resolveType=="string"?i.__resolveType:"";let d;if(t[0]!==n||t[1]!==m||t[2]!==e){const c=e?H(e,m):null;d=c&&n?.length?{...c,properties:Object.fromEntries(Object.entries(c.properties??{}).filter(y=>{const[I]=y;return!n.includes(I)}))}:c,t[0]=n,t[1]=m,t[2]=e,t[3]=d}else d=t[3];const f=d;let u;t[4]!==i||t[5]!==r||t[6]!==m||t[7]!==E?(u=E??(i?J(r,i,m):r),t[4]=i,t[5]=r,t[6]=m,t[7]=E,t[8]=u):u=t[8];const B=u;let x;t[9]!==k||t[10]!==N||t[11]!==_?(x={orgSlug:N,virtualMcpId:_,branch:k},t[9]=k,t[10]=N,t[11]=_,t[12]=x):x=t[12];const{save:K,isPending:R}=Q(x),[A,L]=S.useState(r),[z,O]=S.useState(null),[V,D]=S.useState(0);let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[13]=h):h=t[13];const[w,$]=S.useState(h);A!==r&&(L(r),O(null),D(X),$([]));let v;t[14]!==i?(v=i??{},t[14]=i,t[15]=v):v=t[15];const F=z??v;let b;t[16]!==r||t[17]!==e||t[18]!==K?(b=c=>{const y=c;O(y),K(r,{...y,__resolveType:e})},t[16]=r,t[17]=e,t[18]=K,t[19]=b):b=t[19];const T=b;let p;t[20]!==B?(p=o.jsx("span",{className:"text-sm font-medium",children:B}),t[20]=B,t[21]=p):p=t[21];let s;t[22]!==R?(s=o.jsx(W,{isPending:R,isError:!1}),t[22]=R,t[23]=s):s=t[23];let l;t[24]!==p||t[25]!==s?(l=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[p,s]}),t[24]=p,t[25]=s,t[26]=l):l=t[26];let a;t[27]!==r||t[28]!==w||t[29]!==F||t[30]!==V||t[31]!==T||t[32]!==f||t[33]!==P?(a=o.jsx(G,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:f?o.jsx(U,{schema:f,value:F,onChange:T,basePath:"",breadcrumbPath:w,onBreadcrumbChange:$},`${r}:${V}`):P?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(q,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[27]=r,t[28]=w,t[29]=F,t[30]=V,t[31]=T,t[32]=f,t[33]=P,t[34]=a):a=t[34];let j;return t[35]!==l||t[36]!==a?(j=o.jsxs("div",{className:"flex h-full flex-col",children:[l,a]}),t[35]=l,t[36]=a,t[37]=j):j=t[37],j}function X(g){return g+1}export{qo as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l,g as m,j as t,A as f,S as h,h as x,i as r,k as p,N as u}from"./index-
|
|
1
|
+
import{e as l,g as m,j as t,A as f,S as h,h as x,i as r,k as p,N as u}from"./index-zyABZOuD.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o,j as i}from"./index-
|
|
1
|
+
import{e as o,j as i}from"./index-zyABZOuD.js";function f(r){const e=o.c(9),{children:n,visual:c}=r;let l;e[0]!==n?(l=i.jsx("section",{className:"flex flex-1 items-center justify-center bg-sidebar p-6 md:p-10",children:i.jsx("div",{className:"w-full max-w-[440px]",children:n})}),e[0]=n,e[1]=l):l=e[1];let s;e[2]!==c?(s=c??i.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[2]=c,e[3]=s):s=e[3];let t;e[4]!==s?(t=i.jsx("aside",{className:"relative hidden md:flex flex-1 overflow-hidden bg-muted",children:s}),e[4]=s,e[5]=t):t=e[5];let a;return e[6]!==l||e[7]!==t?(a=i.jsxs("main",{className:"flex min-h-screen w-full",children:[l,t]}),e[6]=l,e[7]=t,e[8]=a):a=e[8],a}export{f as A};
|
package/dist/client/assets/{automation-list-row-Ca7Xhucl.js → automation-list-row-BAzOudP_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as E,r as F,c as $,j as t,B as K}from"./index-
|
|
1
|
+
import{e as E,r as F,c as $,j as t,B as K}from"./index-zyABZOuD.js";import{b as O,d as B,e as I,g as L,c as H,f as Q,a as V,A as q}from"./alert-dialog-CA-7j9GK.js";import{a as G,D as J,b as U,c as W}from"./dropdown-menu-DI-Jgf22.js";import{A as X,Q as Y}from"./agent-icon-DjUyM2GK.js";import{i as Z}from"./DotsVertical-CMNXuxac.js";import{s as ee}from"./Trash01-CgOGDFfp.js";import{i as te}from"./Zap-DLhCOSk9.js";import{u as se}from"./use-virtual-mcp-DsQdohZI.js";import{u as ne}from"./use-automations-YduxJQuL.js";function pe(a){const e=E.c(53),{automation:s,showAgent:n,onClick:r}=a,{remove:i}=ne(),[P,S]=F.useState(!1),o=se(n?s.virtual_mcp_id:void 0);let D;e[0]!==s.id||e[1]!==i?(D=()=>{i.mutate(s.id),S(!1)},e[0]=s.id,e[1]=i,e[2]=D):D=e[2];const z=D;let A;e[3]!==r?(A=l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},e[3]=r,e[4]=A):A=e[4];const T=A,M=s.active&&s.trigger_count>0?"bg-emerald-500":"bg-muted-foreground/40";let c;e[5]!==M?(c=$("inline-block size-2 rounded-full shrink-0",M),e[5]=M,e[6]=c):c=e[6];const R=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let m;e[7]!==c||e[8]!==R?(m=t.jsx("span",{className:c,"aria-label":R}),e[7]=c,e[8]=R,e[9]=m):m=e[9];let u;e[10]!==o?.icon||e[11]!==o?.title||e[12]!==s.name||e[13]!==n?(u=n&&t.jsx(X,{icon:o?.icon??null,name:o?.title??s.name,size:"xs",className:"shrink-0"}),e[10]=o?.icon,e[11]=o?.title,e[12]=s.name,e[13]=n,e[14]=u):u=e[14];let d;e[15]!==s.name?(d=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[15]=s.name,e[16]=d):d=e[16];let g;e[17]!==o||e[18]!==n?(g=n&&o&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",o.title]}),e[17]=o,e[18]=n,e[19]=g):g=e[19];let f;e[20]!==d||e[21]!==g?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d,g]}),e[20]=d,e[21]=g,e[22]=f):f=e[22];let x;e[23]!==s.nearest_next_run_at||e[24]!==s.trigger_count?(x=t.jsx(oe,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[23]=s.nearest_next_run_at,e[24]=s.trigger_count,e[25]=x):x=e[25];let p;e[26]!==f||e[27]!==x?(p=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[f,x]}),e[26]=f,e[27]=x,e[28]=p):p=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(G,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(Z,{size:16})})}),e[29]=N):N=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{onClick:ie,onKeyDown:re,role:"presentation",className:"shrink-0",children:t.jsxs(J,{children:[N,t.jsx(U,{align:"end",children:t.jsxs(W,{variant:"destructive",onClick:l=>{l.stopPropagation(),S(!0)},children:[t.jsx(ee,{size:16}),"Delete"]})})]})}),e[30]=y):y=e[30];let h;e[31]!==T||e[32]!==r||e[33]!==p||e[34]!==m||e[35]!==u?(h=t.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:T,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[m,u,p,y]}),e[31]=T,e[32]=r,e[33]=p,e[34]=m,e[35]=u,e[36]=h):h=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(H,{children:"Delete automation?"}),e[37]=w):w=e[37];let j;e[38]!==s.name?(j=t.jsxs(O,{children:[w,t.jsxs(B,{children:["This removes"," ",t.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[38]=s.name,e[39]=j):j=e[39];let C;e[40]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Q,{children:"Cancel"}),e[40]=C):C=e[40];let _;e[41]!==z||e[42]!==i.isPending?(_=t.jsxs(I,{children:[C,t.jsx(L,{onClick:z,disabled:i.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[41]=z,e[42]=i.isPending,e[43]=_):_=e[43];let v;e[44]!==j||e[45]!==_?(v=t.jsxs(V,{children:[j,_]}),e[44]=j,e[45]=_,e[46]=v):v=e[46];let b;e[47]!==P||e[48]!==v?(b=t.jsx(q,{open:P,onOpenChange:S,children:v}),e[47]=P,e[48]=v,e[49]=b):b=e[49];let k;return e[50]!==h||e[51]!==b?(k=t.jsxs(t.Fragment,{children:[h,b]}),e[50]=h,e[51]=b,e[52]=k):k=e[52],k}function re(a){return a.stopPropagation()}function ie(a){return a.stopPropagation()}function oe(a){const e=E.c(4),{triggerCount:s,nextRunAt:n}=a;if(s===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=i):i=e[0],i}let r;return e[1]!==n||e[2]!==s?(r=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):t.jsxs(t.Fragment,{children:[t.jsx(te,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=r):r=e[3],r}export{pe as A};
|