decocms 3.84.1 → 3.84.3
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-CmMED3h6.js → AlertCircle-CBqPbJhE.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DwILncVx.js → ArrowUpRight-CeK93HMb.js} +1 -1
- package/dist/client/assets/{CheckCircle-DpKZZDmN.js → CheckCircle-DZ7lx3KF.js} +1 -1
- package/dist/client/assets/{ChevronDown-BjzwFuai.js → ChevronDown-CJWYZLuA.js} +1 -1
- package/dist/client/assets/{ChevronLeft-uRkOj5F8.js → ChevronLeft-CnLqo_kp.js} +1 -1
- package/dist/client/assets/{ChevronRight-BRGGbOax.js → ChevronRight-DfdMQ2Fw.js} +1 -1
- package/dist/client/assets/{ChevronUp-CzO_7LvF.js → ChevronUp-D9KnZoAi.js} +1 -1
- package/dist/client/assets/{DotsVertical-DshGnU_X.js → DotsVertical-DFqqfAl6.js} +1 -1
- package/dist/client/assets/{Eye-BBVg-SSa.js → Eye-BT74up7P.js} +1 -1
- package/dist/client/assets/{FilterLines-CowTK4HW.js → FilterLines-C8AP3gRc.js} +1 -1
- package/dist/client/assets/{Globe01-Cm82tRCS.js → Globe01-D-zy1b5e.js} +1 -1
- package/dist/client/assets/{Globe04-DrE78eQQ.js → Globe04-CTK-EMBE.js} +1 -1
- package/dist/client/assets/{HardDrive-DsahIXX5.js → HardDrive-C5zzTdLP.js} +1 -1
- package/dist/client/assets/{Key01-CwoTMTFC.js → Key01-CGqUyM9V.js} +1 -1
- package/dist/client/assets/{LayoutLeft-_ZNcVcNz.js → LayoutLeft-ByH5X-SK.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BeE3-oct.js → LinkExternal01-BPuS9hJa.js} +1 -1
- package/dist/client/assets/{Monitor01-Aa4wN2Ct.js → Monitor01-CoqnETyV.js} +1 -1
- package/dist/client/assets/{Palette-DT-obB9z.js → Palette-COnOloJT.js} +1 -1
- package/dist/client/assets/{Play-D7fUrl6h.js → Play-B0YCT5-m.js} +1 -1
- package/dist/client/assets/{Plus-CK2CAzo5.js → Plus-B8D680G_.js} +1 -1
- package/dist/client/assets/{SearchMd-B3Rw93l5.js → SearchMd-u8dQ1GMf.js} +1 -1
- package/dist/client/assets/{Settings02-B1ZVVT_e.js → Settings02-BWSkBAC0.js} +1 -1
- package/dist/client/assets/{Shield01-BR2mZOZb.js → Shield01-D6oYrc9O.js} +1 -1
- package/dist/client/assets/{Star01-DBcQByZk.js → Star01-6xSTQrG2.js} +1 -1
- package/dist/client/assets/{Stars01-aJC5veoy.js → Stars01-CC6YF-Gm.js} +1 -1
- package/dist/client/assets/{Stars02-BwRZ8reG.js → Stars02-CsFUuUcv.js} +1 -1
- package/dist/client/assets/{Sun-BMePDS8S.js → Sun-Boa0IILr.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B_NmbobE.js → SwitchHorizontal01-CS0hM449.js} +1 -1
- package/dist/client/assets/{Tool01-CZPk8Ney.js → Tool01-DKSKRkDn.js} +1 -1
- package/dist/client/assets/{Trash01-SWS-_O9Z.js → Trash01-CWfKClvv.js} +1 -1
- package/dist/client/assets/{Upload01-CoqelT_E.js → Upload01-Dzd1geuw.js} +1 -1
- package/dist/client/assets/{User01-Do5enW22.js → User01-C8VsM6kw.js} +1 -1
- package/dist/client/assets/{Users01-BmWtNHuf.js → Users01-3oKdAMi1.js} +1 -1
- package/dist/client/assets/{Users03-B_G71vm-.js → Users03-BNYrsyyA.js} +1 -1
- package/dist/client/assets/{X-CO9z9Xp0.js → X-CSyvhNbh.js} +1 -1
- package/dist/client/assets/{XCircle-BFWoSw7W.js → XCircle-DX7bokFz.js} +1 -1
- package/dist/client/assets/{XClose-BO6FjXoT.js → XClose-BDFu3FRS.js} +1 -1
- package/dist/client/assets/{Zap-Bs_ao0zW.js → Zap-CXfIxPjW.js} +1 -1
- package/dist/client/assets/{ZapSquare-CmQdJEdR.js → ZapSquare-CRuF7_Od.js} +1 -1
- package/dist/client/assets/{ZoomOut-BR28jpI9.js → ZoomOut-hi-FNg6F.js} +1 -1
- package/dist/client/assets/{access-gate-mrUaShW4.js → access-gate-C-kLa8V2.js} +1 -1
- package/dist/client/assets/{add-section-modal-BTy1RUe_.js → add-section-modal-DzwoE-VD.js} +1 -1
- package/dist/client/assets/{agent-icon-BB0OI_Zf.js → agent-icon-B5jKg1D4.js} +1 -1
- package/dist/client/assets/agents-list-DPApd7XV.js +1 -0
- package/dist/client/assets/ai-providers-C09A26hu.js +1 -0
- package/dist/client/assets/{alert-FpAPxAaA.js → alert-B6KsNvdj.js} +1 -1
- package/dist/client/assets/{alert-dialog-CU4F0Cas.js → alert-dialog-BMQCNP5r.js} +1 -1
- package/dist/client/assets/app-editor-B4OFXY5P.js +1 -0
- package/dist/client/assets/{auth-DscXYOeb.js → auth-BkwEkX2d.js} +1 -1
- package/dist/client/assets/{auth-catchall-BtmfoD1y.js → auth-catchall-C3EDy8Lr.js} +1 -1
- package/dist/client/assets/{auth-entry-CC1ARBuN.js → auth-entry-cn4hgqYj.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Cxddqcmf.js → auth-split-layout-DsYH7119.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-KVWekoHI.js → authenticate-and-persist-oauth-CYtmcv5M.js} +1 -1
- package/dist/client/assets/{automation-list-row-DdnU0_oJ.js → automation-list-row-B6RsIqvM.js} +1 -1
- package/dist/client/assets/{automation-runs-CxkH2J7y.js → automation-runs-CMCvBggE.js} +1 -1
- package/dist/client/assets/automations-BpvvdMu8.js +1 -0
- package/dist/client/assets/{avatar-B2rvHJ2u.js → avatar-DVfn3HK-.js} +1 -1
- package/dist/client/assets/{badge-Bu3HgcYX.js → badge-C-PgyJP_.js} +1 -1
- package/dist/client/assets/{block-document-DR69_B0F.js → block-document-C3HZF41z.js} +1 -1
- package/dist/client/assets/brand-context-BV09oT1U.js +1 -0
- package/dist/client/assets/buckets-p48X8MxL.js +1 -0
- package/dist/client/assets/{capability-load-error-CmAUMxoM.js → capability-load-error-8Q7IbpjY.js} +1 -1
- package/dist/client/assets/{card-kDiEfTw9.js → card-Cg4U92wO.js} +1 -1
- package/dist/client/assets/category-editor-BFj-n6b6.js +1 -0
- package/dist/client/assets/{chat-context-D6S41DOV.js → chat-context-Dphq5ubi.js} +1 -1
- package/dist/client/assets/{checkbox-CsCGEg8f.js → checkbox-BAdcCLlw.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B79VcMNm.js → cli-auth-success-C_or_CmK.js} +1 -1
- package/dist/client/assets/collection-detail-DThGhP7u.js +1 -0
- package/dist/client/assets/{collection-display-button-BKfSRcS4.js → collection-display-button-C5aIg6vR.js} +1 -1
- package/dist/client/assets/{collection-search-Did_rDKr.js → collection-search-BlM-1h2p.js} +1 -1
- package/dist/client/assets/{collection-tabs-BWGqEvBL.js → collection-tabs-DLdr8wLT.js} +1 -1
- package/dist/client/assets/{command-HyE3vuW8.js → command-CSVnblSP.js} +1 -1
- package/dist/client/assets/commerce-onboarding-BKSKu197.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-DzyRhy80.js → connect-desktop-dialog-VHzsIUyV.js} +1 -1
- package/dist/client/assets/{connection-card-D0jDIFWU.js → connection-card-D4RLitiQ.js} +1 -1
- package/dist/client/assets/connection-detail-CE3VlhwT.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DoxJStk3.js → connection-form-helpers-CZiloNgc.js} +1 -1
- package/dist/client/assets/connections-mZne5BrK.js +1 -0
- package/dist/client/assets/{context-menu-CBHA394l.js → context-menu-DYeV_YKF.js} +1 -1
- package/dist/client/assets/{decopilot-Cs0sTBvJ.js → decopilot-DlqOnjYH.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DCimHDb8.js → decopilot-sse-pool-dougyUqv.js} +1 -1
- package/dist/client/assets/{dialog-D4-cpiIq.js → dialog-CvVsKEYZ.js} +1 -1
- package/dist/client/assets/{domain-settings-CpdgF4g-.js → domain-settings-DsdL2e7s.js} +1 -1
- package/dist/client/assets/{drawer-EynyRy5s.js → drawer-BwNOtTqY.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DgXWnPV7.js → dropdown-menu-Btez7WVe.js} +1 -1
- package/dist/client/assets/{empty-state-BqLGg5Qt.js → empty-state-B1HRggjH.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BrfuWfn9.js → extract-connection-data-CT8AxPCy.js} +1 -1
- package/dist/client/assets/file-explorer-DpO6Na_G.js +2 -0
- package/dist/client/assets/{file-type-icon-vWAzpBPp.js → file-type-icon-CzW2A5RE.js} +1 -1
- package/dist/client/assets/{files-CelzOm7s.js → files-Ip15kqmr.js} +1 -1
- package/dist/client/assets/{form-C0rXEiGF.js → form-BWMflY-D.js} +1 -1
- package/dist/client/assets/general-Ds-uKNgF.js +1 -0
- package/dist/client/assets/{github-repo-picker-BMm6sNS0.js → github-repo-picker-DjPaaZ8o.js} +1 -1
- package/dist/client/assets/{hooks-iTnRVGBT.js → hooks-DHpz1d4N.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-CEwUaYj8.js → import-from-deco-dialog-DpallAXe.js} +1 -1
- package/dist/client/assets/index-B1FrmLLd.js +1 -0
- package/dist/client/assets/index-BWjIO2_h.js +1 -0
- package/dist/client/assets/{index-BafofCVM.js → index-BgmIzn4p.js} +1 -1
- package/dist/client/assets/{index-DU_rFtey.js → index-BseuxgOP.js} +1 -1
- package/dist/client/assets/{index-7--My7Kk.js → index-CDQDonc2.js} +18 -18
- package/dist/client/assets/{index-nQQO626p.js → index-CZynoR0p.js} +1 -1
- package/dist/client/assets/{index-C1yj8oW9.js → index-Cdi_SW9v.js} +4 -4
- package/dist/client/assets/{index-Bt_ZjPsW.js → index-ChJT_O6D.js} +1 -1
- package/dist/client/assets/{index-CChD3seh.js → index-DNuFDhRe.js} +2 -2
- package/dist/client/assets/{index-C6QKjDvm.js → index-DPtZiiq2.js} +1 -1
- package/dist/client/assets/{index-BHPHIMku.js → index-DpoaFFFe.js} +2 -2
- package/dist/client/assets/{index-D5MvY5fk.js → index-Dy0NHd84.js} +1 -1
- package/dist/client/assets/{index-ChS8eVb4.js → index-K-9e2ZDA.js} +1 -1
- package/dist/client/assets/{index-BeL2IYvj.js → index-W4B0CmtU.js} +1 -1
- package/dist/client/assets/{index-redirect-ZLqUsySW.js → index-redirect-Bn8nTxK6.js} +1 -1
- package/dist/client/assets/{input-CjEjpxdM.js → input-C85X5mQd.js} +1 -1
- package/dist/client/assets/{integration-icon-CSYS5mut.js → integration-icon-5EPhLKNh.js} +1 -1
- package/dist/client/assets/{label-B1XS6835.js → label-BQtTOPkv.js} +1 -1
- package/dist/client/assets/{login-BwzmQ6Vl.js → login-GQgDbR7c.js} +1 -1
- package/dist/client/assets/{mcp-oauth-RIVS58UD.js → mcp-oauth-DuXz7McC.js} +1 -1
- package/dist/client/assets/{members-Cv5_M0H8.js → members-DDkcjjUM.js} +2 -2
- package/dist/client/assets/{monaco-editor-BhcbAKhi.js → monaco-editor-BORZmFin.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D2hdprzy.js → monitoring-stats-row-I3txRI3K.js} +1 -1
- package/dist/client/assets/{oauth-callback-Ca8aLtLz.js → oauth-callback-BDkUtUND.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-nS8-aDg-.js → oauth-callback-ai-provider-DR6T8Hni.js} +1 -1
- package/dist/client/assets/{onboarding-DokdM2si.js → onboarding-BZtattlf.js} +1 -1
- package/dist/client/assets/{org-install-CFBQ5UN5.js → org-install-ByMo7TpY.js} +1 -1
- package/dist/client/assets/{org-layout-2xw7J9o1.js → org-layout-CibjT00r.js} +1 -1
- package/dist/client/assets/{organization-choice-B7gbF-gx.js → organization-choice-DG1wa9ZD.js} +1 -1
- package/dist/client/assets/{page-seo-form-B9gdIgu6.js → page-seo-form-BnV5BbeL.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DALiYt9z.js +1 -0
- package/dist/client/assets/{popover-C7DR14Uv.js → popover-B07cKons.js} +1 -1
- package/dist/client/assets/post-editor-CybfyzFh.js +1 -0
- package/dist/client/assets/{preview-dialog-D0Xo8R0Y.js → preview-dialog-CmWcwQ_d.js} +1 -1
- package/dist/client/assets/{primitives-BGDftBXt.js → primitives-C4IQk_dn.js} +1 -1
- package/dist/client/assets/profile-l-wWEHSm.js +1 -0
- package/dist/client/assets/project-app-view-BvnkCP6L.js +1 -0
- package/dist/client/assets/record-editor-ChFWUCDb.js +1 -0
- package/dist/client/assets/registry-Dpu3-9ah.js +2 -0
- package/dist/client/assets/{registry-layout-CepDP4zO.js → registry-layout-B8IjWU4h.js} +2 -2
- package/dist/client/assets/{require-capability-CI6JAqgD.js → require-capability-DUC2rNq-.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Be42uHMA.js → required-auth-layout-BemkjKan.js} +1 -1
- package/dist/client/assets/{reset-password-vSV6JpaW.js → reset-password-BSCLBo6Q.js} +1 -1
- package/dist/client/assets/roles-BYwsj8Sz.js +1 -0
- package/dist/client/assets/{save-status-B4LrYjc4.js → save-status-sNJre79x.js} +1 -1
- package/dist/client/assets/{scroll-area-Btbw5x0S.js → scroll-area-dzkBqX8_.js} +1 -1
- package/dist/client/assets/{search-input-BJySI9eP.js → search-input-CAgO5lFg.js} +1 -1
- package/dist/client/assets/secrets-VODDM6qM.js +1 -0
- package/dist/client/assets/{sections-editor-73TndVEn.js → sections-editor-rMfKmqo4.js} +2 -2
- package/dist/client/assets/select-DEG7PFkZ.js +1 -0
- package/dist/client/assets/{select-model-Da9fCD4_.js → select-model-zOa-Rdrr.js} +1 -1
- package/dist/client/assets/seo-editor-BRcQaVtJ.js +1 -0
- package/dist/client/assets/settings-layout-BJN2SrZW.js +1 -0
- package/dist/client/assets/{settings-section-BIuqqQso.js → settings-section-51WiZXYd.js} +1 -1
- package/dist/client/assets/{sheet-CzR0tmZA.js → sheet-0vdtuc3i.js} +1 -1
- package/dist/client/assets/{shell-controls-B_8RFrNm.js → shell-controls-CDkTdWuk.js} +1 -1
- package/dist/client/assets/{shell-layout-DPTryinF.js → shell-layout-BdF9IDeE.js} +1 -1
- package/dist/client/assets/{shell-route-loading-D5ohEyID.js → shell-route-loading-D58stY2L.js} +1 -1
- package/dist/client/assets/{sidebar-BLFhVRa1.js → sidebar-BqyUOUvx.js} +1 -1
- package/dist/client/assets/{skeleton-BhIDQEW6.js → skeleton-BWev8k8G.js} +1 -1
- package/dist/client/assets/{sortable.esm-BrVUE0Ot.js → sortable.esm-A8tP5NgA.js} +1 -1
- package/dist/client/assets/sso-DS5DzPVa.js +1 -0
- package/dist/client/assets/store-CSIMYuDp.js +1 -0
- package/dist/client/assets/store-registry-CJiDvQQc.js +2 -0
- package/dist/client/assets/{studio-tools-cTyVqaHA.js → studio-tools-D8jocIuF.js} +1 -1
- package/dist/client/assets/{switch-DoFOdYGu.js → switch-Cq8_Q7W_.js} +1 -1
- package/dist/client/assets/{table-zRS7Teha.js → table-Dsj-XDfc.js} +1 -1
- package/dist/client/assets/{tabs-CQOpbrKh.js → tabs-By9RVZpO.js} +1 -1
- package/dist/client/assets/{task-status-DjLIycFQ.js → task-status-D9dvEJiX.js} +1 -1
- package/dist/client/assets/{textarea-Cya3KDiz.js → textarea-DPdVb49N.js} +1 -1
- package/dist/client/assets/{toggle-group-DENfWHtP.js → toggle-group-BVAqJsgZ.js} +1 -1
- package/dist/client/assets/{toolbar-CO9czXOO.js → toolbar-CP1DI4yM.js} +1 -1
- package/dist/client/assets/tooltip-B8O5EzJh.js +1 -0
- package/dist/client/assets/{types-DkLih0NK.js → types-Di9YuMWP.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BB_netT8.js → use-ai-providers-_Cu_CUx8.js} +1 -1
- package/dist/client/assets/{use-automations-C4-BEJDp.js → use-automations-Bluj9UpJ.js} +1 -1
- package/dist/client/assets/{use-capability-DtJSLljk.js → use-capability-054Jlz5j.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Bo_9gN4h.js → use-clock-tick-2NgWXYqH.js} +1 -1
- package/dist/client/assets/{use-collections-C5z5SeL0.js → use-collections--Li9hsny.js} +1 -1
- package/dist/client/assets/{use-connection-DYuQNBQ8.js → use-connection-CV9pGQq0.js} +1 -1
- package/dist/client/assets/{use-copy-V2SquoUh.js → use-copy-C7bsJAWf.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DqGii1ks.js → use-create-virtual-mcp-Bg23ngKV.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B5XSTYsz.js → use-debounced-autosave-BBjgbH01.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D_b2gPBM.js → use-delete-connection-BxK8edOU.js} +1 -1
- package/dist/client/assets/{use-file-configs-CSX8A1vE.js → use-file-configs-KASOspWn.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BaJGyvxX.js → use-infinite-scroll-Dj9UAgIo.js} +1 -1
- package/dist/client/assets/{use-join-requests-dGis0QYB.js → use-join-requests-BPtAiUq0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-90IJIS7G.js → use-mcp-client-DBqNVBda.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D2ucpusX.js → use-mcp-prompts-C_k5ossc.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-IJf4yY8f.js → use-mcp-tools-B4W-z7bl.js} +1 -1
- package/dist/client/assets/{use-members-DSWXPVdi.js → use-members-9RqOs3Qh.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D_hba2ju.js → use-navigate-to-agent-zUK-3Xnr.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Bmz_glRx.js → use-org-auth-client-d3773LF8.js} +1 -1
- package/dist/client/assets/{use-org-sso-d8VUjdDF.js → use-org-sso-CpvSwXK-.js} +1 -1
- package/dist/client/assets/{use-organization-roles-AnHrNvDP.js → use-organization-roles-BJf7IYH2.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B-FYwlct.js → use-organization-settings-D73e98lK.js} +1 -1
- package/dist/client/assets/{use-registry-connections-COP2SiNd.js → use-registry-connections-BWn-5VV_.js} +1 -1
- package/dist/client/assets/{use-secrets-CgpawoY3.js → use-secrets-CLwAc1Jw.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CO3Rxsnj.js → use-status-sounds-Dl5xgyQC.js} +1 -1
- package/dist/client/assets/{use-view-mode-CbF51x_n.js → use-view-mode-q6Q13eC9.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-yUKVcLc_.js → use-virtual-mcp-DjogNdpY.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-bc8haI9M.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BbH0X03C.js +1 -0
- package/dist/client/assets/variant-calendar-B-JZS_wJ.js +1 -0
- package/dist/client/assets/{view-mode-toggle-D1TNBVMm.js → view-mode-toggle-DMN8QWmQ.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agents-list-DP438aHv.js +0 -1
- package/dist/client/assets/ai-providers-CHjXy2IX.js +0 -1
- package/dist/client/assets/app-editor-DbyBYBd1.js +0 -1
- package/dist/client/assets/automations-CHJDB1Wn.js +0 -1
- package/dist/client/assets/brand-context-BsVjZN3k.js +0 -1
- package/dist/client/assets/buckets-BH1wtZ3x.js +0 -1
- package/dist/client/assets/category-editor-CAYNohGr.js +0 -1
- package/dist/client/assets/collection-detail-BV78giTN.js +0 -1
- package/dist/client/assets/commerce-onboarding-CbmMdla_.js +0 -1
- package/dist/client/assets/connection-detail-CTydjWNJ.js +0 -1
- package/dist/client/assets/connections-BZqNukEV.js +0 -1
- package/dist/client/assets/file-explorer-l8kW6-_R.js +0 -2
- package/dist/client/assets/general-Bcxz5b3F.js +0 -1
- package/dist/client/assets/index-C9vgWyOp.js +0 -1
- package/dist/client/assets/index-D6W1a9Ed.js +0 -1
- package/dist/client/assets/index-uuDmStBi.js +0 -1
- package/dist/client/assets/page-seo-sheet-Dim8a_29.js +0 -1
- package/dist/client/assets/post-editor-Dwsexwwq.js +0 -1
- package/dist/client/assets/profile-Tt594UKC.js +0 -1
- package/dist/client/assets/project-app-view-BWGayozD.js +0 -1
- package/dist/client/assets/record-editor-Cf-PzES3.js +0 -1
- package/dist/client/assets/registry-Bt-hzkrl.js +0 -2
- package/dist/client/assets/roles-DVimCkc2.js +0 -1
- package/dist/client/assets/secrets-CgCqWHuI.js +0 -1
- package/dist/client/assets/select-Bdte2-mH.js +0 -1
- package/dist/client/assets/seo-editor-oYyGw_6F.js +0 -1
- package/dist/client/assets/settings-layout-CnLgsNWc.js +0 -1
- package/dist/client/assets/sso-Dz4ih-D0.js +0 -1
- package/dist/client/assets/store-41qcx4ON.js +0 -1
- package/dist/client/assets/store-registry-Du1ihhH9.js +0 -2
- package/dist/client/assets/tooltip-Cvbl_0l0.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BxIrRxsB.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DENvoLd9.js +0 -1
- package/dist/client/assets/variant-calendar-Cjzj9fQr.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,l as d,r as p,j as r}from"./index-
|
|
1
|
+
import{c as f,l as d,r as p,j as r}from"./index-Cdi_SW9v.js";import{m as w}from"./sidebar-BqyUOUvx.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{c as le,r as K,b as yt,w as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,a7 as rs,u as ls,s as xt,E as os}from"./index-
|
|
1
|
+
import{c as le,r as K,b as yt,w as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,a7 as rs,u as ls,s as xt,E as os}from"./index-Cdi_SW9v.js";import{S as as}from"./search-input-CAgO5lFg.js";import{P as De}from"./index-ChJT_O6D.js";import{E as St}from"./empty-state-B1HRggjH.js";import{R as ns}from"./require-capability-DUC2rNq-.js";import{J as Tt,S as is}from"./scroll-area-dzkBqX8_.js";import{u as vt}from"./use-connection-CV9pGQq0.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-C-PgyJP_.js";import{P as ct,a as dt,b as mt}from"./popover-B07cKons.js";import{b as Ze,T as et,a as tt}from"./tooltip-B8O5EzJh.js";import{i as ft,n as cs}from"./ChevronUp-D9KnZoAi.js";import{a as Xe}from"./Eye-BT74up7P.js";import{n as Mt}from"./Globe01-D-zy1b5e.js";import{i as At}from"./FilterLines-C8AP3gRc.js";import{i as ds}from"./Key01-CGqUyM9V.js";import{i as ms}from"./Play-B0YCT5-m.js";import{aj as us,T as xs,M as fs}from"./agent-icon-B5jKg1D4.js";import{M as _t}from"./monaco-editor-BORZmFin.js";import{u as ps}from"./use-members-9RqOs3Qh.js";import{S as hs,u as gs,W as js}from"./use-mcp-client-DBqNVBda.js";import{u as vs}from"./use-virtual-mcp-DjogNdpY.js";import{n as Qe}from"./XCircle-DX7bokFz.js";import{c as Ns}from"./SwitchHorizontal01-CS0hM449.js";import{s as bs}from"./Plus-B8D680G_.js";import{s as ys}from"./Trash01-CWfKClvv.js";import{I as Ge}from"./input-C85X5mQd.js";import{C as ws,g as Ss,b as Dt,f as st,a as Vt,c as pt,d as Is,e as Lt,h as Ut,A as Cs,T as ks,i as Ts,M as ht}from"./automation-runs-CMCvBggE.js";import{b as lt,c as ot,S as at,a as $e,d as nt}from"./select-DEG7PFkZ.js";import{t as Kt}from"./ChevronDown-CJWYZLuA.js";import{s as Ms}from"./Stars02-CsFUuUcv.js";import{T as _s}from"./textarea-DPdVb49N.js";import{C as qt}from"./collection-tabs-DLdr8wLT.js";import{S as Ds}from"./switch-Cq8_Q7W_.js";import{L as Ls}from"./label-BQtTOPkv.js";import{I as qe}from"./integration-icon-5EPhLKNh.js";import{A as Bt}from"./avatar-DVfn3HK-.js";import{A as Fs,a as Rs,b as $s}from"./alert-B6KsNvdj.js";import{C as Ht}from"./card-Cg4U92wO.js";import{K as Me}from"./monitoring-stats-row-I3txRI3K.js";import{u as Jt}from"./studio-tools-D8jocIuF.js";import{u as zs}from"./useSuspenseInfiniteQuery-BbH0X03C.js";import{b as Os,S as Es,c as Ps,d as As}from"./sheet-0vdtuc3i.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-Dsj-XDfc.js";import{u as Vs}from"./use-infinite-scroll-Dj9UAgIo.js";import{c as Us,b as Ks}from"./use-automations-Bluj9UpJ.js";import"./SearchMd-u8dQ1GMf.js";import"./sidebar-BqyUOUvx.js";import"./LayoutLeft-ByH5X-SK.js";import"./use-capability-054Jlz5j.js";import"./access-gate-C-kLa8V2.js";import"./capability-load-error-8Q7IbpjY.js";import"./Stars01-CC6YF-Gm.js";import"./ChevronRight-DfdMQ2Fw.js";import"./use-clock-tick-2NgWXYqH.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C7bsJAWf.js";import"./file-type-icon-CzW2A5RE.js";import"./dialog-CvVsKEYZ.js";import"./X-CSyvhNbh.js";import"./ZoomOut-hi-FNg6F.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-Di9YuMWP.js";import"./chat-context-Dphq5ubi.js";import"./hooks-DHpz1d4N.js";import"./decopilot-sse-pool-dougyUqv.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-_Cu_CUx8.js";import"./use-organization-settings-D73e98lK.js";import"./AlertCircle-CBqPbJhE.js";import"./Star01-6xSTQrG2.js";import"./XClose-BDFu3FRS.js";import"./ZapSquare-CRuF7_Od.js";import"./Tool01-DKSKRkDn.js";import"./Monitor01-CoqnETyV.js";import"./Upload01-Dzd1geuw.js";import"./shell-layout-BdF9IDeE.js";import"./Users03-BNYrsyyA.js";import"./CheckCircle-DZ7lx3KF.js";import"./Zap-CXfIxPjW.js";import"./required-auth-layout-BemkjKan.js";import"./use-org-sso-CpvSwXK-.js";import"./LinkExternal01-BPuS9hJa.js";import"./ArrowUpRight-CeK93HMb.js";import"./Palette-COnOloJT.js";import"./use-navigate-to-agent-zUK-3Xnr.js";import"./use-mcp-prompts-C_k5ossc.js";import"./form-BWMflY-D.js";import"./use-collections--Li9hsny.js";import"./Settings02-BWSkBAC0.js";import"./ChevronLeft-CnLqo_kp.js";import"./DotsVertical-DFqqfAl6.js";import"./Globe04-CTK-EMBE.js";import"./HardDrive-C5zzTdLP.js";import"./Sun-Boa0IILr.js";import"./Shield01-D6oYrc9O.js";import"./User01-C8VsM6kw.js";import"./Users01-3oKdAMi1.js";import"./index-Dy0NHd84.js";import"./use-org-auth-client-d3773LF8.js";import"./auth-BkwEkX2d.js";import"./useInfiniteQuery-bc8haI9M.js";import"./task-status-D9dvEJiX.js";import"./checkbox-BAdcCLlw.js";import"./command-CSVnblSP.js";import"./index-DPtZiiq2.js";import"./index-W4B0CmtU.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
2
|
`)}function Ft(s){return s.trim()?s.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=Nt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,Nt.maxJsonRenderSize)+`
|
|
4
4
|
|
|
5
5
|
... [TRUNCATED - content too large to display]`,isTruncated:!0,originalSize:r}}function Hs(s){const e=le.c(117),{log:r}=s,[l,a]=K.useState(!1),[o,c]=K.useState(!1),i=yt(),{org:n}=Be(),d=vt(),f=Rt(r.input),p=Rt(r.output),v=Js;let b;e[0]!==r.input||e[1]!==r.output?(b=async se=>{const ee=v(se==="input"?r.input:r.output);try{await navigator.clipboard.writeText(ee),se==="input"?(a(!0),setTimeout(()=>a(!1),2e3)):(c(!0),setTimeout(()=>c(!1),2e3))}catch{Se.error("Failed to copy to clipboard")}},e[0]=r.input,e[1]=r.output,e[2]=b):b=e[2];const u=b;let R;e[3]!==r.id||e[4]!==r.input||e[5]!==r.output||e[6]!==r.toolName?(R=se=>{const ee=v(se==="input"?r.input:r.output),oe=new Blob([ee],{type:"application/json"}),he=URL.createObjectURL(oe),be=document.createElement("a");be.href=he,be.download=`${r.toolName}-${se}-${r.id}.json`,be.click(),URL.revokeObjectURL(he)},e[3]=r.id,e[4]=r.input,e[5]=r.output,e[6]=r.toolName,e[7]=R):R=e[7];const h=R;let j;e[8]!==d||e[9]!==r.connectionId||e[10]!==r.input||e[11]!==r.toolName||e[12]!==i||e[13]!==n?(j=()=>{const se=d.find(oe=>oe.id===r.connectionId);if(!se){Se.error("Could not find the connection for this tool call");return}const ee=crypto.randomUUID();sessionStorage.setItem(`replay-${ee}`,JSON.stringify(r.input)),i({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:n.slug,appSlug:Pt(se),collectionName:"tools",itemId:encodeURIComponent(r.toolName)},search:{replayId:ee}})},e[8]=d,e[9]=r.connectionId,e[10]=r.input,e[11]=r.toolName,e[12]=i,e[13]=n,e[14]=j):j=e[14];const m=j,[C,S]=K.useState(!1);let g;e[15]!==r.requestId?(g=async()=>{try{await navigator.clipboard.writeText(r.requestId),S(!0),setTimeout(()=>S(!1),2e3)}catch{Se.error("Failed to copy to clipboard")}},e[15]=r.requestId,e[16]=g):g=e[16];const _=g;let I;e[17]!==r.timestamp?(I=new Date(r.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[17]=r.timestamp,e[18]=I):I=e[18];const x=I,F="text-sm px-5 md:px-6 py-5 space-y-5";let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Timestamp"}),e[19]=w):w=e[19];let D;e[20]!==x?(D=t.jsxs("div",{children:[w,t.jsx("div",{className:"text-sm text-foreground",children:x})]}),e[20]=x,e[21]=D):D=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Duration"}),e[22]=k):k=e[22];let O;e[23]!==r.durationMs?(O=t.jsxs("div",{children:[k,t.jsxs("div",{className:"text-sm font-mono text-foreground",children:[r.durationMs,"ms"]})]}),e[23]=r.durationMs,e[24]=O):O=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[25]=$):$=e[25];let J;e[26]!==r.userName?(J=t.jsxs("div",{children:[$,t.jsx("div",{className:"text-sm text-foreground",children:r.userName})]}),e[26]=r.userName,e[27]=J):J=e[27];let P;e[28]!==r.virtualMcpName?(P=r.virtualMcpName&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsx("div",{className:"text-sm text-foreground",children:r.virtualMcpName})]}),e[28]=r.virtualMcpName,e[29]=P):P=e[29];let X;e[30]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Request ID"}),e[30]=X):X=e[30];let y;e[31]!==r.requestId?(y=t.jsx("code",{className:"font-mono text-foreground text-[11px]",children:r.requestId}),e[31]=r.requestId,e[32]=y):y=e[32];let T;e[33]!==C?(T=C?t.jsx(ft,{size:12}):t.jsx(Xe,{size:12}),e[33]=C,e[34]=T):T=e[34];let L;e[35]!==_||e[36]!==T?(L=t.jsx(Z,{size:"icon",variant:"ghost",onClick:_,"aria-label":"Copy request ID",className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:T}),e[35]=_,e[36]=T,e[37]=L):L=e[37];let z;e[38]!==y||e[39]!==L?(z=t.jsxs("div",{children:[X,t.jsxs("div",{className:"flex items-center gap-1",children:[y,L]})]}),e[38]=y,e[39]=L,e[40]=z):z=e[40];let E;e[41]!==r.userAgent?(E=r.userAgent&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Client"}),t.jsx("div",{className:"text-sm font-mono text-foreground",children:r.userAgent})]}),e[41]=r.userAgent,e[42]=E):E=e[42];let U;e[43]!==r.properties||e[44]!==i||e[45]!==n?(U=r.properties&&Object.keys(r.properties).length>0&&t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1.5",children:"Properties"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(r.properties).map(se=>{const[ee,oe]=se;return t.jsxs(ct,{children:[t.jsx(dt,{asChild:!0,children:t.jsxs(rt,{variant:"secondary",className:"font-mono text-xs px-2 py-0.5 cursor-pointer hover:bg-secondary/80 transition-colors",children:[ee,"=",oe]})}),t.jsx(mt,{className:"w-auto p-1",align:"end",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:()=>{const he={key:ee,operator:"eq",value:oe};i({to:"/$org/settings/monitor",params:{org:n.slug},search:{propertyFilters:Re([he])}})},children:[t.jsx(At,{size:14,className:"mr-2"}),"Filter by this property"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(`${ee}=${oe}`),Se.success("Copied filter to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(Xe,{size:14,className:"mr-2"}),"Copy filter"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(ee),Se.success("Copied key to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(ds,{size:14,className:"mr-2"}),"Copy key"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(oe),Se.success("Copied value to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(us,{size:14,className:"mr-2"}),"Copy value"]})]})})]},ee)})})]}),e[43]=r.properties,e[44]=i,e[45]=n,e[46]=U):U=e[46];let q;e[47]!==O||e[48]!==J||e[49]!==P||e[50]!==z||e[51]!==E||e[52]!==U||e[53]!==D?(q=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",children:[D,O,J,P,z,E,U]}),e[47]=O,e[48]=J,e[49]=P,e[50]=z,e[51]=E,e[52]=U,e[53]=D,e[54]=q):q=e[54];let V;e[55]!==r.errorMessage?(V=r.errorMessage&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-destructive mb-1",children:"Error"}),t.jsx("div",{className:"text-destructive font-mono text-xs bg-destructive/10 p-2 rounded break-all",children:r.errorMessage})]}),e[55]=r.errorMessage,e[56]=V):V=e[56];const Y="space-y-4";let B;e[57]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Input"}),e[57]=B):B=e[57];const G=f.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Tt(f.originalSize)," - truncated)"]});let A;e[58]!==G?(A=t.jsxs("div",{className:"flex items-center gap-2",children:[B,G]}),e[58]=G,e[59]=A):A=e[59];let N;e[60]!==m||e[61]!==r.input?(N=r.input&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:m,"aria-label":"Replay tool call",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(ms,{size:14})})}),t.jsx(tt,{children:"Replay tool call"})]}),e[60]=m,e[61]=r.input,e[62]=N):N=e[62];let M;e[63]!==h||e[64]!==f?(M=f.isTruncated&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>h("input"),"aria-label":"Download full input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Mt,{size:14})})}),t.jsx(tt,{children:"Download full input"})]}),e[63]=h,e[64]=f,e[65]=M):M=e[65];let H;e[66]!==u?(H=()=>u("input"),e[66]=u,e[67]=H):H=e[67];let te;e[68]!==l?(te=l?t.jsx(ft,{size:14}):t.jsx(Xe,{size:14}),e[68]=l,e[69]=te):te=e[69];let Q;e[70]!==H||e[71]!==te?(Q=t.jsx(Z,{size:"icon",variant:"ghost",onClick:H,"aria-label":"Copy input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:te}),e[70]=H,e[71]=te,e[72]=Q):Q=e[72];let re;e[73]!==N||e[74]!==M||e[75]!==Q?(re=t.jsxs("div",{className:"flex items-center gap-1",children:[N,M,Q]}),e[73]=N,e[74]=M,e[75]=Q,e[76]=re):re=e[76];let W;e[77]!==A||e[78]!==re?(W=t.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 border-b border-border",children:[A,re]}),e[77]=A,e[78]=re,e[79]=W):W=e[79];let ne;e[80]!==f?(ne=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(_t,{code:f.content,language:"json",height:"100%",readOnly:!0})}),e[80]=f,e[81]=ne):ne=e[81];let ce;e[82]!==W||e[83]!==ne?(ce=t.jsx("div",{children:t.jsxs("div",{className:"rounded-lg overflow-hidden border border-border",children:[W,ne]})}),e[82]=W,e[83]=ne,e[84]=ce):ce=e[84];const ze="rounded-lg overflow-hidden border border-border",Ie="flex items-center justify-between p-1 pl-4 border-b border-border",Ce="flex items-center gap-2";let ie;e[85]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Output"}),e[85]=ie):ie=e[85];const Le=p.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Tt(p.originalSize)," - truncated)"]});let ge;e[86]!==ie||e[87]!==Le?(ge=t.jsxs("div",{className:Ce,children:[ie,Le]}),e[86]=ie,e[87]=Le,e[88]=ge):ge=e[88];let je;e[89]!==h||e[90]!==p.isTruncated?(je=p.isTruncated&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>h("output"),"aria-label":"Download full output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Mt,{size:14})})}),t.jsx(tt,{children:"Download full output"})]}),e[89]=h,e[90]=p.isTruncated,e[91]=je):je=e[91];let ve;e[92]!==u?(ve=()=>u("output"),e[92]=u,e[93]=ve):ve=e[93];let me;e[94]!==o?(me=o?t.jsx(ft,{size:14}):t.jsx(Xe,{size:14}),e[94]=o,e[95]=me):me=e[95];let Ne;e[96]!==ve||e[97]!==me?(Ne=t.jsx(Z,{size:"icon",variant:"ghost",onClick:ve,"aria-label":"Copy output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:me}),e[96]=ve,e[97]=me,e[98]=Ne):Ne=e[98];let ue;e[99]!==je||e[100]!==Ne?(ue=t.jsxs("div",{className:"flex items-center gap-1",children:[je,Ne]}),e[99]=je,e[100]=Ne,e[101]=ue):ue=e[101];let xe;e[102]!==ge||e[103]!==ue?(xe=t.jsxs("div",{className:Ie,children:[ge,ue]}),e[102]=ge,e[103]=ue,e[104]=xe):xe=e[104];let fe;e[105]!==p.content?(fe=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(_t,{code:p.content,language:"json",height:"100%",readOnly:!0})}),e[105]=p.content,e[106]=fe):fe=e[106];let pe;e[107]!==xe||e[108]!==fe?(pe=t.jsx("div",{children:t.jsxs("div",{className:ze,children:[xe,fe]})}),e[107]=xe,e[108]=fe,e[109]=pe):pe=e[109];let ke;e[110]!==ce||e[111]!==pe?(ke=t.jsxs("div",{className:Y,children:[ce,pe]}),e[110]=ce,e[111]=pe,e[112]=ke):ke=e[112];let we;return e[113]!==q||e[114]!==V||e[115]!==ke?(we=t.jsxs("div",{className:F,children:[q,V,ke]}),e[113]=q,e[114]=V,e[115]=ke,e[116]=we):we=e[116],we}function Js(s){return JSON.stringify(s,null,2)}const Xt=/^now(?:-(\d+)([mhdwM]))?$/,Gs={m:"minute",h:"hour",d:"day",w:"week",M:"month"};function Yt(s){const e=s.trim();if(e==="now")return{isNow:!0,offset:0,unit:null};const r=e.match(Xt);if(!r)return null;const l=r[1]?Number.parseInt(r[1],10):0,a=r[2]||null;return{isNow:!0,offset:l,unit:a}}function ye(s){const e=s.trim(),r=new Date(e);if(!Number.isNaN(r.getTime())&&e.includes("-"))return{valid:!0,date:r};const l=Yt(e);if(!l)return{valid:!1,date:null,error:'Invalid expression. Use "now" or "now-Xu" (e.g., now-2d, now-3h)'};const a=new Date,o=new Date(a);if(l.offset===0||!l.unit)return{valid:!0,date:o};switch(l.unit){case"m":o.setMinutes(o.getMinutes()-l.offset);break;case"h":o.setHours(o.getHours()-l.offset);break;case"d":o.setDate(o.getDate()-l.offset);break;case"w":o.setDate(o.getDate()-l.offset*7);break;case"M":o.setMonth(o.getMonth()-l.offset);break}return{valid:!0,date:o}}function Qs(s){return s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Zt(s){const e=s.trim();return Xt.test(e)}function $t(s){const e=s.trim();if(e==="now")return"Now";const r=Yt(e);if(!r||!r.unit){const o=ye(e);return o.valid&&o.date?Qs(o.date):e}const l=Gs[r.unit],a=r.offset!==1?"s":"";return`${r.offset} ${l}${a} ago`}const es=[{label:"Last 5 minutes",from:"now-5m",to:"now",value:"5m"},{label:"Last 15 minutes",from:"now-15m",to:"now",value:"15m"},{label:"Last 30 minutes",from:"now-30m",to:"now",value:"30m"},{label:"Last 1 hour",from:"now-1h",to:"now",value:"1h"},{label:"Last 3 hours",from:"now-3h",to:"now",value:"3h"},{label:"Last 6 hours",from:"now-6h",to:"now",value:"6h"},{label:"Last 12 hours",from:"now-12h",to:"now",value:"12h"},{label:"Last 24 hours",from:"now-24h",to:"now",value:"24h"},{label:"Last 2 days",from:"now-2d",to:"now",value:"2d"},{label:"Last 7 days",from:"now-7d",to:"now",value:"7d"},{label:"Last 30 days",from:"now-30d",to:"now",value:"30d"}];function Ws(s,e){const r=es.find(l=>l.from===s&&l.to===e);return r?r.label:`${$t(s)} to ${$t(e)}`}function Je(s){const e=s.getFullYear(),r=String(s.getMonth()+1).padStart(2,"0"),l=String(s.getDate()).padStart(2,"0"),a=String(s.getHours()).padStart(2,"0"),o=String(s.getMinutes()).padStart(2,"0"),c=String(s.getSeconds()).padStart(2,"0");return`${e}-${r}-${l} ${a}:${o}:${c}`}function Xs(s){const e=s.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(!e)return null;const[,r,l,a,o,c,i]=e,n=new Date(Number(r),Number(l)-1,Number(a),Number(o),Number(c),Number(i));return Number.isNaN(n.getTime())?null:n}function gt(s){if(Zt(s))return s;const e=ye(s);return e.valid&&e.date?Je(e.date):s}function zt({value:s,onChange:e,placeholder:r="now or now-2d",className:l,disabled:a,error:o}){const[c,i]=K.useState(!1),[n,d]=K.useState(()=>gt(s)),[f,p]=K.useState(),[v,b]=K.useState(!1),u=K.useRef(s);u.current!==s&&(u.current=s,v||d(gt(s)));const R=x=>{const F=x.target.value;d(F),p(void 0)},h=()=>{b(!0)},j=()=>{b(!1);const x=n.trim();if(Zt(x)){p(void 0),e(x);return}const F=Xs(x);if(F){p(void 0),e(F.toISOString()),d(Je(F));return}const w=ye(x);if(w.valid&&w.date){p(void 0),e(x),d(Je(w.date));return}d(gt(s)),p(void 0)},m=x=>{if(x){const w=ye(s).date||new Date;x.setHours(w.getHours()),x.setMinutes(w.getMinutes()),x.setSeconds(0),x.setMilliseconds(0);const D=x.toISOString();d(Je(x)),e(D),p(void 0)}i(!1)},C=x=>{const[F,w]=x.target.value.split(":").map(Number),k=ye(s).date||new Date;k.setHours(F||0),k.setMinutes(w||0),k.setSeconds(0),k.setMilliseconds(0);const O=k.toISOString();d(Je(k)),e(O)},S=ye(s),g=S.valid?S.date:new Date,_=g?`${String(g.getHours()).padStart(2,"0")}:${String(g.getMinutes()).padStart(2,"0")}`:"",I=o||f;return t.jsxs("div",{className:de("flex gap-1",l),children:[t.jsxs("div",{className:"flex-1 relative",children:[t.jsx(Ge,{value:n,onChange:R,onFocus:h,onBlur:j,placeholder:r,disabled:a,className:de("text-sm h-8",I&&"border-destructive focus-visible:ring-destructive")}),I&&t.jsx("p",{className:"text-xs text-destructive mt-1",children:I})]}),t.jsxs(ct,{open:c,onOpenChange:i,children:[t.jsx(dt,{asChild:!0,children:t.jsx(Z,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",disabled:a,children:t.jsx(xs,{className:"h-4 w-4"})})}),t.jsxs(mt,{className:"w-auto p-0",align:"end",children:[t.jsx(ws,{mode:"single",selected:g||void 0,onSelect:m,initialFocus:!0}),t.jsxs("div",{className:"border-t p-3",children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"Time"}),t.jsx(Ge,{type:"time",value:_,onChange:C,className:"text-sm h-8"})]})]})]})]})}function Ys({value:s,onChange:e,className:r,disabled:l,quickRanges:a=es}){const[o,c]=K.useState(!1),[i,n]=K.useState(s.from),[d,f]=K.useState(s.to),[p,v]=K.useState(null),b=K.useRef({from:s.from,to:s.to});(b.current.from!==s.from||b.current.to!==s.to)&&(b.current={from:s.from,to:s.to},n(s.from),f(s.to));const u=m=>{b.current={from:m.from,to:m.to},n(m.from),f(m.to),c(!1),e({from:m.from,to:m.to})},R=()=>{const m=ye(i),C=ye(d);if(!m.valid||!m.date){v("Invalid 'From' date");return}if(!C.valid||!C.date){v("Invalid 'To' date");return}if(m.date>=C.date){v("'From' must be before 'To'");return}v(null),e({from:i,to:d}),c(!1)},h=m=>s.from===m.from&&s.to===m.to,j=Ws(s.from,s.to);return t.jsxs(ct,{open:o,onOpenChange:c,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:de("gap-1.5 min-w-[160px] justify-between",r),disabled:l,children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Ms,{className:"size-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:j})]}),t.jsx(Kt,{className:"size-4 text-muted-foreground"})]})}),t.jsx(mt,{className:"w-[540px] p-0",align:"end",sideOffset:4,onCloseAutoFocus:m=>m.preventDefault(),style:o?void 0:{animationDuration:"0s"},children:t.jsxs("div",{className:"flex",children:[t.jsxs("div",{className:"flex-1 p-4 border-r",children:[t.jsx("h4",{className:"text-sm font-medium mb-4",children:"Absolute time range"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"From"}),t.jsx(zt,{value:i,onChange:n,placeholder:"now-24h"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"To"}),t.jsx(zt,{value:d,onChange:f,placeholder:"now"})]}),p&&t.jsx("p",{className:"text-xs text-destructive",children:p}),t.jsx(Z,{onClick:R,className:"w-full",size:"sm",children:"Apply time range"})]})]}),t.jsx("div",{className:"w-[200px]",children:t.jsx(is,{className:"h-[280px]",children:t.jsx("div",{className:"p-2",children:a.map(m=>{const C=h(m);return t.jsx("button",{type:"button",onClick:()=>u(m),className:de("w-full text-left px-3 py-2 text-sm rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground",C&&"bg-accent text-accent-foreground font-medium"),children:m.label},m.value)})})})})]})})]})}const ts="decopilot";async function ss(s,e){return await s.call("MONITORING_STATS",e)}function Zs(s,e){const r=le.c(12),{org:l}=Be(),a=Jt();let o,c,i;r[0]!==l.id||r[1]!==s?(i={...s,excludeConnectionIds:[ts,...s.excludeConnectionIds??[]]},c=wt,o=it.monitoringStatsToolCalls(l.id,JSON.stringify(i)),r[0]=l.id,r[1]=s,r[2]=o,r[3]=c,r[4]=i):(o=r[2],c=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ss(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let d;return r[8]!==e||r[9]!==o||r[10]!==n?(d={queryKey:o,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=o,r[10]=n,r[11]=d):d=r[11],c(d)}function er(s,e){const r=le.c(12),{org:l}=Be(),a=Jt();let o,c,i;r[0]!==l.id||r[1]!==s?(i={...s,connectionIds:[ts],topN:5,llmUsage:!0,userIds:s.userIds?.length?s.userIds:void 0},c=wt,o=it.monitoringStatsLlm(l.id,JSON.stringify(i)),r[0]=l.id,r[1]=s,r[2]=o,r[3]=c,r[4]=i):(o=r[2],c=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ss(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let d;return r[8]!==e||r[9]!==o||r[10]!==n?(d={queryKey:o,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=o,r[10]=n,r[11]=d):d=r[11],c(d)}function _e(s){const e=le.c(20),{title:r,value:l,action:a,children:o,className:c}=s;let i;e[0]!==c?(i=de("pt-4 px-4 pb-6 gap-8",c),e[0]=c,e[1]=i):i=e[1];let n;e[2]!==r?(n=t.jsx("span",{className:"text-sm text-foreground/70",children:r}),e[2]=r,e[3]=n):n=e[3];let d;e[4]!==l?(d=t.jsx("span",{className:"text-4xl font-normal",children:l}),e[4]=l,e[5]=d):d=e[5];let f;e[6]!==n||e[7]!==d?(f=t.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[n,d]}),e[6]=n,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==a?(p=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=p):p=e[10];let v;e[11]!==f||e[12]!==p?(v=t.jsxs("div",{className:"flex items-start justify-between",children:[f,p]}),e[11]=f,e[12]=p,e[13]=v):v=e[13];let b;e[14]!==o?(b=o&&t.jsx("div",{className:"flex flex-col gap-6",children:o}),e[14]=o,e[15]=b):b=e[15];let u;return e[16]!==i||e[17]!==v||e[18]!==b?(u=t.jsxs(Ht,{className:i,children:[v,b]}),e[16]=i,e[17]=v,e[18]=b,e[19]=u):u=e[19],u}function jt(s){const e=le.c(14),{metrics:r,connections:l,mode:a,total:o}=s,{org:c}=Be(),i=yt();let n,d,f;if(e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==c||e[5]!==o){f=Symbol.for("react.early_return_sentinel");e:{const v=l??[],b=new Map(r.map(sr));let u;e[9]!==a?(u=(h,j)=>{const m=Lt(h.metric,a);return Lt(j.metric,a)-m},e[9]=a,e[10]=u):u=e[10];const R=v.map(h=>({connection:h,metric:b.get(h.id)})).filter(tr).sort(u).slice(0,4);if(R.length===0){f=null;break e}n="flex flex-col",d=R.map((h,j)=>{const{connection:m,metric:C}=h,S=o>0?(C.calls/o*100).toFixed(1):"0.0",g=a==="errors"?`${C.errorRate.toFixed(1)}%`:`${S}%`,_=j===R.length-1;return t.jsxs("div",{className:de("flex items-center h-10 px-3 cursor-pointer hover:bg-accent/50 transition-colors",!_&&"border-b border-border/50"),onClick:()=>i({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:Pt(m)}}),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:m.icon,name:m.title,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:"shrink-0 size-6! min-w-6! rounded-md"}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:m.title})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsx("span",{className:"text-sm text-foreground/30 tabular-nums",children:g}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:Is(C,a)})]})]},m.id)})}e[0]=l,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=o,e[6]=n,e[7]=d,e[8]=f}else n=e[6],d=e[7],f=e[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;let p;return e[11]!==n||e[12]!==d?(p=t.jsx("div",{className:n,children:d}),e[11]=n,e[12]=d,e[13]=p):p=e[13],p}function tr(s){return s.metric}function sr(s){return[s.connectionId,s]}const Ot=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function Et(s){let e=0;for(let r=0;r<s.length;r++)e=e*31+s.charCodeAt(r)>>>0;return Ot[e%Ot.length]}function He(s){const e=le.c(21),{models:r,mode:l}=s,a=l===void 0?"calls":l;if(r.length===0)return null;let o;e[0]!==a?(o=u=>a==="tokens"?(u.inputTokens??0)+(u.outputTokens??0):a==="cost"?u.costUsd??0:u.calls,e[0]=a,e[1]=o):o=e[1];const c=o;let i;e[2]!==a?(i=u=>a==="cost"?Vt(u):a==="tokens"?st(u):u.toLocaleString(),e[2]=a,e[3]=i):i=e[3];const n=i;let d;e[4]!==c?(d=(u,R)=>u+c(R),e[4]=c,e[5]=d):d=e[5];const f=r.reduce(d,0);let p,v;if(e[6]!==n||e[7]!==r||e[8]!==f||e[9]!==c){let u;e[12]!==c?(u=(j,m)=>c(m)-c(j),e[12]=c,e[13]=u):u=e[13];const R=[...r].sort(u).slice(0,4);p="flex flex-col";let h;e[14]!==n||e[15]!==f||e[16]!==c?(h=(j,m,C)=>{const S=c(j),g=f>0?(S/f*100).toFixed(1):"0.0",_=m===C.length-1;return t.jsxs("div",{className:de("flex items-center h-10 px-3",!_&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-6 rounded-md border border-border/10 shadow-sm flex items-center justify-center shrink-0",style:{backgroundColor:`color-mix(in oklch, ${Et(j.toolName)} 18%, transparent)`},children:t.jsx(Qe,{size:14,style:{color:Et(j.toolName)}})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:j.toolName})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsxs("span",{className:"text-sm text-foreground/30 tabular-nums",children:[g,"%"]}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:n(S)})]})]},j.toolName)},e[14]=n,e[15]=f,e[16]=c,e[17]=h):h=e[17],v=R.map(h),e[6]=n,e[7]=r,e[8]=f,e[9]=c,e[10]=p,e[11]=v}else p=e[10],v=e[11];let b;return e[18]!==p||e[19]!==v?(b=t.jsx("div",{className:p,children:v}),e[18]=p,e[19]=v,e[20]=b):b=e[20],b}function rr(s){const e=le.c(48),{displayDateRange:r,connectionIds:l,excludeConnectionIds:a,toolName:o,status:c,connections:i,isStreaming:n,streamingRefetchInterval:d,llmUserIds:f}=s,p=Ss(r),v=n?d:!1;let b;e[0]!==v?(b={refetchInterval:v},e[0]=v,e[1]=b):b=e[1];const{data:u,isError:R}=Zs({interval:p,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),connectionIds:l.length>0?l:void 0,excludeConnectionIds:a,toolNames:o?[o]:void 0,status:c},b);let h;e[2]!==v?(h={refetchInterval:v},e[2]=v,e[3]=h):h=e[3];const{data:j,isError:m}=er({interval:p,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),userIds:f?.length?f:void 0},h),C=R||m,S=u?{totalCalls:u.totalCalls,totalErrors:u.totalErrors,avgDurationMs:u.avgDurationMs,p95DurationMs:u.p95DurationMs,data:Dt(u.timeseries,r,p)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},g=j?{totalCalls:j.totalCalls,totalErrors:j.totalErrors,avgDurationMs:j.avgDurationMs,p95DurationMs:j.p95DurationMs,data:Dt(j.timeseries,r,p)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]};let _;e[4]!==j?.topTools?(_=j?.topTools??[],e[4]=j?.topTools,e[5]=_):_=e[5];const I=_,x=j?.totalInputTokens??0,F=j?.totalOutputTokens??0,w=j?.totalTokens??0,D=j?.totalCostUsd??0;let k;e[6]!==u?.connectionBreakdown?(k=u?.connectionBreakdown??[],e[6]=u?.connectionBreakdown,e[7]=k):k=e[7];const O=k,[$,J]=K.useState("avg");let P;e[8]!==C?(P=C&&t.jsxs(Fs,{variant:"destructive",children:[t.jsx(rs,{}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(Rs,{children:"Failed to load monitoring data"}),t.jsx($s,{children:"We couldn't fetch your monitoring stats right now. Please try again later."})]})]}),e[8]=C,e[9]=P):P=e[9];let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=ce=>J(ce),e[10]=X):X=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(lt,{className:"w-[120px]",children:t.jsx(ot,{})}),e[11]=y):y=e[11];let T;e[12]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(at,{children:[t.jsx($e,{value:"avg",children:"Avg"}),t.jsx($e,{value:"p95",children:"P95"})]}),e[12]=T):T=e[12];let L;e[13]!==$?(L=t.jsxs(nt,{value:$,onValueChange:X,children:[y,T]}),e[13]=$,e[14]=L):L=e[14];let z;e[15]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"AI Usage"}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),e[15]=z):z=e[15];let E;e[16]!==I?(E=t.jsx(He,{models:I,mode:"calls"}),e[16]=I,e[17]=E):E=e[17];let U;e[18]!==w?(U=st(w),e[18]=w,e[19]=U):U=e[19];let q;e[20]!==x?(q=st(x),e[20]=x,e[21]=q):q=e[21];let V;e[22]!==F?(V=st(F),e[22]=F,e[23]=V):V=e[23];let Y;e[24]!==q||e[25]!==V?(Y=t.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[q," in ·"," ",V," out"]}),e[24]=q,e[25]=V,e[26]=Y):Y=e[26];let B;e[27]!==I?(B=t.jsx(He,{models:I,mode:"tokens"}),e[27]=I,e[28]=B):B=e[28];let G;e[29]!==D?(G=D>0?Vt(D):"—",e[29]=D,e[30]=G):G=e[30];let A;e[31]!==D?(A=D===0?t.jsx("span",{className:"text-xs text-muted-foreground",children:"No provider cost data"}):void 0,e[31]=D,e[32]=A):A=e[32];let N;e[33]!==I||e[34]!==D?(N=D>0?t.jsx(He,{models:I,mode:"cost"}):t.jsx("div",{className:"flex items-center justify-center h-20 text-center text-xs text-muted-foreground px-4",children:"Cost is reported only for the deco AI Gateway and OpenRouter providers."}),e[33]=I,e[34]=D,e[35]=N):N=e[35];let M;e[36]!==I?(M=t.jsx(He,{models:I,mode:"calls"}),e[36]=I,e[37]=M):M=e[37];const H=_e,te="AI Errors",Q=g.totalErrors.toLocaleString();let re;e[38]!==g.data?(re=t.jsx(Me,{data:g.data,dataKey:"errors",colorNum:3,chartHeight:"h-[80px] md:h-[120px]"}),e[38]=g.data,e[39]=re):re=e[39];let W;e[40]!==I||e[41]!==g.totalErrors?(W=g.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No AI errors in this period"}):t.jsx(He,{models:I,mode:"calls"}),e[40]=I,e[41]=g.totalErrors,e[42]=W):W=e[42];let ne;return e[43]!==H||e[44]!==Q||e[45]!==re||e[46]!==W?(ne=t.jsxs(H,{title:te,value:Q,children:[re,W]}),e[43]=H,e[44]=Q,e[45]=re,e[46]=W,e[47]=ne):ne=e[47],t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-2 pb-6 max-w-[1200px] mx-auto w-full overflow-auto",children:[P,t.jsxs(_e,{title:"Tool Calls",value:S.totalCalls.toLocaleString(),children:[t.jsx(Me,{data:S.data,dataKey:"calls",colorNum:1,chartHeight:"h-[120px] md:h-[180px]",variant:"area"}),t.jsx(jt,{metrics:O,connections:i,mode:"requests",total:S.totalCalls})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(_e,{title:"Latency",value:pt($==="avg"?S.avgDurationMs:S.p95DurationMs),action:L,children:[t.jsx(Me,{data:S.data,dataKey:$,colorNum:4,chartHeight:"h-[120px] md:h-[180px]"}),t.jsx(jt,{metrics:O,connections:i,mode:"latency",total:S.totalCalls})]}),t.jsxs(_e,{title:"Errors",value:S.totalErrors.toLocaleString(),children:[t.jsx(Me,{data:S.data,dataKey:"errors",colorNum:3,chartHeight:"h-[120px] md:h-[180px]"}),S.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No errors in this period"}):t.jsx(jt,{metrics:O,connections:i,mode:"errors",total:S.totalErrors})]})]}),z,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs(_e,{title:"AI Calls",value:g.totalCalls.toLocaleString(),children:[t.jsx(Me,{data:g.data,dataKey:"calls",colorNum:1,chartHeight:"h-[80px] md:h-[120px]"}),E]}),t.jsxs(_e,{title:"Tokens",value:U,action:Y,children:[t.jsx(Me,{data:g.data,dataKey:"totalTokens",colorNum:2,chartHeight:"h-[80px] md:h-[120px]"}),B]}),t.jsxs(_e,{title:"Cost",value:G,action:A,children:[t.jsx(Me,{data:g.data,dataKey:"costUsd",colorNum:5,chartHeight:"h-[80px] md:h-[120px]"}),N]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(_e,{title:"AI Latency",value:pt(g.avgDurationMs),action:t.jsxs("span",{className:"text-xs text-muted-foreground",children:["p95: ",pt(g.p95DurationMs)]}),children:[t.jsx(Me,{data:g.data,dataKey:"avg",colorNum:4,chartHeight:"h-[80px] md:h-[120px]"}),M]}),ne]})]})}function Ke(s){const e=le.c(8),{className:r}=s;let l;e[0]!==r?(l=de("pt-4 px-4 pb-6 gap-8",r),e[0]=r,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-10 w-14 rounded bg-muted animate-pulse"})]}),t.jsx("div",{className:"h-8 w-[120px] rounded-md bg-muted animate-pulse"})]}),e[2]=a):a=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"h-[180px] w-full rounded bg-muted/60 animate-pulse"}),e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=Array.from({length:4}).map(lr),e[4]=c):c=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-6",children:[o,t.jsxs("div",{className:"flex flex-col",children:[c,t.jsx("div",{className:"flex items-center h-10 px-4 gap-2",children:t.jsx("div",{className:"h-4 w-14 rounded bg-muted animate-pulse"})})]})]}),e[5]=i):i=e[5];let n;return e[6]!==l?(n=t.jsxs(Ht,{className:l,children:[a,i]}),e[6]=l,e[7]=n):n=e[7],n}function lr(s,e){return t.jsxs("div",{className:de("flex items-center h-10 px-3",e<3&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx("div",{className:"size-6 rounded-md bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"})]}),t.jsxs("div",{className:"flex items-center gap-2 px-3",children:[t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"})]})]},e)}function or(){const s=le.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{}),s[0]=e):e=s[0];let r,l;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{})]}),l=t.jsx("div",{className:"border-t border-border"}),s[1]=r,s[2]=l):(r=s[1],l=s[2]);let a;return s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-8 md:pt-12 pb-6 max-w-[1200px] mx-auto w-full",children:[e,r,l,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{}),t.jsx(Ke,{})]})]}),s[3]=a):a=s[3],a}function ar(s){const e=le.c(46),{log:r,connection:l,virtualMcpName:a,virtualMcpIcon:o,onClick:c,lastLogRef:i}=s;let n,d;if(e[0]!==r.timestamp){const $=new Date(r.timestamp);n=$.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=$.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=n,e[2]=d}else n=e[1],d=e[2];const f=d,p=l?.icon||null,v=l?.title??r.connectionId;let b;e[3]!==p||e[4]!==v?(b=t.jsx(Fe,{className:"w-12 md:w-16 px-2 md:px-4",children:t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(qe,{icon:p,name:v,size:"xs",className:"shadow-sm"})})}),e[3]=p,e[4]=v,e[5]=b):b=e[5];let u;e[6]!==r.toolName?(u=t.jsx("div",{className:"font-medium text-foreground truncate block",children:r.toolName}),e[6]=r.toolName,e[7]=u):u=e[7];const R=l?.title??r.connectionId;let h;e[8]!==R?(h=t.jsx("div",{className:"text-muted-foreground truncate block text-xs",children:R}),e[8]=R,e[9]=h):h=e[9];let j;e[10]!==u||e[11]!==h?(j=t.jsxs(Fe,{className:"min-w-0 pr-2 md:pr-4",children:[u,h]}),e[10]=u,e[11]=h,e[12]=j):j=e[12];let m;e[13]!==o||e[14]!==a?(m=t.jsx(Fe,{className:"w-36 md:w-44 px-2 md:px-3 text-muted-foreground",children:a?t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:o,name:a,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"truncate",children:a})]}):t.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),e[13]=o,e[14]=a,e[15]=m):m=e[15];let C;e[16]!==r.userImage||e[17]!==r.userName?(C=t.jsx(Bt,{url:r.userImage,fallback:r.userName,shape:"circle",size:"2xs",className:"shrink-0"}),e[16]=r.userImage,e[17]=r.userName,e[18]=C):C=e[18];let S;e[19]!==r.userName?(S=t.jsx("span",{className:"truncate",children:r.userName}),e[19]=r.userName,e[20]=S):S=e[20];let g;e[21]!==C||e[22]!==S?(g=t.jsx(Fe,{className:"w-28 md:w-36 px-2 md:px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,S]})}),e[21]=C,e[22]=S,e[23]=g):g=e[23];let _;e[24]!==n?(_=t.jsx("div",{children:n}),e[24]=n,e[25]=_):_=e[25];let I;e[26]!==f?(I=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:f}),e[26]=f,e[27]=I):I=e[27];let x;e[28]!==_||e[29]!==I?(x=t.jsxs(Fe,{className:"w-32 md:w-40 px-2 md:px-3 text-muted-foreground",children:[_,I]}),e[28]=_,e[29]=I,e[30]=x):x=e[30];let F;e[31]!==r.durationMs?(F=t.jsxs(Fe,{className:"w-16 md:w-20 px-2 md:px-3 text-muted-foreground font-mono",children:[r.durationMs,"ms"]}),e[31]=r.durationMs,e[32]=F):F=e[32];const w=r.isError?"destructive":"success",D=r.isError?"Error":"OK";let k;e[33]!==w||e[34]!==D?(k=t.jsx(Fe,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"flex items-center justify-end",children:t.jsx(rt,{variant:w,className:"px-1.5 md:px-2 py-0.5 md:py-1",children:D})})}),e[33]=w,e[34]=D,e[35]=k):k=e[35];let O;return e[36]!==i||e[37]!==c||e[38]!==g||e[39]!==x||e[40]!==F||e[41]!==k||e[42]!==b||e[43]!==j||e[44]!==m?(O=t.jsxs(ut,{ref:i,className:"h-14 md:h-16 transition-colors cursor-pointer hover:bg-muted/40 border-b-0",onClick:c,children:[b,j,m,g,x,F,k]}),e[36]=i,e[37]=c,e[38]=g,e[39]=x,e[40]=F,e[41]=k,e[42]=b,e[43]=j,e[44]=m,e[45]=O):O=e[45],O}function nr(s){const e=le.c(26),{connectionIds:r,virtualMcpIds:l,tool:a,status:o,search:c,logs:i,hasMore:n,onLoadMore:d,isLoadingMore:f,connections:p,virtualMcps:v,membersData:b,client:u}=s,R=p??[],h=v??[],[j,m]=K.useState(null),C=Vs(d,n,f),S=Ut(b),g=new Map(S.map(mr)),_=new Map(h.map(dr));let x=i.map(N=>{const M=g.get(N.userId??""),H=N.virtualMcpId?_.get(N.virtualMcpId):null;return{...N,userName:M?.name??N.userId??"Unknown",userImage:M?.image??void 0,virtualMcpName:H?.title??null,virtualMcpIcon:H?.icon??null}});if(r.length>1){let N;e[0]!==r?(N=M=>r.includes(M.connectionId),e[0]=r,e[1]=N):N=e[1],x=x.filter(N)}if(l.length>1){let N;e[2]!==l?(N=M=>M.virtualMcpId&&l.includes(M.virtualMcpId),e[2]=l,e[3]=N):N=e[3],x=x.filter(N)}const F=new Map(R.map(cr));if(c){const N=c.toLowerCase();x=x.filter(M=>M.toolName.toLowerCase().includes(N)||(F.get(M.connectionId)?.title??M.connectionId).toLowerCase().includes(N)||M.errorMessage?.toLowerCase().includes(N))}const w=j!==null?x[j]??null:null,D=wt({queryKey:it.monitoringLogDetail(w?.id??""),queryFn:async()=>{if(!u)throw new Error("MCP client is not available");const N=await u.callTool({name:"MONITORING_LOG_GET",arguments:{id:w.id}});return N.structuredContent??N},enabled:w!==null}),k=D.data?.log,O=w&&k?{...w,input:k.input,output:k.output}:w;if(x.length===0){let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[4]=N):N=e[4];const M=c||r.length>0||l.length>0||a||o!=="all"?"No logs match your filters":"No logs found in this time range";let H;return e[5]!==M?(H=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(St,{image:N,title:"No logs found",description:M})}),e[5]=M,e[6]=H):H=e[6],H}const $="flex-1 flex flex-col min-w-0",J="flex-1 min-w-0 pt-1",P="min-w-[600px] md:min-w-0",X=Qt,y="w-full border-collapse";let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(ae,{className:"w-5"}),t.jsx(ae,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),t.jsx(ae,{className:"w-36 md:w-44 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(ae,{className:"w-28 md:w-36 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(ae,{className:"w-32 md:w-40 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),t.jsx(ae,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Latency"}),t.jsx(ae,{className:"w-16 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right pr-3 md:pr-5",children:"Status"})]})}),e[7]=T):T=e[7];const L=Gt,z=x.map((N,M)=>t.jsx(ar,{log:N,connection:F.get(N.connectionId),virtualMcpName:N.virtualMcpName??"",virtualMcpIcon:N.virtualMcpIcon,onClick:()=>m(M),lastLogRef:M===x.length-1?C:void 0},N.id));let E;e[8]!==L||e[9]!==z?(E=t.jsx(L,{children:z}),e[8]=L,e[9]=z,e[10]=E):E=e[10];let U;e[11]!==X||e[12]!==T||e[13]!==E?(U=t.jsx("div",{className:J,children:t.jsx("div",{className:P,children:t.jsxs(X,{className:y,children:[T,E]})})}),e[11]=X,e[12]=T,e[13]=E,e[14]=U):U=e[14];const q=j!==null;let V;e[15]!==m?(V=N=>{N||m(null)},e[15]=m,e[16]=V):V=e[16];const Y=w&&j!==null&&t.jsxs(t.Fragment,{children:[t.jsx(Os,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(qe,{icon:F.get(w.connectionId)?.icon||null,name:F.get(w.connectionId)?.title??w.connectionId,size:"sm",className:"shadow-sm shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(Es,{className:"text-sm leading-snug truncate",children:w.toolName}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:F.get(w.connectionId)?.title??w.connectionId})]})]}),t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(ir),disabled:j===0,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous entry",children:t.jsx(cs,{size:14})}),t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(N=>N!==null&&N<x.length-1?N+1:N),disabled:j===x.length-1,className:"h-7 w-7 text-muted-foreground","aria-label":"Next entry",children:t.jsx(Kt,{size:14})})]})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:D.isLoading?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"size-5 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin"})}):D.isError?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground",children:[t.jsx("p",{children:"Failed to load log details"}),t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>D.refetch(),children:"Retry"})]}):t.jsx(Hs,{log:O})})]});let B;e[17]!==Y?(B=t.jsx(Ps,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:Y}),e[17]=Y,e[18]=B):B=e[18];let G;e[19]!==V||e[20]!==B||e[21]!==q?(G=t.jsx(As,{open:q,onOpenChange:V,children:B}),e[19]=V,e[20]=B,e[21]=q,e[22]=G):G=e[22];let A;return e[23]!==G||e[24]!==U?(A=t.jsxs("div",{className:$,children:[U,G]}),e[23]=G,e[24]=U,e[25]=A):A=e[25],A}function ir(s){return s!==null&&s>0?s-1:s}function cr(s){return[s.id,s]}function dr(s){return[s.id,s]}function mr(s){return[s.userId,s.user]}function ur(){const s=le.c(8);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ae,{className:"w-12 md:w-16 px-2 md:px-4"}),s[0]=e):e=s[0];let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ae,{className:"pr-2 md:pr-4",children:t.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),s[1]=r):r=s[1];let l;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ae,{className:"w-24 md:w-32 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),s[2]=l):l=s[2];let a;s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ae,{className:"w-20 md:w-24 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),s[3]=a):a=s[3];let o;s[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(ae,{className:"w-32 md:w-40 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),s[4]=o):o=s[4];let c;s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ae,{className:"w-16 md:w-20 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),s[5]=c):c=s[5];let i;s[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,r,l,a,o,c,t.jsx(ae,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse ml-auto"})})]})}),s[6]=i):i=s[6];let n;return s[7]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsxs(Qt,{className:"w-full border-collapse",children:[i,t.jsx(Gt,{children:Array.from({length:8}).map(xr)})]})})}),s[7]=n):n=s[7],n}function xr(s,e){return t.jsxs(ut,{className:"h-14 border-b border-border hover:bg-transparent",children:[t.jsx("td",{className:"px-2 md:px-4",children:t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"pr-2 md:pr-4",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),t.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const bt=Object.assign(nr,{Skeleton:ur});function fr(s){const e=le.c(34),{client:r,locator:l,baseParams:a,pageSize:o,isStreaming:c,streamingRefetchInterval:i,connectionIds:n,virtualMcpIds:d,tool:f,status:p,searchQuery:v,allConnections:b,allVirtualMcps:u,membersData:R}=s;let h;e[0]!==a||e[1]!==l?(h=it.monitoringLogsInfinite(l,JSON.stringify(a)),e[0]=a,e[1]=l,e[2]=h):h=e[2];let j;e[3]!==a||e[4]!==r||e[5]!==o?(j=async J=>{const{pageParam:P}=J,X=P===void 0?0:P;if(!r)throw new Error("MCP client is not available");const y=await r.callTool({name:"MONITORING_LOGS_LIST",arguments:{...a,limit:o,offset:X}});return y.structuredContent??y},e[3]=a,e[4]=r,e[5]=o,e[6]=j):j=e[6];let m;e[7]!==o?(m=(J,P)=>{if(!((J?.logs?.length??0)<o))return P.length*o},e[7]=o,e[8]=m):m=e[8];const C=c?i:!1;let S;e[9]!==h||e[10]!==j||e[11]!==m||e[12]!==C?(S={queryKey:h,queryFn:j,initialPageParam:0,getNextPageParam:m,staleTime:0,refetchInterval:C},e[9]=h,e[10]=j,e[11]=m,e[12]=C,e[13]=S):S=e[13];const{data:g,fetchNextPage:_,hasNextPage:I,isFetchingNextPage:x}=zs(S);let F;e[14]!==g.pages?(F=g.pages.flatMap(pr),e[14]=g.pages,e[15]=F):F=e[15];const w=F;let D;e[16]!==_||e[17]!==I||e[18]!==x?(D=()=>{I&&!x&&_()},e[16]=_,e[17]=I,e[18]=x,e[19]=D):D=e[19];const k=D,O=I??!1;let $;return e[20]!==b||e[21]!==u||e[22]!==r||e[23]!==n||e[24]!==k||e[25]!==x||e[26]!==R||e[27]!==w||e[28]!==v||e[29]!==p||e[30]!==O||e[31]!==f||e[32]!==d?($=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:t.jsx(bt,{connectionIds:n,virtualMcpIds:d,tool:f,status:p,search:v,logs:w,hasMore:O,onLoadMore:k,isLoadingMore:x,connections:b,virtualMcps:u,membersData:R,client:r})})})}),e[20]=b,e[21]=u,e[22]=r,e[23]=n,e[24]=k,e[25]=x,e[26]=R,e[27]=w,e[28]=v,e[29]=p,e[30]=O,e[31]=f,e[32]=d,e[33]=$):$=e[33],$}function pr(s){return s.logs??[]}function hr(s){const e=le.c(15),{dateRange:r}=s,{data:l,isLoading:a}=Us(void 0);let o;e[0]!==l?(o=l===void 0?[]:l,e[0]=l,e[1]=o):o=e[1];const c=o,[i,n]=K.useState(null),d=i??c[0]?.id??null,{data:f}=Ks(d??"");let p;e[2]!==r.startDate?(p=r.startDate.toISOString(),e[2]=r.startDate,e[3]=p):p=e[3];let v;e[4]!==r.endDate?(v=r.endDate.toISOString(),e[4]=r.endDate,e[5]=v):v=e[5];let b;e[6]!==p||e[7]!==v?(b={startDate:p,endDate:v},e[6]=p,e[7]=v,e[8]=b):b=e[8];const u=b;let R;return e[9]!==f||e[10]!==c||e[11]!==d||e[12]!==a||e[13]!==u?(R=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0 gap-5 pt-1",children:a?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"}):c.length===0?t.jsx("div",{className:"py-16",children:t.jsx(St,{title:"No automations",description:"Create an automation to see its runs and usage here."})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(nt,{value:d??"",onValueChange:h=>n(h),children:[t.jsx(lt,{className:"w-72",children:t.jsx(ot,{placeholder:"Select an automation…"})}),t.jsx(at,{children:c.map(jr)})]})}),f?t.jsx(Cs,{automationId:f.id,triggerIds:f.triggers.map(gr),range:u}):t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"})]})})}),e[9]=f,e[10]=c,e[11]=d,e[12]=a,e[13]=u,e[14]=R):R=e[14],R}function gr(s){return s.id}function jr(s){return t.jsx($e,{value:s.id,children:s.name},s.id)}const vr=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Nr({connectionIds:s,virtualMcpIds:e,tool:r,status:l,hideSystem:a,propertyFilters:o,connectionOptions:c,virtualMcpOptions:i,activeFiltersCount:n,onUpdateFilters:d,onConnectionSearchChange:f,memberOptions:p,llmUserIds:v=[],onLlmUserIdsChange:b,showMemberFilter:u}){const[R,h]=K.useState(!1),[j,m]=K.useState("form"),[C,S]=K.useState(r),[g,_]=K.useState(o),[I,x]=K.useState(Ye(o)),F=K.useRef(r),w=K.useRef(Re(o));F.current!==r&&(F.current=r,C!==r&&S(r));const D=Re(o);w.current!==D&&(w.current=D,_(o),x(Ye(o)));const k=(y,T)=>{const L=[...g],z=L[y];z&&(L[y]={key:T.key??z.key,operator:T.operator??z.operator,value:T.value??z.value},_(L))},O=()=>{_([...g,{key:"",operator:"eq",value:""}])},$=y=>{const T=g.filter((L,z)=>z!==y);_(T),x(Ye(T)),d({propertyFilters:Re(T)})},J=()=>{d({propertyFilters:Re(g)})},P=()=>{const y=Ft(I);_(y),d({propertyFilters:Re(y)})},X=()=>{if(j==="raw"){const y=Ft(I);_(y),m("form")}else x(Ye(g)),m("raw")};return t.jsxs(ct,{open:R,onOpenChange:h,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:"relative",children:[t.jsx(At,{size:16}),t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),n>0&&t.jsxs(t.Fragment,{children:[t.jsx(rt,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:n}),t.jsx(rt,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:n})]})]})}),t.jsx(mt,{align:"end",className:"w-[320px]",children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{children:t.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Ls,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),t.jsx(Ds,{id:"hide-system-calls",checked:a,onCheckedChange:y=>d({hideSystem:!!y})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),t.jsx(ht,{options:c,defaultValue:s,onValueChange:y=>d({connectionId:y}),onSearchChange:f,placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),t.jsx(ht,{options:i,defaultValue:e,onValueChange:y=>d({virtualMcpId:y}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),u&&t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Members"}),t.jsx(ht,{options:p??[],defaultValue:v,onValueChange:y=>b?.(y),placeholder:"All members",variant:"secondary",className:"w-full",maxCount:2}),t.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Filters AI usage (calls, tokens, cost) only."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),t.jsx(Ge,{id:"filter-tool",placeholder:"Filter by tool...",value:C,onChange:y=>S(y.target.value),onBlur:()=>{C!==r&&d({tool:C})},onKeyDown:y=>{y.key==="Enter"&&C!==r&&d({tool:C})},className:"w-full"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),t.jsxs(nt,{value:l,onValueChange:y=>d({status:y}),children:[t.jsx(lt,{className:"w-full",children:t.jsx(ot,{})}),t.jsxs(at,{children:[t.jsx($e,{value:"all",children:"All Status"}),t.jsx($e,{value:"success",children:"Success Only"}),t.jsx($e,{value:"errors",children:"Errors Only"})]})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:X,children:j==="raw"?t.jsx(Ns,{size:14}):t.jsx(fs,{size:14})})}),t.jsx(tt,{children:j==="raw"?"Switch to form view":"Switch to raw text"})]})]}),j==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(_s,{placeholder:`Paste property filters here:
|
|
6
6
|
thread_id=abc123
|
|
7
7
|
user~test
|
|
8
|
-
debug?`,value:I,onChange:y=>x(y.target.value),onBlur:P,onKeyDown:y=>{y.key==="Enter"&&y.metaKey&&P()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[g.map((y,T)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",T+1]}),t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>$(T),children:t.jsx(ys,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ge,{placeholder:"Key (e.g., thread_id)",value:y.key,onChange:L=>k(T,{key:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"flex-1 font-mono text-sm"}),t.jsxs(nt,{value:y.operator,onValueChange:L=>{const z=[...g],E=z[T];E&&(z[T]={...E,operator:L,value:L==="exists"?"":E.value},_(z),d({propertyFilters:Re(z)}))},children:[t.jsx(lt,{className:"w-28",children:t.jsx(ot,{})}),t.jsx(at,{children:vr.map(L=>t.jsx($e,{value:L.value,children:L.label},L.value))})]})]}),y.operator!=="exists"&&t.jsx(Ge,{placeholder:"Value",value:y.value,onChange:L=>k(T,{value:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"w-full font-mono text-sm"})]},T)),t.jsxs(Z,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[t.jsx(bs,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),n>0&&t.jsx(Z,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{S(""),_([]),x(""),d({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),h(!1)},children:"Clear all filters"})]})})]})}function br(s){const e=le.c(113),{tab:r,dateRange:l,displayDateRange:a,connectionIds:o,virtualMcpIds:c,tool:i,status:n,search:d,streaming:f,hideSystem:p,activeFiltersCount:v,from:b,to:u,propertyFilters:R,onUpdateFilters:h,onTimeRangeChange:j,onStreamingToggle:m,onTabChange:C}=s,S=vt(),g=vs(),{data:_}=ps(),[I,x]=K.useState(""),F=I||void 0;let w;e[0]!==F?(w={searchTerm:F},e[0]=F,e[1]=w):w=e[1];const D=vt(w);let k;e[2]!==D?(k=D??[],e[2]=D,e[3]=k):k=e[3];let O;e[4]!==k?(O=k.map(Sr),e[4]=k,e[5]=O):O=e[5];const $=O;let J;e[6]!==g?(J=g.map(wr),e[6]=g,e[7]=J):J=e[7];const P=J,{pageSize:X,streamingRefetchInterval:y}=Nt,{org:T,locator:L}=Be();let z;e[8]!==T.id||e[9]!==T.slug?(z={connectionId:hs,orgId:T.id,orgSlug:T.slug},e[8]=T.id,e[9]=T.slug,e[10]=z):z=e[10];const E=gs(z);let U;e[11]!==R?(U=Bs(R),e[11]=R,e[12]=U):U=e[12];const q=U;let V;e[13]!==p||e[14]!==T.id?(V=p?[js.SELF(T.id)]:void 0,e[13]=p,e[14]=T.id,e[15]=V):V=e[15];const Y=V;let B;e[16]===Symbol.for("react.memo_cache_sentinel")?(B=[],e[16]=B):B=e[16];const[G,A]=K.useState(B);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[17]=N):N=e[17];const[M,H]=K.useState(N);let te;e[18]===Symbol.for("react.memo_cache_sentinel")?(te=[],e[18]=te):te=e[18];const[Q,re]=K.useState(te),[W,ne]=K.useState("all"),ce=(M.length>0?1:0)+(Q.length>0?1:0)+(W!=="all"?1:0);let ze;e[19]!==_?(ze=Ut(_).map(yr),e[19]=_,e[20]=ze):ze=e[20];const Ie=ze;let Ce;e[21]!==l.startDate?(Ce=l.startDate.toISOString(),e[21]=l.startDate,e[22]=Ce):Ce=e[22];let ie;e[23]!==l.endDate?(ie=l.endDate.toISOString(),e[23]=l.endDate,e[24]=ie):ie=e[24];const Le=o.length===1?o[0]:void 0,ge=c.length===1?c[0]:void 0,je=i||void 0,ve=n==="errors"?!0:n==="success"?!1:void 0;let me;e[25]!==Y||e[26]!==q||e[27]!==Ce||e[28]!==ie||e[29]!==Le||e[30]!==ge||e[31]!==je||e[32]!==ve?(me={startDate:Ce,endDate:ie,connectionId:Le,excludeConnectionIds:Y,virtualMcpId:ge,toolName:je,isError:ve,...q},e[25]=Y,e[26]=q,e[27]=Ce,e[28]=ie,e[29]=Le,e[30]=ge,e[31]=je,e[32]=ve,e[33]=me):me=e[33];const Ne=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue={id:"overview",label:"Overview"},e[34]=ue):ue=e[34];let xe;e[35]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"audit",label:"Audit"},e[35]=xe):xe=e[35];let fe;e[36]===Symbol.for("react.memo_cache_sentinel")?(fe={id:"threads",label:"Threads"},e[36]=fe):fe=e[36];let pe;e[37]===Symbol.for("react.memo_cache_sentinel")?(pe=[ue,xe,fe,{id:"automations",label:"Automations"}],e[37]=pe):pe=e[37];const ke=pe;let we;e[38]===Symbol.for("react.memo_cache_sentinel")?(we=t.jsx(De.Title,{children:"Monitoring"}),e[38]=we):we=e[38];let se;e[39]!==C?(se=Te=>C(Te),e[39]=C,e[40]=se):se=e[40];let ee;e[41]!==se||e[42]!==r?(ee=t.jsx(qt,{tabs:ke,activeTab:r,onTabChange:se}),e[41]=se,e[42]=r,e[43]=ee):ee=e[43];let oe;e[44]!==v||e[45]!==o||e[46]!==$||e[47]!==I||e[48]!==p||e[49]!==f||e[50]!==G||e[51]!==Ie||e[52]!==m||e[53]!==h||e[54]!==R||e[55]!==n||e[56]!==r||e[57]!==i||e[58]!==c||e[59]!==P?(oe=(r==="overview"||r==="audit")&&t.jsxs(t.Fragment,{children:[t.jsxs(Z,{variant:f?"secondary":"outline",className:"gap-1.5",onClick:m,children:[f&&t.jsx("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}),t.jsx("span",{children:"Live"}),f&&t.jsx("span",{className:"text-muted-foreground text-xs",children:"3s"})]}),t.jsx(Nr,{connectionIds:o,virtualMcpIds:c,tool:i,status:n,hideSystem:p,propertyFilters:R,connectionOptions:$,virtualMcpOptions:P,activeFiltersCount:v,onUpdateFilters:h,connectionSearchTerm:I,onConnectionSearchChange:x,memberOptions:Ie,llmUserIds:G,onLlmUserIdsChange:A,showMemberFilter:r==="overview"})]}),e[44]=v,e[45]=o,e[46]=$,e[47]=I,e[48]=p,e[49]=f,e[50]=G,e[51]=Ie,e[52]=m,e[53]=h,e[54]=R,e[55]=n,e[56]=r,e[57]=i,e[58]=c,e[59]=P,e[60]=oe):oe=e[60];let he;e[61]!==Ie||e[62]!==r||e[63]!==ce||e[64]!==M||e[65]!==W||e[66]!==Q||e[67]!==P?(he=r==="threads"&&t.jsx(ks,{filterAgentIds:M,filterUserIds:Q,filterStatus:W,virtualMcpOptions:P,memberOptions:Ie,activeFiltersCount:ce,onUpdateFilters:Te=>{const{filterAgentIds:It,filterUserIds:Ct,filterStatus:kt}=Te;It!==void 0&&H(It),Ct!==void 0&&re(Ct),kt!==void 0&&ne(kt)}}),e[61]=Ie,e[62]=r,e[63]=ce,e[64]=M,e[65]=W,e[66]=Q,e[67]=P,e[68]=he):he=e[68];let be;e[69]!==b||e[70]!==u?(be={from:b,to:u},e[69]=b,e[70]=u,e[71]=be):be=e[71];let Oe;e[72]!==j||e[73]!==be?(Oe=t.jsx(Ys,{value:be,onChange:j}),e[72]=j,e[73]=be,e[74]=Oe):Oe=e[74];let Ee;e[75]!==oe||e[76]!==he||e[77]!==Oe?(Ee=t.jsxs("div",{className:"flex items-center gap-2",children:[oe,he,Oe]}),e[75]=oe,e[76]=he,e[77]=Oe,e[78]=Ee):Ee=e[78];let Pe;e[79]!==ee||e[80]!==Ee?(Pe=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[ee,Ee]}),e[79]=ee,e[80]=Ee,e[81]=Pe):Pe=e[81];let Ae;e[82]!==h||e[83]!==d||e[84]!==r?(Ae=(r==="audit"||r==="threads")&&t.jsx(as,{value:d,onChange:Te=>h({search:Te}),placeholder:r==="threads"?"Search by title…":"Search by tool name, connection, or error...",onKeyDown:Te=>{Te.key==="Escape"&&(h({search:""}),Te.target.blur())},className:"w-full md:w-[375px]"}),e[82]=h,e[83]=d,e[84]=r,e[85]=Ae):Ae=e[85];let Ve;e[86]!==Pe||e[87]!==Ae?(Ve=t.jsx(De.Body,{className:"!pb-4",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[we,Pe,Ae]})}),e[86]=Pe,e[87]=Ae,e[88]=Ve):Ve=e[88];let Ue;e[89]!==S||e[90]!==g||e[91]!==Ne||e[92]!==E||e[93]!==o||e[94]!==l||e[95]!==a||e[96]!==Y||e[97]!==f||e[98]!==G||e[99]!==L||e[100]!==_||e[101]!==d||e[102]!==n||e[103]!==r||e[104]!==M||e[105]!==W||e[106]!==Q||e[107]!==i||e[108]!==c?(Ue=r==="automations"?t.jsx(hr,{dateRange:l}):r==="threads"?t.jsx(Ts,{client:E,locator:L,membersData:_,allConnections:S,allVirtualMcps:g,dateRange:l,searchQuery:d,filterAgentIds:M,filterUserIds:Q,filterStatus:W}):r==="audit"?t.jsx(fr,{client:E,locator:L,baseParams:Ne,pageSize:X,isStreaming:f,streamingRefetchInterval:y,connectionIds:o,virtualMcpIds:c,tool:i,status:n,searchQuery:d,allConnections:S,allVirtualMcps:g,membersData:_}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx(rr,{displayDateRange:a,connectionIds:o,excludeConnectionIds:Y,toolName:i||void 0,status:n==="errors"?"error":n==="success"?"success":void 0,connections:S,isStreaming:f,streamingRefetchInterval:y,llmUserIds:G})}),e[89]=S,e[90]=g,e[91]=Ne,e[92]=E,e[93]=o,e[94]=l,e[95]=a,e[96]=Y,e[97]=f,e[98]=G,e[99]=L,e[100]=_,e[101]=d,e[102]=n,e[103]=r,e[104]=M,e[105]=W,e[106]=Q,e[107]=i,e[108]=c,e[109]=Ue):Ue=e[109];let We;return e[110]!==Ve||e[111]!==Ue?(We=t.jsxs(t.Fragment,{children:[Ve,Ue]}),e[110]=Ve,e[111]=Ue,e[112]=We):We=e[112],We}function yr(s){const e=s.user.name??s.user.email??s.userId,r=s.user.image??void 0;return{value:s.userId,label:e,icon:l=>{const{className:a}=l;return t.jsx(Bt,{url:r,fallback:e,shape:"circle",size:"2xs",className:de("shrink-0",a)})}}}function wr(s){const e=s.icon,r=s.title??"Decopilot";return{value:s.id??"",label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Sr(s){const e=s.icon,r=s.title||s.id;return{value:s.id,label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Mo(){const s=le.c(83),{org:e}=Be(),r=yt();let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/settings/monitor"},s[0]=l):l=s[0];const a=ls(l),{tab:o,from:c,to:i,connectionId:n,virtualMcpId:d,tool:f,search:p,status:v,streaming:b,propertyFilters:u,hideSystem:R}=a,h=o===void 0?"overview":o;let j;s[1]!==n?(j=n===void 0?[]:n,s[1]=n,s[2]=j):j=s[2];const m=j;let C;s[3]!==d?(C=d===void 0?[]:d,s[3]=d,s[4]=C):C=s[4];const S=C,g=b===void 0?!0:b,_=u===void 0?"":u,I=R===void 0?!1:R;let x,F,w,D,k,O,$;if(s[5]!==m.length||s[6]!==c||s[7]!==I||s[8]!==r||s[9]!==e.slug||s[10]!==_||s[11]!==a||s[12]!==v||s[13]!==g||s[14]!==i||s[15]!==f||s[16]!==S.length){k=qs(_);let A;s[24]!==r||s[25]!==e.slug||s[26]!==a?(A=Q=>{r({to:"/$org/settings/monitor",params:{org:e.slug},search:{...a,...Q}})},s[24]=r,s[25]=e.slug,s[26]=a,s[27]=A):A=s[27],$=A;let N;s[28]!==$?(N=Q=>{$({from:Q.from,to:Q.to})},s[28]=$,s[29]=N):N=s[29],D=N;let M,H;if(s[30]!==c||s[31]!==g||s[32]!==i){const Q=ye(c),re=ye(i);H=Q.date||new Date(Date.now()-18e5);const W=re.date||new Date;w={startDate:H,endDate:W},M=W,g&&i==="now"&&(M=new Date(W),M.setHours(M.getHours()+1)),s[30]=c,s[31]=g,s[32]=i,s[33]=w,s[34]=M,s[35]=H}else w=s[33],M=s[34],H=s[35];let te;s[36]!==M||s[37]!==H?(te={startDate:H,endDate:M},s[36]=M,s[37]=H,s[38]=te):te=s[38],F=te,x=0,m.length>0&&x++,S.length>0&&x++,f&&x++,v!=="all"&&x++,I&&x++,O=k.filter(Ir),s[5]=m.length,s[6]=c,s[7]=I,s[8]=r,s[9]=e.slug,s[10]=_,s[11]=a,s[12]=v,s[13]=g,s[14]=i,s[15]=f,s[16]=S.length,s[17]=x,s[18]=F,s[19]=w,s[20]=D,s[21]=k,s[22]=O,s[23]=$}else x=s[17],F=s[18],w=s[19],D=s[20],k=s[21],O=s[22],$=s[23];const J=O;J.length>0&&(x=x+J.length);let P;s[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(De.Body,{className:"!pb-3",children:t.jsx(De.Title,{children:"Monitoring"})}),s[39]=P):P=s[39];let X;s[40]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsxs(t.Fragment,{children:[P,t.jsx(De.Content,{children:t.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:t.jsx(St,{title:"Failed to load monitoring data",description:"There was an error loading the monitoring data. Please try again."})})})]}),s[40]=X):X=s[40];let y;s[41]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(De.Title,{children:"Monitoring"}),s[41]=y):y=s[41];let T;s[42]===Symbol.for("react.memo_cache_sentinel")?(T=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"threads",label:"Threads"},{id:"automations",label:"Automations"}],s[42]=T):T=s[42];let L;s[43]!==$?(L=A=>$({tab:A}),s[43]=$,s[44]=L):L=s[44];let z;s[45]!==L||s[46]!==h?(z=t.jsx(De.Body,{className:"!pb-3",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[y,t.jsx(qt,{tabs:T,activeTab:h,onTabChange:L})]})}),s[45]=L,s[46]=h,s[47]=z):z=s[47];let E;s[48]!==h?(E=h==="threads"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):h==="audit"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto",children:t.jsx(or,{})}),s[48]=h,s[49]=E):E=s[49];let U;s[50]!==z||s[51]!==E?(U=t.jsxs(t.Fragment,{children:[z,E]}),s[50]=z,s[51]=E,s[52]=U):U=s[52];let q;s[53]!==D?(q=A=>{xt("monitoring_time_range_changed",{from:A.from,to:A.to}),D(A)},s[53]=D,s[54]=q):q=s[54];let V;s[55]!==g||s[56]!==$?(V=()=>{xt("monitoring_live_toggled",{enabled:!g}),$({streaming:!g})},s[55]=g,s[56]=$,s[57]=V):V=s[57];let Y;s[58]!==h||s[59]!==$?(Y=A=>{A!==h&&xt("monitoring_tab_changed",{from_tab:h,to_tab:A}),$({tab:A})},s[58]=h,s[59]=$,s[60]=Y):Y=s[60];let B;s[61]!==x||s[62]!==m||s[63]!==F||s[64]!==w||s[65]!==c||s[66]!==I||s[67]!==k||s[68]!==p||s[69]!==v||s[70]!==g||s[71]!==q||s[72]!==V||s[73]!==Y||s[74]!==h||s[75]!==i||s[76]!==f||s[77]!==$||s[78]!==S?(B=t.jsx(br,{tab:h,dateRange:F,displayDateRange:w,connectionIds:m,virtualMcpIds:S,tool:f,status:v,search:p,streaming:g,hideSystem:I,activeFiltersCount:x,from:c,to:i,propertyFilters:k,onUpdateFilters:$,onTimeRangeChange:q,onStreamingToggle:V,onTabChange:Y}),s[61]=x,s[62]=m,s[63]=F,s[64]=w,s[65]=c,s[66]=I,s[67]=k,s[68]=p,s[69]=v,s[70]=g,s[71]=q,s[72]=V,s[73]=Y,s[74]=h,s[75]=i,s[76]=f,s[77]=$,s[78]=S,s[79]=B):B=s[79];let G;return s[80]!==U||s[81]!==B?(G=t.jsx(ns,{capability:"monitoring:view",area:"monitoring",children:t.jsx(De,{children:t.jsx(os,{fallback:X,children:t.jsx(K.Suspense,{fallback:U,children:B})})})}),s[80]=U,s[81]=B,s[82]=G):G=s[82],G}function Ir(s){return s.key.trim()}export{Mo as default};
|
|
8
|
+
debug?`,value:I,onChange:y=>x(y.target.value),onBlur:P,onKeyDown:y=>{y.key==="Enter"&&y.metaKey&&P()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[g.map((y,T)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",T+1]}),t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>$(T),children:t.jsx(ys,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ge,{placeholder:"Key (e.g., thread_id)",value:y.key,onChange:L=>k(T,{key:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"flex-1 font-mono text-sm"}),t.jsxs(nt,{value:y.operator,onValueChange:L=>{const z=[...g],E=z[T];E&&(z[T]={...E,operator:L,value:L==="exists"?"":E.value},_(z),d({propertyFilters:Re(z)}))},children:[t.jsx(lt,{className:"w-28",children:t.jsx(ot,{})}),t.jsx(at,{children:vr.map(L=>t.jsx($e,{value:L.value,children:L.label},L.value))})]})]}),y.operator!=="exists"&&t.jsx(Ge,{placeholder:"Value",value:y.value,onChange:L=>k(T,{value:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"w-full font-mono text-sm"})]},T)),t.jsxs(Z,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[t.jsx(bs,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),n>0&&t.jsx(Z,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{S(""),_([]),x(""),d({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),h(!1)},children:"Clear all filters"})]})})]})}function br(s){const e=le.c(113),{tab:r,dateRange:l,displayDateRange:a,connectionIds:o,virtualMcpIds:c,tool:i,status:n,search:d,streaming:f,hideSystem:p,activeFiltersCount:v,from:b,to:u,propertyFilters:R,onUpdateFilters:h,onTimeRangeChange:j,onStreamingToggle:m,onTabChange:C}=s,S=vt(),g=vs(),{data:_}=ps(),[I,x]=K.useState(""),F=I||void 0;let w;e[0]!==F?(w={searchTerm:F},e[0]=F,e[1]=w):w=e[1];const D=vt(w);let k;e[2]!==D?(k=D??[],e[2]=D,e[3]=k):k=e[3];let O;e[4]!==k?(O=k.map(Sr),e[4]=k,e[5]=O):O=e[5];const $=O;let J;e[6]!==g?(J=g.map(wr),e[6]=g,e[7]=J):J=e[7];const P=J,{pageSize:X,streamingRefetchInterval:y}=Nt,{org:T,locator:L}=Be();let z;e[8]!==T.id||e[9]!==T.slug?(z={connectionId:hs,orgId:T.id,orgSlug:T.slug},e[8]=T.id,e[9]=T.slug,e[10]=z):z=e[10];const E=gs(z);let U;e[11]!==R?(U=Bs(R),e[11]=R,e[12]=U):U=e[12];const q=U;let V;e[13]!==p||e[14]!==T.id?(V=p?[js.SELF(T.id)]:void 0,e[13]=p,e[14]=T.id,e[15]=V):V=e[15];const Y=V;let B;e[16]===Symbol.for("react.memo_cache_sentinel")?(B=[],e[16]=B):B=e[16];const[G,A]=K.useState(B);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[17]=N):N=e[17];const[M,H]=K.useState(N);let te;e[18]===Symbol.for("react.memo_cache_sentinel")?(te=[],e[18]=te):te=e[18];const[Q,re]=K.useState(te),[W,ne]=K.useState("all"),ce=(M.length>0?1:0)+(Q.length>0?1:0)+(W!=="all"?1:0);let ze;e[19]!==_?(ze=Ut(_).map(yr),e[19]=_,e[20]=ze):ze=e[20];const Ie=ze;let Ce;e[21]!==l.startDate?(Ce=l.startDate.toISOString(),e[21]=l.startDate,e[22]=Ce):Ce=e[22];let ie;e[23]!==l.endDate?(ie=l.endDate.toISOString(),e[23]=l.endDate,e[24]=ie):ie=e[24];const Le=o.length===1?o[0]:void 0,ge=c.length===1?c[0]:void 0,je=i||void 0,ve=n==="errors"?!0:n==="success"?!1:void 0;let me;e[25]!==Y||e[26]!==q||e[27]!==Ce||e[28]!==ie||e[29]!==Le||e[30]!==ge||e[31]!==je||e[32]!==ve?(me={startDate:Ce,endDate:ie,connectionId:Le,excludeConnectionIds:Y,virtualMcpId:ge,toolName:je,isError:ve,...q},e[25]=Y,e[26]=q,e[27]=Ce,e[28]=ie,e[29]=Le,e[30]=ge,e[31]=je,e[32]=ve,e[33]=me):me=e[33];const Ne=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue={id:"overview",label:"Overview"},e[34]=ue):ue=e[34];let xe;e[35]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"audit",label:"Audit"},e[35]=xe):xe=e[35];let fe;e[36]===Symbol.for("react.memo_cache_sentinel")?(fe={id:"threads",label:"Threads"},e[36]=fe):fe=e[36];let pe;e[37]===Symbol.for("react.memo_cache_sentinel")?(pe=[ue,xe,fe,{id:"automations",label:"Automations"}],e[37]=pe):pe=e[37];const ke=pe;let we;e[38]===Symbol.for("react.memo_cache_sentinel")?(we=t.jsx(De.Title,{children:"Monitoring"}),e[38]=we):we=e[38];let se;e[39]!==C?(se=Te=>C(Te),e[39]=C,e[40]=se):se=e[40];let ee;e[41]!==se||e[42]!==r?(ee=t.jsx(qt,{tabs:ke,activeTab:r,onTabChange:se}),e[41]=se,e[42]=r,e[43]=ee):ee=e[43];let oe;e[44]!==v||e[45]!==o||e[46]!==$||e[47]!==I||e[48]!==p||e[49]!==f||e[50]!==G||e[51]!==Ie||e[52]!==m||e[53]!==h||e[54]!==R||e[55]!==n||e[56]!==r||e[57]!==i||e[58]!==c||e[59]!==P?(oe=(r==="overview"||r==="audit")&&t.jsxs(t.Fragment,{children:[t.jsxs(Z,{variant:f?"secondary":"outline",className:"gap-1.5",onClick:m,children:[f&&t.jsx("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}),t.jsx("span",{children:"Live"}),f&&t.jsx("span",{className:"text-muted-foreground text-xs",children:"3s"})]}),t.jsx(Nr,{connectionIds:o,virtualMcpIds:c,tool:i,status:n,hideSystem:p,propertyFilters:R,connectionOptions:$,virtualMcpOptions:P,activeFiltersCount:v,onUpdateFilters:h,connectionSearchTerm:I,onConnectionSearchChange:x,memberOptions:Ie,llmUserIds:G,onLlmUserIdsChange:A,showMemberFilter:r==="overview"})]}),e[44]=v,e[45]=o,e[46]=$,e[47]=I,e[48]=p,e[49]=f,e[50]=G,e[51]=Ie,e[52]=m,e[53]=h,e[54]=R,e[55]=n,e[56]=r,e[57]=i,e[58]=c,e[59]=P,e[60]=oe):oe=e[60];let he;e[61]!==Ie||e[62]!==r||e[63]!==ce||e[64]!==M||e[65]!==W||e[66]!==Q||e[67]!==P?(he=r==="threads"&&t.jsx(ks,{filterAgentIds:M,filterUserIds:Q,filterStatus:W,virtualMcpOptions:P,memberOptions:Ie,activeFiltersCount:ce,onUpdateFilters:Te=>{const{filterAgentIds:It,filterUserIds:Ct,filterStatus:kt}=Te;It!==void 0&&H(It),Ct!==void 0&&re(Ct),kt!==void 0&&ne(kt)}}),e[61]=Ie,e[62]=r,e[63]=ce,e[64]=M,e[65]=W,e[66]=Q,e[67]=P,e[68]=he):he=e[68];let be;e[69]!==b||e[70]!==u?(be={from:b,to:u},e[69]=b,e[70]=u,e[71]=be):be=e[71];let Oe;e[72]!==j||e[73]!==be?(Oe=t.jsx(Ys,{value:be,onChange:j}),e[72]=j,e[73]=be,e[74]=Oe):Oe=e[74];let Ee;e[75]!==oe||e[76]!==he||e[77]!==Oe?(Ee=t.jsxs("div",{className:"flex items-center gap-2",children:[oe,he,Oe]}),e[75]=oe,e[76]=he,e[77]=Oe,e[78]=Ee):Ee=e[78];let Pe;e[79]!==ee||e[80]!==Ee?(Pe=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[ee,Ee]}),e[79]=ee,e[80]=Ee,e[81]=Pe):Pe=e[81];let Ae;e[82]!==h||e[83]!==d||e[84]!==r?(Ae=(r==="audit"||r==="threads")&&t.jsx(as,{value:d,onChange:Te=>h({search:Te}),placeholder:r==="threads"?"Search by title…":"Search by tool name, connection, or error...",onKeyDown:Te=>{Te.key==="Escape"&&(h({search:""}),Te.target.blur())},className:"w-full md:w-[375px]"}),e[82]=h,e[83]=d,e[84]=r,e[85]=Ae):Ae=e[85];let Ve;e[86]!==Pe||e[87]!==Ae?(Ve=t.jsx(De.Body,{className:"!pb-4",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[we,Pe,Ae]})}),e[86]=Pe,e[87]=Ae,e[88]=Ve):Ve=e[88];let Ue;e[89]!==S||e[90]!==g||e[91]!==Ne||e[92]!==E||e[93]!==o||e[94]!==l||e[95]!==a||e[96]!==Y||e[97]!==f||e[98]!==G||e[99]!==L||e[100]!==_||e[101]!==d||e[102]!==n||e[103]!==r||e[104]!==M||e[105]!==W||e[106]!==Q||e[107]!==i||e[108]!==c?(Ue=r==="automations"?t.jsx(hr,{dateRange:l}):r==="threads"?t.jsx(Ts,{client:E,locator:L,membersData:_,allConnections:S,allVirtualMcps:g,dateRange:l,searchQuery:d,filterAgentIds:M,filterUserIds:Q,filterStatus:W}):r==="audit"?t.jsx(fr,{client:E,locator:L,baseParams:Ne,pageSize:X,isStreaming:f,streamingRefetchInterval:y,connectionIds:o,virtualMcpIds:c,tool:i,status:n,searchQuery:d,allConnections:S,allVirtualMcps:g,membersData:_}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx(rr,{displayDateRange:a,connectionIds:o,excludeConnectionIds:Y,toolName:i||void 0,status:n==="errors"?"error":n==="success"?"success":void 0,connections:S,isStreaming:f,streamingRefetchInterval:y,llmUserIds:G})}),e[89]=S,e[90]=g,e[91]=Ne,e[92]=E,e[93]=o,e[94]=l,e[95]=a,e[96]=Y,e[97]=f,e[98]=G,e[99]=L,e[100]=_,e[101]=d,e[102]=n,e[103]=r,e[104]=M,e[105]=W,e[106]=Q,e[107]=i,e[108]=c,e[109]=Ue):Ue=e[109];let We;return e[110]!==Ve||e[111]!==Ue?(We=t.jsxs(t.Fragment,{children:[Ve,Ue]}),e[110]=Ve,e[111]=Ue,e[112]=We):We=e[112],We}function yr(s){const e=s.user.name??s.user.email??s.userId,r=s.user.image??void 0;return{value:s.userId,label:e,icon:l=>{const{className:a}=l;return t.jsx(Bt,{url:r,fallback:e,shape:"circle",size:"2xs",className:de("shrink-0",a)})}}}function wr(s){const e=s.icon,r=s.title??"Decopilot";return{value:s.id??"",label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Sr(s){const e=s.icon,r=s.title||s.id;return{value:s.id,label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function To(){const s=le.c(83),{org:e}=Be(),r=yt();let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/settings/monitor"},s[0]=l):l=s[0];const a=ls(l),{tab:o,from:c,to:i,connectionId:n,virtualMcpId:d,tool:f,search:p,status:v,streaming:b,propertyFilters:u,hideSystem:R}=a,h=o===void 0?"overview":o;let j;s[1]!==n?(j=n===void 0?[]:n,s[1]=n,s[2]=j):j=s[2];const m=j;let C;s[3]!==d?(C=d===void 0?[]:d,s[3]=d,s[4]=C):C=s[4];const S=C,g=b===void 0?!0:b,_=u===void 0?"":u,I=R===void 0?!1:R;let x,F,w,D,k,O,$;if(s[5]!==m.length||s[6]!==c||s[7]!==I||s[8]!==r||s[9]!==e.slug||s[10]!==_||s[11]!==a||s[12]!==v||s[13]!==g||s[14]!==i||s[15]!==f||s[16]!==S.length){k=qs(_);let A;s[24]!==r||s[25]!==e.slug||s[26]!==a?(A=Q=>{r({to:"/$org/settings/monitor",params:{org:e.slug},search:{...a,...Q}})},s[24]=r,s[25]=e.slug,s[26]=a,s[27]=A):A=s[27],$=A;let N;s[28]!==$?(N=Q=>{$({from:Q.from,to:Q.to})},s[28]=$,s[29]=N):N=s[29],D=N;let M,H;if(s[30]!==c||s[31]!==g||s[32]!==i){const Q=ye(c),re=ye(i);H=Q.date||new Date(Date.now()-18e5);const W=re.date||new Date;w={startDate:H,endDate:W},M=W,g&&i==="now"&&(M=new Date(W),M.setHours(M.getHours()+1)),s[30]=c,s[31]=g,s[32]=i,s[33]=w,s[34]=M,s[35]=H}else w=s[33],M=s[34],H=s[35];let te;s[36]!==M||s[37]!==H?(te={startDate:H,endDate:M},s[36]=M,s[37]=H,s[38]=te):te=s[38],F=te,x=0,m.length>0&&x++,S.length>0&&x++,f&&x++,v!=="all"&&x++,I&&x++,O=k.filter(Ir),s[5]=m.length,s[6]=c,s[7]=I,s[8]=r,s[9]=e.slug,s[10]=_,s[11]=a,s[12]=v,s[13]=g,s[14]=i,s[15]=f,s[16]=S.length,s[17]=x,s[18]=F,s[19]=w,s[20]=D,s[21]=k,s[22]=O,s[23]=$}else x=s[17],F=s[18],w=s[19],D=s[20],k=s[21],O=s[22],$=s[23];const J=O;J.length>0&&(x=x+J.length);let P;s[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(De.Body,{className:"!pb-3",children:t.jsx(De.Title,{children:"Monitoring"})}),s[39]=P):P=s[39];let X;s[40]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsxs(t.Fragment,{children:[P,t.jsx(De.Content,{children:t.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:t.jsx(St,{title:"Failed to load monitoring data",description:"There was an error loading the monitoring data. Please try again."})})})]}),s[40]=X):X=s[40];let y;s[41]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(De.Title,{children:"Monitoring"}),s[41]=y):y=s[41];let T;s[42]===Symbol.for("react.memo_cache_sentinel")?(T=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"threads",label:"Threads"},{id:"automations",label:"Automations"}],s[42]=T):T=s[42];let L;s[43]!==$?(L=A=>$({tab:A}),s[43]=$,s[44]=L):L=s[44];let z;s[45]!==L||s[46]!==h?(z=t.jsx(De.Body,{className:"!pb-3",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[y,t.jsx(qt,{tabs:T,activeTab:h,onTabChange:L})]})}),s[45]=L,s[46]=h,s[47]=z):z=s[47];let E;s[48]!==h?(E=h==="threads"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):h==="audit"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto",children:t.jsx(or,{})}),s[48]=h,s[49]=E):E=s[49];let U;s[50]!==z||s[51]!==E?(U=t.jsxs(t.Fragment,{children:[z,E]}),s[50]=z,s[51]=E,s[52]=U):U=s[52];let q;s[53]!==D?(q=A=>{xt("monitoring_time_range_changed",{from:A.from,to:A.to}),D(A)},s[53]=D,s[54]=q):q=s[54];let V;s[55]!==g||s[56]!==$?(V=()=>{xt("monitoring_live_toggled",{enabled:!g}),$({streaming:!g})},s[55]=g,s[56]=$,s[57]=V):V=s[57];let Y;s[58]!==h||s[59]!==$?(Y=A=>{A!==h&&xt("monitoring_tab_changed",{from_tab:h,to_tab:A}),$({tab:A})},s[58]=h,s[59]=$,s[60]=Y):Y=s[60];let B;s[61]!==x||s[62]!==m||s[63]!==F||s[64]!==w||s[65]!==c||s[66]!==I||s[67]!==k||s[68]!==p||s[69]!==v||s[70]!==g||s[71]!==q||s[72]!==V||s[73]!==Y||s[74]!==h||s[75]!==i||s[76]!==f||s[77]!==$||s[78]!==S?(B=t.jsx(br,{tab:h,dateRange:F,displayDateRange:w,connectionIds:m,virtualMcpIds:S,tool:f,status:v,search:p,streaming:g,hideSystem:I,activeFiltersCount:x,from:c,to:i,propertyFilters:k,onUpdateFilters:$,onTimeRangeChange:q,onStreamingToggle:V,onTabChange:Y}),s[61]=x,s[62]=m,s[63]=F,s[64]=w,s[65]=c,s[66]=I,s[67]=k,s[68]=p,s[69]=v,s[70]=g,s[71]=q,s[72]=V,s[73]=Y,s[74]=h,s[75]=i,s[76]=f,s[77]=$,s[78]=S,s[79]=B):B=s[79];let G;return s[80]!==U||s[81]!==B?(G=t.jsx(ns,{capability:"monitoring:view",area:"monitoring",children:t.jsx(De,{children:t.jsx(os,{fallback:X,children:t.jsx(K.Suspense,{fallback:U,children:B})})})}),s[80]=U,s[81]=B,s[82]=G):G=s[82],G}function Ir(s){return s.key.trim()}export{To as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,aj as j,cB as R,cC as Ee,cD as ke,cE as Se,bT as xe,cF as V}from"./index-C1yj8oW9.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var P='[cmdk-group=""]',_='[cmdk-group-items=""]',je='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",qe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:T=!1,vimBindings:A=!0,...B}=t,U=j(),ne=j(),H=j(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:qe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;q().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${P}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=q().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],O=le(S,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(P))==null?void 0:o.querySelector(je))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function q(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=q()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=q(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(P),a;for(;s&&!a;)s=e>0?He(s,P):Ne(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(q().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=j(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;T(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function T(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:B,onSelect:U,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:V(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:T,onClick:A?void 0:I},t.children)}),Ve=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=j(),v=n.useRef(null),b=n.useRef(null),i=j(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:V(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:V(u,l),...f,"cmdk-separator":"",role:"separator"})}),Be=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Oe=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:V(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:V(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Te=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Oe,Item:Pe,Input:Be,Group:Ve,Separator:Le,Dialog:ze,Empty:Te,Loading:Ue});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
1
|
+
import{r as n,aj as j,cB as R,cC as Ee,cD as ke,cE as Se,bT as xe,cF as V}from"./index-Cdi_SW9v.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var P='[cmdk-group=""]',_='[cmdk-group-items=""]',je='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",qe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:T=!1,vimBindings:A=!0,...B}=t,U=j(),ne=j(),H=j(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:qe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;q().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${P}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=q().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],O=le(S,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(P))==null?void 0:o.querySelector(je))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function q(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=q()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=q(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(P),a;for(;s&&!a;)s=e>0?He(s,P):Ne(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(q().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=j(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;T(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function T(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:B,onSelect:U,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:V(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:T,onClick:A?void 0:I},t.children)}),Ve=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=j(),v=n.useRef(null),b=n.useRef(null),i=j(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:V(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:V(u,l),...f,"cmdk-separator":"",role:"separator"})}),Be=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Oe=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:V(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:V(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Te=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Oe,Item:Pe,Input:Be,Group:Ve,Separator:Le,Dialog:ze,Empty:Te,Loading:Ue});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,w as Fe,m as Je,t as W,b as et,u as tt,E as Te,ad as Tt}from"./index-
|
|
1
|
+
import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,w as Fe,m as Je,t as W,b as et,u as tt,E as Te,ad as Tt}from"./index-Cdi_SW9v.js";import{i as zt}from"./ChevronRight-DfdMQ2Fw.js";import{s as st}from"./Eye-BT74up7P.js";import{n as Pt,i as nt}from"./Globe01-D-zy1b5e.js";import{a as lt,d as Ft,e as Ot,i as Et}from"./ZoomOut-hi-FNg6F.js";import{a as pe}from"./Palette-COnOloJT.js";import{s as At}from"./Plus-B8D680G_.js";import{t as Mt}from"./Stars01-CC6YF-Gm.js";import{i as xe}from"./Upload01-Dzd1geuw.js";import{i as Oe}from"./Zap-CXfIxPjW.js";import{u as it}from"./tooltip-B8O5EzJh.js";import{f as Ut,a as Bt,b as Lt,c as _t,d as Rt,e as qt,A as It,g as Kt}from"./alert-dialog-BMQCNP5r.js";import{c as Ee,d as Ae,a as Me,f as rt,D as Ht,b as Vt,e as Gt}from"./dialog-CvVsKEYZ.js";import{I as Ue}from"./input-C85X5mQd.js";import{S as K}from"./skeleton-BWev8k8G.js";import{F as ie,d as at,M as ot}from"./file-type-icon-CzW2A5RE.js";import{a as Qt}from"./toolbar-CP1DI4yM.js";import{r as Be,s as A,a as be,t as Wt,u as Pe,v as Le,h as Yt,L as Xt,o as Zt,p as Jt,n as es,R as Ve,q as ts,S as ss,b as ns,w as ct,x as le,y as ls}from"./preview-dialog-CmWcwQ_d.js";import{a as ve}from"./DotsVertical-DFqqfAl6.js";import{i as is}from"./Key01-CGqUyM9V.js";import{s as je}from"./Trash01-CWfKClvv.js";import{a as ye,c as te,b as we,D as ke}from"./dropdown-menu-Btez7WVe.js";import{T as rs}from"./textarea-DPdVb49N.js";import{t as as}from"./ChevronDown-CJWYZLuA.js";import{n as os}from"./ChevronUp-D9KnZoAi.js";import{i as ge}from"./X-CSyvhNbh.js";import"./tab-id-BptcWVWa.js";import"./ChevronLeft-CnLqo_kp.js";import"./LinkExternal01-BPuS9hJa.js";import"./XClose-BDFu3FRS.js";import"./index-Dy0NHd84.js";import"./LayoutLeft-ByH5X-SK.js";import"./popover-B07cKons.js";const cs=new Set(["output","upload","public","home"]),ds=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function fs(s){return cs.has(s)||!ds.test(s)?"home":s}function us(s){const e=S.c(33);let n,i,l;e[0]!==s?({glyph:n,readOnly:l,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=l):(n=e[1],i=e[2],l=e[3]);const r=U.useId(),a=`${r}-back`,c=`${r}-front`,o=`url(#${a})`;let d;e[4]!==o?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:o}),e[4]=o,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),x=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=x):(m=e[8],h=e[9],x=e[10]);let v;e[11]!==n?(v=n&&t.jsx(n,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=n,e[12]=v):v=e[12];let j;e[13]!==l?(j=l&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(st,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=l,e[14]=j):j=e[14];let y,k;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),k=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=y,e[16]=k):(y=e[15],k=e[16]);let N;e[17]!==a?(N=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[y,k]}),e[17]=a,e[18]=N):N=e[18];let g,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("stop",{stopColor:"#72B6FA"}),C=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=g,e[20]=C):(g=e[19],C=e[20]);let D;e[21]!==c?(D=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[g,C]}),e[21]=c,e[22]=D):D=e[22];let P;e[23]!==N||e[24]!==D?(P=t.jsxs("defs",{children:[N,D]}),e[23]=N,e[24]=D,e[25]=P):P=e[25];let $;return e[26]!==i||e[27]!==P||e[28]!==d||e[29]!==f||e[30]!==v||e[31]!==j?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,m,h,x,v,j,P]}),e[26]=i,e[27]=P,e[28]=d,e[29]=f,e[30]=v,e[31]=j,e[32]=$):$=e[32],$}function ms(s,e,n){return e?"color":n?"font":/^--brand-(text|fw|leading|tracking)/i.test(s)?"type":/^--brand-space/i.test(s)?"space":/^--brand-radius/i.test(s)?"radius":/^--brand-shadow/i.test(s)?"shadow":/^--brand-(duration|delay|ease)/i.test(s)?"motion":"other"}const hs=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,ps=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,xs=["svg","png","jpg","jpeg","webp","avif","gif"];function gs(s){return s.split(".").pop()?.toLowerCase()??""}function bs(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vs(s){const e=s.trim();return ps.test(e)||hs.test(e)}function js(s){const e=s.trim(),n=e.match(/^#([0-9a-f]{3})$/i);return n?.[1]?`#${[...n[1]].map(i=>i+i).join("")}`:e}function dt(s){const e=[],n=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let l;for(;(l=i.exec(s))!==null;){const r=l[1],a=l[2].trim();n.has(r)||e.push(r),n.set(r,a)}return e.map(r=>{const a=n.get(r),c=vs(a),o=/^--brand-font/i.test(r);return{name:r,value:a,isColor:c,isFont:o,kind:ms(r,c,o)}})}const Ge=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ys(s){return s.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??s}function ws(s){const e=[],n=new Map;for(const l of s){if(l.kind!=="color")continue;const r=ys(l.name);n.has(r)||(e.push(r),n.set(r,[])),n.get(r).push(l)}return e.map(l=>{const r=n.get(l);return{family:l,tokens:r,isRamp:r.filter(a=>/-\d+$/.test(a.name)).length>=5}}).sort((l,r)=>{const a=Ge.indexOf(l.family),c=Ge.indexOf(r.family);return a===-1&&c===-1?0:a===-1?1:c===-1?-1:a-c})}function ks(s,e,n){const i=new RegExp(`(${bs(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(s))return s.replace(i,(a,c,o)=>`${c}${n}${o}`);const l=s.search(/:root\s*\{/);if(l!==-1){const a=s.indexOf("{",l)+1;return`${s.slice(0,a)}
|
|
2
2
|
${e}: ${n};${s.slice(a)}`}const r=s.length>0&&!s.endsWith(`
|
|
3
3
|
`)?`
|
|
4
4
|
`:"";return`${s}${r}:root {
|
|
@@ -166,4 +166,4 @@ import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,w as Fe,m as Je,t as W,
|
|
|
166
166
|
<p class="cta">slides-create --theme …</p>
|
|
167
167
|
</section>`].join(`
|
|
168
168
|
|
|
169
|
-
`);async function We(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function rn(s,e){const n=e?`<style>${e}</style>`:"";return s.replaceAll("{{{slides}}}",ln).replaceAll("{{title}}",nn).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${n}</head>`)}function an(s){const e=S.c(23),{readUrl:n,title:i,tokensUrl:l}=s;let r;e[0]!==n?(r=B.fileText(n),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==n?(a=()=>We(n),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==r||e[5]!==a?(c={queryKey:r,queryFn:a,staleTime:6e4,retry:!1},e[4]=r,e[5]=a,e[6]=c):c=e[6];const o=Y(c);let d;e[7]!==l?(d=B.fileText(l??""),e[7]=l,e[8]=d):d=e[8];const u=!!l;let f;e[9]!==l?(f=()=>We(l??""),e[9]=l,e[10]=f):f=e[10];let m;e[11]!==d||e[12]!==u||e[13]!==f?(m={queryKey:d,enabled:u,queryFn:f,staleTime:6e4,retry:!1},e[11]=d,e[12]=u,e[13]=f,e[14]=m):m=e[14];const h=Y(m);if(o.isPending||l&&h.isPending){let y;return e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(K,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[15]=y):y=e[15],y}if(o.isError||!o.data){let y;return e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[16]=y):y=e[16],y}const x=h.data??null;let v;e[17]!==x||e[18]!==o.data?(v=rn(o.data,x),e[17]=x,e[18]=o.data,e[19]=v):v=e[19];let j;return e[20]!==v||e[21]!==i?(j=t.jsx("iframe",{title:i,srcDoc:v,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[20]=v,e[21]=i,e[22]=j):j=e[22],j}async function Ye(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function ae(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function on(s){const e=S.c(16),{family:n,tokens:i,editing:l,valueOf:r,onEdit:a}=s;let c;e[0]!==n?(c=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=c):c=e[1];let o;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==r){let f;e[7]!==l||e[8]!==a||e[9]!==r?(f=m=>{const h=r(m),x=`${m.name.replace(/^--brand-/,"")}: ${h}`;return l&&/^#/.test(h)?t.jsx("input",{type:"color","aria-label":m.name,title:x,value:js(h),onChange:v=>a(m.name,v.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},m.name):t.jsx("span",{title:x,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:h}},m.name)},e[7]=l,e[8]=a,e[9]=r,e[10]=f):f=e[10],o=i.map(f),e[2]=l,e[3]=a,e[4]=i,e[5]=r,e[6]=o}else o=e[6];let d;e[11]!==o?(d=t.jsx("div",{className:"flex flex-wrap gap-1",children:o}),e[11]=o,e[12]=d):d=e[12];let u;return e[13]!==c||e[14]!==d?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,d]}),e[13]=c,e[14]=d,e[15]=u):u=e[15],u}function cn(s){const e=S.c(9),{token:n,value:i}=s;if(n.kind==="space"){let r;return e[0]!==i?(r=t.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:t.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:i,maxWidth:"100%"}})}),e[0]=i,e[1]=r):r=e[1],r}if(n.kind==="radius"){let r;return e[2]!==i?(r=t.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:i}}),e[2]=i,e[3]=r):r=e[3],r}if(n.kind==="shadow"){let r;return e[4]!==i?(r=t.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:i}}),e[4]=i,e[5]=r):r=e[5],r}if(n.kind==="type"&&/^--brand-text-/.test(n.name)){const r=`min(${i}, 22px)`;let a;return e[6]!==r?(a=t.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:r},children:"Ag"}),e[6]=r,e[7]=a):a=e[7],a}let l;return e[8]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("span",{className:"size-7 shrink-0"}),e[8]=l):l=e[8],l}function ht(s){const e=S.c(17),{token:n,value:i,editing:l,onEdit:r}=s;let a;e[0]!==n||e[1]!==i?(a=t.jsx(cn,{token:n,value:i}),e[0]=n,e[1]=i,e[2]=a):a=e[2];let c;if(e[3]!==n.name){let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=/^--brand-/,e[5]=f):f=e[5],c=n.name.replace(f,""),e[3]=n.name,e[4]=c}else c=e[4];let o;e[6]!==c?(o=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==l||e[9]!==r||e[10]!==n.name||e[11]!==i?(d=l?t.jsx(Ue,{value:i,onChange:f=>r(n.name,f.target.value),className:"h-8 w-40 font-mono text-xs"}):t.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:i}),e[8]=l,e[9]=r,e[10]=n.name,e[11]=i,e[12]=d):d=e[12];let u;return e[13]!==a||e[14]!==o||e[15]!==d?(u=t.jsxs("div",{className:"flex items-center gap-3",children:[a,o,d]}),e[13]=a,e[14]=o,e[15]=d,e[16]=u):u=e[16],u}function re(s){const e=S.c(16),{label:n,tokens:i,editing:l,valueOf:r,onEdit:a}=s;if(i.length===0)return null;let c;e[0]!==n?(c=t.jsx(ae,{children:n}),e[0]=n,e[1]=c):c=e[1];let o;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==r){let f;e[7]!==l||e[8]!==a||e[9]!==r?(f=m=>t.jsx(ht,{token:m,value:r(m),editing:l,onEdit:a},m.name),e[7]=l,e[8]=a,e[9]=r,e[10]=f):f=e[10],o=i.map(f),e[2]=l,e[3]=a,e[4]=i,e[5]=r,e[6]=o}else o=e[6];let d;e[11]!==o?(d=t.jsx("div",{className:"flex flex-col gap-2.5",children:o}),e[11]=o,e[12]=d):d=e[12];let u;return e[13]!==c||e[14]!==d?(u=t.jsxs("div",{className:"flex flex-col gap-3",children:[c,d]}),e[13]=c,e[14]=d,e[15]=u):u=e[15],u}function pt({brandPath:s,onClose:e,variant:n}){const{org:i}=Fe(),l=Be(s),r=l.volume??"",a=l.dirPath,c=A(a),o=l.readOnly,d=Je(),u=be(),f=Wt(r),{upload:m,remove:h}=Pe(r),x=U.useRef(null),v=Le(r,a),j=v.data??[],y=b=>j.some(M=>M.kind==="file"&&A(M.path)===b),k=y("tokens.css"),N=y("brand.md"),g=y("slides-theme.html"),C=Ns(j),D=u(r,`${a}/tokens.css`),P=u(r,`${a}/brand.md`),$=u(r,`${a}/slides-theme.html`),F=Y({queryKey:B.fileText(D),enabled:k,queryFn:()=>Ye(D),staleTime:6e4,retry:!1}),z=Y({queryKey:B.fileText(P),enabled:N,queryFn:()=>Ye(P),staleTime:6e4,retry:!1}),[p,T]=U.useState(!1),[E,L]=U.useState({}),[q,R]=U.useState(null),[Q,O]=U.useState(!1),[G,se]=U.useState(!1),[Se,ue]=U.useState("deck"),H=F.data?dt(F.data):[],$e=b=>H.find(M=>M.name===b)?.value,V=b=>E[b.name]??b.value,w=ws(H),I=H.filter(b=>b.kind==="font"),ne=H.filter(b=>b.kind==="type"),vt=H.filter(b=>b.kind==="space"),jt=H.filter(b=>b.kind==="radius"),yt=H.filter(b=>b.kind==="shadow"),wt=H.filter(b=>b.kind==="motion"),kt=H.filter(b=>b.kind==="other"),Z=(b,M)=>L(he=>({...he,[b]:M})),me=g&&Se==="deck",Ce=q??z.data??"",De=Object.entries(E).filter(([b,M])=>$e(b)!==M),Ie=q!==null&&q!==(z.data??""),Nt=De.length>0||Ie;function St(){L({}),R(null),T(!1)}async function $t(){O(!0);try{if(De.length>0){let b=F.data??"";for(const[M,he]of De)b=ks(b,M,he);await f.mutateAsync({path:`${a}/tokens.css`,body:b,contentType:"text/css; charset=utf-8"}),d.invalidateQueries({queryKey:B.fileText(D)})}Ie&&q!==null&&(await f.mutateAsync({path:`${a}/brand.md`,body:q,contentType:"text/markdown; charset=utf-8"}),d.invalidateQueries({queryKey:B.fileText(P)})),d.invalidateQueries({queryKey:B.orgFsVolume(i.id,r)}),d.invalidateQueries({queryKey:B.orgFsRecent(i.id)}),L({}),R(null),T(!1),W.success("Brand saved")}catch(b){W.error(b instanceof Error?b.message:"Failed to save brand")}finally{O(!1)}}async function Ct(b){const M=b?.[0];if(!M)return;const Ke=`logo.${(M.name.split(".").pop()??"png").toLowerCase()}`;try{await m.mutateAsync({dir:a,files:[new File([M],Ke,{type:M.type})]}),C&&A(C)!==Ke&&await h.mutateAsync(C),W.success("Logo updated")}catch(He){W.error(He instanceof Error?He.message:"Logo upload failed")}finally{x.current&&(x.current.value="")}}const Dt=!v.isPending&&!k&&!N&&!C;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(pe,{size:18})}),n==="dialog"?t.jsx(Me,{className:"flex-1 truncate text-base font-medium text-foreground",children:c}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:c}),!o&&(p?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"ghost",size:"sm",onClick:St,disabled:Q,children:"Cancel"}),t.jsx(_,{size:"sm",disabled:!Nt||Q,onClick:()=>{$t()},children:Q?"Saving…":"Save"})]}):t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>T(!0),children:[t.jsx(Ot,{size:14}),"Edit"]})),n==="dialog"?t.jsx(rt,{asChild:!0,children:t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(ge,{size:16})})}):t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:t.jsx(ge,{size:16})})]}),t.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:v.isPending?t.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[t.jsx(K,{className:"h-40 w-full rounded-xl"}),t.jsx(K,{className:"h-4 w-1/3"}),t.jsx(K,{className:"h-4 w-2/3"})]}):Dt?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This brand is no longer available."}):t.jsxs(t.Fragment,{children:[(g||k)&&t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-label":G?"Show preview":"Hide preview",onClick:()=>se(b=>!b),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),se(M=>!M))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[t.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:b=>b.stopPropagation(),children:[g&&t.jsx("button",{type:"button",onClick:()=>{ue("deck"),se(!1)},className:ee("rounded-md px-2.5 py-1",me?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Deck"}),t.jsx("button",{type:"button",onClick:()=>{ue("components"),se(!1)},className:ee("rounded-md px-2.5 py-1",me?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:"Components"})]}),G?t.jsx(as,{size:16,className:"shrink-0 text-muted-foreground"}):t.jsx(os,{size:16,className:"shrink-0 text-muted-foreground"})]}),!G&&t.jsx("div",{className:"px-4 pb-4",children:t.jsx("div",{className:ee("w-full overflow-hidden rounded-xl border border-border bg-muted/30",me?"aspect-[16/9]":"h-96"),children:me?t.jsx(an,{readUrl:$,title:`${c} deck theme`,tokensUrl:D}):t.jsx(sn,{tokensUrl:D})})})]}),t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Logo"}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:C?t.jsx("img",{src:u(r,C),alt:`${c} logo`,className:"max-h-full max-w-full object-contain"}):t.jsx(pe,{size:28,className:"text-muted-foreground/50"})}),p&&t.jsxs("div",{children:[t.jsxs(_,{variant:"outline",size:"sm",disabled:m.isPending,onClick:()=>x.current?.click(),children:[t.jsx(xe,{size:14}),C?"Replace logo":"Add logo"]}),t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:b=>{Ct(b.target.files)}})]})]})]}),w.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Colors"}),w.map(b=>t.jsx(on,{family:b.family,tokens:b.tokens,editing:p,valueOf:V,onEdit:Z},b.family))]}),(I.length>0||ne.length>0)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Typography"}),I.map(b=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:b.name.replace(/^--brand-font-?/,"")||"font"}),p?t.jsx(Ue,{value:V(b),onChange:M=>Z(b.name,M.target.value),className:"h-9"}):t.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:V(b)},children:V(b)})]},b.name)),ne.map(b=>t.jsx(ht,{token:b,value:V(b),editing:p,onEdit:Z},b.name))]}),t.jsx(re,{label:"Spacing",tokens:vt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Radius",tokens:jt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Shadows",tokens:yt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Motion",tokens:wt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Tokens",tokens:kt,editing:p,valueOf:V,onEdit:Z}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Voice & guidelines"}),p?t.jsx(rs,{value:Ce,onChange:b=>R(b.target.value),placeholder:"Describe the brand voice, tone, do's and don'ts…",className:"min-h-48 font-mono text-sm"}):z.isPending&&N?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(K,{className:"h-3 w-full"}),t.jsx(K,{className:"h-3 w-5/6"})]}):Ce.trim()?t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t.jsx(ot,{id:`brand-preview-${s}`,text:Ce})}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"No brand voice written yet."})]})]})]})})]})}function dn(s){const e=S.c(8),{brandPath:n,onClose:i}=s;let l;e[0]!==i?(l=c=>{c||i()},e[0]=i,e[1]=l):l=e[1];let r;e[2]!==n||e[3]!==i?(r=t.jsx(Ee,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:t.jsx(pt,{brandPath:n,onClose:i,variant:"dialog"})}),e[2]=n,e[3]=i,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsx(Ae,{open:!0,onOpenChange:l,children:r}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function fn(s){const e=S.c(3),{brandPath:n,onClose:i}=s;let l;return e[0]!==n||e[1]!==i?(l=t.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:t.jsx(pt,{brandPath:n,onClose:i,variant:"panel"})}),e[0]=n,e[1]=i,e[2]=l):l=e[2],l}function xt(s){const e=S.c(23),{skillPath:n,onClose:i,variant:l}=s,r=Be(n),{volume:a,dirPath:c}=r,o=be(),d=o(a??"",`${c}/SKILL.md`),u=B.fileText(d);let f;e[0]!==d?(f=async()=>{const O=await fetch(d,{credentials:"include"});if(!O.ok)throw new Error(`fetch failed: ${O.status}`);return O.text()},e[0]=d,e[1]=f):f=e[1];let m;e[2]!==u||e[3]!==f?(m={queryKey:u,queryFn:f,staleTime:6e4,retry:!1},e[2]=u,e[3]=f,e[4]=m):m=e[4];const h=Y(m),x=Le(a??"",c);let v;e[5]!==c?(v=A(c),e[5]=c,e[6]=v):v=e[6];const j=v;let y;e[7]!==h.data?(y=h.data?ft(h.data):null,e[7]=h.data,e[8]=y):y=e[8];const k=y,N=mn;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=(O,G)=>N(O.path)?-1:N(G.path)?1:A(O.path).localeCompare(A(G.path)),e[9]=g):g=e[9];const C=(x.data??[]).filter(un).sort(g),[D,P]=U.useState(null),$=D===null?null:C.find(O=>O.path===D)??null,F=k?.name??j;let z;e[10]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Oe,{size:18})}),e[10]=z):z=e[10];let p;e[11]!==F||e[12]!==l?(p=l==="dialog"?t.jsx(Me,{className:"flex-1 truncate text-base font-medium text-foreground",children:F}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:F}),e[11]=F,e[12]=l,e[13]=p):p=e[13];let T;e[14]!==i||e[15]!==l?(T=l==="dialog"?t.jsx(rt,{asChild:!0,children:t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(ge,{size:16})})}):t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:i,children:t.jsx(ge,{size:16})}),e[14]=i,e[15]=l,e[16]=T):T=e[16];let E;e[17]!==p||e[18]!==T?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[z,p,T]}),e[17]=p,e[18]=T,e[19]=E):E=e[19];let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[20]=L):L=e[20];const q="relative flex min-w-0 flex-1 flex-col overflow-y-auto",R=$?t.jsx(Yt,{file:{key:$.path,filename:A($.path),size:$.size,downloadUrl:o(a??"",$.path)}}):h.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(K,{className:"h-4 w-1/3"}),t.jsx(K,{className:"h-3 w-full"}),t.jsx(K,{className:"h-3 w-5/6"}),t.jsx(K,{className:"h-3 w-2/3"})]}):h.isError||!k?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:k.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(ot,{id:`skill-preview-${n}`,text:k.body})})]});let Q;return e[21]!==R?(Q=t.jsx("div",{className:q,children:R}),e[21]=R,e[22]=Q):Q=e[22],t.jsxs(t.Fragment,{children:[E,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[L,x.isPending?t.jsx(K,{className:"mx-2 h-4 w-24"}):C.map(O=>{const G=N(O.path)?$===null:D===O.path;return t.jsxs("button",{type:"button",onClick:()=>P(N(O.path)?null:O.path),className:ee("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",G?"bg-background shadow-sm":"hover:bg-muted/60"),children:[t.jsx(ie,{filename:A(O.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:ee("truncate text-sm",G?"text-foreground":"text-muted-foreground"),children:A(O.path)})]},O.path)})]}),Q]})]})}function un(s){return s.kind==="file"}function mn(s){return A(s)==="SKILL.md"}function hn(s){const e=S.c(8),{skillPath:n,onClose:i}=s;let l;e[0]!==i?(l=c=>{c||i()},e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i||e[3]!==n?(r=t.jsx(Ee,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:t.jsx(xt,{skillPath:n,onClose:i,variant:"dialog"})}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsx(Ae,{open:!0,onOpenChange:l,children:r}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function pn(s){const e=S.c(3),{skillPath:n,onClose:i}=s;let l;return e[0]!==i||e[1]!==n?(l=t.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:t.jsx(xt,{skillPath:n,onClose:i,variant:"panel"})}),e[0]=i,e[1]=n,e[2]=l):l=e[2],l}function gt(s){return`${window.location.origin}${s}`}function oe(s){if(s.shareMode==="password")return"password";if(s.shareMode==="public"||s.readPublic)return"public";if(s.effectivePublic)return"inherited"}const bt=[{id:"home",description:"Your organization's home folder",glyph:Et},{id:"uploads",description:"Files your team uploads",glyph:xe},{id:"outputs",description:"Agent run outputs",glyph:Mt}],Xe=3;function J(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-[13px] text-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function X(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:n}),e[0]=n,e[1]=i):i=e[1],i}function Re(s){const e=S.c(2),{rows:n}=s,i=n===void 0?1:n;let l;return e[0]!==i?(l=t.jsx(X,{children:Array.from({length:i*3},xn)}),e[0]=i,e[1]=l):l=e[1],l}function xn(s,e){return t.jsx(K,{className:"h-16 rounded-2xl"},e)}function qe(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function gn(s){const e=S.c(6),{volume:n,displayName:i,description:l,glyph:r,onOpen:a}=s,c=ls(n),o=i??n,d=c.data?`${c.data.files} files`:void 0;let u;return e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==o||e[4]!==d?(u=t.jsx(Ne,{name:o,meta:d,subtitle:l,glyph:r,onOpen:a}),e[0]=l,e[1]=r,e[2]=a,e[3]=o,e[4]=d,e[5]=u):u=e[5],u}function bn(s){const e=S.c(8),{segments:n,onNavigate:i}=s;let l;e[0]!==i?(l=t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(""),children:"Library"}),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i||e[3]!==n?(r=n.map((c,o)=>{const d=n.slice(0,o+1).join("/"),u=o===n.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(zt,{size:12,className:"shrink-0 text-muted-foreground"}),u?t.jsx("span",{className:"truncate font-medium text-foreground",children:c}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(d),children:c})]},d)}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[l,r]}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function vn(s){const e=S.c(23),{onOpenDir:n,onOpenFile:i,onShare:l,onDelete:r}=s,{org:a}=Fe(),c=ns(),o=ct(),d=be();let u;e[0]!==d||e[1]!==l?(u=h=>l({volume:h.volume,path:h.path,kind:"file",shareMode:h.shareMode??"private",effectivePublic:h.effectivePublic??!1,url:gt(d(h.volume,h.path))}),e[0]=d,e[1]=l,e[2]=u):u=e[2];const f=u;let m;if(e[3]!==d||e[4]!==r||e[5]!==n||e[6]!==i||e[7]!==a||e[8]!==o.data?.length||e[9]!==c.data||e[10]!==c.isPending||e[11]!==f){const h=c.data??[],x=h.slice(0,Xe),v=h.slice(Xe);let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(J,{children:"Folders"}),e[13]=j):j=e[13];let y;e[14]!==n||e[15]!==a?(y=bt.map(g=>t.jsx(gn,{volume:g.id,displayName:g.id==="home"?fs(a.slug):void 0,description:g.description,glyph:g.glyph,onOpen:()=>n(g.id)},g.id)),e[14]=n,e[15]=a,e[16]=y):y=e[16];let k;e[17]!==n||e[18]!==o.data?.length?(k=(o.data?.length??0)>0&&t.jsx(Ne,{name:"public",meta:`${o.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:nt,readOnly:!0,onOpen:()=>n("public")}),e[17]=n,e[18]=o.data?.length,e[19]=k):k=e[19];let N;e[20]!==y||e[21]!==k?(N=t.jsxs("div",{className:"flex flex-col gap-3",children:[j,t.jsxs(X,{children:[y,k]})]}),e[20]=y,e[21]=k,e[22]=N):N=e[22],m=t.jsxs(t.Fragment,{children:[c.isPending?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Recently added"}),t.jsx(Re,{})]}):x.length>0?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Recently added"}),t.jsx(X,{children:x.map(g=>t.jsx(Xs,{filename:A(g.path),updatedAt:g.updatedAt,size:g.size,downloadUrl:d(g.volume,g.path),publicState:oe(g),onOpen:()=>i(`${g.volume}/${g.path}`),onShare:()=>f(g),onDelete:()=>r({volume:g.volume,path:g.path,kind:"file"})},`${g.volume}/${g.path}`))})]}):t.jsx(qe,{children:"No files yet — upload one, or ask an agent to produce something."}),N,v.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"All files"}),t.jsx(X,{children:v.map(g=>t.jsx(mt,{filename:A(g.path),updatedAt:g.updatedAt,downloadUrl:d(g.volume,g.path),publicState:oe(g),onOpen:()=>i(`${g.volume}/${g.path}`),onShare:()=>f(g),onDelete:()=>r({volume:g.volume,path:g.path,kind:"file"})},`${g.volume}/${g.path}`))})]})]}),e[3]=d,e[4]=r,e[5]=n,e[6]=i,e[7]=a,e[8]=o.data?.length,e[9]=c.data,e[10]=c.isPending,e[11]=f,e[12]=m}else m=e[12];return m}function jn(s){const e=S.c(11),{onOpenDir:n}=s,i=ct();if(i.isPending){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Re,{}),e[0]=o):o=e[0],o}let l;e[1]!==i.data?(l=i.data??[],e[1]=i.data,e[2]=l):l=e[2];const r=l;if(r.length===0){let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(qe,{children:"No public skill sets are configured."}),e[3]=o):o=e[3],o}let a;if(e[4]!==n||e[5]!==r){let o;e[7]!==n?(o=d=>t.jsx(Ne,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>n(`public/${d}`)},d),e[7]=n,e[8]=o):o=e[8],a=r.map(o),e[4]=n,e[5]=r,e[6]=a}else a=e[6];let c;return e[9]!==a?(c=t.jsx(X,{children:a}),e[9]=a,e[10]=c):c=e[10],c}function yn(s){const e=S.c(34),{location:n,onOpenDir:i,onOpenFile:l,onOpenSkill:r,onOpenBrand:a,onShare:c,onDelete:o}=s,d=n.volume??"",u=Le(d,n.dirPath),f=be();if(u.isPending){let k;return e[0]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Re,{rows:2}),e[0]=k):k=e[0],k}if(u.isError){const k=u.error instanceof Error?u.error.message:"Failed to load";let N;return e[1]!==k?(N=t.jsx("p",{className:"text-sm text-destructive",children:k}),e[1]=k,e[2]=N):N=e[2],N}let m,h,x,v,j;if(e[3]!==f||e[4]!==u.data||e[5]!==n||e[6]!==o||e[7]!==a||e[8]!==i||e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==d){j=Symbol.for("react.early_return_sentinel");e:{const k=u.data??[],N=k.filter(Sn),g=k.filter(Nn),C=k.filter(kn),D=k.filter(wn);if(k.length===0){const p=n.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let T;e[18]!==p?(T=t.jsx(qe,{children:p}),e[18]=p,e[19]=T):T=e[19],j=T;break e}let P;e[20]!==n.readOnly||e[21]!==o||e[22]!==d?(P=p=>n.readOnly?void 0:()=>o({volume:d,path:p.path,kind:p.kind}),e[20]=n.readOnly,e[21]=o,e[22]=d,e[23]=P):P=e[23];const $=P;let F;e[24]!==f||e[25]!==n.readOnly||e[26]!==c||e[27]!==d?(F=p=>n.readOnly?void 0:()=>c({volume:d,path:p.path,kind:p.kind,shareMode:p.shareMode??"private",effectivePublic:p.effectivePublic??!1,url:p.kind==="file"?gt(f(d,p.path)):void 0}),e[24]=f,e[25]=n.readOnly,e[26]=c,e[27]=d,e[28]=F):F=e[28];const z=F;m=N.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Skills"}),t.jsx(X,{children:N.map(p=>t.jsx(Us,{dirName:A(p.path),updatedAt:p.updatedAt,skillMdUrl:f(d,`${p.path}/SKILL.md`),publicState:oe(p),onOpen:()=>r(le(n,p.path)),onBrowse:()=>i(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]}),h=g.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Brands"}),t.jsx(X,{children:g.map(p=>t.jsx(_s,{dirName:A(p.path),updatedAt:p.updatedAt,tokensUrl:f(d,`${p.path}/tokens.css`),onOpen:()=>a(le(n,p.path)),onBrowse:()=>i(le(n,p.path)),onDelete:$(p)},p.path))})]}),x=C.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Folders"}),t.jsx(X,{children:C.map(p=>t.jsx(Ne,{name:A(p.path),meta:ce(p.updatedAt),readOnly:n.readOnly,publicState:oe(p),onOpen:()=>i(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]}),v=D.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Files"}),t.jsx(X,{children:D.map(p=>t.jsx(mt,{filename:A(p.path),updatedAt:p.updatedAt,downloadUrl:f(d,p.path),publicState:oe(p),onOpen:()=>l(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]})}e[3]=f,e[4]=u.data,e[5]=n,e[6]=o,e[7]=a,e[8]=i,e[9]=l,e[10]=r,e[11]=c,e[12]=d,e[13]=m,e[14]=h,e[15]=x,e[16]=v,e[17]=j}else m=e[13],h=e[14],x=e[15],v=e[16],j=e[17];if(j!==Symbol.for("react.early_return_sentinel"))return j;let y;return e[29]!==m||e[30]!==h||e[31]!==x||e[32]!==v?(y=t.jsxs(t.Fragment,{children:[m,h,x,v]}),e[29]=m,e[30]=h,e[31]=x,e[32]=v,e[33]=y):y=e[33],y}function wn(s){return s.kind==="file"}function kn(s){return s.kind==="dir"&&!s.hasSkill&&!s.hasBrand}function Nn(s){return s.kind==="dir"&&s.hasBrand&&!s.hasSkill}function Sn(s){return s.kind==="dir"&&s.hasSkill}function Ze(){const{org:s}=Fe(),e=Je(),n=et(),i=it(),l=tt({strict:!1}),r=l.path??"",a=Be(r),c=a.segments.length===0,o=(w,I)=>n({to:".",search:ne=>({...ne,[w]:I||void 0})}),d=w=>o("path",w),u=(w,I)=>n({to:".",search:ne=>({...ne,preview:void 0,skill:void 0,brand:void 0,[w]:I})}),f=w=>u("preview",w),m=w=>u("skill",w),h=w=>u("brand",w),[x,v]=U.useState(null),[j,y]=U.useState(null),[k,N]=U.useState(!1),[g,C]=U.useState(""),D=U.useRef(null),[P,$]=U.useState(!1),F=U.useRef(0),z=a.readOnly?null:a.volume??"uploads",p=a.volume?a.dirPath:"",{upload:T,mkdir:E}=Pe(z??"uploads"),{remove:L}=Pe(x?.volume??"uploads");async function q(w){if(!(!z||!w||w.length===0))try{await T.mutateAsync({dir:p,files:[...w]}),W.success(w.length===1?`Uploaded ${w[0]?.name}`:`Uploaded ${w.length} files`)}catch(I){W.error(I instanceof Error?I.message:"Upload failed")}finally{D.current&&(D.current.value="")}}const R=z!==null,Q=c?"uploads":a.segments.at(-1)??"this folder";function O(w){return w.dataTransfer.types.includes("Files")}function G(w){!R||!O(w)||(w.preventDefault(),F.current+=1,$(!0))}function se(w){!R||!O(w)||w.preventDefault()}function Se(){R&&(F.current=Math.max(0,F.current-1),F.current===0&&$(!1))}function ue(w){R&&(w.preventDefault(),F.current=0,$(!1),w.dataTransfer.files.length>0&&q(w.dataTransfer.files))}async function H(){const w=g.trim();if(!(!z||!w))try{await E.mutateAsync(p?`${p}/${w}`:w),W.success(`Folder "${w}" created`),N(!1),C("")}catch(I){W.error(I instanceof Error?I.message:"Failed to create folder")}}async function $e(){if(!x)return;const w=x;try{await L.mutateAsync(w.path),W.success(`Deleted ${A(w.path)}`)}catch(I){W.error(I instanceof Error?I.message:"Delete failed")}finally{v(null)}}function V(){for(const w of bt)e.invalidateQueries({queryKey:B.orgFsVolume(s.id,w.id)});a.volume&&e.invalidateQueries({queryKey:B.orgFsVolume(s.id,a.volume)}),e.invalidateQueries({queryKey:B.orgFsRecent(s.id)}),e.invalidateQueries({queryKey:B.orgFsPublicSets(s.id)})}return t.jsxs("div",{className:"relative h-full",onDragEnter:G,onDragOver:se,onDragLeave:Se,onDrop:ue,children:[P&&t.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:t.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[t.jsx(xe,{size:28,className:"text-primary"}),t.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Drop to upload to ",Q]})]})}),t.jsx("div",{className:"h-full overflow-y-auto",children:t.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[!c&&t.jsx(bn,{segments:a.segments,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:c?"Library":a.segments.at(-1)??"Library"}),t.jsx(_,{variant:"ghost",size:"icon",onClick:V,"aria-label":"Refresh",children:t.jsx(Tt,{size:14})}),!c&&z&&t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>N(!0),children:[t.jsx(At,{size:14}),"New folder"]}),a.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(st,{size:12}),"Read-only"]}):t.jsxs(_,{size:"sm",disabled:T.isPending,onClick:()=>D.current?.click(),children:[t.jsx(xe,{size:14}),T.isPending?"Uploading…":"Upload file"]}),t.jsx("input",{ref:D,type:"file",multiple:!0,className:"hidden",onChange:w=>{q(w.target.files)}})]})]}),c?t.jsx(vn,{onOpenDir:d,onOpenFile:f,onShare:y,onDelete:v}):a.volume===null?t.jsx(jn,{onOpenDir:d}):t.jsx(yn,{location:a,onOpenDir:d,onOpenFile:f,onOpenSkill:m,onOpenBrand:h,onShare:y,onDelete:v},a.volume)]})}),i&&(l.preview?t.jsx(ts,{previewPath:l.preview,onClose:()=>o("preview",null)}):l.skill?t.jsx(hn,{skillPath:l.skill,onClose:()=>o("skill",null)},l.skill):l.brand?t.jsx(dn,{brandPath:l.brand,onClose:()=>o("brand",null)},l.brand):null),t.jsx(Ae,{open:k,onOpenChange:N,children:t.jsxs(Ee,{children:[t.jsxs(Ht,{children:[t.jsx(Me,{children:"New folder"}),t.jsxs(Vt,{children:["Create a folder in ",r||"the library","."]})]}),t.jsx(Ue,{autoFocus:!0,placeholder:"folder-name",value:g,onChange:w=>C(w.target.value),onKeyDown:w=>{w.key==="Enter"&&H()}}),t.jsxs(Gt,{children:[t.jsx(_,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),t.jsx(_,{disabled:!g.trim()||E.isPending,onClick:()=>{H()},children:"Create"})]})]})}),t.jsx(ss,{target:j,onOpenChange:w=>{w||y(null)}}),t.jsx(Ut,{open:x!==null,onOpenChange:w=>{w||v(null)},children:t.jsxs(Bt,{children:[t.jsxs(Lt,{children:[t.jsxs(_t,{children:["Delete ",x?A(x.path):"","?"]}),t.jsx(Rt,{children:x?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),t.jsxs(qt,{children:[t.jsx(It,{children:"Cancel"}),t.jsx(Kt,{onClick:()=>{$e()},children:"Delete"})]})]})})]})}function rl(){const s=S.c(12),e=it(),n=et();let i;s[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},s[0]=i):i=s[0];const l=tt(i);let r;s[1]!==n?(r=d=>n({to:".",search:u=>({...u,[d]:void 0})}),s[1]=n,s[2]=r):r=s[2];const a=r;let c,o;if(s[3]!==a||s[4]!==e||s[5]!==l.brand||s[6]!==l.preview||s[7]!==l.skill){o=Symbol.for("react.early_return_sentinel");e:{const d=l.preview?{key:"preview",path:l.preview,panel:t.jsx(Xt,{previewPath:l.preview,onClose:()=>a("preview")})}:l.skill?{key:"skill",path:l.skill,panel:t.jsx(pn,{skillPath:l.skill,onClose:()=>a("skill")},l.skill)}:l.brand?{key:"brand",path:l.brand,panel:t.jsx(fn,{brandPath:l.brand,onClose:()=>a("brand")},l.brand)}:null;if(e){let f;s[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:t.jsx(Te,{children:t.jsx(Ze,{})})}),s[10]=f):f=s[10],o=f;break e}let u;s[11]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ve,{order:1,minSize:30,defaultSize:55,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(Te,{children:t.jsx(Ze,{})})})})}),s[11]=u):u=s[11],c=t.jsxs(Zt,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[u,d&&t.jsxs(t.Fragment,{children:[t.jsx(Qt.Tabs,{children:t.jsx(Jt,{title:A(d.path),icon:{kind:"component",Component:f=>d.key==="preview"?t.jsx(ie,{filename:A(d.path),...f}):d.key==="skill"?t.jsx(Oe,{...f}):t.jsx(pe,{...f})},active:!0,onClick:()=>a(d.key)})}),t.jsx(es,{className:"bg-sidebar"}),t.jsx(Ve,{order:2,minSize:25,defaultSize:45,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(Te,{children:d.panel})})})})]})]})}s[3]=a,s[4]=e,s[5]=l.brand,s[6]=l.preview,s[7]=l.skill,s[8]=c,s[9]=o}else c=s[8],o=s[9];return o!==Symbol.for("react.early_return_sentinel")?o:c}export{rl as default};
|
|
169
|
+
`);async function We(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function rn(s,e){const n=e?`<style>${e}</style>`:"";return s.replaceAll("{{{slides}}}",ln).replaceAll("{{title}}",nn).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${n}</head>`)}function an(s){const e=S.c(23),{readUrl:n,title:i,tokensUrl:l}=s;let r;e[0]!==n?(r=B.fileText(n),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==n?(a=()=>We(n),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==r||e[5]!==a?(c={queryKey:r,queryFn:a,staleTime:6e4,retry:!1},e[4]=r,e[5]=a,e[6]=c):c=e[6];const o=Y(c);let d;e[7]!==l?(d=B.fileText(l??""),e[7]=l,e[8]=d):d=e[8];const u=!!l;let f;e[9]!==l?(f=()=>We(l??""),e[9]=l,e[10]=f):f=e[10];let m;e[11]!==d||e[12]!==u||e[13]!==f?(m={queryKey:d,enabled:u,queryFn:f,staleTime:6e4,retry:!1},e[11]=d,e[12]=u,e[13]=f,e[14]=m):m=e[14];const h=Y(m);if(o.isPending||l&&h.isPending){let y;return e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(K,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[15]=y):y=e[15],y}if(o.isError||!o.data){let y;return e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[16]=y):y=e[16],y}const x=h.data??null;let v;e[17]!==x||e[18]!==o.data?(v=rn(o.data,x),e[17]=x,e[18]=o.data,e[19]=v):v=e[19];let j;return e[20]!==v||e[21]!==i?(j=t.jsx("iframe",{title:i,srcDoc:v,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[20]=v,e[21]=i,e[22]=j):j=e[22],j}async function Ye(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function ae(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function on(s){const e=S.c(16),{family:n,tokens:i,editing:l,valueOf:r,onEdit:a}=s;let c;e[0]!==n?(c=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=c):c=e[1];let o;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==r){let f;e[7]!==l||e[8]!==a||e[9]!==r?(f=m=>{const h=r(m),x=`${m.name.replace(/^--brand-/,"")}: ${h}`;return l&&/^#/.test(h)?t.jsx("input",{type:"color","aria-label":m.name,title:x,value:js(h),onChange:v=>a(m.name,v.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},m.name):t.jsx("span",{title:x,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:h}},m.name)},e[7]=l,e[8]=a,e[9]=r,e[10]=f):f=e[10],o=i.map(f),e[2]=l,e[3]=a,e[4]=i,e[5]=r,e[6]=o}else o=e[6];let d;e[11]!==o?(d=t.jsx("div",{className:"flex flex-wrap gap-1",children:o}),e[11]=o,e[12]=d):d=e[12];let u;return e[13]!==c||e[14]!==d?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,d]}),e[13]=c,e[14]=d,e[15]=u):u=e[15],u}function cn(s){const e=S.c(9),{token:n,value:i}=s;if(n.kind==="space"){let r;return e[0]!==i?(r=t.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:t.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:i,maxWidth:"100%"}})}),e[0]=i,e[1]=r):r=e[1],r}if(n.kind==="radius"){let r;return e[2]!==i?(r=t.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:i}}),e[2]=i,e[3]=r):r=e[3],r}if(n.kind==="shadow"){let r;return e[4]!==i?(r=t.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:i}}),e[4]=i,e[5]=r):r=e[5],r}if(n.kind==="type"&&/^--brand-text-/.test(n.name)){const r=`min(${i}, 22px)`;let a;return e[6]!==r?(a=t.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:r},children:"Ag"}),e[6]=r,e[7]=a):a=e[7],a}let l;return e[8]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("span",{className:"size-7 shrink-0"}),e[8]=l):l=e[8],l}function ht(s){const e=S.c(17),{token:n,value:i,editing:l,onEdit:r}=s;let a;e[0]!==n||e[1]!==i?(a=t.jsx(cn,{token:n,value:i}),e[0]=n,e[1]=i,e[2]=a):a=e[2];let c;if(e[3]!==n.name){let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=/^--brand-/,e[5]=f):f=e[5],c=n.name.replace(f,""),e[3]=n.name,e[4]=c}else c=e[4];let o;e[6]!==c?(o=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==l||e[9]!==r||e[10]!==n.name||e[11]!==i?(d=l?t.jsx(Ue,{value:i,onChange:f=>r(n.name,f.target.value),className:"h-8 w-40 font-mono text-xs"}):t.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:i}),e[8]=l,e[9]=r,e[10]=n.name,e[11]=i,e[12]=d):d=e[12];let u;return e[13]!==a||e[14]!==o||e[15]!==d?(u=t.jsxs("div",{className:"flex items-center gap-3",children:[a,o,d]}),e[13]=a,e[14]=o,e[15]=d,e[16]=u):u=e[16],u}function re(s){const e=S.c(16),{label:n,tokens:i,editing:l,valueOf:r,onEdit:a}=s;if(i.length===0)return null;let c;e[0]!==n?(c=t.jsx(ae,{children:n}),e[0]=n,e[1]=c):c=e[1];let o;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==r){let f;e[7]!==l||e[8]!==a||e[9]!==r?(f=m=>t.jsx(ht,{token:m,value:r(m),editing:l,onEdit:a},m.name),e[7]=l,e[8]=a,e[9]=r,e[10]=f):f=e[10],o=i.map(f),e[2]=l,e[3]=a,e[4]=i,e[5]=r,e[6]=o}else o=e[6];let d;e[11]!==o?(d=t.jsx("div",{className:"flex flex-col gap-2.5",children:o}),e[11]=o,e[12]=d):d=e[12];let u;return e[13]!==c||e[14]!==d?(u=t.jsxs("div",{className:"flex flex-col gap-3",children:[c,d]}),e[13]=c,e[14]=d,e[15]=u):u=e[15],u}function pt({brandPath:s,onClose:e,variant:n}){const{org:i}=Fe(),l=Be(s),r=l.volume??"",a=l.dirPath,c=A(a),o=l.readOnly,d=Je(),u=be(),f=Wt(r),{upload:m,remove:h}=Pe(r),x=U.useRef(null),v=Le(r,a),j=v.data??[],y=b=>j.some(M=>M.kind==="file"&&A(M.path)===b),k=y("tokens.css"),N=y("brand.md"),g=y("slides-theme.html"),C=Ns(j),D=u(r,`${a}/tokens.css`),P=u(r,`${a}/brand.md`),$=u(r,`${a}/slides-theme.html`),F=Y({queryKey:B.fileText(D),enabled:k,queryFn:()=>Ye(D),staleTime:6e4,retry:!1}),z=Y({queryKey:B.fileText(P),enabled:N,queryFn:()=>Ye(P),staleTime:6e4,retry:!1}),[p,T]=U.useState(!1),[E,L]=U.useState({}),[q,R]=U.useState(null),[Q,O]=U.useState(!1),[G,se]=U.useState(!1),[Se,ue]=U.useState("deck"),H=F.data?dt(F.data):[],$e=b=>H.find(M=>M.name===b)?.value,V=b=>E[b.name]??b.value,w=ws(H),I=H.filter(b=>b.kind==="font"),ne=H.filter(b=>b.kind==="type"),vt=H.filter(b=>b.kind==="space"),jt=H.filter(b=>b.kind==="radius"),yt=H.filter(b=>b.kind==="shadow"),wt=H.filter(b=>b.kind==="motion"),kt=H.filter(b=>b.kind==="other"),Z=(b,M)=>L(he=>({...he,[b]:M})),me=g&&Se==="deck",Ce=q??z.data??"",De=Object.entries(E).filter(([b,M])=>$e(b)!==M),Ie=q!==null&&q!==(z.data??""),Nt=De.length>0||Ie;function St(){L({}),R(null),T(!1)}async function $t(){O(!0);try{if(De.length>0){let b=F.data??"";for(const[M,he]of De)b=ks(b,M,he);await f.mutateAsync({path:`${a}/tokens.css`,body:b,contentType:"text/css; charset=utf-8"}),d.invalidateQueries({queryKey:B.fileText(D)})}Ie&&q!==null&&(await f.mutateAsync({path:`${a}/brand.md`,body:q,contentType:"text/markdown; charset=utf-8"}),d.invalidateQueries({queryKey:B.fileText(P)})),d.invalidateQueries({queryKey:B.orgFsVolume(i.id,r)}),d.invalidateQueries({queryKey:B.orgFsRecent(i.id)}),L({}),R(null),T(!1),W.success("Brand saved")}catch(b){W.error(b instanceof Error?b.message:"Failed to save brand")}finally{O(!1)}}async function Ct(b){const M=b?.[0];if(!M)return;const Ke=`logo.${(M.name.split(".").pop()??"png").toLowerCase()}`;try{await m.mutateAsync({dir:a,files:[new File([M],Ke,{type:M.type})]}),C&&A(C)!==Ke&&await h.mutateAsync(C),W.success("Logo updated")}catch(He){W.error(He instanceof Error?He.message:"Logo upload failed")}finally{x.current&&(x.current.value="")}}const Dt=!v.isPending&&!k&&!N&&!C;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(pe,{size:18})}),n==="dialog"?t.jsx(Me,{className:"flex-1 truncate text-base font-medium text-foreground",children:c}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:c}),!o&&(p?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"ghost",size:"sm",onClick:St,disabled:Q,children:"Cancel"}),t.jsx(_,{size:"sm",disabled:!Nt||Q,onClick:()=>{$t()},children:Q?"Saving…":"Save"})]}):t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>T(!0),children:[t.jsx(Ot,{size:14}),"Edit"]})),n==="dialog"?t.jsx(rt,{asChild:!0,children:t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(ge,{size:16})})}):t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:t.jsx(ge,{size:16})})]}),t.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:v.isPending?t.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[t.jsx(K,{className:"h-40 w-full rounded-xl"}),t.jsx(K,{className:"h-4 w-1/3"}),t.jsx(K,{className:"h-4 w-2/3"})]}):Dt?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This brand is no longer available."}):t.jsxs(t.Fragment,{children:[(g||k)&&t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-label":G?"Show preview":"Hide preview",onClick:()=>se(b=>!b),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),se(M=>!M))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[t.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:b=>b.stopPropagation(),children:[g&&t.jsx("button",{type:"button",onClick:()=>{ue("deck"),se(!1)},className:ee("rounded-md px-2.5 py-1",me?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Deck"}),t.jsx("button",{type:"button",onClick:()=>{ue("components"),se(!1)},className:ee("rounded-md px-2.5 py-1",me?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:"Components"})]}),G?t.jsx(as,{size:16,className:"shrink-0 text-muted-foreground"}):t.jsx(os,{size:16,className:"shrink-0 text-muted-foreground"})]}),!G&&t.jsx("div",{className:"px-4 pb-4",children:t.jsx("div",{className:ee("w-full overflow-hidden rounded-xl border border-border bg-muted/30",me?"aspect-[16/9]":"h-96"),children:me?t.jsx(an,{readUrl:$,title:`${c} deck theme`,tokensUrl:D}):t.jsx(sn,{tokensUrl:D})})})]}),t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Logo"}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:C?t.jsx("img",{src:u(r,C),alt:`${c} logo`,className:"max-h-full max-w-full object-contain"}):t.jsx(pe,{size:28,className:"text-muted-foreground/50"})}),p&&t.jsxs("div",{children:[t.jsxs(_,{variant:"outline",size:"sm",disabled:m.isPending,onClick:()=>x.current?.click(),children:[t.jsx(xe,{size:14}),C?"Replace logo":"Add logo"]}),t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:b=>{Ct(b.target.files)}})]})]})]}),w.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Colors"}),w.map(b=>t.jsx(on,{family:b.family,tokens:b.tokens,editing:p,valueOf:V,onEdit:Z},b.family))]}),(I.length>0||ne.length>0)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Typography"}),I.map(b=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:b.name.replace(/^--brand-font-?/,"")||"font"}),p?t.jsx(Ue,{value:V(b),onChange:M=>Z(b.name,M.target.value),className:"h-9"}):t.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:V(b)},children:V(b)})]},b.name)),ne.map(b=>t.jsx(ht,{token:b,value:V(b),editing:p,onEdit:Z},b.name))]}),t.jsx(re,{label:"Spacing",tokens:vt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Radius",tokens:jt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Shadows",tokens:yt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Motion",tokens:wt,editing:p,valueOf:V,onEdit:Z}),t.jsx(re,{label:"Tokens",tokens:kt,editing:p,valueOf:V,onEdit:Z}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ae,{children:"Voice & guidelines"}),p?t.jsx(rs,{value:Ce,onChange:b=>R(b.target.value),placeholder:"Describe the brand voice, tone, do's and don'ts…",className:"min-h-48 font-mono text-sm"}):z.isPending&&N?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(K,{className:"h-3 w-full"}),t.jsx(K,{className:"h-3 w-5/6"})]}):Ce.trim()?t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t.jsx(ot,{id:`brand-preview-${s}`,text:Ce})}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"No brand voice written yet."})]})]})]})})]})}function dn(s){const e=S.c(8),{brandPath:n,onClose:i}=s;let l;e[0]!==i?(l=c=>{c||i()},e[0]=i,e[1]=l):l=e[1];let r;e[2]!==n||e[3]!==i?(r=t.jsx(Ee,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:t.jsx(pt,{brandPath:n,onClose:i,variant:"dialog"})}),e[2]=n,e[3]=i,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsx(Ae,{open:!0,onOpenChange:l,children:r}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function fn(s){const e=S.c(3),{brandPath:n,onClose:i}=s;let l;return e[0]!==n||e[1]!==i?(l=t.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:t.jsx(pt,{brandPath:n,onClose:i,variant:"panel"})}),e[0]=n,e[1]=i,e[2]=l):l=e[2],l}function xt(s){const e=S.c(23),{skillPath:n,onClose:i,variant:l}=s,r=Be(n),{volume:a,dirPath:c}=r,o=be(),d=o(a??"",`${c}/SKILL.md`),u=B.fileText(d);let f;e[0]!==d?(f=async()=>{const O=await fetch(d,{credentials:"include"});if(!O.ok)throw new Error(`fetch failed: ${O.status}`);return O.text()},e[0]=d,e[1]=f):f=e[1];let m;e[2]!==u||e[3]!==f?(m={queryKey:u,queryFn:f,staleTime:6e4,retry:!1},e[2]=u,e[3]=f,e[4]=m):m=e[4];const h=Y(m),x=Le(a??"",c);let v;e[5]!==c?(v=A(c),e[5]=c,e[6]=v):v=e[6];const j=v;let y;e[7]!==h.data?(y=h.data?ft(h.data):null,e[7]=h.data,e[8]=y):y=e[8];const k=y,N=mn;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=(O,G)=>N(O.path)?-1:N(G.path)?1:A(O.path).localeCompare(A(G.path)),e[9]=g):g=e[9];const C=(x.data??[]).filter(un).sort(g),[D,P]=U.useState(null),$=D===null?null:C.find(O=>O.path===D)??null,F=k?.name??j;let z;e[10]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Oe,{size:18})}),e[10]=z):z=e[10];let p;e[11]!==F||e[12]!==l?(p=l==="dialog"?t.jsx(Me,{className:"flex-1 truncate text-base font-medium text-foreground",children:F}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:F}),e[11]=F,e[12]=l,e[13]=p):p=e[13];let T;e[14]!==i||e[15]!==l?(T=l==="dialog"?t.jsx(rt,{asChild:!0,children:t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(ge,{size:16})})}):t.jsx(_,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:i,children:t.jsx(ge,{size:16})}),e[14]=i,e[15]=l,e[16]=T):T=e[16];let E;e[17]!==p||e[18]!==T?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[z,p,T]}),e[17]=p,e[18]=T,e[19]=E):E=e[19];let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[20]=L):L=e[20];const q="relative flex min-w-0 flex-1 flex-col overflow-y-auto",R=$?t.jsx(Yt,{file:{key:$.path,filename:A($.path),size:$.size,downloadUrl:o(a??"",$.path)}}):h.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(K,{className:"h-4 w-1/3"}),t.jsx(K,{className:"h-3 w-full"}),t.jsx(K,{className:"h-3 w-5/6"}),t.jsx(K,{className:"h-3 w-2/3"})]}):h.isError||!k?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:k.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(ot,{id:`skill-preview-${n}`,text:k.body})})]});let Q;return e[21]!==R?(Q=t.jsx("div",{className:q,children:R}),e[21]=R,e[22]=Q):Q=e[22],t.jsxs(t.Fragment,{children:[E,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[L,x.isPending?t.jsx(K,{className:"mx-2 h-4 w-24"}):C.map(O=>{const G=N(O.path)?$===null:D===O.path;return t.jsxs("button",{type:"button",onClick:()=>P(N(O.path)?null:O.path),className:ee("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",G?"bg-background shadow-sm":"hover:bg-muted/60"),children:[t.jsx(ie,{filename:A(O.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:ee("truncate text-sm",G?"text-foreground":"text-muted-foreground"),children:A(O.path)})]},O.path)})]}),Q]})]})}function un(s){return s.kind==="file"}function mn(s){return A(s)==="SKILL.md"}function hn(s){const e=S.c(8),{skillPath:n,onClose:i}=s;let l;e[0]!==i?(l=c=>{c||i()},e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i||e[3]!==n?(r=t.jsx(Ee,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:t.jsx(xt,{skillPath:n,onClose:i,variant:"dialog"})}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsx(Ae,{open:!0,onOpenChange:l,children:r}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function pn(s){const e=S.c(3),{skillPath:n,onClose:i}=s;let l;return e[0]!==i||e[1]!==n?(l=t.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:t.jsx(xt,{skillPath:n,onClose:i,variant:"panel"})}),e[0]=i,e[1]=n,e[2]=l):l=e[2],l}function gt(s){return`${window.location.origin}${s}`}function oe(s){if(s.shareMode==="password")return"password";if(s.shareMode==="public"||s.readPublic)return"public";if(s.effectivePublic)return"inherited"}const bt=[{id:"home",description:"Your organization's home folder",glyph:Et},{id:"uploads",description:"Files your team uploads",glyph:xe},{id:"outputs",description:"Agent run outputs",glyph:Mt}],Xe=3;function J(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-[13px] text-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function X(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:n}),e[0]=n,e[1]=i):i=e[1],i}function Re(s){const e=S.c(2),{rows:n}=s,i=n===void 0?1:n;let l;return e[0]!==i?(l=t.jsx(X,{children:Array.from({length:i*3},xn)}),e[0]=i,e[1]=l):l=e[1],l}function xn(s,e){return t.jsx(K,{className:"h-16 rounded-2xl"},e)}function qe(s){const e=S.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1],i}function gn(s){const e=S.c(6),{volume:n,displayName:i,description:l,glyph:r,onOpen:a}=s,c=ls(n),o=i??n,d=c.data?`${c.data.files} files`:void 0;let u;return e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==o||e[4]!==d?(u=t.jsx(Ne,{name:o,meta:d,subtitle:l,glyph:r,onOpen:a}),e[0]=l,e[1]=r,e[2]=a,e[3]=o,e[4]=d,e[5]=u):u=e[5],u}function bn(s){const e=S.c(8),{segments:n,onNavigate:i}=s;let l;e[0]!==i?(l=t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(""),children:"Library"}),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i||e[3]!==n?(r=n.map((c,o)=>{const d=n.slice(0,o+1).join("/"),u=o===n.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(zt,{size:12,className:"shrink-0 text-muted-foreground"}),u?t.jsx("span",{className:"truncate font-medium text-foreground",children:c}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(d),children:c})]},d)}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==r?(a=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[l,r]}),e[5]=l,e[6]=r,e[7]=a):a=e[7],a}function vn(s){const e=S.c(23),{onOpenDir:n,onOpenFile:i,onShare:l,onDelete:r}=s,{org:a}=Fe(),c=ns(),o=ct(),d=be();let u;e[0]!==d||e[1]!==l?(u=h=>l({volume:h.volume,path:h.path,kind:"file",shareMode:h.shareMode??"private",effectivePublic:h.effectivePublic??!1,url:gt(d(h.volume,h.path))}),e[0]=d,e[1]=l,e[2]=u):u=e[2];const f=u;let m;if(e[3]!==d||e[4]!==r||e[5]!==n||e[6]!==i||e[7]!==a||e[8]!==o.data?.length||e[9]!==c.data||e[10]!==c.isPending||e[11]!==f){const h=c.data??[],x=h.slice(0,Xe),v=h.slice(Xe);let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(J,{children:"Folders"}),e[13]=j):j=e[13];let y;e[14]!==n||e[15]!==a?(y=bt.map(g=>t.jsx(gn,{volume:g.id,displayName:g.id==="home"?fs(a.slug):void 0,description:g.description,glyph:g.glyph,onOpen:()=>n(g.id)},g.id)),e[14]=n,e[15]=a,e[16]=y):y=e[16];let k;e[17]!==n||e[18]!==o.data?.length?(k=(o.data?.length??0)>0&&t.jsx(Ne,{name:"public",meta:`${o.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:nt,readOnly:!0,onOpen:()=>n("public")}),e[17]=n,e[18]=o.data?.length,e[19]=k):k=e[19];let N;e[20]!==y||e[21]!==k?(N=t.jsxs("div",{className:"flex flex-col gap-3",children:[j,t.jsxs(X,{children:[y,k]})]}),e[20]=y,e[21]=k,e[22]=N):N=e[22],m=t.jsxs(t.Fragment,{children:[c.isPending?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Recently added"}),t.jsx(Re,{})]}):x.length>0?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Recently added"}),t.jsx(X,{children:x.map(g=>t.jsx(Xs,{filename:A(g.path),updatedAt:g.updatedAt,size:g.size,downloadUrl:d(g.volume,g.path),publicState:oe(g),onOpen:()=>i(`${g.volume}/${g.path}`),onShare:()=>f(g),onDelete:()=>r({volume:g.volume,path:g.path,kind:"file"})},`${g.volume}/${g.path}`))})]}):t.jsx(qe,{children:"No files yet — upload one, or ask an agent to produce something."}),N,v.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"All files"}),t.jsx(X,{children:v.map(g=>t.jsx(mt,{filename:A(g.path),updatedAt:g.updatedAt,downloadUrl:d(g.volume,g.path),publicState:oe(g),onOpen:()=>i(`${g.volume}/${g.path}`),onShare:()=>f(g),onDelete:()=>r({volume:g.volume,path:g.path,kind:"file"})},`${g.volume}/${g.path}`))})]})]}),e[3]=d,e[4]=r,e[5]=n,e[6]=i,e[7]=a,e[8]=o.data?.length,e[9]=c.data,e[10]=c.isPending,e[11]=f,e[12]=m}else m=e[12];return m}function jn(s){const e=S.c(11),{onOpenDir:n}=s,i=ct();if(i.isPending){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Re,{}),e[0]=o):o=e[0],o}let l;e[1]!==i.data?(l=i.data??[],e[1]=i.data,e[2]=l):l=e[2];const r=l;if(r.length===0){let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(qe,{children:"No public skill sets are configured."}),e[3]=o):o=e[3],o}let a;if(e[4]!==n||e[5]!==r){let o;e[7]!==n?(o=d=>t.jsx(Ne,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>n(`public/${d}`)},d),e[7]=n,e[8]=o):o=e[8],a=r.map(o),e[4]=n,e[5]=r,e[6]=a}else a=e[6];let c;return e[9]!==a?(c=t.jsx(X,{children:a}),e[9]=a,e[10]=c):c=e[10],c}function yn(s){const e=S.c(34),{location:n,onOpenDir:i,onOpenFile:l,onOpenSkill:r,onOpenBrand:a,onShare:c,onDelete:o}=s,d=n.volume??"",u=Le(d,n.dirPath),f=be();if(u.isPending){let k;return e[0]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Re,{rows:2}),e[0]=k):k=e[0],k}if(u.isError){const k=u.error instanceof Error?u.error.message:"Failed to load";let N;return e[1]!==k?(N=t.jsx("p",{className:"text-sm text-destructive",children:k}),e[1]=k,e[2]=N):N=e[2],N}let m,h,x,v,j;if(e[3]!==f||e[4]!==u.data||e[5]!==n||e[6]!==o||e[7]!==a||e[8]!==i||e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==d){j=Symbol.for("react.early_return_sentinel");e:{const k=u.data??[],N=k.filter(Sn),g=k.filter(Nn),C=k.filter(kn),D=k.filter(wn);if(k.length===0){const p=n.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let T;e[18]!==p?(T=t.jsx(qe,{children:p}),e[18]=p,e[19]=T):T=e[19],j=T;break e}let P;e[20]!==n.readOnly||e[21]!==o||e[22]!==d?(P=p=>n.readOnly?void 0:()=>o({volume:d,path:p.path,kind:p.kind}),e[20]=n.readOnly,e[21]=o,e[22]=d,e[23]=P):P=e[23];const $=P;let F;e[24]!==f||e[25]!==n.readOnly||e[26]!==c||e[27]!==d?(F=p=>n.readOnly?void 0:()=>c({volume:d,path:p.path,kind:p.kind,shareMode:p.shareMode??"private",effectivePublic:p.effectivePublic??!1,url:p.kind==="file"?gt(f(d,p.path)):void 0}),e[24]=f,e[25]=n.readOnly,e[26]=c,e[27]=d,e[28]=F):F=e[28];const z=F;m=N.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Skills"}),t.jsx(X,{children:N.map(p=>t.jsx(Us,{dirName:A(p.path),updatedAt:p.updatedAt,skillMdUrl:f(d,`${p.path}/SKILL.md`),publicState:oe(p),onOpen:()=>r(le(n,p.path)),onBrowse:()=>i(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]}),h=g.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Brands"}),t.jsx(X,{children:g.map(p=>t.jsx(_s,{dirName:A(p.path),updatedAt:p.updatedAt,tokensUrl:f(d,`${p.path}/tokens.css`),onOpen:()=>a(le(n,p.path)),onBrowse:()=>i(le(n,p.path)),onDelete:$(p)},p.path))})]}),x=C.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Folders"}),t.jsx(X,{children:C.map(p=>t.jsx(Ne,{name:A(p.path),meta:ce(p.updatedAt),readOnly:n.readOnly,publicState:oe(p),onOpen:()=>i(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]}),v=D.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(J,{children:"Files"}),t.jsx(X,{children:D.map(p=>t.jsx(mt,{filename:A(p.path),updatedAt:p.updatedAt,downloadUrl:f(d,p.path),publicState:oe(p),onOpen:()=>l(le(n,p.path)),onShare:z(p),onDelete:$(p)},p.path))})]})}e[3]=f,e[4]=u.data,e[5]=n,e[6]=o,e[7]=a,e[8]=i,e[9]=l,e[10]=r,e[11]=c,e[12]=d,e[13]=m,e[14]=h,e[15]=x,e[16]=v,e[17]=j}else m=e[13],h=e[14],x=e[15],v=e[16],j=e[17];if(j!==Symbol.for("react.early_return_sentinel"))return j;let y;return e[29]!==m||e[30]!==h||e[31]!==x||e[32]!==v?(y=t.jsxs(t.Fragment,{children:[m,h,x,v]}),e[29]=m,e[30]=h,e[31]=x,e[32]=v,e[33]=y):y=e[33],y}function wn(s){return s.kind==="file"}function kn(s){return s.kind==="dir"&&!s.hasSkill&&!s.hasBrand}function Nn(s){return s.kind==="dir"&&s.hasBrand&&!s.hasSkill}function Sn(s){return s.kind==="dir"&&s.hasSkill}function Ze(){const{org:s}=Fe(),e=Je(),n=et(),i=it(),l=tt({strict:!1}),r=l.path??"",a=Be(r),c=a.segments.length===0,o=(w,I)=>n({to:".",search:ne=>({...ne,[w]:I||void 0})}),d=w=>o("path",w),u=(w,I)=>n({to:".",search:ne=>({...ne,preview:void 0,skill:void 0,brand:void 0,[w]:I})}),f=w=>u("preview",w),m=w=>u("skill",w),h=w=>u("brand",w),[x,v]=U.useState(null),[j,y]=U.useState(null),[k,N]=U.useState(!1),[g,C]=U.useState(""),D=U.useRef(null),[P,$]=U.useState(!1),F=U.useRef(0),z=a.readOnly?null:a.volume??"uploads",p=a.volume?a.dirPath:"",{upload:T,mkdir:E}=Pe(z??"uploads"),{remove:L}=Pe(x?.volume??"uploads");async function q(w){if(!(!z||!w||w.length===0))try{await T.mutateAsync({dir:p,files:[...w]}),W.success(w.length===1?`Uploaded ${w[0]?.name}`:`Uploaded ${w.length} files`)}catch(I){W.error(I instanceof Error?I.message:"Upload failed")}finally{D.current&&(D.current.value="")}}const R=z!==null,Q=c?"uploads":a.segments.at(-1)??"this folder";function O(w){return w.dataTransfer.types.includes("Files")}function G(w){!R||!O(w)||(w.preventDefault(),F.current+=1,$(!0))}function se(w){!R||!O(w)||w.preventDefault()}function Se(){R&&(F.current=Math.max(0,F.current-1),F.current===0&&$(!1))}function ue(w){R&&(w.preventDefault(),F.current=0,$(!1),w.dataTransfer.files.length>0&&q(w.dataTransfer.files))}async function H(){const w=g.trim();if(!(!z||!w))try{await E.mutateAsync(p?`${p}/${w}`:w),W.success(`Folder "${w}" created`),N(!1),C("")}catch(I){W.error(I instanceof Error?I.message:"Failed to create folder")}}async function $e(){if(!x)return;const w=x;try{await L.mutateAsync(w.path),W.success(`Deleted ${A(w.path)}`)}catch(I){W.error(I instanceof Error?I.message:"Delete failed")}finally{v(null)}}function V(){for(const w of bt)e.invalidateQueries({queryKey:B.orgFsVolume(s.id,w.id)});a.volume&&e.invalidateQueries({queryKey:B.orgFsVolume(s.id,a.volume)}),e.invalidateQueries({queryKey:B.orgFsRecent(s.id)}),e.invalidateQueries({queryKey:B.orgFsPublicSets(s.id)})}return t.jsxs("div",{className:"relative h-full",onDragEnter:G,onDragOver:se,onDragLeave:Se,onDrop:ue,children:[P&&t.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:t.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[t.jsx(xe,{size:28,className:"text-primary"}),t.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Drop to upload to ",Q]})]})}),t.jsx("div",{className:"h-full overflow-y-auto",children:t.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[!c&&t.jsx(bn,{segments:a.segments,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:c?"Library":a.segments.at(-1)??"Library"}),t.jsx(_,{variant:"ghost",size:"icon",onClick:V,"aria-label":"Refresh",children:t.jsx(Tt,{size:14})}),!c&&z&&t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>N(!0),children:[t.jsx(At,{size:14}),"New folder"]}),a.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(st,{size:12}),"Read-only"]}):t.jsxs(_,{size:"sm",disabled:T.isPending,onClick:()=>D.current?.click(),children:[t.jsx(xe,{size:14}),T.isPending?"Uploading…":"Upload file"]}),t.jsx("input",{ref:D,type:"file",multiple:!0,className:"hidden",onChange:w=>{q(w.target.files)}})]})]}),c?t.jsx(vn,{onOpenDir:d,onOpenFile:f,onShare:y,onDelete:v}):a.volume===null?t.jsx(jn,{onOpenDir:d}):t.jsx(yn,{location:a,onOpenDir:d,onOpenFile:f,onOpenSkill:m,onOpenBrand:h,onShare:y,onDelete:v},a.volume)]})}),i&&(l.preview?t.jsx(ts,{previewPath:l.preview,onClose:()=>o("preview",null)}):l.skill?t.jsx(hn,{skillPath:l.skill,onClose:()=>o("skill",null)},l.skill):l.brand?t.jsx(dn,{brandPath:l.brand,onClose:()=>o("brand",null)},l.brand):null),t.jsx(Ae,{open:k,onOpenChange:N,children:t.jsxs(Ee,{children:[t.jsxs(Ht,{children:[t.jsx(Me,{children:"New folder"}),t.jsxs(Vt,{children:["Create a folder in ",r||"the library","."]})]}),t.jsx(Ue,{autoFocus:!0,placeholder:"folder-name",value:g,onChange:w=>C(w.target.value),onKeyDown:w=>{w.key==="Enter"&&H()}}),t.jsxs(Gt,{children:[t.jsx(_,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),t.jsx(_,{disabled:!g.trim()||E.isPending,onClick:()=>{H()},children:"Create"})]})]})}),t.jsx(ss,{target:j,onOpenChange:w=>{w||y(null)}}),t.jsx(Ut,{open:x!==null,onOpenChange:w=>{w||v(null)},children:t.jsxs(Bt,{children:[t.jsxs(Lt,{children:[t.jsxs(_t,{children:["Delete ",x?A(x.path):"","?"]}),t.jsx(Rt,{children:x?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),t.jsxs(qt,{children:[t.jsx(It,{children:"Cancel"}),t.jsx(Kt,{onClick:()=>{$e()},children:"Delete"})]})]})})]})}function il(){const s=S.c(12),e=it(),n=et();let i;s[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},s[0]=i):i=s[0];const l=tt(i);let r;s[1]!==n?(r=d=>n({to:".",search:u=>({...u,[d]:void 0})}),s[1]=n,s[2]=r):r=s[2];const a=r;let c,o;if(s[3]!==a||s[4]!==e||s[5]!==l.brand||s[6]!==l.preview||s[7]!==l.skill){o=Symbol.for("react.early_return_sentinel");e:{const d=l.preview?{key:"preview",path:l.preview,panel:t.jsx(Xt,{previewPath:l.preview,onClose:()=>a("preview")})}:l.skill?{key:"skill",path:l.skill,panel:t.jsx(pn,{skillPath:l.skill,onClose:()=>a("skill")},l.skill)}:l.brand?{key:"brand",path:l.brand,panel:t.jsx(fn,{brandPath:l.brand,onClose:()=>a("brand")},l.brand)}:null;if(e){let f;s[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:t.jsx(Te,{children:t.jsx(Ze,{})})}),s[10]=f):f=s[10],o=f;break e}let u;s[11]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ve,{order:1,minSize:30,defaultSize:55,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(Te,{children:t.jsx(Ze,{})})})})}),s[11]=u):u=s[11],c=t.jsxs(Zt,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[u,d&&t.jsxs(t.Fragment,{children:[t.jsx(Qt.Tabs,{children:t.jsx(Jt,{title:A(d.path),icon:{kind:"component",Component:f=>d.key==="preview"?t.jsx(ie,{filename:A(d.path),...f}):d.key==="skill"?t.jsx(Oe,{...f}):t.jsx(pe,{...f})},active:!0,onClick:()=>a(d.key)})}),t.jsx(es,{className:"bg-sidebar"}),t.jsx(Ve,{order:2,minSize:25,defaultSize:45,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(Te,{children:d.panel})})})})]})]})}s[3]=a,s[4]=e,s[5]=l.brand,s[6]=l.preview,s[7]=l.skill,s[8]=c,s[9]=o}else c=s[8],o=s[9];return o!==Symbol.for("react.early_return_sentinel")?o:c}export{il as default};
|