@decocms/mesh 2.125.0 → 2.125.1
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-BzYW4X7z.js → AlertCircle-DxaosN_f.js} +1 -1
- package/dist/client/assets/{AlertOctagon-CUysWl_m.js → AlertOctagon-cUZLNABf.js} +1 -1
- package/dist/client/assets/{AlertTriangle-DniGvpwb.js → AlertTriangle-4A_giHV7.js} +1 -1
- package/dist/client/assets/{ArrowDown-B35oswmj.js → ArrowDown-BCC90_2r.js} +1 -1
- package/dist/client/assets/{ArrowLeft-dS1h2Fqu.js → ArrowLeft-CPy9b3-I.js} +1 -1
- package/dist/client/assets/{ArrowUp-G8RCE5_O.js → ArrowUp-095f00XC.js} +1 -1
- package/dist/client/assets/{Check-Bv0pZ3gl.js → Check-DX81M4UN.js} +1 -1
- package/dist/client/assets/{CheckCircle-lzDHXhkH.js → CheckCircle-CIh-eFaM.js} +1 -1
- package/dist/client/assets/{CheckDone01-BrxNvWbF.js → CheckDone01-B4S514Pm.js} +1 -1
- package/dist/client/assets/{CheckVerified02-6wwLRSRQ.js → CheckVerified02-BZWM283O.js} +1 -1
- package/dist/client/assets/{ChevronDown-CggIFEVQ.js → ChevronDown-C_pFRqX8.js} +1 -1
- package/dist/client/assets/{ChevronRight-DgAfR8pA.js → ChevronRight-DY1xiCUb.js} +1 -1
- package/dist/client/assets/{Clock-IA7N95Qq.js → Clock-vSHk4lRO.js} +1 -1
- package/dist/client/assets/{Code01-DP2jwP0n.js → Code01-D3JhXTPK.js} +1 -1
- package/dist/client/assets/{Container-jfv9L6Hc.js → Container-adXBBWtI.js} +1 -1
- package/dist/client/assets/{Copy01-Dq7Edhtu.js → Copy01-y1kUbB69.js} +1 -1
- package/dist/client/assets/{Dataflow03-C6KAN8vb.js → Dataflow03-CGMAE4CD.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-CQ-MbYsC.js → DotsHorizontal-B48pfMoL.js} +1 -1
- package/dist/client/assets/{DotsVertical-PhooMqUv.js → DotsVertical-fI7whvq1.js} +1 -1
- package/dist/client/assets/{Download01-CA9RmYjX.js → Download01-CQdpB9dg.js} +1 -1
- package/dist/client/assets/{Edit01-DRruZKzG.js → Edit01-DV7i6b_1.js} +1 -1
- package/dist/client/assets/{Eye-B9ZDOUkE.js → Eye-0EEXzuIs.js} +1 -1
- package/dist/client/assets/{File02-B2t2I1sM.js → File02-DDGoV-pJ.js} +1 -1
- package/dist/client/assets/{File06-2US99J_V.js → File06-vlWs29hO.js} +1 -1
- package/dist/client/assets/{FilterLines-BFeSNY4D.js → FilterLines-C6hE4dxD.js} +1 -1
- package/dist/client/assets/{Globe01-Dxe6Kj1c.js → Globe01-YUJRKhi7.js} +1 -1
- package/dist/client/assets/{Globe02-BPmEw10H.js → Globe02-McmndEy1.js} +1 -1
- package/dist/client/assets/{Grid01-CJW4ZLO5.js → Grid01-D-UJvJ4U.js} +1 -1
- package/dist/client/assets/{Hash02-CIZbsu7P.js → Hash02-BsuEn6Tr.js} +1 -1
- package/dist/client/assets/{Home02-Doo3wLuN.js → Home02-BzWLDni0.js} +1 -1
- package/dist/client/assets/{Image01-C9h8llDV.js → Image01-D37M36hG.js} +1 -1
- package/dist/client/assets/{Inbox01-BweXezQd.js → Inbox01-A36zOoLA.js} +1 -1
- package/dist/client/assets/{InfoCircle-DBbArWGV.js → InfoCircle-BptNWRbo.js} +1 -1
- package/dist/client/assets/{Key01-CfL5jY3W.js → Key01-DTOaoO9L.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DAvzaXYE.js → LinkExternal01-s5AS-l6s.js} +1 -1
- package/dist/client/assets/{List-sG42OZ_v.js → List-ChBrkSt3.js} +1 -1
- package/dist/client/assets/{Loading01-BHMOj-H5.js → Loading01-C_dZ70Y_.js} +1 -1
- package/dist/client/assets/{Lock01-CQ3bhGvR.js → Lock01-BgYAZD0M.js} +1 -1
- package/dist/client/assets/{Pin01-8MTlfWD2.js → Pin01-m8Usx-G2.js} +1 -1
- package/dist/client/assets/{Play-APj1Lxit.js → Play-Dj27C0Pj.js} +1 -1
- package/dist/client/assets/{Plus-DNqvDLOK.js → Plus-Cqqd1qB7.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-4dzpBOob.js → RefreshCcw01-aEpj51K0.js} +1 -1
- package/dist/client/assets/{RefreshCw01-DHXbMDcX.js → RefreshCw01-CND9qgYc.js} +1 -1
- package/dist/client/assets/{Rows03-Cdgrgsit.js → Rows03-YSN8NfTb.js} +1 -1
- package/dist/client/assets/{Save01-D-T2SbCx.js → Save01-Cvritm34.js} +1 -1
- package/dist/client/assets/{SearchMd-BLcaRHQs.js → SearchMd-C2TJxhWh.js} +1 -1
- package/dist/client/assets/{Settings01-DKXbh8uh.js → Settings01-CUb7_xIo.js} +1 -1
- package/dist/client/assets/{Shield01-B89AcbSX.js → Shield01-BmOROuXR.js} +1 -1
- package/dist/client/assets/{Terminal-BblMM2fp.js → Terminal-Z3ZvfZjV.js} +1 -1
- package/dist/client/assets/{Trash01-CkTOgej8.js → Trash01-DGNEPK6E.js} +1 -1
- package/dist/client/assets/{Upload01-gcuuVZ2S.js → Upload01-Bu2dTgTN.js} +1 -1
- package/dist/client/assets/{Users03-C1B58zTV.js → Users03-21KXT9Tr.js} +1 -1
- package/dist/client/assets/{XCircle-DneNZUk0.js → XCircle-DtxTTf3G.js} +1 -1
- package/dist/client/assets/{XClose-Dgr_gyyv.js → XClose-aBNfOQCP.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-Dq0jl9Fh.js → agent-connections-preview-CUZdrftq.js} +1 -1
- package/dist/client/assets/{agent-detail-BNn3Uyo0.js → agent-detail-CQ93FkhV.js} +1 -1
- package/dist/client/assets/{agents-BAZxaM_m.js → agents-DH13svFw.js} +1 -1
- package/dist/client/assets/{alert-dialog-BvNipqK_.js → alert-dialog-CqcaYkiJ.js} +1 -1
- package/dist/client/assets/{auth-catchall-BoSUXTLZ.js → auth-catchall-D1O9ygtz.js} +1 -1
- package/dist/client/assets/{avatar-BNKSN34R.js → avatar-CLwmO-iu.js} +1 -1
- package/dist/client/assets/{badge-Do8iK9u9.js → badge-COxDM0wU.js} +1 -1
- package/dist/client/assets/{binder-BBB8LQyx.js → binder-BnqkDZhr.js} +1 -1
- package/dist/client/assets/{breadcrumb-DeYbtjMk.js → breadcrumb-DNLwlIVn.js} +1 -1
- package/dist/client/assets/{button-D6YZfFzy.js → button-Bh5FwGIY.js} +1 -1
- package/dist/client/assets/{card-BNyCnFpQ.js → card-CQpD36Cd.js} +1 -1
- package/dist/client/assets/{chart--8-symKO.js → chart-CJ0LfYbL.js} +1 -1
- package/dist/client/assets/{checkbox-BZwARXIv.js → checkbox-2aSR3jmV.js} +1 -1
- package/dist/client/assets/{circle-alert-YjViK8VE.js → circle-alert-CkvRYvnb.js} +1 -1
- package/dist/client/assets/{collection-detail-LkGK1rw-.js → collection-detail-egzLIo3p.js} +1 -1
- package/dist/client/assets/{collection-search-CBYSITVU.js → collection-search-By6ZMwtA.js} +1 -1
- package/dist/client/assets/{collection-tab-BrrYAQmN.js → collection-tab-DFeE5Fu9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-fNhnYl-G.js → collection-table-wrapper-BRK1q11U.js} +1 -1
- package/dist/client/assets/{collection-tabs-D0bfkNrY.js → collection-tabs-BtVgWqaS.js} +1 -1
- package/dist/client/assets/{command-Dt3t7o57.js → command-BaS-0Wfh.js} +1 -1
- package/dist/client/assets/{connect-DPEGql6L.js → connect-3VJmRE1h.js} +1 -1
- package/dist/client/assets/{connection-card-Cwh5xUmA.js → connection-card-B91SZISg.js} +1 -1
- package/dist/client/assets/{connection-detail-DgHwxZSJ.js → connection-detail-mo3MA2Xi.js} +1 -1
- package/dist/client/assets/{connections-D2AuzZXu.js → connections-CE3xmstM.js} +1 -1
- package/dist/client/assets/constants-Bg8UqzBy.js +1 -0
- package/dist/client/assets/{constants-8URKDp4Y.js → constants-DnuxEo5s.js} +1 -1
- package/dist/client/assets/{context-DHicyHl4.js → context-DKu_mHFC.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Cb3EQpzl.js → create-organization-dialog-De0OX1Zl.js} +1 -1
- package/dist/client/assets/{create-project-dialog-BjqZAjhY.js → create-project-dialog-lv0TRMx_.js} +1 -1
- package/dist/client/assets/{deco-constants-CyaJG-D1.js → deco-constants-CTtPnJzR.js} +1 -1
- package/dist/client/assets/{dialog-DSPMVHyJ.js → dialog-BYwNnwwA.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CRT7qGQ9.js → dropdown-menu-usbHDlIZ.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Dj3hkiA6.js → dynamic-plugin-layout-d2sr4Zos.js} +1 -1
- package/dist/client/assets/{empty-state-BA6UkF4p.js → empty-state-BmmycNCG.js} +1 -1
- package/dist/client/assets/{empty-state-sMx3NP6e.js → empty-state-D0ORcC9s.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DuW-Il-b.js → env-vars-editor-CEsz7coi.js} +1 -1
- package/dist/client/assets/{error-boundary-lFjWy2-n.js → error-boundary-BLEw7xWo.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B39uuFqG.js → extract-connection-data-BReoF993.js} +1 -1
- package/dist/client/assets/{file-browser-BIF8ssgw.js → file-browser-BwHr0_f-.js} +2 -2
- package/dist/client/assets/{form-BMtUcs2k.js → form-Cci_0GHL.js} +1 -1
- package/dist/client/assets/{grid-view-e1dnT7b5.js → grid-view-DxVImF1W.js} +1 -1
- package/dist/client/assets/{home-1A3rDo1n.js → home-EcK31mDl.js} +1 -1
- package/dist/client/assets/{index-CjGa0AXv.js → index-B9KDyGv1.js} +1 -1
- package/dist/client/assets/{index-QQ-XmLlG.js → index-CJPy6tkz.js} +1 -1
- package/dist/client/assets/{index-DnrfuViL.js → index-Cqq1nFO_.js} +1 -1
- package/dist/client/assets/{index-DmoBx0VC.js → index-CzbRSFGS.js} +1 -1
- package/dist/client/assets/{index-DwBgLSti.js → index-D52JGBSW.js} +24 -24
- package/dist/client/assets/{index-B_nMIrSY.js → index-DH9RHGRj.js} +1 -1
- package/dist/client/assets/{index-DJ_LDW-E.js → index-DMSLkGyV.js} +1 -1
- package/dist/client/assets/{index-CCjxSJ1y.js → index-TP7Ym6Gi.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Yvt0ZTml.js → infiniteQueryObserver-DXqCWbrQ.js} +1 -1
- package/dist/client/assets/{input-B7id4I1j.js → input--zCus1rn.js} +1 -1
- package/dist/client/assets/{integration-icon-qV_BsBQR.js → integration-icon-B4lXAd2V.js} +1 -1
- package/dist/client/assets/{label-29qY4FPs.js → label-Dt9hwfoA.js} +1 -1
- package/dist/client/assets/{layout-Ck3H2-cu.js → layout-Desge4fu.js} +1 -1
- package/dist/client/assets/{localstorage-keys-Ct4C992S.js → localstorage-keys-DFOUclc3.js} +1 -1
- package/dist/client/assets/{login-DO8QasPa.js → login-ZxDL_xXY.js} +1 -1
- package/dist/client/assets/{markdown-jp5pFlBz.js → markdown-B_rkr1OY.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Bb9gvF4o.js → mcp-oauth-g19aHl5R.js} +1 -1
- package/dist/client/assets/{mcp-server-card-D_Epc4aH.js → mcp-server-card-PYGzaKTV.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Dut9IDFd.js → mcp-server-detail-sq3Zve-q.js} +2 -2
- package/dist/client/assets/{members-4s3A4PQH.js → members-Dko3OMBs.js} +1 -1
- package/dist/client/assets/{monitoring-gEkChCwS.js → monitoring-25vjnX5K.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-DyFCcJjq.js → monitoring-dashboard-edit-APi27Lyy.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-Bc4tCiDF.js → monitoring-dashboard-view-BTgDG7Qr.js} +1 -1
- package/dist/client/assets/{oauth-callback-tz7MTdrq.js → oauth-callback-C2TJ9rrs.js} +1 -1
- package/dist/client/assets/{page-YrzfNFn-.js → page-BuCrRSmo.js} +1 -1
- package/dist/client/assets/{page-pkTyp5rB.js → page-C2P203ja.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-dEbxXjO6.js → plugin-empty-state-BiS9FDyZ.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-YsTdKC2B.js → plugin-empty-state-CJIaoSBt.js} +1 -1
- package/dist/client/assets/{plugin-header-Di-tZc0h.js → plugin-header-BMhkjONo.js} +1 -1
- package/dist/client/assets/{plugin-header-Djvd0-eL.js → plugin-header-Be_rW9BG.js} +1 -1
- package/dist/client/assets/{popover-pjzQQlLd.js → popover-C4pJDbzd.js} +1 -1
- package/dist/client/assets/project-layout-a9ZljoS8.js +1 -0
- package/dist/client/assets/{projects-list-DcozT0tR.js → projects-list-bxq1MrSm.js} +1 -1
- package/dist/client/assets/{ranking-layout-D3PvNfv7.js → ranking-layout-DEmm60_H.js} +1 -1
- package/dist/client/assets/{readme-viewer-BmO5RwRH.js → readme-viewer-5tvDeQHi.js} +1 -1
- package/dist/client/assets/{registry-layout-DEN2jHtD.js → registry-layout-CJhj9rcX.js} +1 -1
- package/dist/client/assets/{registry-utils-DMdc5PTp.js → registry-utils-DEhTjpqF.js} +1 -1
- package/dist/client/assets/{reports-layout-DziFQRp_.js → reports-layout-fQTBEwe0.js} +1 -1
- package/dist/client/assets/{reset-password-CrHLBBwi.js → reset-password-ez0ppaGq.js} +1 -1
- package/dist/client/assets/{resizable-jXkpfiVS.js → resizable-C26aI2AS.js} +1 -1
- package/dist/client/assets/{save-actions-BPg_8VMI.js → save-actions-Dv1nRyHY.js} +1 -1
- package/dist/client/assets/{scroll-area-CcejXaMp.js → scroll-area-DcJFHDMz.js} +1 -1
- package/dist/client/assets/{select-CkeKfTEx.js → select-DEG2HUsU.js} +1 -1
- package/dist/client/assets/shell-layout-BXZeCKqs.js +3 -0
- package/dist/client/assets/{skeleton-DNLZ4Kho.js → skeleton-_QoQu65Z.js} +1 -1
- package/dist/client/assets/{spinner-DZtD-MX0.js → spinner-CpcUYhT9.js} +1 -1
- package/dist/client/assets/{store-invite-B_jz8YSY.js → store-invite-BI-C3Ger.js} +1 -1
- package/dist/client/assets/{switch-DFKxfcc5.js → switch-Yifr4LYd.js} +1 -1
- package/dist/client/assets/{table-Csfk_VXo.js → table-BE49uKeW.js} +1 -1
- package/dist/client/assets/{tasks-Dv2Dq-cV.js → tasks-_TSvuWWo.js} +1 -1
- package/dist/client/assets/{textarea-GWXLFYfv.js → textarea-DGrDCMYg.js} +1 -1
- package/dist/client/assets/{time-range-picker-DnUGZRLa.js → time-range-picker-D-bxceyA.js} +1 -1
- package/dist/client/assets/{toggle-group-CojJ3wZ4.js → toggle-group-BDPgnYqc.js} +1 -1
- package/dist/client/assets/{tools-list-BPGP3JUO.js → tools-list-DmG41xlg.js} +1 -1
- package/dist/client/assets/{tooltip-D71dCz4E.js → tooltip-DJR7bz1l.js} +1 -1
- package/dist/client/assets/{topbar-portal-BKT0Es8i.js → topbar-portal-CoIDsv0w.js} +1 -1
- package/dist/client/assets/{typewriter-title-DqLjhGgL.js → typewriter-title-EJB9gire.js} +1 -1
- package/dist/client/assets/{use-binding-DbH4Xe03.js → use-binding-Cs2Y-PcQ.js} +1 -1
- package/dist/client/assets/{use-connection-BEGrPCmR.js → use-connection-Dj9QSNVL.js} +1 -1
- package/dist/client/assets/{use-copy-DsHlaDHD.js → use-copy-D7PzOc0z.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BzTARjrD.js → use-create-virtual-mcp-B-HizY93.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-CxG3qwlT.js → use-deco-chat-open-C86CtM_I.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-CSDJ0ZgD.js → use-install-from-registry-C8e-6Etm.js} +1 -1
- package/dist/client/assets/{use-list-state-DvpdPuz-.js → use-list-state-CmfVe0Sz.js} +1 -1
- package/dist/client/assets/{use-llm-BbYG_RIr.js → use-llm-C_wGfF_N.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-qD8uHlkj.js → use-mcp-prompts-CFUruqMt.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BAsmCzEJ.js → use-mcp-tools-CjZtbvY1.js} +1 -1
- package/dist/client/assets/{use-mobile-Bs0AkxK7.js → use-mobile-DBGLvQCZ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BJ9tNAL9.js → use-organization-settings-DFBQM6OB.js} +1 -1
- package/dist/client/assets/{use-project-CXHCn5kp.js → use-project-cfHYfzp_.js} +1 -1
- package/dist/client/assets/{use-settings-modal-Dx8IF1Gs.js → use-settings-modal-D3XdLMRO.js} +1 -1
- package/dist/client/assets/{use-view-mode-DMPiUC22.js → use-view-mode-DyCv_xrc.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DBzFAk7J.js → use-virtual-mcp-ctHrpgTx.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BSv9hDZn.js +1 -0
- package/dist/client/assets/{useMutation-DgG1LVg-.js → useMutation-B8qgpkUA.js} +1 -1
- package/dist/client/assets/useQuery--0jbogka.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DU-5JWKq.js +1 -0
- package/dist/client/assets/{view-mode-toggle-2-qyK3LU.js → view-mode-toggle-DnPBouL3.js} +1 -1
- package/dist/client/assets/{workflow-YppA7Sxi.js → workflow-Dfnb1_XD.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/constants-oXq_cTdm.js +0 -1
- package/dist/client/assets/project-layout-Bp5s1iI1.js +0 -1
- package/dist/client/assets/shell-layout-C4PQ301W.js +0 -3
- package/dist/client/assets/useInfiniteQuery-DXQ7BtjQ.js +0 -1
- package/dist/client/assets/useQuery-CPsXfVfR.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CuH1Eku2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,ap as $,j as c,aG as L,al as G,as as A,ar as _,au as P,aH as w,aw as j,aI as H,aJ as E,aK as z,aL as K,ax as J,aM as Q,aN as U,aO as V,aP as W,aQ as Z,aR as q,c as R}from"./index-
|
|
1
|
+
import{r as i,ap as $,j as c,aG as L,al as G,as as A,ar as _,au as P,aH as w,aw as j,aI as H,aJ as E,aK as z,aL as K,ax as J,aM as Q,aN as U,aO as V,aP as W,aQ as Z,aR as q,c as R}from"./index-D52JGBSW.js";import{c as B}from"./button-Bh5FwGIY.js";var m="Popover",[b]=J(m,[E]),g=E(),[X,d]=b(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=g(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:s,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),a=g(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(w,{...a,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),a=g(o),s=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":k(n.open),...r,ref:s,onClick:P(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(w,{asChild:!0,...a,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=b(O,{forceMount:void 0}),M=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||a.open,children:c.jsx(H,{asChild:!0,container:n,children:r})})})};M.displayName=O;var v="PopoverContent",D=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(j,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});D.displayName=v;var te=Q("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return z(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(I,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(I,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),I=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),C=g(o);return U(),c.jsx(V,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(W,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":k(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:P(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=g(o);return c.jsx(q,{...n,...r,ref:e})});ce.displayName=se;function k(t){return t?"open":"closed"}var ie=N,pe=y,le=M,ue=D;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,a;e[0]!==t?({className:o,align:n,sideOffset:a,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a):(o=e[1],r=e[2],n=e[3],a=e[4]);const s=n===void 0?"center":n,p=a===void 0?4:a;let l;e[5]!==o?(l=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:s,sideOffset:p,className:l,...r})}),e[7]=s,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{Pe as P,ge as a,ve as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as v,c as L,d as et,j as i,u as X,O as ee,t as V,H as zr,o as Lt,s as be,b as $e,m as Fe,l as $t,k as Ft,K as Q,aF as Ge,bG as Lr,b1 as ne,P as Mt,S as Ye,e as $r,aD as Fr}from"./index-D52JGBSW.js";import{u as Mr,a as Bt}from"./use-project-cfHYfzp_.js";import{c as ie,B as Y}from"./button-Bh5FwGIY.js";import{a as Rt,b as Br,c as Rr,d as Wr,D as Wt}from"./dialog-BYwNnwwA.js";import{a as Gr,b as Ur,c as Kr,T as qr,i as Gt}from"./tooltip-DJR7bz1l.js";import{u as tt,S as re}from"./skeleton-_QoQu65Z.js";import{p as Ut,a as mt,t as Yr,u as Hr}from"./use-settings-modal-D3XdLMRO.js";import{A as Kt}from"./avatar-CLwmO-iu.js";import{a as rt,i as Vr}from"./deco-constants-CTtPnJzR.js";import{t as qt}from"./Settings01-CUb7_xIo.js";import{i as Xr}from"./Check-DX81M4UN.js";import{a as Qr}from"./Copy01-y1kUbB69.js";import{S as _e}from"./switch-Yifr4LYd.js";import{S as Yt,a as Ht,d as Ae,c as Vt,b as Jr}from"./select-DEG2HUsU.js";import{i as Zr}from"./Code01-D3JhXTPK.js";import{i as en}from"./Shield01-BmOROuXR.js";import{n as tn}from"./CheckDone01-B4S514Pm.js";import{u as Me}from"./useMutation-B8qgpkUA.js";import{a as Xt,F as je,b as le,c as oe,d as ce,f as ke,e as He}from"./form-Cci_0GHL.js";import{I as ae}from"./input--zCus1rn.js";import{i as rn}from"./Upload01-Bu2dTgTN.js";import{a as nt,u as Se}from"./constants-DnuxEo5s.js";import{T as nn}from"./textarea-DGrDCMYg.js";import{c as an,h as sn,d as ln,b as on,A as cn,e as dn,g as un,a as mn,f as fn}from"./alert-dialog-CqcaYkiJ.js";import{u as hn}from"./useQuery--0jbogka.js";import{L as Oe}from"./label-Dt9hwfoA.js";import{n as xn}from"./Container-adXBBWtI.js";import{h as Qt}from"./use-connection-Dj9QSNVL.js";import{a as pn,c as gn}from"./use-binding-Cs2Y-PcQ.js";import{u as vn}from"./use-install-from-registry-C8e-6Etm.js";import{i as yn}from"./Loading01-C_dZ70Y_.js";import{s as Jt}from"./Plus-Cqqd1qB7.js";import{i as q,G as Zt,g as Ue,m as bn,D as Be,r as we,Z as Re,L as me,s as Ne,C as jn,a as kn,b as er,c as Sn,d as wn,T as Nn,u as Pn,e as Cn,f as An,h as Ie,j as H,k as ft,l as ht,n as tr,o as rr,p as We,q as it,t as _n,v as On,w as nr,x as at,y as st,z as ir,A as En,B as ar,E as xt,F as In,H as Dn,I as sr,R as Tn,S as zn,J as Ln,K as $n,M as lr,N as Fn,O as Mn,P as Bn,Q as Rn,U as Wn,V as Gn,W as Un,X as Kn,Y as qn,_ as pt,$ as gt,a0 as vt,a1 as Yn,a2 as lt,a3 as Hn,a4 as ve,a5 as Vn,a6 as Xn,a7 as Qn,a8 as Jn,a9 as Zn,aa as Ke,ab as ei,ac as Te,ad as W,ae as ot,af as ti,ag as ri,ah as ni,ai as or,aj as cr,ak as ii,al as ai,am as si,an as dr,ao as G,ap as li,aq as oi,ar as ci,as as di,at as ui,au as mi,av as fi,aw as hi,ax as xi,ay as pi,az as gi,aA as vi,aB as yi}from"./chart-CJ0LfYbL.js";import{B as ur}from"./badge-COxDM0wU.js";import{i as bi}from"./AlertCircle-DxaosN_f.js";import{b as ji,a as mr}from"./use-mcp-tools-CjZtbvY1.js";import"./localstorage-keys-DFOUclc3.js";import"./ChevronDown-C_pFRqX8.js";import"./binder-BnqkDZhr.js";import"./extract-connection-data-BReoF993.js";import"./constants-Bg8UqzBy.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-DEhTjpqF.js";import"./generate-id-Dyweu44Y.js";import"./index-DMSLkGyV.js";const fr=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M10 2v4.66c0 .218 0 .326-.033.413a.47.47 0 0 1-.138.198c-.07.06-.183.102-.409.185a7.5 7.5 0 1 0 5.16 0c-.226-.083-.339-.125-.409-.185a.469.469 0 0 1-.138-.198C14 6.986 14 6.878 14 6.66V2M8.5 2h7"}));fr.displayName="Beaker01";const hr=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));hr.displayName="Bell01";const ct=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));ct.displayName="Zap";const ki=[{key:"general",label:"General",icon:i.jsx(qt,{size:14})},{key:"plugins",label:"Plugins",icon:i.jsx(ct,{size:14})}];function Si(t){const e=L.c(14),{activeSection:r,onNavigate:n}=t,{org:s}=X();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={suspense:!0},e[0]=a):a=e[0];const{data:l}=Mr(s.id,a);let o;e[1]!==r?(o=Ut(r),e[1]=r,e[2]=o):o=e[2];const u=o;let d;if(e[3]!==u?.slug||e[4]!==r||e[5]!==n||e[6]!==l){let f;e[8]!==u?.slug||e[9]!==r||e[10]!==n?(f=m=>{const x=u?.slug===m.slug;return i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsxs("button",{type:"button",onClick:()=>n(mt(m.slug,"general")),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",x?"text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("div",{className:"size-4 shrink-0 rounded-[3px] flex items-center justify-center overflow-hidden border border-border/50",style:{backgroundColor:m.ui?.themeColor??"#60a5fa"},children:m.ui?.icon?i.jsx("img",{src:m.ui.icon,alt:"",className:"size-full object-cover"}):i.jsx("span",{className:"text-[8px] font-semibold text-white leading-none",children:(m.name??m.slug).charAt(0).toUpperCase()})}),i.jsx("span",{className:"truncate",children:m.name??m.slug})]}),x&&i.jsx("div",{className:"ml-3 flex flex-col gap-0.5 border-l border-border pl-2.5",children:ki.map(h=>{const g=mt(m.slug,h.key);return i.jsxs("button",{type:"button",onClick:()=>n(g),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===g?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:h.icon}),i.jsx("span",{className:"truncate",children:h.label})]},h.key)})})]},m.slug)},e[8]=u?.slug,e[9]=r,e[10]=n,e[11]=f):f=e[11],d=(l??[]).filter(wi).map(f),e[3]=u?.slug,e[4]=r,e[5]=n,e[6]=l,e[7]=d}else d=e[7];let c;return e[12]!==d?(c=i.jsx(i.Fragment,{children:d}),e[12]=d,e[13]=c):c=e[13],c}function wi(t){return t.slug!==ee}function Ni(t){const e=L.c(31),{activeSection:r,onNavigate:n}=t,{data:s}=et.useSession(),[a]=tt(),l=s?.user,o=l?.image,u=l?.name??"Profile",d=l?.name??"U";let c;e[0]!==d||e[1]!==o?(c=i.jsx(Kt,{url:o,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=o,e[2]=c):c=e[2];let f;e[3]!==u||e[4]!==c?(f={key:"account.profile",label:u,icon:c},e[3]=u,e[4]=c,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={key:"account.preferences",label:"Preferences",icon:i.jsx(qt,{size:14})},e[6]=m):m=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x={key:"account.experimental",label:"Experimental",icon:i.jsx(fr,{size:14})},e[7]=x):x=e[7];let h;e[8]!==f?(h=[f,m,x],e[8]=f,e[9]=h):h=e[9];const g=h;let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"org.general",label:"General",icon:i.jsx(Yr,{size:14})},e[10]=y):y=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={key:"org.plugins",label:"Plugins",icon:i.jsx(ct,{size:14})},e[11]=S):S=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=[y,S,{key:"org.billing",label:"Billing",icon:i.jsx(rt,{size:14})}],e[12]=w):w=e[12];const P=w;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[13]=j):j=e[13];let p;e[14]!==g||e[15]!==r||e[16]!==n?(p=i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[j,g.map(_=>i.jsxs("button",{type:"button",onClick:()=>n(_.key),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===_.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:_.icon}),i.jsx("span",{className:"truncate",children:_.label})]},_.key))]}),e[14]=g,e[15]=r,e[16]=n,e[17]=p):p=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=b):b=e[18];let k;e[19]!==r||e[20]!==n?(k=i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[b,P.map(_=>i.jsxs("button",{type:"button",onClick:()=>n(_.key),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===_.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:_.icon}),i.jsx("span",{className:"truncate",children:_.label})]},_.key))]}),e[19]=r,e[20]=n,e[21]=k):k=e[21];let N;e[22]!==r||e[23]!==n||e[24]!==a.experimental_projects?(N=a.experimental_projects&&i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Projects"}),i.jsx(v.Suspense,{fallback:i.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/50",children:"Loading…"}),children:i.jsx(Si,{activeSection:r,onNavigate:n})})]}),e[22]=r,e[23]=n,e[24]=a.experimental_projects,e[25]=N):N=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx("div",{className:"mt-auto px-4 pb-1",children:i.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.125.1"]})}),e[26]=C):C=e[26];let A;return e[27]!==p||e[28]!==k||e[29]!==N?(A=i.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[p,k,N,C]}),e[27]=p,e[28]=k,e[29]=N,e[30]=A):A=e[30],A}function Pi(){const t=L.c(32),{data:e}=et.useSession(),[r,n]=v.useState(!1),s=e?.user,a=s?.image;let l;t[0]!==s?(l=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},t[0]=s,t[1]=l):l=t[1];const o=l;let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=u):u=t[2];const d=s?.name??"U";let c;t[3]!==d||t[4]!==a?(c=i.jsx(Kt,{url:a,fallback:d,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=d,t[4]=a,t[5]=c):c=t[5];const f=s?.name??"User";let m;t[6]!==f?(m=i.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:f}),t[6]=f,t[7]=m):m=t[7];const x=s?.email;let h;t[8]!==x?(h=i.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),t[8]=x,t[9]=h):h=t[9];let g;t[10]!==m||t[11]!==h?(g=i.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[m,h]}),t[10]=m,t[11]=h,t[12]=g):g=t[12];let y;t[13]!==c||t[14]!==g?(y=i.jsxs("div",{className:"flex items-center gap-4",children:[c,g]}),t[13]=c,t[14]=g,t[15]=y):y=t[15];let S;t[16]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=S):S=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=w):w=t[17];const P=s?.id;let j;t[18]!==P?(j=i.jsx("span",{className:"font-mono text-sm",children:P}),t[18]=P,t[19]=j):j=t[19];let p;t[20]!==r?(p=r?i.jsx(Xr,{size:14,className:"text-green-600 shrink-0"}):i.jsx(Qr,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=p):p=t[21];let b;t[22]!==o||t[23]!==j||t[24]!==p?(b=i.jsx(Gr,{asChild:!0,children:i.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[j,p]})}),t[22]=o,t[23]=j,t[24]=p,t[25]=b):b=t[25];let k;t[26]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(Ur,{side:"left",children:i.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=k):k=t[26];let N;t[27]!==b?(N=i.jsxs("div",{className:"flex flex-col",children:[S,i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[w,i.jsx(Kr,{children:i.jsxs(qr,{children:[b,k]})})]})]}),t[27]=b,t[28]=N):N=t[28];let C;return t[29]!==N||t[30]!==y?(C=i.jsxs("div",{className:"flex flex-col gap-8",children:[u,y,N]}),t[29]=N,t[30]=y,t[31]=C):C=t[31],C}function qe(t){const e=L.c(27),{icon:r,label:n,description:s,control:a,onClick:l,disabled:o}=t,u=o?void 0:l,d=l?"button":void 0,c=l&&!o?0:void 0;let f;e[0]!==o||e[1]!==l?(f=l&&!o?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),l())}:void 0,e[0]=o,e[1]=l,e[2]=f):f=e[2];const m=l&&!o?"pointer":void 0;let x;e[3]!==m?(x={cursor:m},e[3]=m,e[4]=x):x=e[4];let h;e[5]!==r?(h=i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=h):h=e[6];let g;e[7]!==n?(g=i.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[7]=n,e[8]=g):g=e[8];let y;e[9]!==s?(y=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:s}),e[9]=s,e[10]=y):y=e[10];let S;e[11]!==g||e[12]!==y?(S=i.jsxs("div",{className:"min-w-0",children:[g,y]}),e[11]=g,e[12]=y,e[13]=S):S=e[13];let w;e[14]!==S||e[15]!==h?(w=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[h,S]}),e[14]=S,e[15]=h,e[16]=w):w=e[16];let P;e[17]!==a?(P=i.jsx("div",{onClick:Ci,className:"shrink-0",children:a}),e[17]=a,e[18]=P):P=e[18];let j;return e[19]!==u||e[20]!==w||e[21]!==P||e[22]!==d||e[23]!==c||e[24]!==f||e[25]!==x?(j=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:u,role:d,tabIndex:c,onKeyDown:f,style:x,children:[w,P]}),e[19]=u,e[20]=w,e[21]=P,e[22]=d,e[23]=c,e[24]=f,e[25]=x,e[26]=j):j=e[26],j}function Ci(t){return t.stopPropagation()}function yt(){const t=L.c(35),[e,r]=tt();let n;t[0]!==r?(n=async k=>{if(k&&await Notification.requestPermission()!=="granted"){V.error("Notifications denied. Please enable them in your browser settings."),r(_i);return}r(N=>({...N,enableNotifications:k}))},t[0]=r,t[1]=n):n=t[1];const s=n;let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(Zr,{size:16}),t[3]=l):l=t[3];let o;t[4]!==r?(o=()=>r(Ai),t[4]=r,t[5]=o):o=t[5];let u;t[6]!==r?(u=k=>r(N=>({...N,devMode:k})),t[6]=r,t[7]=u):u=t[7];let d;t[8]!==e.devMode||t[9]!==u?(d=i.jsx(_e,{checked:e.devMode,onCheckedChange:u}),t[8]=e.devMode,t[9]=u,t[10]=d):d=t[10];let c;t[11]!==o||t[12]!==d?(c=i.jsx(qe,{icon:l,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:d}),t[11]=o,t[12]=d,t[13]=c):c=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hr,{size:16}),t[14]=f):f=t[14];let m;t[15]!==s||t[16]!==e.enableNotifications?(m=i.jsx(qe,{icon:f,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>s(!e.enableNotifications),control:i.jsx(_e,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:s})}),t[15]=s,t[16]=e.enableNotifications,t[17]=m):m=t[17];let x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(en,{size:16}),t[18]=x):x=t[18];let h;t[19]!==r?(h=k=>r(N=>({...N,toolApprovalLevel:k})),t[19]=r,t[20]=h):h=t[20];let g;t[21]===Symbol.for("react.memo_cache_sentinel")?(g={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[21]=g):g=t[21];const y=g[e.toolApprovalLevel];let S;t[22]!==y?(S=i.jsx(Ht,{className:"w-36",children:i.jsx("span",{children:y})}),t[22]=y,t[23]=S):S=t[23];let w;t[24]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx(Ae,{value:"none",textValue:"Always ask",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"Always ask"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=w):w=t[24];let P;t[25]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(Ae,{value:"readonly",textValue:"Skip read-only",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"Skip read-only"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=P):P=t[25];let j;t[26]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs(Vt,{children:[w,P,i.jsx(Ae,{value:"yolo",textValue:"Auto-approve all",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"Auto-approve all"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=j):j=t[26];let p;t[27]!==e.toolApprovalLevel||t[28]!==h||t[29]!==S?(p=i.jsx(qe,{icon:x,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:i.jsxs(Yt,{value:e.toolApprovalLevel,onValueChange:h,children:[S,j]})}),t[27]=e.toolApprovalLevel,t[28]=h,t[29]=S,t[30]=p):p=t[30];let b;return t[31]!==p||t[32]!==c||t[33]!==m?(b=i.jsxs("div",{className:"flex flex-col gap-6",children:[a,i.jsxs("div",{className:"flex flex-col",children:[c,m,p]})]}),t[31]=p,t[32]=c,t[33]=m,t[34]=b):b=t[34],b}function Ai(t){return{...t,devMode:!t.devMode}}function _i(t){return{...t,enableNotifications:!1}}function bt(t){const e=L.c(22),{icon:r,label:n,description:s,checked:a,onCheckedChange:l}=t;let o;e[0]!==a||e[1]!==l?(o=()=>l(!a),e[0]=a,e[1]=l,e[2]=o):o=e[2];let u;e[3]!==r?(u=i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[3]=r,e[4]=u):u=e[4];let d;e[5]!==n?(d=i.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[5]=n,e[6]=d):d=e[6];let c;e[7]!==s?(c=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:s}),e[7]=s,e[8]=c):c=e[8];let f;e[9]!==d||e[10]!==c?(f=i.jsxs("div",{className:"min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=f):f=e[11];let m;e[12]!==u||e[13]!==f?(m=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[u,f]}),e[12]=u,e[13]=f,e[14]=m):m=e[14];let x;e[15]!==a||e[16]!==l?(x=i.jsx("div",{onClick:Oi,className:"shrink-0",children:i.jsx(_e,{checked:a,onCheckedChange:l})}),e[15]=a,e[16]=l,e[17]=x):x=e[17];let h;return e[18]!==o||e[19]!==m||e[20]!==x?(h=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0 cursor-pointer",onClick:o,children:[m,x]}),e[18]=o,e[19]=m,e[20]=x,e[21]=h):h=e[21],h}function Oi(t){return t.stopPropagation()}function Ei(){const t=L.c(16),[e,r]=tt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Experimental"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"These features are unstable and may change or stop working at any time."})]}),t[0]=n):n=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(zr,{size:16}),t[1]=s):s=t[1];let a;t[2]!==r?(a=f=>r(m=>({...m,experimental_projects:f})),t[2]=r,t[3]=a):a=t[3];let l;t[4]!==e.experimental_projects||t[5]!==a?(l=i.jsx(bt,{icon:s,label:"Projects",description:"Enable the projects feature in the sidebar.",checked:e.experimental_projects,onCheckedChange:a}),t[4]=e.experimental_projects,t[5]=a,t[6]=l):l=t[6];let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(tn,{size:16}),t[7]=o):o=t[7];let u;t[8]!==r?(u=f=>r(m=>({...m,experimental_tasks:f})),t[8]=r,t[9]=u):u=t[9];let d;t[10]!==e.experimental_tasks||t[11]!==u?(d=i.jsx(bt,{icon:o,label:"Tasks",description:"Enable the tasks feature in the sidebar.",checked:e.experimental_tasks,onCheckedChange:u}),t[10]=e.experimental_tasks,t[11]=u,t[12]=d):d=t[12];let c;return t[13]!==l||t[14]!==d?(c=i.jsxs("div",{className:"flex flex-col gap-6",children:[n,i.jsxs("div",{className:"flex flex-col rounded-lg border border-border bg-muted/25 px-4",children:[l,d]})]}),t[13]=l,t[14]=d,t[15]=c):c=t[15],c}const Ii=Lt({name:be().min(1,"Name is required").max(255,"Name is too long"),slug:be().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:be().optional()});function Di(t){const e=L.c(24),{value:r,onChange:n,name:s}=t,a=v.useRef(null);let l;e[0]!==n?(l=j=>{const p=j.target.files?.[0];if(p){if(p.size>2097152){V.error("Image must be smaller than 2MB");return}const b=new FileReader;b.onerror=()=>{const k=b.error;console.error("FileReader error:",k),V.error(k?.message||"Failed to read image file. Please try again."),a.current&&(a.current.value="")},b.onloadend=()=>{if(b.readyState===FileReader.DONE&&b.result){const k=b.result;n(k)}},b.readAsDataURL(p)}},e[0]=n,e[1]=l):l=e[1];const o=l;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a.current?.click()},e[2]=u):u=e[2];const d=u;let c;e[3]!==n?(c=j=>{j.stopPropagation(),n("")},e[3]=n,e[4]=c):c=e[4];const f=c;let m;e[5]!==o?(m=i.jsx("input",{type:"file",ref:a,className:"hidden",accept:"image/*",onChange:o}),e[5]=o,e[6]=m):m=e[6];let x;e[7]!==f||e[8]!==s||e[9]!==r?(x=r?i.jsxs("div",{className:"relative group",children:[i.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:i.jsx("img",{src:r,alt:s||"Organization logo",className:"w-full h-full object-cover"})}),i.jsx("button",{type:"button",onClick:f,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:i.jsx(Gt,{className:"h-3 w-3"})})]}):i.jsxs("button",{type:"button",onClick:d,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[i.jsx(rn,{className:"h-5 w-5"}),i.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=f,e[8]=s,e[9]=r,e[10]=x):x=e[10];const h=r?"Change Logo":"Upload Logo";let g;e[11]!==h?(g=i.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:d,className:"mb-2",children:h}),e[11]=h,e[12]=g):g=e[12];let y;e[13]!==f||e[14]!==r?(y=r&&i.jsx(Y,{type:"button",variant:"ghost",size:"sm",onClick:f,className:"ml-2",children:"Remove"}),e[13]=f,e[14]=r,e[15]=y):y=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=S):S=e[16];let w;e[17]!==g||e[18]!==y?(w=i.jsxs("div",{className:"flex-1",children:[g,y,S]}),e[17]=g,e[18]=y,e[19]=w):w=e[19];let P;return e[20]!==w||e[21]!==m||e[22]!==x?(P=i.jsxs("div",{className:"flex items-start gap-4",children:[m,x,w]}),e[20]=w,e[21]=m,e[22]=x,e[23]=P):P=e[23],P}function Ti(){const t=$e(),{org:e,project:r}=X(),n=Fe(),[s,a]=v.useState(!1),l=$t({resolver:Ft(Ii),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Me({mutationFn:async c=>{const f={name:c.name,slug:c.slug};c.logo&&(f.logo=c.logo);const m=await et.organization.update({organizationId:e.id,data:f});if(m?.error)throw new Error(m.error.message||"Failed to update organization");return m},onSuccess:c=>{n.invalidateQueries({queryKey:Q.organizations()}),n.invalidateQueries({queryKey:Q.activeOrganization(e.slug)}),V.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{V.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{a(!1)}}),u=c=>{a(!0),o.mutate(c)},d=l.formState.isDirty;return i.jsx(Xt,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(u),className:"space-y-6",children:[i.jsx(je,{control:l.control,name:"name",render:({field:c})=>i.jsxs(le,{children:[i.jsx(oe,{children:"Organization Name"}),i.jsx(ce,{children:i.jsx(ae,{placeholder:"My Organization",...c,disabled:s})}),i.jsx(ke,{})]})}),i.jsx(je,{control:l.control,name:"slug",render:({field:c})=>i.jsxs(le,{children:[i.jsx(oe,{children:"Organization Slug"}),i.jsx(ce,{children:i.jsx(ae,{placeholder:"my-organization",...c,disabled:s,onChange:f=>{const m=f.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(m)}})}),i.jsx(He,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),i.jsx(ke,{})]})}),i.jsx(je,{control:l.control,name:"logo",render:({field:c})=>i.jsxs(le,{children:[i.jsx(oe,{children:"Logo"}),i.jsx(ce,{children:i.jsx(Di,{value:c.value,onChange:c.onChange,name:l.watch("name")})}),i.jsx(ke,{})]})}),i.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[i.jsx(Y,{type:"submit",disabled:!d||s,className:"min-w-24",children:s?"Saving...":"Save Changes"}),d&&i.jsx(Y,{type:"button",variant:"outline",onClick:()=>l.reset(),disabled:s,children:"Cancel"})]})]})})}function zi(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),i.jsx(Ti,{})]}),t[0]=e):e=t[0],e}const Li=Lt({name:be().min(1,"Name is required").max(200,"Name is too long"),description:be().max(1e3,"Description is too long").nullable(),themeColor:be().nullable()});function $i(){const t=L.c(63),{org:e,project:r}=X(),n=Fe(),s=r.slug===ee;let a;t[0]!==e.id?(a={connectionId:nt,orgId:e.id},t[0]=e.id,t[1]=a):a=t[1];const l=Se(a);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=Ft(Li),t[2]=o):o=t[2];const u=r.name??"",d=r.description??"",c=r.ui?.themeColor??"#60a5fa";let f;t[3]!==u||t[4]!==d||t[5]!==c?(f={resolver:o,values:{name:u,description:d,themeColor:c}},t[3]=u,t[4]=d,t[5]=c,t[6]=f):f=t[6];const m=$t(f);let x;t[7]!==l||t[8]!==r.id||t[9]!==r.ui?.banner||t[10]!==r.ui?.bannerColor||t[11]!==r.ui?.icon?(x=async D=>{const T=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:r.id,name:D.name,description:D.description||null,ui:{themeColor:D.themeColor||null,banner:r.ui?.banner??null,bannerColor:r.ui?.bannerColor??null,icon:r.ui?.icon??null}}});return T.structuredContent??T},t[7]=l,t[8]=r.id,t[9]=r.ui?.banner,t[10]=r.ui?.bannerColor,t[11]=r.ui?.icon,t[12]=x):x=t[12];let h;t[13]!==m||t[14]!==e.id||t[15]!==r.slug||t[16]!==n?(h=()=>{n.invalidateQueries({queryKey:Q.project(e.id,r.slug)}),n.invalidateQueries({queryKey:Q.projects(e.id)}),m.reset(m.getValues())},t[13]=m,t[14]=e.id,t[15]=r.slug,t[16]=n,t[17]=h):h=t[17];let g;t[18]!==x||t[19]!==h?(g={mutationFn:x,onSuccess:h,onError:Fi},t[18]=x,t[19]=h,t[20]=g):g=t[20];const y=Me(g);let S;t[21]!==y?(S=async D=>{await y.mutateAsync(D)},t[21]=y,t[22]=S):S=t[22];const w=S;let P;t[23]!==m||t[24]!==w?(P=D=>{D(),m.handleSubmit(w)()},t[23]=m,t[24]=w,t[25]=P):P=t[25];const j=P;let p;t[26]!==m||t[27]!==w?(p=m.handleSubmit(w),t[26]=m,t[27]=w,t[28]=p):p=t[28];let b;t[29]!==s||t[30]!==y.isPending||t[31]!==j?(b=D=>{const{field:T}=D;return i.jsxs(le,{children:[i.jsx(oe,{children:"Project Name"}),i.jsx(ce,{children:i.jsx(ae,{placeholder:"My Project",...T,onBlur:()=>j(T.onBlur),disabled:s||y.isPending})}),s&&i.jsx(He,{children:"The organization admin project name cannot be changed."}),i.jsx(ke,{})]})},t[29]=s,t[30]=y.isPending,t[31]=j,t[32]=b):b=t[32];let k;t[33]!==m.control||t[34]!==b?(k=i.jsx(je,{control:m.control,name:"name",render:b}),t[33]=m.control,t[34]=b,t[35]=k):k=t[35];let N;t[36]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(oe,{children:"Slug"}),t[36]=N):N=t[36];let C;t[37]!==r.slug?(C=i.jsx(ce,{children:i.jsx(ae,{value:r.slug,disabled:!0,className:"bg-muted"})}),t[37]=r.slug,t[38]=C):C=t[38];let A;t[39]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(He,{children:"The project slug cannot be changed after creation."}),t[39]=A):A=t[39];let _;t[40]!==C?(_=i.jsxs(le,{children:[N,C,A]}),t[40]=C,t[41]=_):_=t[41];let O;t[42]!==y.isPending||t[43]!==j?(O=D=>{const{field:T}=D;return i.jsxs(le,{children:[i.jsx(oe,{children:"Description"}),i.jsx(ce,{children:i.jsx(nn,{placeholder:"Optional project description...",rows:3,...T,value:T.value??"",onBlur:()=>j(T.onBlur),disabled:y.isPending})}),i.jsx(ke,{})]})},t[42]=y.isPending,t[43]=j,t[44]=O):O=t[44];let E;t[45]!==m.control||t[46]!==O?(E=i.jsx(je,{control:m.control,name:"description",render:O}),t[45]=m.control,t[46]=O,t[47]=E):E=t[47];let I;t[48]!==y.isPending||t[49]!==j?(I=D=>{const{field:T}=D;return i.jsxs(le,{children:[i.jsx(oe,{children:"Color"}),i.jsx(ce,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"size-9 rounded-md border border-input overflow-hidden cursor-pointer shrink-0",style:{backgroundColor:T.value??"#60a5fa"},children:i.jsx("input",{type:"color",value:T.value??"#60a5fa",onChange:B=>T.onChange(B.target.value),onBlur:()=>j(T.onBlur),disabled:y.isPending,className:"opacity-0 w-full h-full cursor-pointer"})}),i.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:T.value??"#60a5fa"})]})}),i.jsx(ke,{})]})},t[48]=y.isPending,t[49]=j,t[50]=I):I=t[50];let z;t[51]!==m.control||t[52]!==I?(z=i.jsx(je,{control:m.control,name:"themeColor",render:I}),t[51]=m.control,t[52]=I,t[53]=z):z=t[53];let F;t[54]!==p||t[55]!==k||t[56]!==_||t[57]!==E||t[58]!==z?(F=i.jsxs("form",{onSubmit:p,className:"space-y-6",children:[k,_,E,z]}),t[54]=p,t[55]=k,t[56]=_,t[57]=E,t[58]=z,t[59]=F):F=t[59];let $;return t[60]!==m||t[61]!==F?($=i.jsx("div",{className:"flex flex-col",children:i.jsx(Xt,{...m,children:F})}),t[60]=m,t[61]=F,t[62]=$):$=t[62],$}function Fi(t){V.error("Failed to update project: "+(t instanceof Error?t.message:"Unknown error"))}function xr(){const t=L.c(45),{org:e,project:r}=X(),n=$e(),s=Fe(),[a,l]=v.useState(""),[o,u]=v.useState(!1),d=r.slug===ee;let c;t[0]!==e.id?(c={connectionId:nt,orgId:e.id},t[0]=e.id,t[1]=c):c=t[1];const f=Se(c);let m;t[2]!==f||t[3]!==r.id?(m=async()=>{const M=await f.callTool({name:"PROJECT_DELETE",arguments:{projectId:r.id}});return M.structuredContent??M},t[2]=f,t[3]=r.id,t[4]=m):m=t[4];let x;t[5]!==n||t[6]!==e.id||t[7]!==e.slug||t[8]!==s?(x=M=>{M.success?(s.invalidateQueries({queryKey:Q.projects(e.id)}),V.success("Project deleted"),n({to:"/$org/$project",params:{org:e.slug,project:ee}})):V.error(M.message??"Failed to delete project")},t[5]=n,t[6]=e.id,t[7]=e.slug,t[8]=s,t[9]=x):x=t[9];let h;t[10]!==m||t[11]!==x?(h={mutationFn:m,onSuccess:x,onError:Mi},t[10]=m,t[11]=x,t[12]=h):h=t[12];const g=Me(h);if(d)return null;const y=a===r.name;let S;t[13]!==g?(S=()=>{g.mutate()},t[13]=g,t[14]=S):S=t[14];const w=S;let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P=M=>{u(M),M||l("")},t[15]=P):P=t[15];const j=P;let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"Danger Zone"}),t[16]=p):p=t[16];let b;t[17]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Delete Project"}),i.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Permanently delete this project and all its data. This action cannot be undone."})]}),t[17]=b):b=t[17];let k;t[18]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(sn,{asChild:!0,children:i.jsx(Y,{variant:"outline",className:"shrink-0 bg-destructive/10 text-destructive border-0 hover:bg-destructive/15 hover:text-destructive",children:"Delete Project"})}),t[18]=k):k=t[18];let N;t[19]!==r.name?(N=i.jsxs(an,{children:['Delete "',r.name,'"?']}),t[19]=r.name,t[20]=N):N=t[20];let C;t[21]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ln,{children:"This action cannot be undone. All project data will be permanently deleted."}),t[21]=C):C=t[21];let A;t[22]!==N?(A=i.jsxs(on,{children:[N,C]}),t[22]=N,t[23]=A):A=t[23];let _;t[24]!==r.name?(_=i.jsxs("p",{className:"text-sm mb-2",children:["Type ",i.jsx("strong",{children:r.name})," to confirm:"]}),t[24]=r.name,t[25]=_):_=t[25];let O;t[26]===Symbol.for("react.memo_cache_sentinel")?(O=M=>l(M.target.value),t[26]=O):O=t[26];let E;t[27]!==a||t[28]!==r.name?(E=i.jsx(ae,{value:a,onChange:O,placeholder:r.name}),t[27]=a,t[28]=r.name,t[29]=E):E=t[29];let I;t[30]!==_||t[31]!==E?(I=i.jsxs("div",{className:"py-4",children:[_,E]}),t[30]=_,t[31]=E,t[32]=I):I=t[32];let z;t[33]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx(cn,{children:"Cancel"}),t[33]=z):z=t[33];const F=!y||g.isPending,$=g.isPending?"Deleting...":"Delete Project";let D;t[34]!==w||t[35]!==F||t[36]!==$?(D=i.jsxs(dn,{children:[z,i.jsx(un,{onClick:w,disabled:F,className:"bg-destructive/10 text-destructive hover:bg-destructive/15 hover:text-destructive border-0",children:$})]}),t[34]=w,t[35]=F,t[36]=$,t[37]=D):D=t[37];let T;t[38]!==A||t[39]!==I||t[40]!==D?(T=i.jsxs(mn,{children:[A,I,D]}),t[38]=A,t[39]=I,t[40]=D,t[41]=T):T=t[41];let B;return t[42]!==o||t[43]!==T?(B=i.jsxs("div",{className:"flex flex-col",children:[p,i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[b,i.jsxs(fn,{open:o,onOpenChange:j,children:[k,T]})]})]}),t[42]=o,t[43]=T,t[44]=B):B=t[44],B}function Mi(t){V.error("Failed to delete project: "+(t instanceof Error?t.message:"Unknown error"))}function Bi(){const t=L.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"General"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsxs("div",{className:"flex flex-col",children:[e,i.jsxs("div",{className:"pt-6 flex flex-col gap-6",children:[i.jsx($i,{}),i.jsx(xr,{})]})]}),t[1]=r):r=t[1],r}function Ri({value:t,onValueChange:e,placeholder:r="Select a connection...",binding:n,bindingType:s,onAddNew:a,className:l,disabled:o=!1}){const[u,d]=v.useState(!1),{installByBinding:c,isInstalling:f}=vn(),m=u||f,x=Qt(),h=pn({connections:x,binding:typeof n=="string"?n:void 0}),g=!n||!x?x??[]:typeof n=="string"?h:Array.isArray(n)&&n.length>0?x.filter(p=>gn(p,n)):x,y=(()=>{if(!s?.startsWith("@"))return null;const[p,b]=s.replace("@","").split("/");return p&&b?{scope:p,appName:b}:null})(),S=(()=>{let p=g;const b=Array.isArray(n)&&n.length>0;if(y&&!b&&(p=p.filter(k=>{const N=k.app_name,C=k.metadata?.scopeName;return N===y.appName&&C===y.scope})),t&&!p.some(k=>k.id===t)){const k=x?.find(N=>N.id===t);if(k)return[k,...p]}return p})(),w=s?.startsWith("@"),P=async()=>{if(w&&s){d(!0);try{const p=await c(s);p&&e(p.id)}finally{d(!1)}return}a?.()},j=S.find(p=>p.id===t);return i.jsxs(Yt,{value:t??"none",onValueChange:p=>e(p==="none"?null:p),disabled:o,children:[i.jsx(Ht,{size:"sm",className:ie("w-[200px]",l),children:i.jsx(Jr,{placeholder:r,children:j?i.jsxs("div",{className:"flex items-center gap-2",children:[j.icon?i.jsx("img",{src:j.icon,alt:j.title,className:"w-4 h-4 rounded shrink-0"}):i.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:j.title.slice(0,1).toUpperCase()}),i.jsx("span",{className:"truncate",children:j.title})]}):r})}),i.jsxs(Vt,{children:[i.jsx(Ae,{value:"none",children:"No connection"}),S.length===0?i.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):S.map(p=>i.jsx(Ae,{value:p.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[p.icon?i.jsx("img",{src:p.icon,alt:p.title,className:"w-4 h-4 rounded"}):i.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:p.title.slice(0,1).toUpperCase()}),i.jsx("span",{children:p.title})]})},p.id)),(a||w)&&i.jsx("div",{className:"border-t border-border",children:i.jsx(Y,{onPointerDown:p=>p.stopPropagation(),onClick:p=>{p.preventDefault(),p.stopPropagation(),P()},disabled:m||o,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:m?i.jsxs(i.Fragment,{children:[i.jsx(yn,{size:16,className:"animate-spin"}),i.jsx("span",{children:"Connecting..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(Jt,{size:16}),i.jsx("span",{children:"Add Connection"})]})})})]})]})}const Wi=t=>{if(!t||typeof t!="object")return!1;const e=t;return e.type==="text"&&typeof e.text=="string"&&e.text.trim().toLowerCase().startsWith("error")},Ve=t=>{const e=t.structuredContent??t,r=e&&typeof e=="object"?e:null,n=r?.content?.[0]?.text&&typeof r.content[0].text=="string"?r.content[0].text:null;if(r?.isError)throw new Error(n??"Tool call failed");if(Wi(e))throw new Error(e.text);return e};function Gi(t){return t.requiresMcpBinding===!0?!0:t.binding!==void 0}function Ui(t){const e=L.c(57),{plugin:r,isEnabled:n,isSaving:s,pendingBinding:a,description:l,label:o,icon:u,projectId:d,client:c,onBindingChange:f,onToggle:m}=t;let x;e[0]!==r?(x=Gi(r),e[0]=r,e[1]=x):x=e[1];const h=x;let g;e[2]!==r.id||e[3]!==d?(g=Q.projectPluginConfig(d??"",r.id),e[2]=r.id,e[3]=d,e[4]=g):g=e[4];let y;e[5]!==c||e[6]!==r.id||e[7]!==d?(y=async()=>{if(!d)throw new Error("Project ID is required to load plugin config.");const B=await c.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:d,pluginId:r.id}});return Ve(B)},e[5]=c,e[6]=r.id,e[7]=d,e[8]=y):y=e[8];const S=!!d&&h;let w;e[9]!==g||e[10]!==y||e[11]!==S?(w={queryKey:g,queryFn:y,enabled:S},e[9]=g,e[10]=y,e[11]=S,e[12]=w):w=e[12];const{data:P,isLoading:j}=hn(w),p=P?.config?.connectionId??null,b=a!==void 0?a:p;let k;e[13]!==n||e[14]!==s||e[15]!==m||e[16]!==r.id?(k=()=>!s&&m(r.id,!n),e[13]=n,e[14]=s,e[15]=m,e[16]=r.id,e[17]=k):k=e[17];const N=s?void 0:"pointer";let C;e[18]!==N?(C={cursor:N},e[18]=N,e[19]=C):C=e[19];let A;e[20]!==u?(A=u&&i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:u}),e[20]=u,e[21]=A):A=e[21];let _;e[22]!==o?(_=i.jsx("p",{className:"text-sm font-medium text-foreground",children:o}),e[22]=o,e[23]=_):_=e[23];let O;e[24]!==l?(O=l&&i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[24]=l,e[25]=O):O=e[25];let E;e[26]!==_||e[27]!==O?(E=i.jsxs("div",{className:"min-w-0",children:[_,O]}),e[26]=_,e[27]=O,e[28]=E):E=e[28];let I;e[29]!==E||e[30]!==A?(I=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[A,E]}),e[29]=E,e[30]=A,e[31]=I):I=e[31];let z;e[32]!==m||e[33]!==r.id?(z=B=>m(r.id,B),e[32]=m,e[33]=r.id,e[34]=z):z=e[34];let F;e[35]!==n||e[36]!==s||e[37]!==z?(F=i.jsx("div",{onClick:qi,className:"shrink-0",children:i.jsx(_e,{checked:n,onCheckedChange:z,disabled:s})}),e[35]=n,e[36]=s,e[37]=z,e[38]=F):F=e[38];let $;e[39]!==I||e[40]!==F?($=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[I,F]}),e[39]=I,e[40]=F,e[41]=$):$=e[41];let D;e[42]!==j||e[43]!==n||e[44]!==s||e[45]!==h||e[46]!==f||e[47]!==r.binding||e[48]!==r.id||e[49]!==b||e[50]!==p?(D=n&&h&&i.jsxs("div",{onClick:Ki,className:"pb-4 pl-7 flex items-center gap-3",children:[i.jsx(Oe,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),i.jsx(Ri,{value:b??null,onValueChange:B=>f(r.id,B,p),binding:r.binding,placeholder:"Select connection...",className:"w-56",disabled:s||j})]}),e[42]=j,e[43]=n,e[44]=s,e[45]=h,e[46]=f,e[47]=r.binding,e[48]=r.id,e[49]=b,e[50]=p,e[51]=D):D=e[51];let T;return e[52]!==$||e[53]!==D||e[54]!==k||e[55]!==C?(T=i.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:k,style:C,children:[$,D]}),e[52]=$,e[53]=D,e[54]=k,e[55]=C,e[56]=T):T=e[56],T}function Ki(t){return t.stopPropagation()}function qi(t){return t.stopPropagation()}function Yi(){const{org:t,project:e}=X(),r=Fe(),n=Se({connectionId:nt,orgId:t.id}),[s,a]=v.useState({}),[l,o]=v.useState({}),[u,d]=v.useState(!1),c=e.enabledPlugins??[],f=p=>{const b=s[p];return b!==void 0?b:c.includes(p)},m=()=>{const p=new Set(c);for(const[b,k]of Object.entries(s))k?p.add(b):p.delete(b);return Array.from(p)},x=Object.keys(s).length>0||Object.keys(l).length>0,h=(p,b)=>{const k=c.includes(p);a(b===k?N=>{const{[p]:C,...A}=N;return A}:N=>({...N,[p]:b}))},g=(p,b,k)=>{if(b===k){o(N=>{const{[p]:C,...A}=N;return A});return}o(N=>({...N,[p]:b}))},y=Me({mutationFn:async p=>{const b=[];if(p.updatePlugins){const k=await n.callTool({name:"PROJECT_UPDATE",arguments:{projectId:e.id,enabledPlugins:p.enabledPlugins}});b.push(Ve(k))}if(p.bindingUpdates.length>0){const k=await Promise.all(p.bindingUpdates.map(async({pluginId:N,connectionId:C})=>{const A=await n.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:e.id,pluginId:N,connectionId:C}});return Ve(A)}));b.push(...k)}return b},onSuccess:(p,b)=>{b.updatePlugins&&(r.invalidateQueries({queryKey:Q.project(t.id,e.slug)}),r.invalidateQueries({queryKey:Q.projects(t.id)})),b.bindingUpdates.forEach(({pluginId:k})=>{r.invalidateQueries({queryKey:Q.projectPluginConfig(e.id??"",k)})}),a({}),o({}),V.success("Plugins updated successfully")},onError:p=>{V.error("Failed to update plugins: "+(p instanceof Error?p.message:"Unknown error"))},onSettled:()=>{d(!1)}}),S=()=>{d(!0),y.mutate({enabledPlugins:m(),updatePlugins:Object.keys(s).length>0,bindingUpdates:Object.entries(l).map(([p,b])=>({pluginId:p,connectionId:b}))})},w=()=>{a({}),o({})},P=p=>{const b=Lr.find(k=>k.pluginId===p);return b?{label:b.label,icon:b.items[0]?.icon}:null},j=p=>Ge.find(k=>k.id===p)?.description??null;return Ge.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"flex flex-col",children:Ge.map(p=>{const b=P(p.id),k=j(p.id),N=f(p.id);return i.jsx(Ui,{plugin:p,isEnabled:N,isSaving:u,pendingBinding:l[p.id],description:k,label:b?.label??p.id,icon:b?.icon??i.jsx(xn,{size:14}),projectId:e.id,client:n,onBindingChange:g,onToggle:h},p.id)})}),i.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[i.jsx(Y,{variant:"outline",onClick:w,disabled:!x||u,children:"Cancel"}),i.jsx(Y,{onClick:S,disabled:!x||u,className:"min-w-24",children:u?"Saving...":"Save Changes"})]})]})}function jt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Plugins"})}),i.jsx(Yi,{})]}),t[0]=e):e=t[0],e}function Hi(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Danger Zone"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),i.jsx(xr,{})]}),t[0]=e):e=t[0],e}var kt=function(e,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),a=2;a<n;a++)s[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(r.replace(/%s/g,()=>s[l++]))}};function Vi(t){return t&&typeof t=="object"&&"className"in t&&typeof t.className=="string"?t.className:""}function Xi(t){return(t%180+180)%180}var Qi=function(e){var{width:r,height:n}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Xi(s),l=a*Math.PI/180,o=Math.atan(n/r),u=l>o&&l<Math.PI-o?n/Math.sin(l):r/Math.cos(l);return Math.abs(u)};function pr(t,e){if(e<1)return[];if(e===1)return t;for(var r=[],n=0;n<t.length;n+=e){var s=t[n];s!==void 0&&r.push(s)}return r}function Ji(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return Qi(n,r)}function Zi(t,e,r){var n=r==="width",{x:s,y:a,width:l,height:o}=t;return e===1?{start:n?s:a,end:n?s+l:a+o}:{start:n?s+l:a+o,end:n?s:a}}function Ee(t,e,r,n,s){if(t*e<t*n||t*e>t*s)return!1;var a=r();return t*(e-t*a/2-n)>=0&&t*(e+t*a/2-s)<=0}function ea(t,e){return pr(t,e+1)}function ta(t,e,r,n,s){for(var a=(n||[]).slice(),{start:l,end:o}=e,u=0,d=1,c=l,f=function(){var h=n?.[u];if(h===void 0)return{v:pr(n,d)};var g=u,y,S=()=>(y===void 0&&(y=r(h,g)),y),w=h.coordinate,P=u===0||Ee(t,w,S,c,o);P||(u=0,c=l,d+=1),P&&(c=w+t*(S()/2+s),u+=d)},m;d<=a.length;)if(m=f(),m)return m.v;return[]}function ra(t,e,r,n,s){var a=(n||[]).slice(),l=a.length;if(l===0)return[];for(var{start:o,end:u}=e,d=1;d<=l;d++){for(var c=(l-1)%d,f=o,m=!0,x=function(){var j=n[g];if(j==null)return 0;var p=g,b,k=()=>(b===void 0&&(b=r(j,p)),b),N=j.coordinate,C=g===c||Ee(t,N,k,f,u);if(!C)return m=!1,1;C&&(f=N+t*(k()/2+s))},h,g=c;g<l&&(h=x(),!(h!==0&&h===1));g+=d);if(m){for(var y=[],S=c;S<l;S+=d){var w=n[S];w!=null&&y.push(w)}return y}}return[]}function St(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function U(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?St(Object(r),!0).forEach(function(n){na(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function na(t,e,r){return(e=ia(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ia(t){var e=aa(t,"string");return typeof e=="symbol"?e:e+""}function aa(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sa(t,e,r,n,s){for(var a=(n||[]).slice(),l=a.length,{start:o}=e,{end:u}=e,d=function(m){var x=a[m];if(x==null)return 1;var h=x,g,y=()=>(g===void 0&&(g=r(x,m)),g);if(m===l-1){var S=t*(h.coordinate+t*y()/2-u);a[m]=h=U(U({},h),{},{tickCoord:S>0?h.coordinate-S*t:h.coordinate})}else a[m]=h=U(U({},h),{},{tickCoord:h.coordinate});if(h.tickCoord!=null){var w=Ee(t,h.tickCoord,y,o,u);w&&(u=h.tickCoord-t*(y()/2+s),a[m]=U(U({},h),{},{isShow:!0}))}},c=l-1;c>=0;c--)d(c);return a}function la(t,e,r,n,s,a){var l=(n||[]).slice(),o=l.length,{start:u,end:d}=e;if(a){var c=n[o-1];if(c!=null){var f=r(c,o-1),m=t*(c.coordinate+t*f/2-d);if(l[o-1]=c=U(U({},c),{},{tickCoord:m>0?c.coordinate-m*t:c.coordinate}),c.tickCoord!=null){var x=Ee(t,c.tickCoord,()=>f,u,d);x&&(d=c.tickCoord-t*(f/2+s),l[o-1]=U(U({},c),{},{isShow:!0}))}}}for(var h=a?o-1:o,g=function(w){var P=l[w];if(P==null)return 1;var j=P,p,b=()=>(p===void 0&&(p=r(P,w)),p);if(w===0){var k=t*(j.coordinate-t*b()/2-u);l[w]=j=U(U({},j),{},{tickCoord:k<0?j.coordinate-k*t:j.coordinate})}else l[w]=j=U(U({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var N=Ee(t,j.tickCoord,b,u,d);N&&(u=j.tickCoord+t*(b()/2+s),l[w]=U(U({},j),{},{isShow:!0}))}},y=0;y<h;y++)g(y);return l}function dt(t,e,r){var{tick:n,ticks:s,viewBox:a,minTickGap:l,orientation:o,interval:u,tickFormatter:d,unit:c,angle:f}=t;if(!s||!s.length||!n)return[];if(q(u)||Zt.isSsr){var m;return(m=ea(s,q(u)?u:0))!==null&&m!==void 0?m:[]}var x=[],h=o==="top"||o==="bottom"?"width":"height",g=c&&h==="width"?Ue(c,{fontSize:e,letterSpacing:r}):{width:0,height:0},y=(p,b)=>{var k=typeof d=="function"?d(p.value,b):p.value;return h==="width"?Ji(Ue(k,{fontSize:e,letterSpacing:r}),g,f):Ue(k,{fontSize:e,letterSpacing:r})[h]},S=s[0],w=s[1],P=s.length>=2&&S!=null&&w!=null?bn(w.coordinate-S.coordinate):1,j=Zi(a,P,h);return u==="equidistantPreserveStart"?ta(P,j,y,s,l):u==="equidistantPreserveEnd"?ra(P,j,y,s,l):(u==="preserveStart"||u==="preserveStartEnd"?x=la(P,j,y,s,l,u==="preserveStartEnd"):x=sa(P,j,y,s,l),x.filter(p=>p.isShow))}var oa=t=>{var{ticks:e,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:a=0}=t,l=0;if(e){Array.from(e).forEach(c=>{if(c){var f=c.getBoundingClientRect();f.width>l&&(l=f.width)}});var o=r?r.getBoundingClientRect().width:0,u=s+a,d=l+u+o+(r?n:0);return Math.round(d)}return 0},ca=["axisLine","width","height","className","hide","ticks","axisType"];function da(t,e){if(t==null)return{};var r,n,s=ua(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ua(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function fe(){return fe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},fe.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(n){ma(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ma(t,e,r){return(e=fa(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fa(t){var e=ha(t,"string");return typeof e=="symbol"?e:e+""}function ha(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var J={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Be.axis};function xa(t){var{x:e,y:r,width:n,height:s,orientation:a,mirror:l,axisLine:o,otherSvgProps:u}=t;if(!o)return null;var d=R(R(R({},u),Ne(o)),{},{fill:"none"});if(a==="top"||a==="bottom"){var c=+(a==="top"&&!l||a==="bottom"&&l);d=R(R({},d),{},{x1:e,y1:r+c*s,x2:e+n,y2:r+c*s})}else{var f=+(a==="left"&&!l||a==="right"&&l);d=R(R({},d),{},{x1:e+f*n,y1:r,x2:e+f*n,y2:r+s})}return v.createElement("line",fe({},d,{className:ne("recharts-cartesian-axis-line",er(o,"className"))}))}function pa(t,e,r,n,s,a,l,o,u){var d,c,f,m,x,h,g=o?-1:1,y=t.tickSize||l,S=q(t.tickCoord)?t.tickCoord:t.coordinate;switch(a){case"top":d=c=t.coordinate,m=r+ +!o*s,f=m-g*y,h=f-g*u,x=S;break;case"left":f=m=t.coordinate,c=e+ +!o*n,d=c-g*y,x=d-g*u,h=S;break;case"right":f=m=t.coordinate,c=e+ +o*n,d=c+g*y,x=d+g*u,h=S;break;default:d=c=t.coordinate,m=r+ +o*s,f=m+g*y,h=f+g*u,x=S;break}return{line:{x1:d,y1:f,x2:c,y2:m},tick:{x,y:h}}}function ga(t,e){switch(t){case"left":return e?"start":"end";case"right":return e?"end":"start";default:return"middle"}}function va(t,e){switch(t){case"left":case"right":return"middle";case"top":return e?"start":"end";default:return e?"end":"start"}}function ya(t){var{option:e,tickProps:r,value:n}=t,s,a=ne(r.className,"recharts-cartesian-axis-tick-value");if(v.isValidElement(e))s=v.cloneElement(e,R(R({},r),{},{className:a}));else if(typeof e=="function")s=e(R(R({},r),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof e!="boolean"&&(l=ne(l,Vi(e))),s=v.createElement(Nn,fe({},r,{className:l}),n)}return s}var ba=v.forwardRef((t,e)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:a,tickFormatter:l,unit:o,padding:u,tickTextProps:d,orientation:c,mirror:f,x:m,y:x,width:h,height:g,tickSize:y,tickMargin:S,fontSize:w,letterSpacing:P,getTicksConfig:j,events:p,axisType:b}=t,k=dt(R(R({},j),{},{ticks:r}),w,P),N=ga(c,f),C=va(c,f),A=Ne(j),_=Sn(n),O={};typeof s=="object"&&(O=s);var E=R(R({},A),{},{fill:"none"},O),I=k.map($=>R({entry:$},pa($,m,x,h,g,c,y,f,S))),z=I.map($=>{var{entry:D,line:T}=$;return v.createElement(me,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(D.value,"-").concat(D.coordinate,"-").concat(D.tickCoord)},s&&v.createElement("line",fe({},E,T,{className:ne("recharts-cartesian-axis-tick-line",er(s,"className"))})))}),F=I.map(($,D)=>{var T,B,{entry:M,tick:te}=$,Pe=R(R(R(R({verticalAnchor:C},A),{},{textAnchor:N,stroke:"none",fill:a},te),{},{index:D,payload:M,visibleTicksCount:k.length,tickFormatter:l,padding:u},d),{},{angle:(T=(B=d?.angle)!==null&&B!==void 0?B:A.angle)!==null&&T!==void 0?T:0}),Ce=R(R({},Pe),_);return v.createElement(me,fe({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(M.value,"-").concat(M.coordinate,"-").concat(M.tickCoord)},wn(p,M,D)),n&&v.createElement(ya,{option:n,tickProps:Ce,value:"".concat(typeof l=="function"?l(M.value,D):M.value).concat(o||"")}))});return v.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(b,"-ticks")},F.length>0&&v.createElement(Re,{zIndex:Be.label},v.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(b,"-tick-labels"),ref:e},F)),z.length>0&&v.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(b,"-tick-lines")},z))}),ja=v.forwardRef((t,e)=>{var{axisLine:r,width:n,height:s,className:a,hide:l,ticks:o,axisType:u}=t,d=da(t,ca),[c,f]=v.useState(""),[m,x]=v.useState(""),h=v.useRef(null);v.useImperativeHandle(e,()=>({getCalculatedWidth:()=>{var y;return oa({ticks:h.current,label:(y=t.labelRef)===null||y===void 0?void 0:y.current,labelGapWithTick:5,tickSize:t.tickSize,tickMargin:t.tickMargin})}}));var g=v.useCallback(y=>{if(y){var S=y.getElementsByClassName("recharts-cartesian-axis-tick-value");h.current=S;var w=S[0];if(w){var P=window.getComputedStyle(w),j=P.fontSize,p=P.letterSpacing;(j!==c||p!==m)&&(f(j),x(p))}}},[c,m]);return l||n!=null&&n<=0||s!=null&&s<=0?null:v.createElement(Re,{zIndex:t.zIndex},v.createElement(me,{className:ne("recharts-cartesian-axis",a)},v.createElement(xa,{x:t.x,y:t.y,width:n,height:s,orientation:t.orientation,mirror:t.mirror,axisLine:r,otherSvgProps:Ne(t)}),v.createElement(ba,{ref:g,axisType:u,events:d,fontSize:c,getTicksConfig:t,height:t.height,letterSpacing:m,mirror:t.mirror,orientation:t.orientation,padding:t.padding,stroke:t.stroke,tick:t.tick,tickFormatter:t.tickFormatter,tickLine:t.tickLine,tickMargin:t.tickMargin,tickSize:t.tickSize,tickTextProps:t.tickTextProps,ticks:o,unit:t.unit,width:t.width,x:t.x,y:t.y}),v.createElement(jn,{x:t.x,y:t.y,width:t.width,height:t.height,lowerWidth:t.width,upperWidth:t.width},v.createElement(kn,{label:t.label,labelRef:t.labelRef}),t.children)))}),ut=v.forwardRef((t,e)=>{var r=we(t,J);return v.createElement(ja,fe({},r,{ref:e}))});ut.displayName="CartesianAxis";var ka=["x1","y1","x2","y2","key"],Sa=["offset"],wa=["xAxisId","yAxisId"],Na=["xAxisId","yAxisId"];function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function K(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(n){Pa(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pa(t,e,r){return(e=Ca(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ca(t){var e=Aa(t,"string");return typeof e=="symbol"?e:e+""}function Aa(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function de(){return de=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},de.apply(null,arguments)}function ze(t,e){if(t==null)return{};var r,n,s=_a(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function _a(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}var Oa=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:n,y:s,width:a,height:l,ry:o}=t;return v.createElement("rect",{x:n,y:s,ry:o,width:a,height:l,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function gr(t){var{option:e,lineItemProps:r}=t,n;if(v.isValidElement(e))n=v.cloneElement(e,r);else if(typeof e=="function")n=e(r);else{var s,{x1:a,y1:l,x2:o,y2:u,key:d}=r,c=ze(r,ka),f=(s=Ne(c))!==null&&s!==void 0?s:{},{offset:m}=f,x=ze(f,Sa);n=v.createElement("line",de({},x,{x1:a,y1:l,x2:o,y2:u,fill:"none",key:d}))}return n}function Ea(t){var{x:e,width:r,horizontal:n=!0,horizontalPoints:s}=t;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:l}=t,o=ze(t,wa),u=s.map((d,c)=>{var f=K(K({},o),{},{x1:e,y1:d,x2:e+r,y2:d,key:"line-".concat(c),index:c});return v.createElement(gr,{key:"line-".concat(c),option:n,lineItemProps:f})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function Ia(t){var{y:e,height:r,vertical:n=!0,verticalPoints:s}=t;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:l}=t,o=ze(t,Na),u=s.map((d,c)=>{var f=K(K({},o),{},{x1:d,y1:e,x2:d,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(gr,{option:n,lineItemProps:f,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function Da(t){var{horizontalFill:e,fillOpacity:r,x:n,y:s,width:a,height:l,horizontalPoints:o,horizontal:u=!0}=t;if(!u||!e||!e.length||o==null)return null;var d=o.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var c=d.map((f,m)=>{var x=d[m+1],h=x==null,g=h?s+l-f:x-f;if(g<=0)return null;var y=m%e.length;return v.createElement("rect",{key:"react-".concat(m),y:f,x:n,height:g,width:a,stroke:"none",fill:e[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function Ta(t){var{vertical:e=!0,verticalFill:r,fillOpacity:n,x:s,y:a,width:l,height:o,verticalPoints:u}=t;if(!e||!r||!r.length)return null;var d=u.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var c=d.map((f,m)=>{var x=d[m+1],h=x==null,g=h?s+l-f:x-f;if(g<=0)return null;var y=m%r.length;return v.createElement("rect",{key:"react-".concat(m),x:f,y:a,width:g,height:o,stroke:"none",fill:r[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var za=(t,e)=>{var{xAxis:r,width:n,height:s,offset:a}=t;return tr(dt(K(K(K({},J),r),{},{ticks:rr(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,e)},La=(t,e)=>{var{yAxis:r,width:n,height:s,offset:a}=t;return tr(dt(K(K(K({},J),r),{},{ticks:rr(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,e)},$a={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Be.grid};function vr(t){var e=Pn(),r=Cn(),n=An(),s=K(K({},we(t,$a)),{},{x:q(t.x)?t.x:n.left,y:q(t.y)?t.y:n.top,width:q(t.width)?t.width:n.width,height:q(t.height)?t.height:n.height}),{xAxisId:a,yAxisId:l,x:o,y:u,width:d,height:c,syncWithTicks:f,horizontalValues:m,verticalValues:x}=s,h=Ie(),g=H(C=>ft(C,"xAxis",a,h)),y=H(C=>ft(C,"yAxis",l,h));if(!ht(d)||!ht(c)||!q(o)||!q(u))return null;var S=s.verticalCoordinatesGenerator||za,w=s.horizontalCoordinatesGenerator||La,{horizontalPoints:P,verticalPoints:j}=s;if((!P||!P.length)&&typeof w=="function"){var p=m&&m.length,b=w({yAxis:y?K(K({},y),{},{ticks:p?m:y.ticks}):void 0,width:e??d,height:r??c,offset:n},p?!0:f);kt(Array.isArray(b),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof b,"]")),Array.isArray(b)&&(P=b)}if((!j||!j.length)&&typeof S=="function"){var k=x&&x.length,N=S({xAxis:g?K(K({},g),{},{ticks:k?x:g.ticks}):void 0,width:e??d,height:r??c,offset:n},k?!0:f);kt(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof N,"]")),Array.isArray(N)&&(j=N)}return v.createElement(Re,{zIndex:s.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(Oa,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),v.createElement(Da,de({},s,{horizontalPoints:P})),v.createElement(Ta,de({},s,{verticalPoints:j})),v.createElement(Ea,de({},s,{offset:n,horizontalPoints:P,xAxis:g,yAxis:y})),v.createElement(Ia,de({},s,{offset:n,verticalPoints:j,xAxis:g,yAxis:y}))))}vr.displayName="CartesianGrid";var yr=(t,e,r)=>nr(t,"xAxis",at(t,e),r),br=(t,e,r)=>ir(t,"xAxis",at(t,e),r),jr=(t,e,r)=>nr(t,"yAxis",st(t,e),r),kr=(t,e,r)=>ir(t,"yAxis",st(t,e),r),Fa=We([it,yr,jr,br,kr],(t,e,r,n,s)=>ar(t,"xAxis")?xt(e,n,!1):xt(r,s,!1)),Ma=(t,e)=>e,Sr=We([In,Ma],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),wr=t=>{var e=it(t),r=ar(e,"xAxis");return r?"yAxis":"xAxis"},Ba=(t,e)=>{var r=wr(t);return r==="yAxis"?st(t,e):at(t,e)},Ra=(t,e,r)=>Dn(t,wr(t),Ba(t,e),r),Wa=We([Sr,Ra],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:n}=t,s=En(t);if(!(n==null||s==null)){var a=(r=e[n])===null||r===void 0?void 0:r.stackedData,l=a?.find(o=>o.key===s);if(l!=null)return l.map(o=>[o[0],o[1]])}}}),Ga=We([it,yr,jr,br,kr,Wa,_n,Fa,Sr,On],(t,e,r,n,s,a,l,o,u,d)=>{var{chartData:c,dataStartIndex:f,dataEndIndex:m}=l;if(!(u==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||n==null||s==null||n.length===0||s.length===0||o==null)){var{data:x}=u,h;if(x&&x.length>0?h=x:h=c?.slice(f,m+1),h!=null)return os({layout:t,xAxis:e,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataStartIndex:f,areaSettings:u,stackedData:a,displayedData:h,chartBaseValue:d,bandSize:o})}}),Ua=["id"],Ka=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function ue(){return ue=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ue.apply(null,arguments)}function Nr(t,e){if(t==null)return{};var r,n,s=qa(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function qa(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function Pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ye(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pt(Object(r),!0).forEach(function(n){Ya(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ya(t,e,r){return(e=Ha(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ha(t){var e=Va(t,"string");return typeof e=="symbol"?e:e+""}function Va(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Le(t,e){return t&&t!=="none"?t:e}var Xa=t=>{var{dataKey:e,name:r,stroke:n,fill:s,legendType:a,hide:l}=t;return[{inactive:l,dataKey:e,type:a,color:Le(n,s),value:lr(r,e),payload:t}]},Qa=v.memo(t=>{var{dataKey:e,data:r,stroke:n,strokeWidth:s,fill:a,name:l,hide:o,unit:u,tooltipType:d,id:c}=t,f={dataDefinedOnItem:r,getPosition:Mn,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:e,nameKey:void 0,name:lr(l,e),hide:o,type:d,color:Le(n,a),unit:u,graphicalItemId:c}};return v.createElement(Fn,{tooltipEntrySettings:f})});function Ja(t){var{clipPathId:e,points:r,props:n}=t,{needClip:s,dot:a,dataKey:l}=n,o=Ne(n);return v.createElement(ei,{points:r,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:o,needClip:s,clipPathId:e})}function Za(t){var{showLabels:e,children:r,points:n}=t,s=n.map(a=>{var l,o,u={x:(l=a.x)!==null&&l!==void 0?l:0,y:(o=a.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ye(ye({},u),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:u,fill:void 0})});return v.createElement(Jn,{value:e?s:void 0},r)}function Ct(t){var{points:e,baseLine:r,needClip:n,clipPathId:s,props:a}=t,{layout:l,type:o,stroke:u,connectNulls:d,isRange:c}=a,{id:f}=a,m=Nr(a,Ua),x=Ne(m),h=Zn(m);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(me,{clipPath:n?"url(#clipPath-".concat(s,")"):void 0},v.createElement(Ke,ue({},h,{id:f,points:e,connectNulls:d,type:o,baseLine:r,layout:l,stroke:"none",className:"recharts-area-area"})),u!=="none"&&v.createElement(Ke,ue({},x,{className:"recharts-area-curve",layout:l,type:o,connectNulls:d,fill:"none",points:e})),u!=="none"&&c&&v.createElement(Ke,ue({},x,{className:"recharts-area-curve",layout:l,type:o,connectNulls:d,fill:"none",points:r}))),v.createElement(Ja,{points:e,props:m,clipPathId:s}))}function es(t){var e,r,{alpha:n,baseLine:s,points:a,strokeWidth:l}=t,o=(e=a[0])===null||e===void 0?void 0:e.y,u=(r=a[a.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(u))return null;var d=n*Math.abs(o-u),c=Math.max(...a.map(f=>f.x||0));return q(s)?c=Math.max(s,c):s&&Array.isArray(s)&&s.length&&(c=Math.max(...s.map(f=>f.x||0),c)),q(c)?v.createElement("rect",{x:0,y:o<u?o:o-d,width:c+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}function ts(t){var e,r,{alpha:n,baseLine:s,points:a,strokeWidth:l}=t,o=(e=a[0])===null||e===void 0?void 0:e.x,u=(r=a[a.length-1])===null||r===void 0?void 0:r.x;if(!Te(o)||!Te(u))return null;var d=n*Math.abs(o-u),c=Math.max(...a.map(f=>f.y||0));return q(s)?c=Math.max(s,c):s&&Array.isArray(s)&&s.length&&(c=Math.max(...s.map(f=>f.y||0),c)),q(c)?v.createElement("rect",{x:o<u?o:o-d,y:0,width:d,height:Math.floor(c+(l?parseInt("".concat(l),10):1))}):null}function rs(t){var{alpha:e,layout:r,points:n,baseLine:s,strokeWidth:a}=t;return r==="vertical"?v.createElement(es,{alpha:e,points:n,baseLine:s,strokeWidth:a}):v.createElement(ts,{alpha:e,points:n,baseLine:s,strokeWidth:a})}function ns(t){var{needClip:e,clipPathId:r,props:n,previousPointsRef:s,previousBaselineRef:a}=t,{points:l,baseLine:o,isAnimationActive:u,animationBegin:d,animationDuration:c,animationEasing:f,onAnimationStart:m,onAnimationEnd:x}=n,h=v.useMemo(()=>({points:l,baseLine:o}),[l,o]),g=Yn(h,"recharts-area-"),y=lt(),[S,w]=v.useState(!1),P=!S,j=v.useCallback(()=>{typeof x=="function"&&x(),w(!1)},[x]),p=v.useCallback(()=>{typeof m=="function"&&m(),w(!0)},[m]);if(y==null)return null;var b=s.current,k=a.current;return v.createElement(Za,{showLabels:P,points:l},n.children,v.createElement(Hn,{animationId:g,begin:d,duration:c,isActive:u,easing:f,onAnimationEnd:j,onAnimationStart:p,key:g},N=>{if(b){var C=b.length/l.length,A=N===1?l:l.map((O,E)=>{var I=Math.floor(E*C);if(b[I]){var z=b[I];return ye(ye({},O),{},{x:ve(z.x,O.x,N),y:ve(z.y,O.y,N)})}return O}),_;return q(o)?_=ve(k,o,N):Vn(o)||Xn(o)?_=ve(k,0,N):_=o.map((O,E)=>{var I=Math.floor(E*C);if(Array.isArray(k)&&k[I]){var z=k[I];return ye(ye({},O),{},{x:ve(z.x,O.x,N),y:ve(z.y,O.y,N)})}return O}),N>0&&(s.current=A,a.current=_),v.createElement(Ct,{points:A,baseLine:_,needClip:e,clipPathId:r,props:n})}return N>0&&(s.current=l,a.current=o),v.createElement(me,null,u&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(rs,{alpha:N,points:l,baseLine:o,layout:y,strokeWidth:n.strokeWidth}))),v.createElement(me,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(Ct,{points:l,baseLine:o,needClip:e,clipPathId:r,props:n})))}),v.createElement(Qn,{label:n.label}))}function is(t){var{needClip:e,clipPathId:r,props:n}=t,s=v.useRef(null),a=v.useRef();return v.createElement(ns,{needClip:e,clipPathId:r,props:n,previousPointsRef:s,previousBaselineRef:a})}class as extends v.PureComponent{render(){var{hide:e,dot:r,points:n,className:s,top:a,left:l,needClip:o,xAxisId:u,yAxisId:d,width:c,height:f,id:m,baseLine:x,zIndex:h}=this.props;if(e)return null;var g=ne("recharts-area",s),y=m,{r:S,strokeWidth:w}=Un(r),P=Kn(r),j=S*2+w,p=o?"url(#clipPath-".concat(P?"":"dots-").concat(y,")"):void 0;return v.createElement(Re,{zIndex:h},v.createElement(me,{className:g},o&&v.createElement("defs",null,v.createElement(qn,{clipPathId:y,xAxisId:u,yAxisId:d}),!P&&v.createElement("clipPath",{id:"clipPath-dots-".concat(y)},v.createElement("rect",{x:l-j/2,y:a-j/2,width:c+j,height:f+j}))),v.createElement(is,{needClip:o,clipPathId:y,props:this.props})),v.createElement(pt,{points:n,mainColor:Le(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:p}),this.props.isRange&&Array.isArray(x)&&v.createElement(pt,{points:x,mainColor:Le(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:p}))}}var Pr={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Be.area};function ss(t){var e,r=we(t,Pr),{activeDot:n,animationBegin:s,animationDuration:a,animationEasing:l,connectNulls:o,dot:u,fill:d,fillOpacity:c,hide:f,isAnimationActive:m,legendType:x,stroke:h,xAxisId:g,yAxisId:y}=r,S=Nr(r,Ka),w=Bn(),P=Rn(),{needClip:j}=Wn(g,y),p=Ie(),{points:b,isRange:k,baseLine:N}=(e=H(I=>Ga(I,t.id,p)))!==null&&e!==void 0?e:{},C=Gn();if(w!=="horizontal"&&w!=="vertical"||C==null||P!=="AreaChart"&&P!=="ComposedChart")return null;var{height:A,width:_,x:O,y:E}=C;return!b||!b.length?null:v.createElement(as,ue({},S,{activeDot:n,animationBegin:s,animationDuration:a,animationEasing:l,baseLine:N,connectNulls:o,dot:u,fill:d,fillOpacity:c,height:A,hide:f,layout:w,isAnimationActive:m==="auto"?!Zt.isSsr:m,isRange:k,legendType:x,needClip:j,points:b,stroke:h,width:_,left:O,top:E,xAxisId:g,yAxisId:y}))}var ls=(t,e,r,n,s)=>{var a=r??e;if(q(a))return a;var l=t==="horizontal"?s:n,o=l.scale.domain();if(l.type==="number"){var u=Math.max(o[0],o[1]),d=Math.min(o[0],o[1]);return a==="dataMin"?d:a==="dataMax"||u<0?u:Math.max(Math.min(o[0],o[1]),0)}return a==="dataMin"?o[0]:a==="dataMax"?o[1]:o[0]};function os(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:n},stackedData:s,layout:a,chartBaseValue:l,xAxis:o,yAxis:u,displayedData:d,dataStartIndex:c,xAxisTicks:f,yAxisTicks:m,bandSize:x}=t,h=s&&s.length,g=ls(a,l,r,o,u),y=a==="horizontal",S=!1,w=d.map((j,p)=>{var b,k,N,C;if(h)C=s[c+p];else{var A=gt(j,n);Array.isArray(A)?(C=A,S=!0):C=[g,A]}var _=(b=(k=C)===null||k===void 0?void 0:k[1])!==null&&b!==void 0?b:null,O=_==null||h&&!e&>(j,n)==null;if(y){var E;return{x:vt({axis:o,ticks:f,bandSize:x,entry:j,index:p}),y:O?null:(E=u.scale.map(_))!==null&&E!==void 0?E:null,value:C,payload:j}}return{x:O?null:(N=o.scale.map(_))!==null&&N!==void 0?N:null,y:vt({axis:u,ticks:m,bandSize:x,entry:j,index:p}),value:C,payload:j}}),P;return h||S?P=w.map(j=>{var p,b=Array.isArray(j.value)?j.value[0]:null;if(y){var k;return{x:j.x,y:b!=null&&j.y!=null&&(k=u.scale.map(b))!==null&&k!==void 0?k:null,payload:j.payload}}return{x:b!=null&&(p=o.scale.map(b))!==null&&p!==void 0?p:null,y:j.y,payload:j.payload}}):P=y?u.scale.map(g):o.scale.map(g),{points:w,baseLine:P??0,isRange:S}}function cs(t){var e=we(t,Pr),r=Ie();return v.createElement(Tn,{id:e.id,type:"area"},n=>v.createElement(v.Fragment,null,v.createElement(zn,{legendPayload:Xa(e)}),v.createElement(Qa,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:n}),v.createElement(Ln,{type:"area",id:n,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:$n(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(ss,ue({},e,{id:n}))))}var Cr=v.memo(cs,sr);Cr.displayName="Area";var ds=["domain","range"],us=["domain","range"];function At(t,e){if(t==null)return{};var r,n,s=ms(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ms(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function _t(t,e){return t===e?!0:Array.isArray(t)&&t.length===2&&Array.isArray(e)&&e.length===2?t[0]===e[0]&&t[1]===e[1]:!1}function Ar(t,e){if(t===e)return!0;var{domain:r,range:n}=t,s=At(t,ds),{domain:a,range:l}=e,o=At(e,us);return!_t(r,a)||!_t(n,l)?!1:sr(s,o)}var fs=["type"],hs=["dangerouslySetInnerHTML","ticks","scale"],xs=["id","scale"];function Xe(){return Xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Xe.apply(null,arguments)}function Ot(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Et(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ot(Object(r),!0).forEach(function(n){ps(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ps(t,e,r){return(e=gs(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gs(t){var e=vs(t,"string");return typeof e=="symbol"?e:e+""}function vs(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qe(t,e){if(t==null)return{};var r,n,s=ys(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ys(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function bs(t){var e=ot(),r=v.useRef(null),n=lt(),{type:s}=t,a=Qe(t,fs),l=dr(n,"xAxis",s),o=v.useMemo(()=>{if(l!=null)return Et(Et({},a),{},{type:l})},[a,l]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(ti(o)):r.current!==o&&e(ri({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ni(r.current)),r.current=null)},[e]),null}var js=t=>{var{xAxisId:e,className:r}=t,n=H(or),s=Ie(),a="xAxis",l=H(S=>cr(S,a,e,s)),o=H(S=>ii(S,e)),u=H(S=>ai(S,e)),d=H(S=>si(S,e));if(o==null||u==null||d==null)return null;var{dangerouslySetInnerHTML:c,ticks:f,scale:m}=t,x=Qe(t,hs),{id:h,scale:g}=d,y=Qe(d,xs);return v.createElement(ut,Xe({},x,y,{x:u.x,y:u.y,width:o.width,height:o.height,className:ne("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:l,axisType:a}))},ks={allowDataOverflow:W.allowDataOverflow,allowDecimals:W.allowDecimals,allowDuplicatedCategory:W.allowDuplicatedCategory,angle:W.angle,axisLine:J.axisLine,height:W.height,hide:!1,includeHidden:W.includeHidden,interval:W.interval,label:!1,minTickGap:W.minTickGap,mirror:W.mirror,orientation:W.orientation,padding:W.padding,reversed:W.reversed,scale:W.scale,tick:W.tick,tickCount:W.tickCount,tickLine:J.tickLine,tickSize:J.tickSize,type:W.type,xAxisId:0},Ss=t=>{var e=we(t,ks);return v.createElement(v.Fragment,null,v.createElement(bs,{allowDataOverflow:e.allowDataOverflow,allowDecimals:e.allowDecimals,allowDuplicatedCategory:e.allowDuplicatedCategory,angle:e.angle,dataKey:e.dataKey,domain:e.domain,height:e.height,hide:e.hide,id:e.xAxisId,includeHidden:e.includeHidden,interval:e.interval,minTickGap:e.minTickGap,mirror:e.mirror,name:e.name,orientation:e.orientation,padding:e.padding,reversed:e.reversed,scale:e.scale,tick:e.tick,tickCount:e.tickCount,tickFormatter:e.tickFormatter,ticks:e.ticks,type:e.type,unit:e.unit}),v.createElement(js,e))},_r=v.memo(Ss,Ar);_r.displayName="XAxis";var ws=["type"],Ns=["dangerouslySetInnerHTML","ticks","scale"],Ps=["id","scale"];function Je(){return Je=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Je.apply(null,arguments)}function It(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?It(Object(r),!0).forEach(function(n){Cs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Cs(t,e,r){return(e=As(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function As(t){var e=_s(t,"string");return typeof e=="symbol"?e:e+""}function _s(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ze(t,e){if(t==null)return{};var r,n,s=Os(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function Os(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function Es(t){var e=ot(),r=v.useRef(null),n=lt(),{type:s}=t,a=Ze(t,ws),l=dr(n,"yAxis",s),o=v.useMemo(()=>{if(l!=null)return Dt(Dt({},a),{},{type:l})},[l,a]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(li(o)):r.current!==o&&e(oi({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ci(r.current)),r.current=null)},[e]),null}function Is(t){var{yAxisId:e,className:r,width:n,label:s}=t,a=v.useRef(null),l=v.useRef(null),o=H(or),u=Ie(),d=ot(),c="yAxis",f=H(b=>di(b,e)),m=H(b=>ui(b,e)),x=H(b=>cr(b,c,e,u)),h=H(b=>mi(b,e));if(v.useLayoutEffect(()=>{if(!(n!=="auto"||!f||fi(s)||v.isValidElement(s)||h==null)){var b=a.current;if(b){var k=b.getCalculatedWidth();Math.round(f.width)!==Math.round(k)&&d(hi({id:e,width:k}))}}},[x,f,d,s,e,n,h]),f==null||m==null||h==null)return null;var{dangerouslySetInnerHTML:g,ticks:y,scale:S}=t,w=Ze(t,Ns),{id:P,scale:j}=h,p=Ze(h,Ps);return v.createElement(ut,Je({},w,p,{ref:a,labelRef:l,x:m.x,y:m.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:ne("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:x,axisType:c}))}var Ds={allowDataOverflow:G.allowDataOverflow,allowDecimals:G.allowDecimals,allowDuplicatedCategory:G.allowDuplicatedCategory,angle:G.angle,axisLine:J.axisLine,hide:!1,includeHidden:G.includeHidden,interval:G.interval,label:!1,minTickGap:G.minTickGap,mirror:G.mirror,orientation:G.orientation,padding:G.padding,reversed:G.reversed,scale:G.scale,tick:G.tick,tickCount:G.tickCount,tickLine:J.tickLine,tickSize:J.tickSize,type:G.type,width:G.width,yAxisId:0},Ts=t=>{var e=we(t,Ds);return v.createElement(v.Fragment,null,v.createElement(Es,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter}),v.createElement(Is,e))},Or=v.memo(Ts,Ar);Or.displayName="YAxis";var zs=["axis"],Ls=v.forwardRef((t,e)=>v.createElement(xi,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:zs,tooltipPayloadSearcher:pi,categoricalChartProps:t,ref:e}));function Z(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function $s(t,e){const r=new Date,n=[];if(t==="day"){for(let s=29;s>=0;s--){const a=new Date(r);a.setDate(a.getDate()-s),n.push({date:a.toLocaleDateString("en-US",{month:"short",day:"numeric"}),amount:s===0?e.daily:0})}n[n.length-1]={date:n[n.length-1]?.date??"Today",amount:e.daily}}else if(t==="week"){for(let s=11;s>=0;s--){const a=new Date(r);a.setDate(a.getDate()-s*7),n.push({date:`W${String(52-s)}`,amount:s===0?e.weekly:0})}n[n.length-1]={date:n[n.length-1]?.date??"This week",amount:e.weekly}}else{for(let s=11;s>=0;s--){const a=new Date(r);a.setMonth(a.getMonth()-s),n.push({date:a.toLocaleDateString("en-US",{month:"short",year:"2-digit"}),amount:s===0?e.monthly:0})}n[n.length-1]={date:n[n.length-1]?.date??"This month",amount:e.monthly}}return n}const Fs={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},Ms=[5,10,25,50,100];function Bs(t){const e=L.c(25),{open:r,onOpenChange:n,connectionId:s,currentLimitUsd:a}=t,{org:l}=X(),[o,u]=v.useState(null),[d,c]=v.useState(""),[f,m]=v.useState(null),[x,h]=v.useState(null);let g;e[0]!==s||e[1]!==l.id?(g={connectionId:s,orgId:l.id},e[0]=s,e[1]=l.id,e[2]=g):g=e[2];const y=Se(g);let S;e[3]!==y?(S={client:y},e[3]=y,e[4]=S):S=e[4];const{mutate:w,isPending:P}=mr(S),j=o??(d?parseFloat(d):null);let p,b;e[5]!==a||e[6]!==j||e[7]!==w||e[8]!==n?(b=()=>{if(!j||j<=0)return;const A=a+j;h(null),w({name:"GATEWAY_SET_LIMIT",arguments:{limit_usd:A,return_url:window.location.href}},{onSuccess:_=>{const O=_.structuredContent;O?.checkout_url?m(O.checkout_url):O?.billing_mode==="postpaid"&&p()},onError:_=>{h(_.message??"Failed to create payment link.")}})},p=()=>{u(null),c(""),m(null),h(null),n(!1)},e[5]=a,e[6]=j,e[7]=w,e[8]=n,e[9]=p,e[10]=b):(p=e[9],b=e[10]);let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsxs(Br,{children:[i.jsx(Rr,{children:"Add Credit"}),i.jsx(Wr,{children:"Choose how much credit to add to your AI Gateway."})]}),e[11]=k):k=e[11];let N;e[12]!==f||e[13]!==a||e[14]!==d||e[15]!==j||e[16]!==x||e[17]!==b||e[18]!==P||e[19]!==o?(N=i.jsxs(Rt,{className:"sm:max-w-md",children:[k,f?i.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),i.jsx(Y,{asChild:!0,className:"gap-2",children:i.jsxs("a",{href:f,children:[i.jsx(rt,{size:15}),"Complete Payment"]})})]}):i.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx(Oe,{className:"text-xs text-muted-foreground",children:"Select amount"}),i.jsx("div",{className:"grid grid-cols-5 gap-2",children:Ms.map(A=>i.jsxs("button",{type:"button",onClick:()=>{u(A),c("")},className:ie("rounded-md border px-3 py-2 text-sm font-medium transition-colors",o===A?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",A]},A))})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(Oe,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:"Or enter a custom amount"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),i.jsx(ae,{id:"custom-amount",type:"number",min:"1",step:"1",placeholder:"0.00",className:"pl-7",value:d,onChange:A=>{c(A.target.value),u(null)}})]})]}),x&&i.jsx("p",{className:"text-xs text-destructive",children:x}),i.jsxs("div",{className:"flex items-center justify-between pt-1",children:[i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Current limit:"," ",i.jsx("span",{className:"font-medium text-foreground",children:Z(a)})]}),i.jsx(Y,{onClick:b,disabled:P||!j||j<=0,className:"gap-2",children:P?"Generating...":"Continue"})]})]})]}),e[12]=f,e[13]=a,e[14]=d,e[15]=j,e[16]=x,e[17]=b,e[18]=P,e[19]=o,e[20]=N):N=e[20];let C;return e[21]!==p||e[22]!==r||e[23]!==N?(C=i.jsx(Wt,{open:r,onOpenChange:p,children:N}),e[21]=p,e[22]=r,e[23]=N,e[24]=C):C=e[24],C}function Rs(t){const e=L.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:n,estimatedDepletionDate:s,avgDailySpend:a}=r;if(n==null)return null;let l;e[0]!==s?(l=s?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=s,e[1]=l):l=e[1];const o=l,u=n!==1?"s":"";let d;e[2]!==n||e[3]!==u?(d=i.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",n," day",u," ","remaining"]}),e[2]=n,e[3]=u,e[4]=d):d=e[4];let c;e[5]!==o?(c=o&&i.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=f):f=e[7];let m;e[8]!==a?(m=Z(a),e[8]=a,e[9]=m):m=e[9];let x;e[10]!==m?(x=i.jsxs("span",{className:"tabular-nums",children:["avg ",m,"/day"]}),e[10]=m,e[11]=x):x=e[11];let h;e[12]!==r.resetsBeforeDepletion?(h=r.resetsBeforeDepletion&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground/60",children:"|"}),i.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=h):h=e[13];const g=Fs[r.confidence];let y;e[14]!==g?(y=i.jsx(ur,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:g}),e[14]=g,e[15]=y):y=e[15];let S;return e[16]!==y||e[17]!==d||e[18]!==c||e[19]!==x||e[20]!==h?(S=i.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[d,c,f,x,h,y]}),e[16]=y,e[17]=d,e[18]=c,e[19]=x,e[20]=h,e[21]=S):S=e[21],S}function Ws(t){const e=L.c(26),{available:r,total:n,estimation:s,onAddCredit:a}=t,l=n>0?Math.max(0,Math.min(100,(n-r)/n*100)):0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),e[0]=o):o=e[0];let u;e[1]!==r?(u=Z(r),e[1]=r,e[2]=u):u=e[2];let d;e[3]!==u?(d=i.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:u}),e[3]=u,e[4]=d):d=e[4];let c;e[5]!==n?(c=n>0&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",Z(n)," total"]}),e[5]=n,e[6]=c):c=e[6];let f;e[7]!==d||e[8]!==c?(f=i.jsxs("div",{className:"flex flex-col gap-1",children:[o,d,c]}),e[7]=d,e[8]=c,e[9]=f):f=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Jt,{size:16}),e[10]=m):m=e[10];let x;e[11]!==a?(x=i.jsxs(Y,{onClick:a,className:"gap-2 px-5",children:[m,"Add Credit"]}),e[11]=a,e[12]=x):x=e[12];let h;e[13]!==f||e[14]!==x?(h=i.jsxs("div",{className:"flex items-center justify-between",children:[f,x]}),e[13]=f,e[14]=x,e[15]=h):h=e[15];let g;e[16]!==r||e[17]!==n||e[18]!==l?(g=n>0&&i.jsxs("div",{className:"mt-4",children:[i.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${l}%`}})}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[Z(Math.max(0,n-r))," used"]})]}),e[16]=r,e[17]=n,e[18]=l,e[19]=g):g=e[19];let y;e[20]!==s?(y=i.jsx(Rs,{estimation:s}),e[20]=s,e[21]=y):y=e[21];let S;return e[22]!==y||e[23]!==h||e[24]!==g?(S=i.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[h,g,y]}),e[22]=y,e[23]=h,e[24]=g,e[25]=S):S=e[25],S}function Gs(t){const e=L.c(54),{connectionId:r,alert:n}=t,{org:s}=X(),[a,l]=v.useState(n.enabled),[o,u]=v.useState(String(n.threshold_usd)),[d,c]=v.useState(n.email??""),[f,m]=v.useState(!1),[x,h]=v.useState(null);let g;e[0]!==r||e[1]!==s.id?(g={connectionId:r,orgId:s.id},e[0]=r,e[1]=s.id,e[2]=g):g=e[2];const y=Se(g);let S;e[3]!==y?(S={client:y},e[3]=y,e[4]=S):S=e[4];const{mutate:w,isPending:P}=mr(S),j=a!==n.enabled||o!==String(n.threshold_usd)||d!==(n.email??"");let p;e[5]!==d||e[6]!==a||e[7]!==w||e[8]!==o?(p=()=>{h(null),m(!1);const se=parseFloat(o);if(a&&(!d||!d.includes("@"))){h("A valid email is required to enable alerts.");return}if(Number.isNaN(se)||se<=0){h("Threshold must be a positive number.");return}w({name:"GATEWAY_SET_ALERT",arguments:{enabled:a,threshold_usd:se,...d?{email:d}:{}}},{onSuccess:()=>{m(!0),setTimeout(()=>m(!1),3e3)},onError:Tr=>{h(Tr.message??"Failed to save alert config.")}})},e[5]=d,e[6]=a,e[7]=w,e[8]=o,e[9]=p):p=e[9];const b=p;let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(bi,{size:16,className:"text-muted-foreground"}),i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Low-Balance Alert"})]}),e[10]=k):k=e[10];let N;e[11]!==a?(N=i.jsxs("div",{className:"flex items-center justify-between",children:[k,i.jsx(_e,{checked:a,onCheckedChange:l})]}),e[11]=a,e[12]=N):N=e[12];const C=!a&&"opacity-50 pointer-events-none";let A;e[13]!==C?(A=ie("flex flex-col gap-3 transition-opacity",C),e[13]=C,e[14]=A):A=e[14];let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Oe,{htmlFor:"alert-threshold",className:"text-xs text-muted-foreground",children:"Alert threshold"}),e[15]=_):_=e[15];let O;e[16]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[16]=O):O=e[16];let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=se=>u(se.target.value),e[17]=E):E=e[17];let I;e[18]!==o?(I=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,i.jsxs("div",{className:"relative",children:[O,i.jsx(ae,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"pl-7",value:o,onChange:E})]})]}),e[18]=o,e[19]=I):I=e[19];let z;e[20]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx(Oe,{htmlFor:"alert-email",className:"text-xs text-muted-foreground",children:"Email"}),e[20]=z):z=e[20];let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=se=>c(se.target.value),e[21]=F):F=e[21];let $;e[22]!==d?($=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[z,i.jsx(ae,{id:"alert-email",type:"email",placeholder:"you@example.com",value:d,onChange:F})]}),e[22]=d,e[23]=$):$=e[23];let D;e[24]!==I||e[25]!==$?(D=i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[I,$]}),e[24]=I,e[25]=$,e[26]=D):D=e[26];let T;e[27]!==x?(T=x&&i.jsx("p",{className:"text-xs text-destructive",children:x}),e[27]=x,e[28]=T):T=e[28];let B;e[29]!==a||e[30]!==o?(B=a?`Notify when credit drops below ${Z(parseFloat(o)||0)}`:"Alerts are disabled",e[29]=a,e[30]=o,e[31]=B):B=e[31];let M;e[32]!==B?(M=i.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[32]=B,e[33]=M):M=e[33];let te;e[34]!==f?(te=f&&i.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Saved"}),e[34]=f,e[35]=te):te=e[35];const Pe=P||!j,Ce=P?"Saving...":"Save";let he;e[36]!==b||e[37]!==Pe||e[38]!==Ce?(he=i.jsx(Y,{size:"sm",variant:"outline",onClick:b,disabled:Pe,children:Ce}),e[36]=b,e[37]=Pe,e[38]=Ce,e[39]=he):he=e[39];let xe;e[40]!==te||e[41]!==he?(xe=i.jsxs("div",{className:"flex items-center gap-2",children:[te,he]}),e[40]=te,e[41]=he,e[42]=xe):xe=e[42];let pe;e[43]!==M||e[44]!==xe?(pe=i.jsxs("div",{className:"flex items-center justify-between",children:[M,xe]}),e[43]=M,e[44]=xe,e[45]=pe):pe=e[45];let ge;e[46]!==D||e[47]!==T||e[48]!==pe||e[49]!==A?(ge=i.jsxs("div",{className:A,children:[D,T,pe]}),e[46]=D,e[47]=T,e[48]=pe,e[49]=A,e[50]=ge):ge=e[50];let De;return e[51]!==ge||e[52]!==N?(De=i.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[N,ge]}),e[51]=ge,e[52]=N,e[53]=De):De=e[53],De}const Tt={day:"Daily",week:"Weekly",month:"Monthly"},Us={day:"daily",week:"weekly",month:"monthly"},Ks={amount:{label:"Spend",color:"var(--chart-1)"}};function qs(t){const e=L.c(38),{usage:r}=t,[n,s]=v.useState("day");let a;e[0]!==n||e[1]!==r?(a=$s(n,r),e[0]=n,e[1]=r,e[2]=a):a=e[2];const l=a,o=r[Us[n]];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),e[3]=u):u=e[3];let d;e[4]!==o?(d=Z(o),e[4]=o,e[5]=d):d=e[5];let c;e[6]!==d?(c=i.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:d}),e[6]=d,e[7]=c):c=e[7];const f=n==="day"?"today":n==="week"?"this week":"this month";let m;e[8]!==f?(m=i.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==c||e[11]!==m?(x=i.jsxs("div",{className:"flex items-baseline gap-2",children:[c,m]}),e[10]=c,e[11]=m,e[12]=x):x=e[12];let h;e[13]!==r.total?(h=Z(r.total),e[13]=r.total,e[14]=h):h=e[14];let g;e[15]!==h?(g=i.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[h," all-time"]}),e[15]=h,e[16]=g):g=e[16];let y;e[17]!==x||e[18]!==g?(y=i.jsxs("div",{className:"flex flex-col gap-0.5",children:[u,x,g]}),e[17]=x,e[18]=g,e[19]=y):y=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=Object.keys(Tt),e[20]=S):S=e[20];let w;e[21]!==n?(w=i.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:S.map(E=>i.jsx("button",{type:"button",onClick:()=>s(E),className:ie("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",n===E?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:Tt[E]},E))}),e[21]=n,e[22]=w):w=e[22];let P;e[23]!==y||e[24]!==w?(P=i.jsxs("div",{className:"flex items-center justify-between",children:[y,w]}),e[23]=y,e[24]=w,e[25]=P):P=e[25];let j;e[26]===Symbol.for("react.memo_cache_sentinel")?(j={top:4,right:4,bottom:0,left:0},e[26]=j):j=e[26];let p,b,k,N;e[27]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx("defs",{children:i.jsxs("linearGradient",{id:"fillAmount",x1:"0",y1:"0",x2:"0",y2:"1",children:[i.jsx("stop",{offset:"5%",stopColor:"var(--color-amount)",stopOpacity:.3}),i.jsx("stop",{offset:"95%",stopColor:"var(--color-amount)",stopOpacity:0})]})}),b=i.jsx(vr,{vertical:!1,strokeDasharray:"3 3"}),k=i.jsx(_r,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11}),N=i.jsx(Or,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:Hs}),e[27]=p,e[28]=b,e[29]=k,e[30]=N):(p=e[27],b=e[28],k=e[29],N=e[30]);let C,A;e[31]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(gi,{content:i.jsx(vi,{formatter:Ys})}),A=i.jsx(Cr,{type:"monotone",dataKey:"amount",stroke:"var(--color-amount)",fill:"url(#fillAmount)",strokeWidth:2}),e[31]=C,e[32]=A):(C=e[31],A=e[32]);let _;e[33]!==l?(_=i.jsx(yi,{config:Ks,className:"h-[280px] w-full",children:i.jsxs(Ls,{data:l,margin:j,children:[p,b,k,N,C,A]})}),e[33]=l,e[34]=_):_=e[34];let O;return e[35]!==P||e[36]!==_?(O=i.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[P,_]}),e[35]=P,e[36]=_,e[37]=O):O=e[37],O}function Ys(t){return Z(t)}function Hs(t){return`$${t}`}function Vs(t){const e=L.c(37),{connectionId:r}=t,{org:n}=X(),[s,a]=v.useState(!1);let l;e[0]!==r||e[1]!==n.id?(l={connectionId:r,orgId:n.id},e[0]=r,e[1]=n.id,e[2]=l):l=e[2];const o=Se(l);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={},e[3]=u):u=e[3];let d;e[4]!==o?(d={client:o,toolName:"GATEWAY_USAGE",toolArguments:u,staleTime:3e4,select:Xs},e[4]=o,e[5]=d):d=e[5];const{data:c,isLoading:f}=ji(d);if(f){let z;return e[6]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx(Er,{}),e[6]=z):z=e[6],z}const m=c?.limit.remaining??0,x=c?.limit.total??0;let h;e[7]!==c?.usage?(h=c?.usage??{total:0,daily:0,weekly:0,monthly:0},e[7]=c?.usage,e[8]=h):h=e[8];const g=h,y=c?.billing.mode??"prepaid",S=c?.estimation??null;let w;e[9]!==c?.alert?(w=c?.alert??{enabled:!1,threshold_usd:10,email:null},e[9]=c?.alert,e[10]=w):w=e[10];const P=w,j=x;let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[11]=p):p=e[11];let b;e[12]!==y?(b=y==="postpaid"&&i.jsx(ur,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal capitalize",children:"Postpaid"}),e[12]=y,e[13]=b):b=e[13];let k;e[14]!==b?(k=i.jsxs("div",{className:"flex items-center gap-2",children:[p,b]}),e[14]=b,e[15]=k):k=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=()=>a(!0),e[16]=N):N=e[16];let C;e[17]!==m||e[18]!==S||e[19]!==x?(C=i.jsx(Ws,{available:m,total:x,estimation:S,onAddCredit:N}),e[17]=m,e[18]=S,e[19]=x,e[20]=C):C=e[20];let A;e[21]!==g?(A=i.jsx(qs,{usage:g}),e[21]=g,e[22]=A):A=e[22];const _=`${P.enabled}-${P.threshold_usd}-${P.email}`;let O;e[23]!==P||e[24]!==r||e[25]!==_?(O=i.jsx(Gs,{connectionId:r,alert:P},_),e[23]=P,e[24]=r,e[25]=_,e[26]=O):O=e[26];let E;e[27]!==s||e[28]!==r||e[29]!==j?(E=i.jsx(Bs,{open:s,onOpenChange:a,connectionId:r,currentLimitUsd:j}),e[27]=s,e[28]=r,e[29]=j,e[30]=E):E=e[30];let I;return e[31]!==C||e[32]!==A||e[33]!==O||e[34]!==E||e[35]!==k?(I=i.jsxs(i.Fragment,{children:[k,C,A,O,E]}),e[31]=C,e[32]=A,e[33]=O,e[34]=E,e[35]=k,e[36]=I):I=e[36],I}function Xs(t){return t.structuredContent}function Er(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsxs("div",{children:[i.jsx(re,{className:"h-5 w-32"}),i.jsx(re,{className:"h-4 w-64 mt-1.5"})]}),i.jsx(re,{className:"h-28 rounded-xl"}),i.jsx(re,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Ir(){const t=L.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Monitor usage and manage credits for your organization."})]}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:i.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"flex flex-col gap-6",children:[e,i.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"No AI Gateway configured"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Install the Deco AI Gateway MCP to start tracking usage and managing credits."})]})]})]}),t[2]=n):n=t[2],n}class Qs extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?i.jsx(Ir,{}):this.props.children}}function Js(){const t=L.c(5),e=Qt();let r;t[0]!==e?(r=e.find(Zs),t[0]=e,t[1]=r):r=t[1];const n=r;if(!n?.id){let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ir,{}),t[2]=a):a=t[2],a}let s;return t[3]!==n.id?(s=i.jsx(i.Fragment,{children:i.jsx(Vs,{connectionId:n.id})}),t[3]=n.id,t[4]=s):s=t[4],s}function Zs(t){return Vr(t.connection_url)}function el(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-6",children:i.jsx(Qs,{children:i.jsx(v.Suspense,{fallback:i.jsx(Er,{}),children:i.jsx(Js,{})})})}),t[0]=e):e=t[0],e}function Dr(){const t=L.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(re,{className:"h-6 w-48"}),r=i.jsx(re,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,i.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[i.jsx(re,{className:"h-12 w-full"}),i.jsx(re,{className:"h-12 w-full"})]})]}),t[2]=n):n=t[2],n}function zt(t){const e=L.c(14),{projectSlug:r,children:n}=t,{org:s}=X(),{data:a,isLoading:l}=Bt(s.id,r);if(l||!a){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Dr,{}),e[0]=f):f=e[0],f}const o=r===ee;let u;e[1]!==a.description||e[2]!==a.enabledPlugins||e[3]!==a.id||e[4]!==a.name||e[5]!==a.organizationId||e[6]!==a.slug||e[7]!==a.ui||e[8]!==o?(u={id:a.id,organizationId:a.organizationId,slug:a.slug,name:a.name,description:a.description,enabledPlugins:a.enabledPlugins,ui:a.ui,isOrgAdmin:o},e[1]=a.description,e[2]=a.enabledPlugins,e[3]=a.id,e[4]=a.name,e[5]=a.organizationId,e[6]=a.slug,e[7]=a.ui,e[8]=o,e[9]=u):u=e[9];const d=u;let c;return e[10]!==n||e[11]!==d||e[12]!==s?(c=i.jsx(Mt,{org:s,project:d,children:n}),e[10]=n,e[11]=d,e[12]=s,e[13]=c):c=e[13],c}function tl(t){const e=L.c(20),{section:r}=t;let n;e[0]!==r?(n=Ut(r),e[0]=r,e[1]=n):n=e[1];const s=n;if(s){let a;e[2]!==s.sub?(a=s.sub==="general"&&i.jsx(Bi,{}),e[2]=s.sub,e[3]=a):a=e[3];let l;e[4]!==s.sub?(l=s.sub==="plugins"&&i.jsx(jt,{}),e[4]=s.sub,e[5]=l):l=e[5];let o;e[6]!==s.sub?(o=s.sub==="danger"&&i.jsx(Hi,{}),e[6]=s.sub,e[7]=o):o=e[7];let u;return e[8]!==s.slug||e[9]!==a||e[10]!==l||e[11]!==o?(u=i.jsxs(zt,{projectSlug:s.slug,children:[a,l,o]}),e[8]=s.slug,e[9]=a,e[10]=l,e[11]=o,e[12]=u):u=e[12],u}switch(r){case"account.profile":{let a;return e[13]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Pi,{}),e[13]=a):a=e[13],a}case"account.preferences":{let a;return e[14]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(yt,{}),e[14]=a):a=e[14],a}case"account.experimental":{let a;return e[15]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ei,{}),e[15]=a):a=e[15],a}case"org.general":{let a;return e[16]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(zi,{}),e[16]=a):a=e[16],a}case"org.plugins":{let a;return e[17]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(zt,{projectSlug:ee,children:i.jsx(jt,{})}),e[17]=a):a=e[17],a}case"org.billing":{let a;return e[18]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(el,{}),e[18]=a):a=e[18],a}default:{let a;return e[19]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(yt,{}),e[19]=a):a=e[19],a}}}function rl(){const t=L.c(23),{isOpen:e,activeSection:r,open:n,close:s}=Hr();let a;t[0]!==s?(a=y=>!y&&s(),t[0]=s,t[1]=a):a=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[2]=l):l=t[2];let o;t[3]!==r||t[4]!==n?(o=i.jsx(v.Suspense,{fallback:l,children:i.jsx(Ni,{activeSection:r,onNavigate:n})}),t[3]=r,t[4]=n,t[5]=o):o=t[5];let u,d;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Gt,{size:16}),d=i.jsx("span",{className:"sr-only",children:"Close"}),t[6]=u,t[7]=d):(u=t[6],d=t[7]);let c;t[8]!==s?(c=i.jsxs("button",{type:"button",onClick:s,className:"absolute top-4 right-4 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[u,d]}),t[8]=s,t[9]=c):c=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Dr,{}),t[10]=f):f=t[10];let m;t[11]!==r?(m=i.jsx(v.Suspense,{fallback:f,children:i.jsx(tl,{section:r})}),t[11]=r,t[12]=m):m=t[12];let x;t[13]!==c||t[14]!==m?(x=i.jsxs("div",{className:"flex-1 overflow-y-auto p-8 min-w-0 relative",children:[c,m]}),t[13]=c,t[14]=m,t[15]=x):x=t[15];let h;t[16]!==o||t[17]!==x?(h=i.jsx(Rt,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:i.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o,x]})}),t[16]=o,t[17]=x,t[18]=h):h=t[18];let g;return t[19]!==e||t[20]!==a||t[21]!==h?(g=i.jsx(Wt,{open:e,onOpenChange:a,children:h}),t[19]=e,t[20]=a,t[21]=h,t[22]=g):g=t[22],g}function nl(t){const e=L.c(12),{projectSlug:r,orgSlug:n,error:s}=t,a=$e();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=l):l=e[0];let o;e[1]!==r?(o=i.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let u;e[3]!==s.message?(u=i.jsx("p",{className:"text-sm text-muted-foreground",children:s.message}),e[3]=s.message,e[4]=u):u=e[4];let d;e[5]!==a||e[6]!==n?(d=i.jsx(Y,{variant:"link",onClick:()=>a({to:"/$org/$project",params:{org:n,project:ee}}),children:"Go to organization home"}),e[5]=a,e[6]=n,e[7]=d):d=e[7];let c;return e[8]!==o||e[9]!==u||e[10]!==d?(c=i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[l,o,u,d]}),e[8]=o,e[9]=u,e[10]=d,e[11]=c):c=e[11],c}function il(t){const e=L.c(9),{projectSlug:r,orgSlug:n}=t,s=$e();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=a):a=e[0];let l;e[1]!==r?(l=i.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=l):l=e[2];let o;e[3]!==s||e[4]!==n?(o=i.jsx(Y,{variant:"link",onClick:()=>s({to:"/$org/$project",params:{org:n,project:ee}}),children:"Go to organization home"}),e[3]=s,e[4]=n,e[5]=o):o=e[5];let u;return e[6]!==l||e[7]!==o?(u=i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[a,l,o]}),e[6]=l,e[7]=o,e[8]=u):u=e[8],u}function al(){const t=L.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=$r(e),{org:n}=X(),s=r.org,a=r.project,{data:l,isLoading:o,error:u}=Bt(n.id,a);if(o){let g;return t[1]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(Ye,{}),t[1]=g):g=t[1],g}if(u){let g;return t[2]!==u||t[3]!==s||t[4]!==a?(g=i.jsx(nl,{projectSlug:a,orgSlug:s,error:u}),t[2]=u,t[3]=s,t[4]=a,t[5]=g):g=t[5],g}if(!l){let g;return t[6]!==s||t[7]!==a?(g=i.jsx(il,{projectSlug:a,orgSlug:s}),t[6]=s,t[7]=a,t[8]=g):g=t[8],g}const d=l.slug===ee;let c;t[9]!==l.description||t[10]!==l.enabledPlugins||t[11]!==l.id||t[12]!==l.name||t[13]!==l.organizationId||t[14]!==l.slug||t[15]!==l.ui||t[16]!==d?(c={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:d},t[9]=l.description,t[10]=l.enabledPlugins,t[11]=l.id,t[12]=l.name,t[13]=l.organizationId,t[14]=l.slug,t[15]=l.ui,t[16]=d,t[17]=c):c=t[17];const f=c;let m,x;t[18]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(v.Suspense,{fallback:i.jsx(Ye,{}),children:i.jsx(Fr,{})}),x=i.jsx(rl,{}),t[18]=m,t[19]=x):(m=t[18],x=t[19]);let h;return t[20]!==f||t[21]!==n?(h=i.jsxs(Mt,{org:n,project:f,children:[m,x]}),t[20]=f,t[21]=n,t[22]=h):h=t[22],h}function Ql(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(v.Suspense,{fallback:i.jsx(Ye,{}),children:i.jsx(al,{})}),t[0]=e):e=t[0],e}export{Ql as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b4 as U,c as O,u as H,j as s,aE as G,r as I,b as M,O as V}from"./index-
|
|
1
|
+
import{b4 as U,c as O,u as H,j as s,aE as G,r as I,b as M,O as V}from"./index-D52JGBSW.js";import{u as q}from"./use-project-cfHYfzp_.js";import{P as E}from"./index-DH9RHGRj.js";import{C as F}from"./collection-search-By6ZMwtA.js";import{A as J}from"./avatar-CLwmO-iu.js";import{c as K,B as R}from"./button-Bh5FwGIY.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as T}from"./empty-state-D0ORcC9s.js";import{C as W}from"./create-project-dialog-lv0TRMx_.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-DNLwlIVn.js";import"./useQuery--0jbogka.js";import"./constants-DnuxEo5s.js";import"./use-mobile-DBGLvQCZ.js";import"./tooltip-DJR7bz1l.js";import"./Loading01-C_dZ70Y_.js";import"./SearchMd-C2TJxhWh.js";import"./input--zCus1rn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./useMutation-B8qgpkUA.js";import"./dialog-BYwNnwwA.js";import"./form-Cci_0GHL.js";import"./label-Dt9hwfoA.js";import"./textarea-DGrDCMYg.js";import"./Check-DX81M4UN.js";import"./ChevronRight-DY1xiCUb.js";const te=U("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=K("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors","opacity-0 group-hover:opacity-100"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=Q(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let C;e[25]!==a||e[26]!==j?(C=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=C):C=e[27];let N;e[28]!==n||e[29]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,C]}),e[28]=n,e[29]=C,e[30]=N):N=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(J,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==N||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[N,L]}),e[49]=N,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let D;return e[55]!==A||e[56]!==u?(D=s.jsx(G,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=D):D=e[57],D}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function Ae(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=M();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const N=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/settings",params:{org:e.slug,project:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=E;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(E.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(E.Header,{children:[w,s.jsx(E.Header.Right,{children:s.jsx(R,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=E.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&N.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(T,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&N.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(T,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(R,{onClick:z,children:"Create new project"})})}),p=!c&&N.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:N.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(W,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let C;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(C=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=C):C=t[39],C}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==V}export{Ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,j as s,bB as V,r as M,bC as me,u as fe,a as ue,b as xe,bD as pe}from"./index-DwBgLSti.js";import{c as he}from"./binder-BBB8LQyx.js";import{u as W}from"./useQuery-CPsXfVfR.js";import{h as ge}from"./use-connection-BEGrPCmR.js";import{a as je,u as be,j as Ne}from"./constants-8URKDp4Y.js";import{u as le,P as ye}from"./topbar-portal-BKT0Es8i.js";import{i as G}from"./Loading01-BHMOj-H5.js";import{t as ve}from"./Settings01-DKXbh8uh.js";import{c as P,B as _e}from"./button-D6YZfFzy.js";import{i as Y}from"./AlertCircle-BzYW4X7z.js";import{i as Se}from"./ArrowLeft-dS1h2Fqu.js";import{s as ne}from"./Clock-IA7N95Qq.js";import{i as Ce}from"./CheckCircle-lzDHXhkH.js";import{i as we}from"./InfoCircle-DBbArWGV.js";import{i as ke}from"./XCircle-DneNZUk0.js";import{T as A,b as F,c as D,a as ie,d as re,e as oe}from"./table-Csfk_VXo.js";import{M as $e}from"./markdown-jp5pFlBz.js";import{n as Te}from"./ArrowDown-B35oswmj.js";import{i as Re}from"./ArrowUp-G8RCE5_O.js";import{i as Ie}from"./CheckVerified02-6wwLRSRQ.js";import{s as J,n as ze,i as Le}from"./Rows03-Cdgrgsit.js";import{i as Pe}from"./File02-B2t2I1sM.js";import{s as Ee}from"./Hash02-CIZbsu7P.js";import{B as Ae,a as De,b as Oe,c as Be}from"./breadcrumb-DeYbtjMk.js";import{b as Me,c as Fe,d as Ke,a as qe,C as Ge}from"./card-BNyCnFpQ.js";import{i as He}from"./SearchMd-BLcaRHQs.js";import{I as Ue}from"./input-B7id4I1j.js";import{S as X,a as Z,b as ee,c as te,d as K}from"./select-CkeKfTEx.js";import"./useMutation-DgG1LVg-.js";import"./ChevronRight-DgAfR8pA.js";import"./Check-Bv0pZ3gl.js";import"./ChevronDown-CggIFEVQ.js";const Q={reportsList:t=>["collection-reorder-ranking","reports","list",t],report:(t,e)=>["collection-reorder-ranking","reports","detail",t,e],pluginConfig:(t,e)=>["project-plugin-config",t,e]};function Ve(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(V,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No report source connected"}),s.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an MCP server that provides reports to view collection reorder ranking insights."})]}),t[0]=e):e=t[0],e}const q={passing:{label:"Passing",color:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-400 border-emerald-500/25",icon:Ce},warning:{label:"Warning",color:"bg-amber-500/15 text-amber-700 dark:text-amber-400 border-amber-500/25",icon:Y},failing:{label:"Failing",color:"bg-red-500/15 text-red-700 dark:text-red-400 border-red-500/25",icon:ke},info:{label:"Info",color:"bg-blue-500/15 text-blue-700 dark:text-blue-400 border-blue-500/25",icon:we}};function ae(t){const e=C.c(10),{status:l,size:n}=t,i=n===void 0?"default":n,r=q[l]??q.info,o=r.icon,a=i==="sm",c=a?"px-2 py-0.5":"px-2.5 py-1";let d;e[0]!==r.color||e[1]!==c?(d=P("inline-flex items-center gap-1 rounded-full border text-xs font-medium",c,r.color),e[0]=r.color,e[1]=c,e[2]=d):d=e[2];const m=a?12:14;let f;e[3]!==o||e[4]!==m?(f=s.jsx(o,{size:m}),e[3]=o,e[4]=m,e[5]=f):f=e[5];let u;return e[6]!==r.label||e[7]!==d||e[8]!==f?(u=s.jsxs("span",{className:d,children:[f,r.label]}),e[6]=r.label,e[7]=d,e[8]=f,e[9]=u):u=e[9],u}function We(){const t=C.c(7),{connectionId:e,toolCaller:l}=le();let n;t[0]!==e?(n=Q.reportsList(e),t[0]=e,t[1]=n):n=t[1];let i;t[2]!==l?(i=async()=>await l("REPORTS_LIST",{}),t[2]=l,t[3]=i):i=t[3];let r;return t[4]!==n||t[5]!==i?(r={queryKey:n,queryFn:i,staleTime:6e4},t[4]=n,t[5]=i,t[6]=r):r=t[6],W(r)}function Ye(t){const e=C.c(10),{connectionId:l,toolCaller:n}=le();let i;e[0]!==l||e[1]!==t?(i=Q.report(l,t),e[0]=l,e[1]=t,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==n?(r=async()=>await n("REPORTS_GET",{id:t}),e[3]=t,e[4]=n,e[5]=r):r=e[5];const o=!!t;let a;return e[6]!==i||e[7]!==r||e[8]!==o?(a={queryKey:i,queryFn:r,enabled:o,staleTime:6e4},e[6]=i,e[7]=r,e[8]=o,e[9]=a):a=e[9],W(a)}const Je={passing:"bg-emerald-500",warning:"bg-amber-500",failing:"bg-red-500",info:"bg-blue-500"},se=["#A595FF","#FFC116","#DE3A6E"];function O(t){const e=C.c(7),{icon:l,title:n}=t;let i;e[0]!==l?(i=s.jsx(l,{size:16,className:"opacity-75 shrink-0 text-foreground"}),e[0]=l,e[1]=i):i=e[1];let r;e[2]!==n?(r=s.jsx("span",{className:"text-base text-foreground opacity-75",children:n}),e[2]=n,e[3]=r):r=e[3];let o;return e[4]!==i||e[5]!==r?(o=s.jsxs("div",{className:"flex gap-2 items-center",children:[i,r]}),e[4]=i,e[5]=r,e[6]=o):o=e[6],o}function Qe(t){const e=C.c(2),{content:l}=t;let n;return e[0]!==l?(n=s.jsx($e,{children:l}),e[0]=l,e[1]=n):n=e[1],n}function Xe(t){const e=C.c(15),{metric:l}=t;let n;e[0]!==l.unit?(n=l.unit&&s.jsx("span",{className:"text-base text-muted-foreground ml-1",children:l.unit}),e[0]=l.unit,e[1]=n):n=e[1];let i;e[2]!==l.value||e[3]!==n?(i=s.jsxs("div",{className:"text-2xl leading-8 text-foreground font-normal tabular-nums",children:[l.value,n]}),e[2]=l.value,e[3]=n,e[4]=i):i=e[4];let r;e[5]!==l.status?(r=l.status&&s.jsx("span",{className:P("inline-block size-2 rounded-full shrink-0",Je[l.status])}),e[5]=l.status,e[6]=r):r=e[6];let o;e[7]!==l.label?(o=s.jsx("span",{className:"text-sm text-foreground",children:l.label}),e[7]=l.label,e[8]=o):o=e[8];let a;e[9]!==r||e[10]!==o?(a=s.jsxs("div",{className:"flex gap-1.5 items-center",children:[r,o]}),e[9]=r,e[10]=o,e[11]=a):a=e[11];let c;return e[12]!==i||e[13]!==a?(c=s.jsxs("div",{className:"flex flex-col gap-3 items-start justify-end border border-border rounded-lg p-5 flex-1",children:[i,a]}),e[12]=i,e[13]=a,e[14]=c):c=e[14],c}function ce(t){const e=C.c(12),{title:l,items:n,stacked:i}=t,r=i===void 0?!1:i;let o;e[0]!==l?(o=l&&s.jsx(O,{icon:J,title:l}),e[0]=l,e[1]=o):o=e[1];const a=r?"flex-col items-stretch":"items-stretch";let c;e[2]!==a?(c=P("flex gap-4",a),e[2]=a,e[3]=c):c=e[3];let d;e[4]!==n?(d=n.map(Ze),e[4]=n,e[5]=d):d=e[5];let m;e[6]!==c||e[7]!==d?(m=s.jsx("div",{className:c,children:d}),e[6]=c,e[7]=d,e[8]=m):m=e[8];let f;return e[9]!==o||e[10]!==m?(f=s.jsxs("div",{className:"space-y-4",children:[o,m]}),e[9]=o,e[10]=m,e[11]=f):f=e[11],f}function Ze(t,e){return s.jsx(Xe,{metric:t},`${t.label}-${e}`)}function et(t){const e=C.c(16),{title:l,columns:n,rows:i}=t;let r;e[0]!==l?(r=l&&s.jsx(O,{icon:J,title:l}),e[0]=l,e[1]=r):r=e[1];let o;e[2]!==n?(o=n.map(lt),e[2]=n,e[3]=o):o=e[3];let a;e[4]!==o?(a=s.jsx(ie,{children:s.jsx(F,{children:o})}),e[4]=o,e[5]=a):a=e[5];let c;e[6]!==i?(c=i.map(tt),e[6]=i,e[7]=c):c=e[7];let d;e[8]!==c?(d=s.jsx(re,{children:c}),e[8]=c,e[9]=d):d=e[9];let m;e[10]!==a||e[11]!==d?(m=s.jsx("div",{className:"rounded-lg border overflow-hidden",children:s.jsxs(oe,{children:[a,d]})}),e[10]=a,e[11]=d,e[12]=m):m=e[12];let f;return e[13]!==r||e[14]!==m?(f=s.jsxs("div",{className:"space-y-4",children:[r,m]}),e[13]=r,e[14]=m,e[15]=f):f=e[15],f}function tt(t,e){return s.jsx(F,{children:t.map(st)},e)}function st(t,e){return s.jsx(D,{className:"text-sm",children:t??s.jsx("span",{className:"text-muted-foreground",children:"—"})},e)}function lt(t){return s.jsx(A,{className:"font-mono text-xs uppercase text-muted-foreground",children:t},t)}function de(t){const e=C.c(11),{title:l,items:n}=t;let i;e[0]!==l?(i=l&&s.jsx(O,{icon:Ie,title:l}),e[0]=l,e[1]=i):i=e[1];let r;if(e[2]!==n){let c;e[4]!==n.length?(c=(d,m)=>s.jsxs("div",{className:"flex gap-4 items-stretch",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center w-4 shrink-0",children:[s.jsx("div",{className:"h-full w-px bg-border"}),s.jsx("div",{className:"w-2 h-4 rounded-full flex",style:{backgroundColor:se[m%se.length]}}),s.jsx("div",{className:P("h-full w-px bg-border",m===n.length-1&&"invisible")})]}),s.jsxs("div",{className:"flex flex-col gap-2 items-start py-3 pb-4 min-w-0",children:[s.jsx("span",{className:"text-sm font-medium text-foreground leading-none",children:d.label}),d.description&&s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:d.description})]})]},`${d.label}-${m}`),e[4]=n.length,e[5]=c):c=e[5],r=n.map(c),e[2]=n,e[3]=r}else r=e[3];let o;e[6]!==r?(o=s.jsx("div",{className:"flex flex-col",children:r}),e[6]=r,e[7]=o):o=e[7];let a;return e[8]!==i||e[9]!==o?(a=s.jsxs("div",{className:"space-y-4",children:[i,o]}),e[8]=i,e[9]=o,e[10]=a):a=e[10],a}function nt(t){const e=C.c(3),{content:l}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(O,{icon:Pe,title:"Notas"}),e[0]=n):n=e[0];let i;return e[1]!==l?(i=s.jsxs("div",{className:"space-y-4",children:[n,s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:l})]}),e[1]=l,e[2]=i):i=e[2],i}function it(t){const e=C.c(11),{delta:l}=t;if(l===0){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("span",{className:"inline-flex items-center justify-center",children:s.jsx(Le,{size:16,className:"text-muted-foreground"})}),e[0]=d):d=e[0],d}const n=l>0,i=n?"text-emerald-600":"text-destructive";let r;e[1]!==i?(r=P("inline-flex items-center gap-0.5 text-sm font-medium",i),e[1]=i,e[2]=r):r=e[2];let o;e[3]!==n?(o=n?s.jsx(Re,{size:16}):s.jsx(Te,{size:16}),e[3]=n,e[4]=o):o=e[4];let a;e[5]!==l?(a=Math.abs(l),e[5]=l,e[6]=a):a=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==a?(c=s.jsxs("span",{className:r,children:[o,a]}),e[7]=r,e[8]=o,e[9]=a,e[10]=c):c=e[10],c}function rt(t){return t.length===0?[]:t.map(e=>{const l=e.reference_position!==void 0?e.reference_position:e.position+(e.delta??0);return{...e,position:l,delta:0,reference_position:void 0}}).sort((e,l)=>e.position-l.position)}function U(t){const e=C.c(25),{rows:l,label:n}=t;let i;e[0]!==l?(i=Math.max(4,...l.map(dt)),e[0]=l,e[1]=i):i=e[1];const r=i;let o;e[2]!==r?(o=["IMPRESSIONS","SELECT RATE","ATC","PURCHASE RATE",...Array.from({length:Math.max(0,r-4)},ct)],e[2]=r,e[3]=o):o=e[3];const a=o;let c;e[4]!==n?(c=n&&s.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground opacity-60 tracking-wide px-1",children:n}),e[4]=n,e[5]=c):c=e[5];let d,m,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(A,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"#"}),m=s.jsx(A,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"DELTA"}),f=s.jsx(A,{className:"font-mono text-xs uppercase text-muted-foreground",children:"PRODUTO"}),e[6]=d,e[7]=m,e[8]=f):(d=e[6],m=e[7],f=e[8]);let u;e[9]!==r||e[10]!==a?(u=s.jsx(ie,{className:"sticky top-0 bg-background z-10",children:s.jsxs(F,{children:[d,m,f,a.slice(0,r).map(at)]})}),e[9]=r,e[10]=a,e[11]=u):u=e[11];let x;if(e[12]!==l||e[13]!==r){let y;e[15]!==r?(y=(N,w)=>{const p=N.reference_position!==void 0?N.reference_position-N.position:N.delta??0;return s.jsxs(F,{children:[s.jsx(D,{children:s.jsxs("div",{className:"flex items-center gap-1 opacity-50",children:[s.jsx(Ee,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground tabular-nums",children:N.position})]})}),s.jsx(D,{children:s.jsx(it,{delta:p})}),s.jsx(D,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[N.image&&s.jsx("img",{src:N.image,alt:"",className:"h-12 w-8 object-cover rounded-sm shrink-0 bg-muted"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:N.label})]})}),(()=>{const k=["sessions","select_rate","add_to_cart_rate","purchase_rate"],R=typeof N.note=="object"&&N.note!==null?N.note:null;return Array.from({length:r},(L,$)=>R?.[k[$]??""]??N.values[$]??null).map(ot)})()]},w)},e[15]=r,e[16]=y):y=e[16],x=l.map(y),e[12]=l,e[13]=r,e[14]=x}else x=e[14];let h;e[17]!==x?(h=s.jsx(re,{children:x}),e[17]=x,e[18]=h):h=e[18];let g;e[19]!==u||e[20]!==h?(g=s.jsx("div",{className:"border border-border rounded-lg overflow-auto max-h-[820px]",children:s.jsxs(oe,{children:[u,h]})}),e[19]=u,e[20]=h,e[21]=g):g=e[21];let j;return e[22]!==g||e[23]!==c?(j=s.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[c,g]}),e[22]=g,e[23]=c,e[24]=j):j=e[24],j}function ot(t,e){return s.jsx(D,{className:"text-sm tabular-nums",children:t??"—"},e)}function at(t){return s.jsx(A,{className:"font-mono text-xs uppercase text-muted-foreground",children:t},t)}function ct(t,e){return`Val ${e+5}`}function dt(t){return t.values.length}function mt(t){const e=C.c(20),{title:l,rows:n}=t,[i,r]=M.useState(!1);let o;e[0]!==n?(o=rt(n),e[0]=n,e[1]=o):o=e[1];const a=o;let c;e[2]!==l?(c=l&&s.jsx(O,{icon:J,title:l}),e[2]=l,e[3]=c):c=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>r(ft),e[4]=d):d=e[4];const m=i?"bg-primary text-primary-foreground border-primary":"bg-transparent text-muted-foreground border-border hover:text-foreground hover:border-foreground/30";let f;e[5]!==m?(f=P("inline-flex items-center gap-1.5 text-xs font-medium px-2.5 py-1.5 rounded-md border transition-colors",m),e[5]=m,e[6]=f):f=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ze,{size:14}),e[7]=u):u=e[7];let x;e[8]!==f?(x=s.jsxs("button",{type:"button",onClick:d,className:f,children:[u,"Comparar com Ordenação Atual"]}),e[8]=f,e[9]=x):x=e[9];let h;e[10]!==c||e[11]!==x?(h=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c,x]}),e[10]=c,e[11]=x,e[12]=h):h=e[12];let g;e[13]!==a||e[14]!==n||e[15]!==i?(g=i?s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx(U,{rows:n,label:"Ordenação Proposta"}),s.jsx(U,{rows:a,label:"Ordenação Atual"})]}):s.jsx(U,{rows:n}),e[13]=a,e[14]=n,e[15]=i,e[16]=g):g=e[16];let j;return e[17]!==h||e[18]!==g?(j=s.jsxs("div",{className:"space-y-4",children:[h,g]}),e[17]=h,e[18]=g,e[19]=j):j=e[19],j}function ft(t){return!t}function ut(t){const e=C.c(17),{section:l}=t;switch(console.log("RankingSectionRenderer section:",l),l.type){case"markdown":{let n;return e[0]!==l.content?(n=s.jsx(Qe,{content:l.content}),e[0]=l.content,e[1]=n):n=e[1],n}case"metrics":{let n;return e[2]!==l.items||e[3]!==l.title?(n=s.jsx(ce,{title:l.title,items:l.items}),e[2]=l.items,e[3]=l.title,e[4]=n):n=e[4],n}case"table":{let n;return e[5]!==l.columns||e[6]!==l.rows||e[7]!==l.title?(n=s.jsx(et,{title:l.title,columns:l.columns,rows:l.rows}),e[5]=l.columns,e[6]=l.rows,e[7]=l.title,e[8]=n):n=e[8],n}case"criteria":{let n;return e[9]!==l.items||e[10]!==l.title?(n=s.jsx(de,{title:l.title,items:l.items}),e[9]=l.items,e[10]=l.title,e[11]=n):n=e[11],n}case"note":{let n;return e[12]!==l.content?(n=s.jsx(nt,{content:l.content}),e[12]=l.content,e[13]=n):n=e[13],n}case"ranked-list":{let n;return e[14]!==l.rows||e[15]!==l.title?(n=s.jsx(mt,{title:l.title,rows:l.rows}),e[14]=l.rows,e[15]=l.title,e[16]=n):n=e[16],n}default:return null}}function xt(t){return new Date(t).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function pt(t){const e=C.c(49),{reportId:l,onBack:n}=t,{data:i,isLoading:r,error:o}=Ye(l);if(r){let _;return e[0]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(G,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading report..."})]}),e[0]=_):_=e[0],_}if(o||!i){let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Y,{size:48,className:"text-destructive mb-4"}),e[1]=_):_=e[1];const L=o?"Error loading report":"Report not found";let $;e[2]!==L?($=s.jsx("h3",{className:"text-lg font-medium mb-2",children:L}),e[2]=L,e[3]=$):$=e[3];const T=o?.message??"The requested report could not be found.";let I;e[4]!==T?(I=s.jsx("p",{className:"text-muted-foreground text-center mb-4",children:T}),e[4]=T,e[5]=I):I=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Se,{size:14,className:"mr-1"}),e[6]=b):b=e[6];let S;e[7]!==n?(S=s.jsxs(_e,{variant:"outline",onClick:n,children:[b,"Back to reports"]}),e[7]=n,e[8]=S):S=e[8];let z;return e[9]!==$||e[10]!==I||e[11]!==S?(z=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[_,$,I,S]}),e[9]=$,e[10]=I,e[11]=S,e[12]=z):z=e[12],z}let a;e[13]!==i.title?(a=s.jsx("h1",{className:"text-xl font-semibold leading-tight",children:i.title}),e[13]=i.title,e[14]=a):a=e[14];let c;e[15]!==i.summary?(c=s.jsx("p",{className:"text-sm text-muted-foreground",children:i.summary}),e[15]=i.summary,e[16]=c):c=e[16];let d;e[17]!==a||e[18]!==c?(d=s.jsxs("div",{className:"space-y-1 min-w-0",children:[a,c]}),e[17]=a,e[18]=c,e[19]=d):d=e[19];let m;e[20]!==i.status?(m=s.jsx(ae,{status:i.status}),e[20]=i.status,e[21]=m):m=e[21];let f;e[22]!==d||e[23]!==m?(f=s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d,m]}),e[22]=d,e[23]=m,e[24]=f):f=e[24];let u;e[25]!==i.category?(u=s.jsx("span",{className:"capitalize",children:i.category}),e[25]=i.category,e[26]=u):u=e[26];let x;e[27]!==i.source?(x=i.source&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-border",children:"|"}),s.jsx("span",{children:i.source})]}),e[27]=i.source,e[28]=x):x=e[28];let h;e[29]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("span",{className:"text-border",children:"|"}),e[29]=h):h=e[29];let g;e[30]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ne,{size:12}),e[30]=g):g=e[30];let j;e[31]!==i.updatedAt?(j=xt(i.updatedAt),e[31]=i.updatedAt,e[32]=j):j=e[32];let y;e[33]!==j?(y=s.jsxs("span",{className:"inline-flex items-center gap-1",children:[g,j]}),e[33]=j,e[34]=y):y=e[34];let N;e[35]!==y||e[36]!==u||e[37]!==x?(N=s.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[u,x,h,y]}),e[35]=y,e[36]=u,e[37]=x,e[38]=N):N=e[38];let w;e[39]!==N||e[40]!==f?(w=s.jsxs("div",{className:"border-b border-border py-4 space-y-3",children:[f,N]}),e[39]=N,e[40]=f,e[41]=w):w=e[41];let p;e[42]!==i.sections?(p=me(i.sections??[]).map(ht),e[42]=i.sections,e[43]=p):p=e[43];let k;e[44]!==p?(k=s.jsx("div",{className:"flex-1 py-6 space-y-8",children:p}),e[44]=p,e[45]=k):k=e[45];let R;return e[46]!==w||e[47]!==k?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-y-auto py-6 px-64",children:[w,k]}),e[46]=w,e[47]=k,e[48]=R):R=e[48],R}function ht(t){return t.type==="side-by-side"?s.jsxs("div",{className:"flex gap-6 items-start w-full",children:[s.jsx("div",{className:"w-full",children:s.jsx(de,{title:t.left.title,items:t.left.items})}),s.jsx("div",{className:"w-full",children:s.jsx(ce,{title:t.right.title,items:t.right.items,stacked:!0})})]},`${t.leftIdx}-${t.rightIdx}`):s.jsx(ut,{section:t.section},t.idx)}function gt(t){const e=C.c(21),{value:l,onChange:n,placeholder:i,onKeyDown:r,className:o,isSearching:a,disabled:c}=t,d=i===void 0?"Search...":i;let m;e[0]!==o?(m=P("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=m):m=e[1];const f=c?"cursor-not-allowed opacity-50":"cursor-text";let u;e[2]!==f?(u=P("flex items-center gap-2.5 h-12 px-4",f),e[2]=f,e[3]=u):u=e[3];let x;e[4]!==a?(x=a?s.jsx(G,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(He,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=x):x=e[5];let h;e[6]!==n?(h=N=>n(N.target.value),e[6]=n,e[7]=h):h=e[7];let g;e[8]!==c||e[9]!==r||e[10]!==d||e[11]!==h||e[12]!==l?(g=s.jsx(Ue,{value:l,onChange:h,onKeyDown:r,placeholder:d,disabled:c,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[8]=c,e[9]=r,e[10]=d,e[11]=h,e[12]=l,e[13]=g):g=e[13];let j;e[14]!==u||e[15]!==x||e[16]!==g?(j=s.jsxs("label",{className:u,children:[x,g]}),e[14]=u,e[15]=x,e[16]=g,e[17]=j):j=e[17];let y;return e[18]!==m||e[19]!==j?(y=s.jsx("div",{className:m,children:j}),e[18]=m,e[19]=j,e[20]=y):y=e[20],y}function jt(t){return new Date(t).toLocaleString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function bt(t){const e=C.c(34),{report:l,onSelect:n}=t;let i;e[0]!==n||e[1]!==l.id?(i=()=>n(l.id),e[0]=n,e[1]=l.id,e[2]=i):i=e[2];let r;e[3]!==l.title?(r=s.jsx(Me,{className:"text-sm leading-snug line-clamp-2",children:l.title}),e[3]=l.title,e[4]=r):r=e[4];let o;e[5]!==l.status?(o=s.jsx(ae,{status:l.status,size:"sm"}),e[5]=l.status,e[6]=o):o=e[6];let a;e[7]!==r||e[8]!==o?(a=s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r,o]}),e[7]=r,e[8]=o,e[9]=a):a=e[9];let c;e[10]!==l.summary?(c=s.jsx(Fe,{className:"mt-1 line-clamp-2 text-xs",children:l.summary}),e[10]=l.summary,e[11]=c):c=e[11];let d;e[12]!==a||e[13]!==c?(d=s.jsxs(Ke,{className:"pb-2 pt-5 px-5",children:[a,c]}),e[12]=a,e[13]=c,e[14]=d):d=e[14];let m;e[15]!==l.category?(m=s.jsx("span",{className:"inline-flex items-center gap-1 capitalize",children:l.category}),e[15]=l.category,e[16]=m):m=e[16];let f;e[17]!==l.source?(f=l.source&&s.jsx("span",{className:"inline-flex items-center gap-1 text-muted-foreground/70",children:l.source}),e[17]=l.source,e[18]=f):f=e[18];let u;e[19]!==m||e[20]!==f?(u=s.jsxs("div",{className:"flex items-center gap-3",children:[m,f]}),e[19]=m,e[20]=f,e[21]=u):u=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ne,{size:12}),e[22]=x):x=e[22];let h;e[23]!==l.updatedAt?(h=jt(l.updatedAt),e[23]=l.updatedAt,e[24]=h):h=e[24];let g;e[25]!==h?(g=s.jsxs("span",{className:"inline-flex items-center gap-1",children:[x,h]}),e[25]=h,e[26]=g):g=e[26];let j;e[27]!==g||e[28]!==u?(j=s.jsx(qe,{className:"px-5 pb-5",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[u,g]})}),e[27]=g,e[28]=u,e[29]=j):j=e[29];let y;return e[30]!==i||e[31]!==j||e[32]!==d?(y=s.jsxs(Ge,{className:"group relative cursor-pointer transition-shadow hover:shadow-md",onClick:i,children:[d,j]}),e[30]=i,e[31]=j,e[32]=d,e[33]=y):y=e[33],y}const Nt={today:"Hoje",thisWeek:"Esta semana",older:"Mais antigos"};function yt(t){const e=new Date(t),l=new Date,n=new Date(l.getFullYear(),l.getMonth(),l.getDate()),i=1440*60*1e3,r=Math.floor((n.getTime()-e.getTime())/i);return r<=0?"today":r<=6?"thisWeek":"older"}function vt(t,e){if(!e.trim())return!0;const l=e.toLowerCase().trim();return t.title.toLowerCase().includes(l)||t.summary.toLowerCase().includes(l)||t.category.toLowerCase().includes(l)||(t.source?.toLowerCase().includes(l)??!1)||(t.tags?.some(n=>n.toLowerCase().includes(l))??!1)}function _t(t){const e=C.c(20),{onSelectReport:l}=t,{data:n,isLoading:i,error:r}=We(),o=n?.reports??[],[a,c]=M.useState(""),[d,m]=M.useState(null),[f,u]=M.useState(null);let x;e[0]!==f||e[1]!==a||e[2]!==d?(x=b=>!(!vt(b,a)||d&&b.status!==d||f&&b.category!==f),e[0]=f,e[1]=a,e[2]=d,e[3]=x):x=e[3];const h=o.filter(x),g=[...new Set(o.map(kt))].sort(),j=h.reduce(wt,{today:[],thisWeek:[],older:[]}),y=["today","thisWeek","older"];if(r){let b,S;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Y,{size:48,className:"text-destructive mb-4"}),S=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading reports"}),e[4]=b,e[5]=S):(b=e[4],S=e[5]);let z;return e[6]!==r.message?(z=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[b,S,s.jsx("p",{className:"text-muted-foreground text-center",children:r.message})]}),e[6]=r.message,e[7]=z):z=e[7],z}const N="flex flex-col h-full";let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"flex items-center gap-2 shrink-0 overflow-hidden",children:s.jsx(Ae,{children:s.jsx(De,{children:s.jsx(Oe,{children:s.jsx(Be,{children:"Collection Ranking"})})})})}),e[8]=w):w=e[8];const p=o.length>0&&s.jsxs("div",{className:"flex items-center gap-2 shrink-0 overflow-hidden border-l border-border pl-3",children:[s.jsxs(X,{value:f??"__all__",onValueChange:b=>u(b==="__all__"?null:b),children:[s.jsx(Z,{size:"sm",children:s.jsx(ee,{placeholder:"Todas as categorias"})}),s.jsxs(te,{children:[s.jsx(K,{value:"__all__",children:"Todas as categorias"}),g.map(Ct)]})]}),s.jsxs(X,{value:d??"__all__",onValueChange:b=>m(b==="__all__"?null:b),children:[s.jsx(Z,{size:"sm",children:s.jsx(ee,{placeholder:"Todos os status"})}),s.jsxs(te,{children:[s.jsx(K,{value:"__all__",children:"Todos os status"}),Object.keys(q).map(St)]})]})]});let k;e[9]!==p?(k=s.jsxs("div",{className:"shrink-0 w-full border-b border-border h-12 overflow-x-auto flex items-center justify-between gap-3 px-4 min-w-max",children:[w,p]}),e[9]=p,e[10]=k):k=e[10];let R;e[11]===Symbol.for("react.memo_cache_sentinel")?(R=b=>{b.key==="Escape"&&(c(""),b.target.blur())},e[11]=R):R=e[11];let _;e[12]!==a?(_=s.jsx(gt,{value:a,onChange:c,placeholder:"Search reports...",onKeyDown:R}),e[12]=a,e[13]=_):_=e[13];const L="flex-1 overflow-auto p-6",$=i?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(G,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading reports..."})]}):o.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[s.jsx(V,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No reports yet"}),s.jsx("p",{className:"text-muted-foreground max-w-sm",children:"Reports will appear here once the connected MCP server provides them."})]}):h.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[s.jsx(V,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No reports match filters"}),s.jsx("p",{className:"text-muted-foreground max-w-sm",children:"Try adjusting your search or filters."})]}):s.jsx("div",{className:"space-y-6",children:y.map(b=>{const S=j[b];return!S||S.length===0?null:s.jsxs("div",{className:"space-y-3",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:Nt[b]}),s.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:S.map(z=>s.jsx(bt,{report:z,onSelect:l},z.id))})]},b)})});let T;e[14]!==$?(T=s.jsx("div",{className:L,children:$}),e[14]=$,e[15]=T):T=e[15];let I;return e[16]!==T||e[17]!==k||e[18]!==_?(I=s.jsxs("div",{className:N,children:[k,_,T]}),e[16]=T,e[17]=k,e[18]=_,e[19]=I):I=e[19],I}function St(t){return s.jsx(K,{value:t,children:q[t].label},t)}function Ct(t){return s.jsx(K,{value:t,children:s.jsx("span",{className:"capitalize",children:t})},t)}function wt(t,e){const l=yt(e.updatedAt);return t[l]||(t[l]=[]),t[l].push(e),t}function kt(t){return t.category}function $t(t){return t?t.filter(e=>he(e,pe)):[]}function as(){const t=C.c(50),{org:e,project:l}=fe();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const i=ue(n),r=xe(),o=ge(),a=i.reportId??null;let c;t[1]!==r?(c=v=>{r({search:v?{reportId:v}:{},replace:!0})},t[1]=r,t[2]=c):c=t[2];const d=c;let m;t[3]!==e.id?(m={connectionId:je,orgId:e.id},t[3]=e.id,t[4]=m):m=t[4];const f=be(m);let u;t[5]!==l.id?(u=Q.pluginConfig(l.id??"","collection-reorder-ranking"),t[5]=l.id,t[6]=u):u=t[6];let x;t[7]!==l.id||t[8]!==f?(x=async()=>{const v=await f.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:"collection-reorder-ranking"}});return v.structuredContent??v},t[7]=l.id,t[8]=f,t[9]=x):x=t[9];const h=!!l.id;let g;t[10]!==u||t[11]!==x||t[12]!==h?(g={queryKey:u,queryFn:x,enabled:h},t[10]=u,t[11]=x,t[12]=h,t[13]=g):g=t[13];const{data:j,isLoading:y}=W(g);let N,w;if(t[14]!==o||t[15]!==j?.config?.connectionId){w=$t(o);const v=j?.config?.connectionId;N=v?w.find(H=>H.id===v):null,t[14]=o,t[15]=j?.config?.connectionId,t[16]=N,t[17]=w}else N=t[16],w=t[17];const p=N,k=p?.id;let R;t[18]!==e.id||t[19]!==k?(R={connectionId:k,orgId:e.id},t[18]=e.id,t[19]=k,t[20]=R):R=t[20];const _=Ne(R);let L;t[21]!==e.id||t[22]!==e.name||t[23]!==e.slug?(L={id:e.id,slug:e.slug,name:e.name},t[21]=e.id,t[22]=e.name,t[23]=e.slug,t[24]=L):L=t[24];const $=L;if(y){let v;return t[25]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(G,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),t[25]=v):v=t[25],v}if(w.length===0){let v;return t[26]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ve,{}),t[26]=v):v=t[26],v}if(!p){let v;return t[27]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(ve,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]})}),t[27]=v):v=t[27],v}let T;t[28]!==p.app_id||t[29]!==p.app_name||t[30]!==p.description||t[31]!==p.icon||t[32]!==p.id||t[33]!==p.metadata||t[34]!==p.title||t[35]!==p.tools?(T={id:p.id,title:p.title,icon:p.icon,description:p.description,app_name:p.app_name,app_id:p.app_id,tools:p.tools,metadata:p.metadata},t[28]=p.app_id,t[29]=p.app_name,t[30]=p.description,t[31]=p.icon,t[32]=p.id,t[33]=p.metadata,t[34]=p.title,t[35]=p.tools,t[36]=T):T=t[36];let I;t[37]!==_?(I=(v,H)=>_?_.callTool({name:v,arguments:H}).then(Tt):Promise.reject(new Error("MCP client is not available")),t[37]=_,t[38]=I):I=t[38];const b=I;let S;t[39]!==p.id||t[40]!==$||t[41]!==T||t[42]!==b?(S={connectionId:p.id,connection:T,toolCaller:b,org:$,session:null},t[39]=p.id,t[40]=$,t[41]=T,t[42]=b,t[43]=S):S=t[43];const z=S;let E;t[44]!==a||t[45]!==d?(E=s.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:s.jsx("div",{className:"flex-1 overflow-hidden",children:a?s.jsx(pt,{reportId:a,onBack:()=>d(null)}):s.jsx(_t,{onSelectReport:d})})}),t[44]=a,t[45]=d,t[46]=E):E=t[46];let B;return t[47]!==z||t[48]!==E?(B=s.jsx(ye,{value:z,children:E}),t[47]=z,t[48]=E,t[49]=B):B=t[49],B}function Tt(t){return t.structuredContent??t}export{as as default};
|
|
1
|
+
import{c as C,j as s,bB as V,r as M,bC as me,u as fe,a as ue,b as xe,bD as pe}from"./index-D52JGBSW.js";import{c as he}from"./binder-BnqkDZhr.js";import{u as W}from"./useQuery--0jbogka.js";import{h as ge}from"./use-connection-Dj9QSNVL.js";import{a as je,u as be,j as Ne}from"./constants-DnuxEo5s.js";import{u as le,P as ye}from"./topbar-portal-CoIDsv0w.js";import{i as G}from"./Loading01-C_dZ70Y_.js";import{t as ve}from"./Settings01-CUb7_xIo.js";import{c as P,B as _e}from"./button-Bh5FwGIY.js";import{i as Y}from"./AlertCircle-DxaosN_f.js";import{i as Se}from"./ArrowLeft-CPy9b3-I.js";import{s as ne}from"./Clock-vSHk4lRO.js";import{i as Ce}from"./CheckCircle-CIh-eFaM.js";import{i as we}from"./InfoCircle-BptNWRbo.js";import{i as ke}from"./XCircle-DtxTTf3G.js";import{T as A,b as F,c as D,a as ie,d as re,e as oe}from"./table-BE49uKeW.js";import{M as $e}from"./markdown-B_rkr1OY.js";import{n as Te}from"./ArrowDown-BCC90_2r.js";import{i as Re}from"./ArrowUp-095f00XC.js";import{i as Ie}from"./CheckVerified02-BZWM283O.js";import{s as J,n as ze,i as Le}from"./Rows03-YSN8NfTb.js";import{i as Pe}from"./File02-DDGoV-pJ.js";import{s as Ee}from"./Hash02-BsuEn6Tr.js";import{B as Ae,a as De,b as Oe,c as Be}from"./breadcrumb-DNLwlIVn.js";import{b as Me,c as Fe,d as Ke,a as qe,C as Ge}from"./card-CQpD36Cd.js";import{i as He}from"./SearchMd-C2TJxhWh.js";import{I as Ue}from"./input--zCus1rn.js";import{S as X,a as Z,b as ee,c as te,d as K}from"./select-DEG2HUsU.js";import"./useMutation-B8qgpkUA.js";import"./ChevronRight-DY1xiCUb.js";import"./Check-DX81M4UN.js";import"./ChevronDown-C_pFRqX8.js";const Q={reportsList:t=>["collection-reorder-ranking","reports","list",t],report:(t,e)=>["collection-reorder-ranking","reports","detail",t,e],pluginConfig:(t,e)=>["project-plugin-config",t,e]};function Ve(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(V,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No report source connected"}),s.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an MCP server that provides reports to view collection reorder ranking insights."})]}),t[0]=e):e=t[0],e}const q={passing:{label:"Passing",color:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-400 border-emerald-500/25",icon:Ce},warning:{label:"Warning",color:"bg-amber-500/15 text-amber-700 dark:text-amber-400 border-amber-500/25",icon:Y},failing:{label:"Failing",color:"bg-red-500/15 text-red-700 dark:text-red-400 border-red-500/25",icon:ke},info:{label:"Info",color:"bg-blue-500/15 text-blue-700 dark:text-blue-400 border-blue-500/25",icon:we}};function ae(t){const e=C.c(10),{status:l,size:n}=t,i=n===void 0?"default":n,r=q[l]??q.info,o=r.icon,a=i==="sm",c=a?"px-2 py-0.5":"px-2.5 py-1";let d;e[0]!==r.color||e[1]!==c?(d=P("inline-flex items-center gap-1 rounded-full border text-xs font-medium",c,r.color),e[0]=r.color,e[1]=c,e[2]=d):d=e[2];const m=a?12:14;let f;e[3]!==o||e[4]!==m?(f=s.jsx(o,{size:m}),e[3]=o,e[4]=m,e[5]=f):f=e[5];let u;return e[6]!==r.label||e[7]!==d||e[8]!==f?(u=s.jsxs("span",{className:d,children:[f,r.label]}),e[6]=r.label,e[7]=d,e[8]=f,e[9]=u):u=e[9],u}function We(){const t=C.c(7),{connectionId:e,toolCaller:l}=le();let n;t[0]!==e?(n=Q.reportsList(e),t[0]=e,t[1]=n):n=t[1];let i;t[2]!==l?(i=async()=>await l("REPORTS_LIST",{}),t[2]=l,t[3]=i):i=t[3];let r;return t[4]!==n||t[5]!==i?(r={queryKey:n,queryFn:i,staleTime:6e4},t[4]=n,t[5]=i,t[6]=r):r=t[6],W(r)}function Ye(t){const e=C.c(10),{connectionId:l,toolCaller:n}=le();let i;e[0]!==l||e[1]!==t?(i=Q.report(l,t),e[0]=l,e[1]=t,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==n?(r=async()=>await n("REPORTS_GET",{id:t}),e[3]=t,e[4]=n,e[5]=r):r=e[5];const o=!!t;let a;return e[6]!==i||e[7]!==r||e[8]!==o?(a={queryKey:i,queryFn:r,enabled:o,staleTime:6e4},e[6]=i,e[7]=r,e[8]=o,e[9]=a):a=e[9],W(a)}const Je={passing:"bg-emerald-500",warning:"bg-amber-500",failing:"bg-red-500",info:"bg-blue-500"},se=["#A595FF","#FFC116","#DE3A6E"];function O(t){const e=C.c(7),{icon:l,title:n}=t;let i;e[0]!==l?(i=s.jsx(l,{size:16,className:"opacity-75 shrink-0 text-foreground"}),e[0]=l,e[1]=i):i=e[1];let r;e[2]!==n?(r=s.jsx("span",{className:"text-base text-foreground opacity-75",children:n}),e[2]=n,e[3]=r):r=e[3];let o;return e[4]!==i||e[5]!==r?(o=s.jsxs("div",{className:"flex gap-2 items-center",children:[i,r]}),e[4]=i,e[5]=r,e[6]=o):o=e[6],o}function Qe(t){const e=C.c(2),{content:l}=t;let n;return e[0]!==l?(n=s.jsx($e,{children:l}),e[0]=l,e[1]=n):n=e[1],n}function Xe(t){const e=C.c(15),{metric:l}=t;let n;e[0]!==l.unit?(n=l.unit&&s.jsx("span",{className:"text-base text-muted-foreground ml-1",children:l.unit}),e[0]=l.unit,e[1]=n):n=e[1];let i;e[2]!==l.value||e[3]!==n?(i=s.jsxs("div",{className:"text-2xl leading-8 text-foreground font-normal tabular-nums",children:[l.value,n]}),e[2]=l.value,e[3]=n,e[4]=i):i=e[4];let r;e[5]!==l.status?(r=l.status&&s.jsx("span",{className:P("inline-block size-2 rounded-full shrink-0",Je[l.status])}),e[5]=l.status,e[6]=r):r=e[6];let o;e[7]!==l.label?(o=s.jsx("span",{className:"text-sm text-foreground",children:l.label}),e[7]=l.label,e[8]=o):o=e[8];let a;e[9]!==r||e[10]!==o?(a=s.jsxs("div",{className:"flex gap-1.5 items-center",children:[r,o]}),e[9]=r,e[10]=o,e[11]=a):a=e[11];let c;return e[12]!==i||e[13]!==a?(c=s.jsxs("div",{className:"flex flex-col gap-3 items-start justify-end border border-border rounded-lg p-5 flex-1",children:[i,a]}),e[12]=i,e[13]=a,e[14]=c):c=e[14],c}function ce(t){const e=C.c(12),{title:l,items:n,stacked:i}=t,r=i===void 0?!1:i;let o;e[0]!==l?(o=l&&s.jsx(O,{icon:J,title:l}),e[0]=l,e[1]=o):o=e[1];const a=r?"flex-col items-stretch":"items-stretch";let c;e[2]!==a?(c=P("flex gap-4",a),e[2]=a,e[3]=c):c=e[3];let d;e[4]!==n?(d=n.map(Ze),e[4]=n,e[5]=d):d=e[5];let m;e[6]!==c||e[7]!==d?(m=s.jsx("div",{className:c,children:d}),e[6]=c,e[7]=d,e[8]=m):m=e[8];let f;return e[9]!==o||e[10]!==m?(f=s.jsxs("div",{className:"space-y-4",children:[o,m]}),e[9]=o,e[10]=m,e[11]=f):f=e[11],f}function Ze(t,e){return s.jsx(Xe,{metric:t},`${t.label}-${e}`)}function et(t){const e=C.c(16),{title:l,columns:n,rows:i}=t;let r;e[0]!==l?(r=l&&s.jsx(O,{icon:J,title:l}),e[0]=l,e[1]=r):r=e[1];let o;e[2]!==n?(o=n.map(lt),e[2]=n,e[3]=o):o=e[3];let a;e[4]!==o?(a=s.jsx(ie,{children:s.jsx(F,{children:o})}),e[4]=o,e[5]=a):a=e[5];let c;e[6]!==i?(c=i.map(tt),e[6]=i,e[7]=c):c=e[7];let d;e[8]!==c?(d=s.jsx(re,{children:c}),e[8]=c,e[9]=d):d=e[9];let m;e[10]!==a||e[11]!==d?(m=s.jsx("div",{className:"rounded-lg border overflow-hidden",children:s.jsxs(oe,{children:[a,d]})}),e[10]=a,e[11]=d,e[12]=m):m=e[12];let f;return e[13]!==r||e[14]!==m?(f=s.jsxs("div",{className:"space-y-4",children:[r,m]}),e[13]=r,e[14]=m,e[15]=f):f=e[15],f}function tt(t,e){return s.jsx(F,{children:t.map(st)},e)}function st(t,e){return s.jsx(D,{className:"text-sm",children:t??s.jsx("span",{className:"text-muted-foreground",children:"—"})},e)}function lt(t){return s.jsx(A,{className:"font-mono text-xs uppercase text-muted-foreground",children:t},t)}function de(t){const e=C.c(11),{title:l,items:n}=t;let i;e[0]!==l?(i=l&&s.jsx(O,{icon:Ie,title:l}),e[0]=l,e[1]=i):i=e[1];let r;if(e[2]!==n){let c;e[4]!==n.length?(c=(d,m)=>s.jsxs("div",{className:"flex gap-4 items-stretch",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center w-4 shrink-0",children:[s.jsx("div",{className:"h-full w-px bg-border"}),s.jsx("div",{className:"w-2 h-4 rounded-full flex",style:{backgroundColor:se[m%se.length]}}),s.jsx("div",{className:P("h-full w-px bg-border",m===n.length-1&&"invisible")})]}),s.jsxs("div",{className:"flex flex-col gap-2 items-start py-3 pb-4 min-w-0",children:[s.jsx("span",{className:"text-sm font-medium text-foreground leading-none",children:d.label}),d.description&&s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:d.description})]})]},`${d.label}-${m}`),e[4]=n.length,e[5]=c):c=e[5],r=n.map(c),e[2]=n,e[3]=r}else r=e[3];let o;e[6]!==r?(o=s.jsx("div",{className:"flex flex-col",children:r}),e[6]=r,e[7]=o):o=e[7];let a;return e[8]!==i||e[9]!==o?(a=s.jsxs("div",{className:"space-y-4",children:[i,o]}),e[8]=i,e[9]=o,e[10]=a):a=e[10],a}function nt(t){const e=C.c(3),{content:l}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(O,{icon:Pe,title:"Notas"}),e[0]=n):n=e[0];let i;return e[1]!==l?(i=s.jsxs("div",{className:"space-y-4",children:[n,s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:l})]}),e[1]=l,e[2]=i):i=e[2],i}function it(t){const e=C.c(11),{delta:l}=t;if(l===0){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("span",{className:"inline-flex items-center justify-center",children:s.jsx(Le,{size:16,className:"text-muted-foreground"})}),e[0]=d):d=e[0],d}const n=l>0,i=n?"text-emerald-600":"text-destructive";let r;e[1]!==i?(r=P("inline-flex items-center gap-0.5 text-sm font-medium",i),e[1]=i,e[2]=r):r=e[2];let o;e[3]!==n?(o=n?s.jsx(Re,{size:16}):s.jsx(Te,{size:16}),e[3]=n,e[4]=o):o=e[4];let a;e[5]!==l?(a=Math.abs(l),e[5]=l,e[6]=a):a=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==a?(c=s.jsxs("span",{className:r,children:[o,a]}),e[7]=r,e[8]=o,e[9]=a,e[10]=c):c=e[10],c}function rt(t){return t.length===0?[]:t.map(e=>{const l=e.reference_position!==void 0?e.reference_position:e.position+(e.delta??0);return{...e,position:l,delta:0,reference_position:void 0}}).sort((e,l)=>e.position-l.position)}function U(t){const e=C.c(25),{rows:l,label:n}=t;let i;e[0]!==l?(i=Math.max(4,...l.map(dt)),e[0]=l,e[1]=i):i=e[1];const r=i;let o;e[2]!==r?(o=["IMPRESSIONS","SELECT RATE","ATC","PURCHASE RATE",...Array.from({length:Math.max(0,r-4)},ct)],e[2]=r,e[3]=o):o=e[3];const a=o;let c;e[4]!==n?(c=n&&s.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground opacity-60 tracking-wide px-1",children:n}),e[4]=n,e[5]=c):c=e[5];let d,m,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(A,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"#"}),m=s.jsx(A,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"DELTA"}),f=s.jsx(A,{className:"font-mono text-xs uppercase text-muted-foreground",children:"PRODUTO"}),e[6]=d,e[7]=m,e[8]=f):(d=e[6],m=e[7],f=e[8]);let u;e[9]!==r||e[10]!==a?(u=s.jsx(ie,{className:"sticky top-0 bg-background z-10",children:s.jsxs(F,{children:[d,m,f,a.slice(0,r).map(at)]})}),e[9]=r,e[10]=a,e[11]=u):u=e[11];let x;if(e[12]!==l||e[13]!==r){let y;e[15]!==r?(y=(N,w)=>{const p=N.reference_position!==void 0?N.reference_position-N.position:N.delta??0;return s.jsxs(F,{children:[s.jsx(D,{children:s.jsxs("div",{className:"flex items-center gap-1 opacity-50",children:[s.jsx(Ee,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground tabular-nums",children:N.position})]})}),s.jsx(D,{children:s.jsx(it,{delta:p})}),s.jsx(D,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[N.image&&s.jsx("img",{src:N.image,alt:"",className:"h-12 w-8 object-cover rounded-sm shrink-0 bg-muted"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:N.label})]})}),(()=>{const k=["sessions","select_rate","add_to_cart_rate","purchase_rate"],R=typeof N.note=="object"&&N.note!==null?N.note:null;return Array.from({length:r},(L,$)=>R?.[k[$]??""]??N.values[$]??null).map(ot)})()]},w)},e[15]=r,e[16]=y):y=e[16],x=l.map(y),e[12]=l,e[13]=r,e[14]=x}else x=e[14];let h;e[17]!==x?(h=s.jsx(re,{children:x}),e[17]=x,e[18]=h):h=e[18];let g;e[19]!==u||e[20]!==h?(g=s.jsx("div",{className:"border border-border rounded-lg overflow-auto max-h-[820px]",children:s.jsxs(oe,{children:[u,h]})}),e[19]=u,e[20]=h,e[21]=g):g=e[21];let j;return e[22]!==g||e[23]!==c?(j=s.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[c,g]}),e[22]=g,e[23]=c,e[24]=j):j=e[24],j}function ot(t,e){return s.jsx(D,{className:"text-sm tabular-nums",children:t??"—"},e)}function at(t){return s.jsx(A,{className:"font-mono text-xs uppercase text-muted-foreground",children:t},t)}function ct(t,e){return`Val ${e+5}`}function dt(t){return t.values.length}function mt(t){const e=C.c(20),{title:l,rows:n}=t,[i,r]=M.useState(!1);let o;e[0]!==n?(o=rt(n),e[0]=n,e[1]=o):o=e[1];const a=o;let c;e[2]!==l?(c=l&&s.jsx(O,{icon:J,title:l}),e[2]=l,e[3]=c):c=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>r(ft),e[4]=d):d=e[4];const m=i?"bg-primary text-primary-foreground border-primary":"bg-transparent text-muted-foreground border-border hover:text-foreground hover:border-foreground/30";let f;e[5]!==m?(f=P("inline-flex items-center gap-1.5 text-xs font-medium px-2.5 py-1.5 rounded-md border transition-colors",m),e[5]=m,e[6]=f):f=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ze,{size:14}),e[7]=u):u=e[7];let x;e[8]!==f?(x=s.jsxs("button",{type:"button",onClick:d,className:f,children:[u,"Comparar com Ordenação Atual"]}),e[8]=f,e[9]=x):x=e[9];let h;e[10]!==c||e[11]!==x?(h=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c,x]}),e[10]=c,e[11]=x,e[12]=h):h=e[12];let g;e[13]!==a||e[14]!==n||e[15]!==i?(g=i?s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx(U,{rows:n,label:"Ordenação Proposta"}),s.jsx(U,{rows:a,label:"Ordenação Atual"})]}):s.jsx(U,{rows:n}),e[13]=a,e[14]=n,e[15]=i,e[16]=g):g=e[16];let j;return e[17]!==h||e[18]!==g?(j=s.jsxs("div",{className:"space-y-4",children:[h,g]}),e[17]=h,e[18]=g,e[19]=j):j=e[19],j}function ft(t){return!t}function ut(t){const e=C.c(17),{section:l}=t;switch(console.log("RankingSectionRenderer section:",l),l.type){case"markdown":{let n;return e[0]!==l.content?(n=s.jsx(Qe,{content:l.content}),e[0]=l.content,e[1]=n):n=e[1],n}case"metrics":{let n;return e[2]!==l.items||e[3]!==l.title?(n=s.jsx(ce,{title:l.title,items:l.items}),e[2]=l.items,e[3]=l.title,e[4]=n):n=e[4],n}case"table":{let n;return e[5]!==l.columns||e[6]!==l.rows||e[7]!==l.title?(n=s.jsx(et,{title:l.title,columns:l.columns,rows:l.rows}),e[5]=l.columns,e[6]=l.rows,e[7]=l.title,e[8]=n):n=e[8],n}case"criteria":{let n;return e[9]!==l.items||e[10]!==l.title?(n=s.jsx(de,{title:l.title,items:l.items}),e[9]=l.items,e[10]=l.title,e[11]=n):n=e[11],n}case"note":{let n;return e[12]!==l.content?(n=s.jsx(nt,{content:l.content}),e[12]=l.content,e[13]=n):n=e[13],n}case"ranked-list":{let n;return e[14]!==l.rows||e[15]!==l.title?(n=s.jsx(mt,{title:l.title,rows:l.rows}),e[14]=l.rows,e[15]=l.title,e[16]=n):n=e[16],n}default:return null}}function xt(t){return new Date(t).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function pt(t){const e=C.c(49),{reportId:l,onBack:n}=t,{data:i,isLoading:r,error:o}=Ye(l);if(r){let _;return e[0]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(G,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading report..."})]}),e[0]=_):_=e[0],_}if(o||!i){let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Y,{size:48,className:"text-destructive mb-4"}),e[1]=_):_=e[1];const L=o?"Error loading report":"Report not found";let $;e[2]!==L?($=s.jsx("h3",{className:"text-lg font-medium mb-2",children:L}),e[2]=L,e[3]=$):$=e[3];const T=o?.message??"The requested report could not be found.";let I;e[4]!==T?(I=s.jsx("p",{className:"text-muted-foreground text-center mb-4",children:T}),e[4]=T,e[5]=I):I=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Se,{size:14,className:"mr-1"}),e[6]=b):b=e[6];let S;e[7]!==n?(S=s.jsxs(_e,{variant:"outline",onClick:n,children:[b,"Back to reports"]}),e[7]=n,e[8]=S):S=e[8];let z;return e[9]!==$||e[10]!==I||e[11]!==S?(z=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[_,$,I,S]}),e[9]=$,e[10]=I,e[11]=S,e[12]=z):z=e[12],z}let a;e[13]!==i.title?(a=s.jsx("h1",{className:"text-xl font-semibold leading-tight",children:i.title}),e[13]=i.title,e[14]=a):a=e[14];let c;e[15]!==i.summary?(c=s.jsx("p",{className:"text-sm text-muted-foreground",children:i.summary}),e[15]=i.summary,e[16]=c):c=e[16];let d;e[17]!==a||e[18]!==c?(d=s.jsxs("div",{className:"space-y-1 min-w-0",children:[a,c]}),e[17]=a,e[18]=c,e[19]=d):d=e[19];let m;e[20]!==i.status?(m=s.jsx(ae,{status:i.status}),e[20]=i.status,e[21]=m):m=e[21];let f;e[22]!==d||e[23]!==m?(f=s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d,m]}),e[22]=d,e[23]=m,e[24]=f):f=e[24];let u;e[25]!==i.category?(u=s.jsx("span",{className:"capitalize",children:i.category}),e[25]=i.category,e[26]=u):u=e[26];let x;e[27]!==i.source?(x=i.source&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-border",children:"|"}),s.jsx("span",{children:i.source})]}),e[27]=i.source,e[28]=x):x=e[28];let h;e[29]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("span",{className:"text-border",children:"|"}),e[29]=h):h=e[29];let g;e[30]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ne,{size:12}),e[30]=g):g=e[30];let j;e[31]!==i.updatedAt?(j=xt(i.updatedAt),e[31]=i.updatedAt,e[32]=j):j=e[32];let y;e[33]!==j?(y=s.jsxs("span",{className:"inline-flex items-center gap-1",children:[g,j]}),e[33]=j,e[34]=y):y=e[34];let N;e[35]!==y||e[36]!==u||e[37]!==x?(N=s.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[u,x,h,y]}),e[35]=y,e[36]=u,e[37]=x,e[38]=N):N=e[38];let w;e[39]!==N||e[40]!==f?(w=s.jsxs("div",{className:"border-b border-border py-4 space-y-3",children:[f,N]}),e[39]=N,e[40]=f,e[41]=w):w=e[41];let p;e[42]!==i.sections?(p=me(i.sections??[]).map(ht),e[42]=i.sections,e[43]=p):p=e[43];let k;e[44]!==p?(k=s.jsx("div",{className:"flex-1 py-6 space-y-8",children:p}),e[44]=p,e[45]=k):k=e[45];let R;return e[46]!==w||e[47]!==k?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-y-auto py-6 px-64",children:[w,k]}),e[46]=w,e[47]=k,e[48]=R):R=e[48],R}function ht(t){return t.type==="side-by-side"?s.jsxs("div",{className:"flex gap-6 items-start w-full",children:[s.jsx("div",{className:"w-full",children:s.jsx(de,{title:t.left.title,items:t.left.items})}),s.jsx("div",{className:"w-full",children:s.jsx(ce,{title:t.right.title,items:t.right.items,stacked:!0})})]},`${t.leftIdx}-${t.rightIdx}`):s.jsx(ut,{section:t.section},t.idx)}function gt(t){const e=C.c(21),{value:l,onChange:n,placeholder:i,onKeyDown:r,className:o,isSearching:a,disabled:c}=t,d=i===void 0?"Search...":i;let m;e[0]!==o?(m=P("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=m):m=e[1];const f=c?"cursor-not-allowed opacity-50":"cursor-text";let u;e[2]!==f?(u=P("flex items-center gap-2.5 h-12 px-4",f),e[2]=f,e[3]=u):u=e[3];let x;e[4]!==a?(x=a?s.jsx(G,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(He,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=x):x=e[5];let h;e[6]!==n?(h=N=>n(N.target.value),e[6]=n,e[7]=h):h=e[7];let g;e[8]!==c||e[9]!==r||e[10]!==d||e[11]!==h||e[12]!==l?(g=s.jsx(Ue,{value:l,onChange:h,onKeyDown:r,placeholder:d,disabled:c,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[8]=c,e[9]=r,e[10]=d,e[11]=h,e[12]=l,e[13]=g):g=e[13];let j;e[14]!==u||e[15]!==x||e[16]!==g?(j=s.jsxs("label",{className:u,children:[x,g]}),e[14]=u,e[15]=x,e[16]=g,e[17]=j):j=e[17];let y;return e[18]!==m||e[19]!==j?(y=s.jsx("div",{className:m,children:j}),e[18]=m,e[19]=j,e[20]=y):y=e[20],y}function jt(t){return new Date(t).toLocaleString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function bt(t){const e=C.c(34),{report:l,onSelect:n}=t;let i;e[0]!==n||e[1]!==l.id?(i=()=>n(l.id),e[0]=n,e[1]=l.id,e[2]=i):i=e[2];let r;e[3]!==l.title?(r=s.jsx(Me,{className:"text-sm leading-snug line-clamp-2",children:l.title}),e[3]=l.title,e[4]=r):r=e[4];let o;e[5]!==l.status?(o=s.jsx(ae,{status:l.status,size:"sm"}),e[5]=l.status,e[6]=o):o=e[6];let a;e[7]!==r||e[8]!==o?(a=s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r,o]}),e[7]=r,e[8]=o,e[9]=a):a=e[9];let c;e[10]!==l.summary?(c=s.jsx(Fe,{className:"mt-1 line-clamp-2 text-xs",children:l.summary}),e[10]=l.summary,e[11]=c):c=e[11];let d;e[12]!==a||e[13]!==c?(d=s.jsxs(Ke,{className:"pb-2 pt-5 px-5",children:[a,c]}),e[12]=a,e[13]=c,e[14]=d):d=e[14];let m;e[15]!==l.category?(m=s.jsx("span",{className:"inline-flex items-center gap-1 capitalize",children:l.category}),e[15]=l.category,e[16]=m):m=e[16];let f;e[17]!==l.source?(f=l.source&&s.jsx("span",{className:"inline-flex items-center gap-1 text-muted-foreground/70",children:l.source}),e[17]=l.source,e[18]=f):f=e[18];let u;e[19]!==m||e[20]!==f?(u=s.jsxs("div",{className:"flex items-center gap-3",children:[m,f]}),e[19]=m,e[20]=f,e[21]=u):u=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ne,{size:12}),e[22]=x):x=e[22];let h;e[23]!==l.updatedAt?(h=jt(l.updatedAt),e[23]=l.updatedAt,e[24]=h):h=e[24];let g;e[25]!==h?(g=s.jsxs("span",{className:"inline-flex items-center gap-1",children:[x,h]}),e[25]=h,e[26]=g):g=e[26];let j;e[27]!==g||e[28]!==u?(j=s.jsx(qe,{className:"px-5 pb-5",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[u,g]})}),e[27]=g,e[28]=u,e[29]=j):j=e[29];let y;return e[30]!==i||e[31]!==j||e[32]!==d?(y=s.jsxs(Ge,{className:"group relative cursor-pointer transition-shadow hover:shadow-md",onClick:i,children:[d,j]}),e[30]=i,e[31]=j,e[32]=d,e[33]=y):y=e[33],y}const Nt={today:"Hoje",thisWeek:"Esta semana",older:"Mais antigos"};function yt(t){const e=new Date(t),l=new Date,n=new Date(l.getFullYear(),l.getMonth(),l.getDate()),i=1440*60*1e3,r=Math.floor((n.getTime()-e.getTime())/i);return r<=0?"today":r<=6?"thisWeek":"older"}function vt(t,e){if(!e.trim())return!0;const l=e.toLowerCase().trim();return t.title.toLowerCase().includes(l)||t.summary.toLowerCase().includes(l)||t.category.toLowerCase().includes(l)||(t.source?.toLowerCase().includes(l)??!1)||(t.tags?.some(n=>n.toLowerCase().includes(l))??!1)}function _t(t){const e=C.c(20),{onSelectReport:l}=t,{data:n,isLoading:i,error:r}=We(),o=n?.reports??[],[a,c]=M.useState(""),[d,m]=M.useState(null),[f,u]=M.useState(null);let x;e[0]!==f||e[1]!==a||e[2]!==d?(x=b=>!(!vt(b,a)||d&&b.status!==d||f&&b.category!==f),e[0]=f,e[1]=a,e[2]=d,e[3]=x):x=e[3];const h=o.filter(x),g=[...new Set(o.map(kt))].sort(),j=h.reduce(wt,{today:[],thisWeek:[],older:[]}),y=["today","thisWeek","older"];if(r){let b,S;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Y,{size:48,className:"text-destructive mb-4"}),S=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading reports"}),e[4]=b,e[5]=S):(b=e[4],S=e[5]);let z;return e[6]!==r.message?(z=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[b,S,s.jsx("p",{className:"text-muted-foreground text-center",children:r.message})]}),e[6]=r.message,e[7]=z):z=e[7],z}const N="flex flex-col h-full";let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"flex items-center gap-2 shrink-0 overflow-hidden",children:s.jsx(Ae,{children:s.jsx(De,{children:s.jsx(Oe,{children:s.jsx(Be,{children:"Collection Ranking"})})})})}),e[8]=w):w=e[8];const p=o.length>0&&s.jsxs("div",{className:"flex items-center gap-2 shrink-0 overflow-hidden border-l border-border pl-3",children:[s.jsxs(X,{value:f??"__all__",onValueChange:b=>u(b==="__all__"?null:b),children:[s.jsx(Z,{size:"sm",children:s.jsx(ee,{placeholder:"Todas as categorias"})}),s.jsxs(te,{children:[s.jsx(K,{value:"__all__",children:"Todas as categorias"}),g.map(Ct)]})]}),s.jsxs(X,{value:d??"__all__",onValueChange:b=>m(b==="__all__"?null:b),children:[s.jsx(Z,{size:"sm",children:s.jsx(ee,{placeholder:"Todos os status"})}),s.jsxs(te,{children:[s.jsx(K,{value:"__all__",children:"Todos os status"}),Object.keys(q).map(St)]})]})]});let k;e[9]!==p?(k=s.jsxs("div",{className:"shrink-0 w-full border-b border-border h-12 overflow-x-auto flex items-center justify-between gap-3 px-4 min-w-max",children:[w,p]}),e[9]=p,e[10]=k):k=e[10];let R;e[11]===Symbol.for("react.memo_cache_sentinel")?(R=b=>{b.key==="Escape"&&(c(""),b.target.blur())},e[11]=R):R=e[11];let _;e[12]!==a?(_=s.jsx(gt,{value:a,onChange:c,placeholder:"Search reports...",onKeyDown:R}),e[12]=a,e[13]=_):_=e[13];const L="flex-1 overflow-auto p-6",$=i?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(G,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading reports..."})]}):o.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[s.jsx(V,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No reports yet"}),s.jsx("p",{className:"text-muted-foreground max-w-sm",children:"Reports will appear here once the connected MCP server provides them."})]}):h.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[s.jsx(V,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No reports match filters"}),s.jsx("p",{className:"text-muted-foreground max-w-sm",children:"Try adjusting your search or filters."})]}):s.jsx("div",{className:"space-y-6",children:y.map(b=>{const S=j[b];return!S||S.length===0?null:s.jsxs("div",{className:"space-y-3",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:Nt[b]}),s.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:S.map(z=>s.jsx(bt,{report:z,onSelect:l},z.id))})]},b)})});let T;e[14]!==$?(T=s.jsx("div",{className:L,children:$}),e[14]=$,e[15]=T):T=e[15];let I;return e[16]!==T||e[17]!==k||e[18]!==_?(I=s.jsxs("div",{className:N,children:[k,_,T]}),e[16]=T,e[17]=k,e[18]=_,e[19]=I):I=e[19],I}function St(t){return s.jsx(K,{value:t,children:q[t].label},t)}function Ct(t){return s.jsx(K,{value:t,children:s.jsx("span",{className:"capitalize",children:t})},t)}function wt(t,e){const l=yt(e.updatedAt);return t[l]||(t[l]=[]),t[l].push(e),t}function kt(t){return t.category}function $t(t){return t?t.filter(e=>he(e,pe)):[]}function as(){const t=C.c(50),{org:e,project:l}=fe();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const i=ue(n),r=xe(),o=ge(),a=i.reportId??null;let c;t[1]!==r?(c=v=>{r({search:v?{reportId:v}:{},replace:!0})},t[1]=r,t[2]=c):c=t[2];const d=c;let m;t[3]!==e.id?(m={connectionId:je,orgId:e.id},t[3]=e.id,t[4]=m):m=t[4];const f=be(m);let u;t[5]!==l.id?(u=Q.pluginConfig(l.id??"","collection-reorder-ranking"),t[5]=l.id,t[6]=u):u=t[6];let x;t[7]!==l.id||t[8]!==f?(x=async()=>{const v=await f.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:"collection-reorder-ranking"}});return v.structuredContent??v},t[7]=l.id,t[8]=f,t[9]=x):x=t[9];const h=!!l.id;let g;t[10]!==u||t[11]!==x||t[12]!==h?(g={queryKey:u,queryFn:x,enabled:h},t[10]=u,t[11]=x,t[12]=h,t[13]=g):g=t[13];const{data:j,isLoading:y}=W(g);let N,w;if(t[14]!==o||t[15]!==j?.config?.connectionId){w=$t(o);const v=j?.config?.connectionId;N=v?w.find(H=>H.id===v):null,t[14]=o,t[15]=j?.config?.connectionId,t[16]=N,t[17]=w}else N=t[16],w=t[17];const p=N,k=p?.id;let R;t[18]!==e.id||t[19]!==k?(R={connectionId:k,orgId:e.id},t[18]=e.id,t[19]=k,t[20]=R):R=t[20];const _=Ne(R);let L;t[21]!==e.id||t[22]!==e.name||t[23]!==e.slug?(L={id:e.id,slug:e.slug,name:e.name},t[21]=e.id,t[22]=e.name,t[23]=e.slug,t[24]=L):L=t[24];const $=L;if(y){let v;return t[25]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(G,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),t[25]=v):v=t[25],v}if(w.length===0){let v;return t[26]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ve,{}),t[26]=v):v=t[26],v}if(!p){let v;return t[27]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(ve,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]})}),t[27]=v):v=t[27],v}let T;t[28]!==p.app_id||t[29]!==p.app_name||t[30]!==p.description||t[31]!==p.icon||t[32]!==p.id||t[33]!==p.metadata||t[34]!==p.title||t[35]!==p.tools?(T={id:p.id,title:p.title,icon:p.icon,description:p.description,app_name:p.app_name,app_id:p.app_id,tools:p.tools,metadata:p.metadata},t[28]=p.app_id,t[29]=p.app_name,t[30]=p.description,t[31]=p.icon,t[32]=p.id,t[33]=p.metadata,t[34]=p.title,t[35]=p.tools,t[36]=T):T=t[36];let I;t[37]!==_?(I=(v,H)=>_?_.callTool({name:v,arguments:H}).then(Tt):Promise.reject(new Error("MCP client is not available")),t[37]=_,t[38]=I):I=t[38];const b=I;let S;t[39]!==p.id||t[40]!==$||t[41]!==T||t[42]!==b?(S={connectionId:p.id,connection:T,toolCaller:b,org:$,session:null},t[39]=p.id,t[40]=$,t[41]=T,t[42]=b,t[43]=S):S=t[43];const z=S;let E;t[44]!==a||t[45]!==d?(E=s.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:s.jsx("div",{className:"flex-1 overflow-hidden",children:a?s.jsx(pt,{reportId:a,onBack:()=>d(null)}):s.jsx(_t,{onSelectReport:d})})}),t[44]=a,t[45]=d,t[46]=E):E=t[46];let B;return t[47]!==z||t[48]!==E?(B=s.jsx(ye,{value:z,children:E}),t[47]=z,t[48]=E,t[49]=B):B=t[49],B}function Tt(t){return t.structuredContent??t}export{as as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,K as E,j as l}from"./index-
|
|
1
|
+
import{c as b,K as E,j as l}from"./index-D52JGBSW.js";import{u as R}from"./useQuery--0jbogka.js";import{i as j}from"./File06-vlWs29hO.js";import{i as v}from"./Loading01-C_dZ70Y_.js";import{e as _}from"./github-icon-Dp3wHhYE.js";function w(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function A(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,r)=>{let t=e;return r.includes("target=")?t=t.replace(/target="[^"]*"/gi,'target="_blank"'):t=t.replace(/>/,' target="_blank">'),r.includes("rel=")?t=t.replace(/rel="[^"]*"/gi,'rel="noopener noreferrer"'):t=t.replace(/>/,' rel="noopener noreferrer">'),t})}function H(s){let e=w(s);return e=A(e),e}async function L(s,e){try{const r=await fetch(`https://api.github.com/repos/${s}/${e}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!r.ok){if(r.status===404)return null;throw new Error(`Failed to fetch README: ${r.statusText}`)}const t=await r.text();return H(t)}catch(r){return console.error("Error fetching README:",r),null}}function D(s){const e=b.c(18),{repository:r,html:t,isLoading:g,queryKey:h}=s;let n,o,a,m;e[0]!==t||e[1]!==h||e[2]!==r?(n=r?_(r):null,o=!!n&&t===void 0,m=R,a=h??E.githubReadme(n?.owner,n?.repo),e[0]=t,e[1]=h,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e[6]=m):(n=e[3],o=e[4],a=e[5],m=e[6]);let c;e[7]!==n?(c=async()=>n?L(n.owner,n.repo):null,e[7]=n,e[8]=c):c=e[8];let u;e[9]!==o||e[10]!==a||e[11]!==c?(u={queryKey:a,queryFn:c,enabled:o,staleTime:36e5,gcTime:864e5},e[9]=o,e[10]=a,e[11]=c,e[12]=u):u=e[12];const{data:x,isLoading:y}=m(u),f=t??x;if(g??(o&&y)){let i;return e[13]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(v,{size:32,className:"animate-spin text-muted-foreground"})}),e[13]=i):i=e[13],i}if(!f){let i;return e[14]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[l.jsx(j,{size:48,className:"text-muted-foreground mb-4"}),l.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),l.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]}),e[14]=i):i=e[14],i}let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d={backgroundColor:"transparent"},e[15]=d):d=e[15];let p;return e[16]!==f?(p=l.jsx("div",{className:"p-5 markdown-body",style:d,dangerouslySetInnerHTML:{__html:f}}),e[16]=f,e[17]=p):p=e[17],p}export{D as R};
|