@decocms/mesh 2.13.0 → 2.14.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-CtP28Oyz.js → AlertCircle-CMyS46jH.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Bps-R0_t.js → ArrowLeft-Dsh9IWd-.js} +1 -1
- package/dist/client/assets/ArrowUp-CXsDJznS.js +1 -0
- package/dist/client/assets/{Check-Bkw0Gz-n.js → Check-BEhtk6Py.js} +1 -1
- package/dist/client/assets/{ChevronDown-mvTJP4-S.js → ChevronDown-BRxtl0-A.js} +1 -1
- package/dist/client/assets/{Clock-DiHiAbv6.js → Clock-BSrN61cb.js} +1 -1
- package/dist/client/assets/{Code01-CTUZx8UP.js → Code01-Bu5zpyWd.js} +1 -1
- package/dist/client/assets/{Copy01-BctGx-5E.js → Copy01-B7vmVdHF.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-MMZ1EZhB.js → DotsHorizontal-B0iNa4YA.js} +1 -1
- package/dist/client/assets/{DotsVertical-CzCtj25W.js → DotsVertical-CdUtOOoG.js} +1 -1
- package/dist/client/assets/Download01-D1VGE3pA.js +1 -0
- package/dist/client/assets/{Edit01-BD5iJRQz.js → Edit01-CGqnOdlK.js} +1 -1
- package/dist/client/assets/{File06-nV81V8TD.js → File06-De52zO32.js} +1 -1
- package/dist/client/assets/FilterLines-ClFUJXZP.js +1 -0
- package/dist/client/assets/{FlipBackward-CpWoOBPz.js → FlipBackward-B4GimHkg.js} +1 -1
- package/dist/client/assets/{GitBranch01-DWYSSAGj.js → GitBranch01-B40VcD0l.js} +1 -1
- package/dist/client/assets/Grid01-CoHgfBeE.js +1 -0
- package/dist/client/assets/Home02-Dax6TXzJ.js +1 -0
- package/dist/client/assets/Image01-D_Oad7Fi.js +1 -0
- package/dist/client/assets/{Inbox01-DkMyh-FB.js → Inbox01-DU8gyK-F.js} +1 -1
- package/dist/client/assets/{InfoCircle-BXctEVkS.js → InfoCircle-Na8jygcw.js} +1 -1
- package/dist/client/assets/{Key01-ChIWeKNh.js → Key01-BbSMVBZS.js} +1 -1
- package/dist/client/assets/{LinkExternal01-By7zx70s.js → LinkExternal01-5OOaoko1.js} +1 -1
- package/dist/client/assets/List-BXC8ldIg.js +1 -0
- package/dist/client/assets/{Loading01-CdaWSExX.js → Loading01-DxDL3s7X.js} +1 -1
- package/dist/client/assets/{Lock01-txD_UwBx.js → Lock01-C1zaHQP8.js} +1 -1
- package/dist/client/assets/{Play-CjVz5-Yt.js → Play-ClPvjsPL.js} +1 -1
- package/dist/client/assets/{Plus-CovnOzP9.js → Plus-WrA7kzKa.js} +1 -1
- package/dist/client/assets/{SearchMd-YxKkBPG0.js → SearchMd-JSFwoON0.js} +1 -1
- package/dist/client/assets/{Terminal-DYwA22tz.js → Terminal-BtV_FLPF.js} +1 -1
- package/dist/client/assets/{Trash01-DopdNXEu.js → Trash01-MX6mkM7g.js} +1 -1
- package/dist/client/assets/Upload01-BGvogcXt.js +1 -0
- package/dist/client/assets/{X-DcqsnRSe.js → X-q5bh176U.js} +1 -1
- package/dist/client/assets/{XClose-D0utLGU3.js → XClose-D_dGSZ7W.js} +1 -1
- package/dist/client/assets/{alert-dialog-B2ogXLEp.js → alert-dialog-ocEz50Se.js} +2 -2
- package/dist/client/assets/{auth-catchall-BG5YjEP_.js → auth-catchall-BJS8UgWt.js} +1 -1
- package/dist/client/assets/avatar-Dtkx4Tl-.js +1 -0
- package/dist/client/assets/badge-BkSn2oaB.js +1 -0
- package/dist/client/assets/binder-BVHRVoIY.js +1 -0
- package/dist/client/assets/button-CICpj3wE.js +1 -0
- package/dist/client/assets/card-BMkFh6vi.js +1 -0
- package/dist/client/assets/checkbox-DTTIHxXg.js +1 -0
- package/dist/client/assets/{collection-detail-BJvqsPlx.js → collection-detail-CDCE926k.js} +2 -2
- package/dist/client/assets/collection-display-button-3hmFOeDC.js +1 -0
- package/dist/client/assets/collection-header-B6vJy14N.js +1 -0
- package/dist/client/assets/{collection-page-C8c74lBQ.js → collection-page-Dt6I6Mr4.js} +1 -1
- package/dist/client/assets/collection-search-ClK_cOgs.js +1 -0
- package/dist/client/assets/collection-tab-D8CKnWEB.js +1 -0
- package/dist/client/assets/collection-table-wrapper-CUsQQB3S.js +1 -0
- package/dist/client/assets/connection-Mp3hTHGP.js +2 -0
- package/dist/client/assets/connection-card-Cm6sQJt-.js +1 -0
- package/dist/client/assets/connection-detail-CS7YtOxG.js +1 -0
- package/dist/client/assets/connections-BXBUh1-5.js +1 -0
- package/dist/client/assets/constants-DsV2FGIq.js +1 -0
- package/dist/client/assets/create-organization-dialog-Kd2yuwpA.js +1 -0
- package/dist/client/assets/dialog-CuzZhGeu.js +1 -0
- package/dist/client/assets/dropdown-menu-D1uHrxpy.js +1 -0
- package/dist/client/assets/dynamic-plugin-layout-BWtm_52W.js +1 -0
- package/dist/client/assets/empty-state-B8LlErgw.js +1 -0
- package/dist/client/assets/empty-state-BhACvnGF.js +1 -0
- package/dist/client/assets/env-vars-editor-BSBPtnyc.js +1 -0
- package/dist/client/assets/error-boundary-u4ffWLYf.js +1 -0
- package/dist/client/assets/extract-connection-data-DSV8dsp9.js +1 -0
- package/dist/client/assets/file-browser-CZ1PEthx.js +2 -0
- package/dist/client/assets/form-f0_t6ok_.js +1 -0
- package/dist/client/assets/gateway-detail-D4FxMVxj.js +1 -0
- package/dist/client/assets/gateways-DjekxeB3.js +1 -0
- package/dist/client/assets/grid-view-BYe4Rwz4.js +1 -0
- package/dist/client/assets/home-C6GUJREk.js +1 -0
- package/dist/client/assets/{index-BuPukvJG.js → index-BZk2eMPx.js} +17 -17
- package/dist/client/assets/{index-o28bnKR9.js → index-BrOzWsZC.js} +1 -1
- package/dist/client/assets/index-CFMXrMRQ.js +25 -0
- package/dist/client/assets/{index-Cw3bkeXO.js → index-DB3GMPX_.js} +1 -1
- package/dist/client/assets/index-fFpUC2Bx.css +1 -0
- package/dist/client/assets/index-pvGhQBw9.js +174 -0
- package/dist/client/assets/infiniteQueryObserver-DjOTL7tS.js +1 -0
- package/dist/client/assets/input-Chnnz9Uq.js +1 -0
- package/dist/client/assets/layout-CE7L7dZF.js +1 -0
- package/dist/client/assets/{lazy-highlighter-C5pGkBnk.js → lazy-highlighter-HM0cmsZA.js} +1 -1
- package/dist/client/assets/localstorage-keys-CdhAbc7P.js +1 -0
- package/dist/client/assets/login-D-qtMr1_.js +1 -0
- package/dist/client/assets/mcp-oauth-Bkju1UsK.js +1 -0
- package/dist/client/assets/mcp-server-card-CsdbMsCj.js +1 -0
- package/dist/client/assets/mcp-server-detail-BI6WT6NT.js +1 -0
- package/dist/client/assets/members-DIF2fQ00.js +3 -0
- package/dist/client/assets/{monaco-editor-BmVBfnK5.js → monaco-editor--HoIUuQe.js} +3 -3
- package/dist/client/assets/{monitoring-7ik3wQUY.js → monitoring-Gwgg901f.js} +10 -10
- package/dist/client/assets/oauth-callback-C8OVySGi.js +1 -0
- package/dist/client/assets/{page-yu9K5Vtj.js → page-BthOOB1S.js} +2 -2
- package/dist/client/assets/page-rpmGCt1t.js +1 -0
- package/dist/client/assets/pin-to-sidebar-button--fqmK37a.js +1 -0
- package/dist/client/assets/plugin-empty-state-BPlieumE.js +1 -0
- package/dist/client/assets/plugin-header-CcEHY2ra.js +1 -0
- package/dist/client/assets/plugins-BR7M1iih.js +1 -0
- package/dist/client/assets/popover-Cq8T_QGa.js +1 -0
- package/dist/client/assets/project-context-provider-CUiGxKJp.js +1 -0
- package/dist/client/assets/{registry-utils-BIzwINzW.js → registry-utils-h9Ud__h7.js} +1 -1
- package/dist/client/assets/resizable-S6LzYu6C.js +1 -0
- package/dist/client/assets/resource-tabs-Blq_ajNW.js +1 -0
- package/dist/client/assets/select-BOEg6aAK.js +1 -0
- package/dist/client/assets/settings-C0Cv06sV.js +1 -0
- package/dist/client/assets/shell-layout-BRSb3To9.js +3 -0
- package/dist/client/assets/spinner-BSgPnpsR.js +1 -0
- package/dist/client/assets/switch-CkVmNhCD.js +1 -0
- package/dist/client/assets/textarea-BgUJNVXI.js +1 -0
- package/dist/client/assets/{thread-history-popover-BKo2wskT.js → thread-history-popover-SCaQRi-L.js} +4 -4
- package/dist/client/assets/tool-set-selector-BVPKiJOI.js +1 -0
- package/dist/client/assets/tools-list-DsOacuX3.js +1 -0
- package/dist/client/assets/tooltip-DySBr2SY.js +1 -0
- package/dist/client/assets/use-binding-s4bqKdJA.js +23 -0
- package/dist/client/assets/use-collections-JQXbZBdV.js +1 -0
- package/dist/client/assets/use-connection-BF1UFzlw.js +1 -0
- package/dist/client/assets/{use-connection-resources-C8cAy7Nl.js → use-connection-resources-D5d-M6jn.js} +1 -1
- package/dist/client/assets/{use-create-gateway-D8vNiD2K.js → use-create-gateway-DLr-GNpv.js} +1 -1
- package/dist/client/assets/use-gateway-B5GGqvj7.js +1 -0
- package/dist/client/assets/{use-gateway-system-prompt-uetw6YB3.js → use-gateway-system-prompt-K6FCpGjs.js} +1 -1
- package/dist/client/assets/{use-list-state-CAv4RNZg.js → use-list-state-BkPjBg3I.js} +1 -1
- package/dist/client/assets/use-mcp-C-3NLCFo.js +1 -0
- package/dist/client/assets/{use-members-9nvpFN_1.js → use-members-B9HW4lZd.js} +1 -1
- package/dist/client/assets/{use-mobile-sd5ko6M_.js → use-mobile-zhrv6Pzr.js} +1 -1
- package/dist/client/assets/use-organization-settings-DTSCQFPr.js +1 -0
- package/dist/client/assets/{use-tool-call-BLplGau6.js → use-tool-call-BMUEJvVc.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-qVzxuL4i.js +1 -0
- package/dist/client/assets/useMutation-B64mCwly.js +1 -0
- package/dist/client/assets/useQuery-Dr4r_H_i.js +1 -0
- package/dist/client/assets/value-DvmerOpY.js +1 -0
- package/dist/client/assets/view-mode-toggle-DXknlAX3.js +1 -0
- package/dist/client/assets/workflow-Bi0pfrEf.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +193 -193
- package/dist/server/migrate.js +128 -128
- package/dist/server/server.js +191 -191
- package/package.json +4 -4
- package/dist/client/assets/FilterLines-CBfbdjv3.js +0 -1
- package/dist/client/assets/Grid01-BEpepbVy.js +0 -1
- package/dist/client/assets/auth-CNkA6dk2.js +0 -1
- package/dist/client/assets/avatar-KT16fAYd.js +0 -1
- package/dist/client/assets/badge-8BCP2QJ_.js +0 -1
- package/dist/client/assets/card-XgDm8_H9.js +0 -1
- package/dist/client/assets/checkbox-B9Ss6ffk.js +0 -1
- package/dist/client/assets/collection-display-button-DroTLKfu.js +0 -1
- package/dist/client/assets/collection-header-CUphFaJM.js +0 -1
- package/dist/client/assets/collection-search-DIEJ7x7R.js +0 -1
- package/dist/client/assets/collection-tab-BQr3sv8I.js +0 -1
- package/dist/client/assets/collection-table-wrapper-x8zydyA0.js +0 -1
- package/dist/client/assets/connection-card-CTMXB5Zh.js +0 -1
- package/dist/client/assets/connection-detail-BU82m59Z.js +0 -1
- package/dist/client/assets/connections-B-zsqKwM.js +0 -1
- package/dist/client/assets/constants-8DEiLmV-.js +0 -1
- package/dist/client/assets/create-organization-dialog-CHS4cOdy.js +0 -1
- package/dist/client/assets/dialog-D9LHhl79.js +0 -1
- package/dist/client/assets/dropdown-menu-DjFWyTtD.js +0 -1
- package/dist/client/assets/empty-state-DSGxvcRL.js +0 -1
- package/dist/client/assets/empty-state-DgOO5bI1.js +0 -2
- package/dist/client/assets/env-vars-editor-mM2KyO-W.js +0 -1
- package/dist/client/assets/error-boundary-uBvOVTCE.js +0 -1
- package/dist/client/assets/extract-connection-data-DMhfaAiL.js +0 -1
- package/dist/client/assets/form-orY-xngM.js +0 -1
- package/dist/client/assets/gateway-detail-Bnl2H9_J.js +0 -1
- package/dist/client/assets/gateways-RS5E135D.js +0 -1
- package/dist/client/assets/home-HRdtfNlr.js +0 -1
- package/dist/client/assets/index-9MwexYU6.css +0 -1
- package/dist/client/assets/index-Bz1LU39D.js +0 -163
- package/dist/client/assets/index-K2EwRRk6.js +0 -25
- package/dist/client/assets/input-CtiQUsvV.js +0 -1
- package/dist/client/assets/layout-C8G6tSLB.js +0 -1
- package/dist/client/assets/localstorage-keys-5oG1CfEQ.js +0 -1
- package/dist/client/assets/login-BvQHpiOu.js +0 -1
- package/dist/client/assets/mcp-oauth-BzcB2WNx.js +0 -1
- package/dist/client/assets/mcp-server-card-BawKO-ZK.js +0 -1
- package/dist/client/assets/mcp-server-detail-CxrhH1J8.js +0 -1
- package/dist/client/assets/members-C0iWKqGR.js +0 -3
- package/dist/client/assets/oauth-callback-Coasa0XK.js +0 -1
- package/dist/client/assets/page-DsAOPS13.js +0 -1
- package/dist/client/assets/pin-to-sidebar-button-C-akIZzz.js +0 -1
- package/dist/client/assets/popover-QWczrvYc.js +0 -1
- package/dist/client/assets/project-context-provider-_aLYBfO9.js +0 -1
- package/dist/client/assets/resizable-djk090hC.js +0 -1
- package/dist/client/assets/resource-tabs-GXDudjH9.js +0 -1
- package/dist/client/assets/select-Bxj6_TSM.js +0 -1
- package/dist/client/assets/settings-0nIjjKRi.js +0 -1
- package/dist/client/assets/shell-layout-BFIjeoYr.js +0 -3
- package/dist/client/assets/spinner-C7HX4n17.js +0 -1
- package/dist/client/assets/switch-zovYrKoi.js +0 -1
- package/dist/client/assets/textarea-D76YOeHc.js +0 -1
- package/dist/client/assets/tool-set-selector-Dfdgsx2h.js +0 -1
- package/dist/client/assets/tools-list-C2S7XIkI.js +0 -1
- package/dist/client/assets/use-binding-UNVemCFv.js +0 -34
- package/dist/client/assets/use-connection-BXdeHsm0.js +0 -1
- package/dist/client/assets/use-gateway-BhC1hXIm.js +0 -1
- package/dist/client/assets/use-mcp-kCjFuvFP.js +0 -1
- package/dist/client/assets/use-organization-settings-DBRSoBd0.js +0 -1
- package/dist/client/assets/value-DxHsXzsm.js +0 -1
- package/dist/client/assets/view-mode-toggle-CVcyaB_S.js +0 -1
- package/dist/client/assets/workflow-BUV3CQv_.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aZ as f,a$ as m,bH as h,bI as x,a_ as b,s as y,r as u,b6 as k,bJ as O,aJ as C,a4 as w,c as p,h as M,j as g,i as E}from"./index-Bz1LU39D.js";var j=class extends f{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),m(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&h(t.mutationKey)!==h(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#n(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#n()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??x();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#n(e){b.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,r=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(e.data,null,t,r,s)}catch(i){Promise.reject(i)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(void 0,e.error,t,r,s)}catch(i){Promise.reject(i)}}}this.listeners.forEach(t=>{t(this.#i)})})}};function K(e,t){const r=y(t),[s]=u.useState(()=>new j(r,e));u.useEffect(()=>{s.setOptions(e)},[s,e]);const i=u.useSyncExternalStore(u.useCallback(n=>s.subscribe(b.batchCalls(n)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=u.useCallback((n,c)=>{s.mutate(n,c).catch(k)},[s]);if(i.error&&O(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function v(...e){return C(w(e))}const S=M("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-7 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function z(e){const t=p.c(14);let r,s,i,o,n;t[0]!==e?({className:r,variant:n,size:i,asChild:o,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=i,t[4]=o,t[5]=n):(r=t[1],s=t[2],i=t[3],o=t[4],n=t[5]);const d=(o===void 0?!1:o)?E:"button";let a;t[6]!==r||t[7]!==i||t[8]!==n?(a=v(S({variant:n,size:i,className:r})),t[6]=r,t[7]=i,t[8]=n,t[9]=a):a=t[9];let l;return t[10]!==d||t[11]!==s||t[12]!==a?(l=g.jsx(d,{"data-slot":"button",className:a,...s}),t[10]=d,t[11]=s,t[12]=a,t[13]=l):l=t[13],l}function P(e){const t=p.c(10);let r,s,i;t[0]!==e?({className:r,type:i,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=i):(r=t[1],s=t[2],i=t[3]);let o;t[4]!==r?(o=v("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] bg-background","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",r),t[4]=r,t[5]=o):o=t[5];let n;return t[6]!==s||t[7]!==o||t[8]!==i?(n=g.jsx("input",{type:i,"data-slot":"input",className:o,...s}),t[6]=s,t[7]=o,t[8]=i,t[9]=n):n=t[9],n}export{z as B,P as I,S as b,v as c,K as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as E,r as f,a6 as v,j as l}from"./index-Bz1LU39D.js";import{B as w}from"./input-CtiQUsvV.js";import{i as k}from"./ArrowLeft-Bps-R0_t.js";const j=f.createContext(null);function S(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.tabsEl)return null;let t;return e[0]!==r||e[1]!==s.tabsEl?(t=v.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=t):t=e[2],t}function _(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.actionsEl)return null;let t;return e[0]!==r||e[1]!==s.actionsEl?(t=v.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=t):t=e[2],t}function B(x){const e=E.c(20),{children:r,onBack:s,title:t}=x,[h,N]=f.useState(null),[p,g]=f.useState(null);let n;e[0]!==p||e[1]!==h?(n={tabsEl:h,actionsEl:p},e[0]=p,e[1]=h,e[2]=n):n=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(k,{}),e[3]=u):u=e[3];let i;e[4]!==s?(i=l.jsx("div",{className:"flex h-full px-2 border-r items-center",children:l.jsx(w,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:s,children:u})}),e[4]=s,e[5]=i):i=e[5];let c;e[6]!==t?(c=t&&l.jsx("div",{className:"flex items-center gap-2 px-2",children:l.jsx("p",{className:"text-sm font-medium",children:t})}),e[6]=t,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsxs("div",{className:"flex px-4 items-center gap-0 flex-1 min-w-0",children:[l.jsx("div",{ref:N,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),l.jsx("div",{ref:g,className:"flex items-center gap-2 ml-auto shrink-0 border-l border-border pl-4"})]}),e[8]=d):d=e[8];let o;e[9]!==i||e[10]!==c?(o=l.jsxs("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:[i,c,d]}),e[9]=i,e[10]=c,e[11]=o):o=e[11];let a;e[12]!==r?(a=l.jsx("div",{className:"flex-1 overflow-auto",children:r}),e[12]=r,e[13]=a):a=e[13];let m;e[14]!==o||e[15]!==a?(m=l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[o,a]}),e[14]=o,e[15]=a,e[16]=m):m=e[16];let b;return e[17]!==n||e[18]!==m?(b=l.jsx(j,{value:n,children:m}),e[17]=n,e[18]=m,e[19]=b):b=e[19],b}export{_ as V,S as a,B as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as O,s as w}from"./index-Bz1LU39D.js";import{b as I}from"./use-connection-BXdeHsm0.js";import{u as x}from"./input-CtiQUsvV.js";function L(e){try{return JSON.parse(e)}catch{return}}function v(e,s){const t=localStorage.getItem(e),a=t?L(t):void 0,r=typeof s=="function"?s(a):a??s;if(a===void 0||r!==a)try{const o=JSON.stringify(r);localStorage.setItem(e,o)}catch{}return r}function q(e,s){const t=O.c(25),a=w();let r;t[0]!==e?(r=["localStorage",e],t[0]=e,t[1]=r):r=t[1];const o=r;let c,i;t[2]!==s||t[3]!==e?(c=()=>v(e,s),i=()=>v(e,s),t[2]=s,t[3]=e,t[4]=c,t[5]=i):(c=t[4],i=t[5]);let h;t[6]!==o||t[7]!==c||t[8]!==i?(h={queryKey:o,queryFn:c,initialData:i,staleTime:1/0,gcTime:1/0},t[6]=o,t[7]=c,t[8]=i,t[9]=h):h=t[9];const{data:$}=I(h);let l;t[10]!==e?(l=async n=>{const y=JSON.stringify(n);return localStorage.setItem(e,y),n},t[10]=e,t[11]=l):l=t[11];let m;t[12]!==a||t[13]!==o?(m=n=>{a.setQueryData(o,n)},t[12]=a,t[13]=o,t[14]=m):m=t[14];let u;t[15]!==l||t[16]!==m?(u={mutationFn:l,onSuccess:m},t[15]=l,t[16]=m,t[17]=u):u=t[17];const g=x(u);let d;t[18]!==g||t[19]!==a||t[20]!==o?(d=n=>{const y=a.getQueryData(o),C=typeof n=="function"?n(y):n;g.mutate(C)},t[18]=g,t[19]=a,t[20]=o,t[21]=d):d=t[21];const S=d,p=$;let f;return t[22]!==S||t[23]!==p?(f=[p,S],t[22]=S,t[23]=p,t[24]=f):f=t[24],f}const A={decoChatOpen:()=>"mesh:decochat:open",threadManagerState:e=>`mesh:thread-manager-state:${e}`,chatSelectedModel:e=>`mesh:chat:selectedModel:${e}`,assistantChatActiveThread:(e,s)=>`mesh:assistant-chat:active-thread:${e}:${s}`,gatewayChatActiveThread:(e,s)=>`mesh:gateway-chat:active-thread:${e}:${s}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:e=>`mesh:store:selected-registry:${e}`,orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,gatewaySystemPrompts:e=>`mesh:gateway:system-prompts:${e}`,storeShowStdio:()=>"mesh:store:show-stdio",developerMode:()=>"mesh:user:developer-mode"};export{A as L,q as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as k,r as p,j as e,a as j,b as z,S as L,N as R,c as U}from"./index-Bz1LU39D.js";import{u as T,c as b,I as E,B as P}from"./input-CtiQUsvV.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function F(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{F as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as T,Q as V,V as P,H as $}from"./auth-CNkA6dk2.js";function A(n){let e=0;for(let t=0;t<n.length;t++){const o=n.charCodeAt(t);e=(e<<5)-e+o,e=e&e}return Math.abs(e).toString(16)}const U=new Map,I="mcp:oauth:callback:";class L{serverUrl;_clientMetadata;_redirectUrl;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`;const t=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...t&&{scope:t}},U.set(A(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){const a=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${a},top=${s},popup=yes`)}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){U.delete(A(this.serverUrl))}}async function x(n){const e=new URL(`/mcp/${n.connectionId}`,window.location.origin),t=new L({serverUrl:e.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope});try{const o=new Promise((r,c)=>{const E=n.timeout||12e4;let w,f=!1;const O=t.state(),_=`${I}${O}`,l=()=>{if(!f){f=!0,window.removeEventListener("message",m),window.removeEventListener("storage",g),clearTimeout(w);try{localStorage.removeItem(_)}catch{}}},k=async i=>{if(f)return;if(!i.success){l(),c(new Error(i.error||"OAuth authentication failed"));return}const{code:h,state:b}=i;if(!h){l(),c(new Error("Missing authorization code"));return}if(t.getStoredState()!==b){l(),c(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const S=(await T(e))?.authorization_servers?.[0]||e,y=await V(S),d=t.clientInformation();if(!d){l(),c(new Error("Client information not found"));return}const C=t.codeVerifier(),M=await P(S,{metadata:y,clientInformation:d,authorizationCode:h,codeVerifier:C,redirectUri:t.redirectUrl,resource:new URL(e)});l(),r({tokens:M,clientId:d.client_id??null,clientSecret:"client_secret"in d?d.client_secret:null,tokenEndpoint:y?.token_endpoint??null})}catch(v){l(),c(v)}},m=async i=>{i.origin===window.location.origin&&i.data?.type==="mcp:oauth:callback"&&await k(i.data)},g=async i=>{if(!(i.key!==_||!i.newValue))try{const h=JSON.parse(i.newValue);await k(h)}catch{}};window.addEventListener("message",m),window.addEventListener("storage",g),w=setTimeout(()=>{l(),c(new Error("OAuth authentication timeout"))},E)});if(await $(t,{serverUrl:e})==="REDIRECT"){const r=await o;return{token:r.tokens.access_token,tokenInfo:{accessToken:r.tokens.access_token,refreshToken:r.tokens.refresh_token??null,expiresIn:r.tokens.expires_in??null,scope:r.tokens.scope??null,clientId:r.clientId,clientSecret:r.clientSecret,tokenEndpoint:r.tokenEndpoint},error:null}}const s=t.tokens(),u=t.clientInformation();return{token:s?.access_token||null,tokenInfo:s?{accessToken:s.access_token,refreshToken:s.refresh_token??null,expiresIn:s.expires_in??null,scope:s.scope??null,clientId:u?.client_id??null,clientSecret:u&&"client_secret"in u?u.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{t.cleanup()}}function p(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${I}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function N(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const o=n.get("error"),a=n.get("error_description");let s=t;if(t)try{const r=atob(t),c=JSON.parse(r);c.clientState&&(s=c.clientState)}catch{}if(o){const r=a||o;return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}if(!e||!t){const r="Missing code or state parameter";return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}return t=s||t,p({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}async function H({url:n,token:e}){try{const t=new Headers;t.set("Content-Type","application/json"),t.set("Accept","application/json, text/event-stream");const o=await fetch(n,{method:"POST",headers:t,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})});if(o.ok)return{isAuthenticated:!0,supportsOAuth:!0};let a;try{const r=await o.json();a=r.error||r.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,error:a||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),error:a||`HTTP ${o.status}`}}catch(t){return console.error("[isConnectionAuthenticated] Error:",t),{isAuthenticated:!1,supportsOAuth:!1,error:t.message}}}export{x as a,N as h,H as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as B,c as V,j as a}from"./index-Bz1LU39D.js";import{b as O,T as q,c as J}from"./project-context-provider-_aLYBfO9.js";import{c as M,B as K}from"./input-CtiQUsvV.js";import{s as Q}from"./registry-utils-BIzwINzW.js";import{i as X}from"./Lock01-txD_UwBx.js";import{s as Y}from"./Plus-CovnOzP9.js";import{i as ee}from"./Terminal-DYwA22tz.js";import{C as te}from"./card-XgDm8_H9.js";import{I as se}from"./empty-state-DgOO5bI1.js";import{g as le}from"./github-icon-Dp3wHhYE.js";const U=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";const W=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 10 4.08 10 5.2 10Zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 22 4.08 22 5.2 22Z"}));W.displayName="Server01";function ie(s){if(!s.includes("/"))return s;const e=s.split("/"),l=e[0],i=e[1];if(!l||!i)return s;if(l.includes(".")){const n=l.split("."),r=n[n.length-1]||l,o=i.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!o||o.length<2?r:o}return i}function ae(s){const e=V.c(2),{protocol:l,className:i}=s;let n;return e[0]!==i?(n={http:a.jsx(Q,{className:i}),sse:a.jsx(W,{className:i}),stdio:a.jsx(ee,{className:i})},e[0]=i,e[1]=n):n=e[1],n[l]}function ne(s){switch(s){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function re(s){const e=V.c(9),{protocol:l}=s;let i;e[0]!==l?(i=M("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[l]),e[0]=l,e[1]=i):i=e[1];let n,r;e[2]!==l?(n=a.jsx(ae,{protocol:l,className:"w-3 h-3"}),r=ne(l),e[2]=l,e[3]=n,e[4]=r):(n=e[3],r=e[4]);let o;return e[5]!==i||e[6]!==n||e[7]!==r?(o=a.jsxs("div",{className:i,children:[n,r]}),e[5]=i,e[6]=n,e[7]=r,e[8]=o):o=e[8],o}function oe(s){const e=V.c(68),{icon:l,displayName:i,description:n,onClick:r}=s,t=(s.variant??"store")==="server",f=t?s.hostname:null,m=t?s.protocol:null,c=t?s.isInstalling:!1,d=t?s.actionLabel:void 0,p=t?null:s.scopeName,_=t?!1:s.isVerified,x=t?!0:s.canInstall,H=t?"p-4":"p-6";let u;e[0]!==H?(u=M("cursor-pointer hover:bg-muted/50 transition-colors",H),e[0]=H,e[1]=u):u=e[1];const R=t?"gap-3":"gap-4";let h;e[2]!==R?(h=M("flex flex-col h-full relative",R),e[2]=R,e[3]=h):h=e[3];const Z=t?"sm":"md";let g;e[4]!==i||e[5]!==l||e[6]!==Z?(g=a.jsx(se,{icon:l,name:i,size:Z,className:"shadow-sm shrink-0"}),e[4]=i,e[5]=l,e[6]=Z,e[7]=g):g=e[7];const G=t?"text-sm":"text-base";let v;e[8]!==G?(v=M("flex items-center gap-2 font-medium min-w-0",G),e[8]=G,e[9]=v):v=e[9];let j;e[10]!==i?(j=a.jsx("span",{className:"truncate",children:i}),e[10]=i,e[11]=j):j=e[11];let N;e[12]!==t||e[13]!==_?(N=!t&&_&&a.jsx(U,{size:16,className:"text-success shrink-0"}),e[12]=t,e[13]=_,e[14]=N):N=e[14];let C;e[15]!==x||e[16]!==t?(C=!t&&!x&&a.jsx(X,{size:16,className:"text-muted-foreground shrink-0"}),e[15]=x,e[16]=t,e[17]=C):C=e[17];let k;e[18]!==t||e[19]!==m?(k=t&&m&&a.jsx(re,{protocol:m}),e[18]=t,e[19]=m,e[20]=k):k=e[20];let b;e[21]!==C||e[22]!==k||e[23]!==v||e[24]!==j||e[25]!==N?(b=a.jsx(O,{asChild:!0,children:a.jsxs("div",{className:v,children:[j,N,C,k]})}),e[21]=C,e[22]=k,e[23]=v,e[24]=j,e[25]=N,e[26]=b):b=e[26];let w;e[27]!==i?(w=a.jsx("p",{children:i}),e[27]=i,e[28]=w):w=e[28];let y;e[29]!==x||e[30]!==t?(y=!t&&!x&&a.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[29]=x,e[30]=t,e[31]=y):y=e[31];let I;e[32]!==w||e[33]!==y?(I=a.jsxs(q,{children:[w,y]}),e[32]=w,e[33]=y,e[34]=I):I=e[34];let $;e[35]!==b||e[36]!==I?($=a.jsxs(J,{children:[b,I]}),e[35]=b,e[36]=I,e[37]=$):$=e[37];let L;e[38]!==f||e[39]!==t||e[40]!==p?(L=(p||f)&&a.jsx("div",{className:M("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:p||f}),e[38]=f,e[39]=t,e[40]=p,e[41]=L):L=e[41];let P;e[42]!==$||e[43]!==L?(P=a.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[$,L]})}),e[42]=$,e[43]=L,e[44]=P):P=e[44];let S;e[45]!==P||e[46]!==g?(S=a.jsxs("div",{className:"flex gap-3",children:[g,P]}),e[45]=P,e[46]=g,e[47]=S):S=e[47];let T;e[48]!==n?(T=n&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:n}),e[48]=n,e[49]=T):T=e[49];let E;e[50]!==n||e[51]!==t?(E=!n&&!t&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[50]=n,e[51]=t,e[52]=E):E=e[52];let z;e[53]!==d||e[54]!==c||e[55]!==t||e[56]!==r?(z=t&&a.jsxs(K,{variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),r()},disabled:c,className:"w-full mt-auto cursor-pointer",children:[a.jsx(Y,{size:16}),c?"Connecting...":d||"Connect"]}),e[53]=d,e[54]=c,e[55]=t,e[56]=r,e[57]=z):z=e[57];let D;e[58]!==S||e[59]!==T||e[60]!==E||e[61]!==z||e[62]!==h?(D=a.jsxs("div",{className:h,children:[S,T,E,z]}),e[58]=S,e[59]=T,e[60]=E,e[61]=z,e[62]=h,e[63]=D):D=e[63];let A;return e[64]!==r||e[65]!==u||e[66]!==D?(A=a.jsx(te,{className:u,onClick:r,children:D}),e[64]=r,e[65]=u,e[66]=D,e[67]=A):A=e[67],A}function ce(s){const e=s.title||s.server.title||s.id||"Unnamed Item",l=s._meta?.["mcp.mesh"],i=l?.short_description||l?.mesh_description||s.server.description||null,n=s.server.icons?.[0]?.src||le(s.server.repository)||null,r=l?.verified??!1,o=(s.server.remotes?.length??0)>0,t=(s.server.packages?.length??0)>0,f=o||t;let m=e,c=null;if(e.includes("/")){const d=e.split("/");d.length>=2&&(c=d[0]||null,m=ie(e))}if(!c){const d=l?.scopeName,p=l?.appName;d&&p?c=`${d}/${p}`:d&&(c=d)}return l?.friendly_name&&(m=l.friendly_name),{icon:n,scopeName:c,displayName:m,description:i,isVerified:r,canInstall:f}}function Ne(s){const e=V.c(12),{items:l,title:i,onItemClick:n}=s;if(l.length===0)return null;let r;e[0]!==i?(r=i&&a.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:a.jsx("h2",{className:"text-lg font-medium",children:i})}),e[0]=i,e[1]=r):r=e[1];let o;if(e[2]!==l||e[3]!==n){let m;e[5]!==n?(m=c=>{const d=ce(c);return a.jsx(oe,{...d,onClick:()=>n(c)},c.id)},e[5]=n,e[6]=m):m=e[6],o=l.map(m),e[2]=l,e[3]=n,e[4]=o}else o=e[4];let t;e[7]!==o?(t=a.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=t):t=e[8];let f;return e[9]!==r||e[10]!==t?(f=a.jsxs("div",{className:"flex flex-col gap-4",children:[r,t]}),e[9]=r,e[10]=t,e[11]=f):f=e[11],f}export{Ne as M,oe as a,W as b,ie as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as z,c as E,j as s,f as $e,d as Qe,b as Xe,a as Ye,t as Le}from"./index-Bz1LU39D.js";import{i as Je}from"./AlertCircle-CtP28Oyz.js";import{i as De}from"./Loading01-CdaWSExX.js";import{B as ae}from"./input-CtiQUsvV.js";import{i as et}from"./ArrowLeft-Bps-R0_t.js";import{I as Ee,E as tt,c as st}from"./empty-state-DgOO5bI1.js";import{t as ot}from"./ChevronDown-mvTJP4-S.js";import{s as Pe}from"./Plus-CovnOzP9.js";import{D as rt,c as nt,a as it,b as lt}from"./dropdown-menu-DjFWyTtD.js";import{n as Me}from"./LinkExternal01-By7zx70s.js";import{T as at,R as ct}from"./tools-list-C2S7XIkI.js";import{R as dt}from"./resource-tabs-GXDudjH9.js";import{s as mt,f as ft,g as ut,c as pt}from"./registry-utils-BIzwINzW.js";import{a as xt,b as ht,e as gt}from"./mcp-server-card-BawKO-ZK.js";import{i as vt}from"./Terminal-DYwA22tz.js";import{a as bt,u as jt,c as yt}from"./use-connection-BXdeHsm0.js";import{a as Nt}from"./use-binding-UNVemCFv.js";import{u as St}from"./use-tool-call-BLplGau6.js";import{u as Ct}from"./use-mcp-kCjFuvFP.js";import{u as wt,L as _t}from"./localstorage-keys-5oG1CfEQ.js";import{u as Re}from"./project-context-provider-_aLYBfO9.js";import{e as It}from"./extract-connection-data-DMhfaAiL.js";import{s as kt}from"./slugify-CEUa2lfQ.js";import{e as Tt,g as Lt}from"./github-icon-Dp3wHhYE.js";import{i as Pt}from"./InfoCircle-BXctEVkS.js";import"./Grid01-BEpepbVy.js";import"./File06-nV81V8TD.js";import"./collection-display-button-DroTLKfu.js";import"./Check-Bkw0Gz-n.js";import"./view-mode-toggle-CVcyaB_S.js";import"./collection-search-DIEJ7x7R.js";import"./SearchMd-YxKkBPG0.js";import"./collection-table-wrapper-x8zydyA0.js";import"./card-XgDm8_H9.js";import"./layout-C8G6tSLB.js";import"./badge-8BCP2QJ_.js";import"./Lock01-txD_UwBx.js";import"./auth-CNkA6dk2.js";import"./constants-8DEiLmV-.js";import"./generate-id-Dyweu44Y.js";const Ae=({size:t=24,color:e="currentColor",...o})=>z.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},z.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Ae.displayName="CheckCircle";const Ue=({size:t=24,color:e="currentColor",...o})=>z.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},z.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));Ue.displayName="SearchLg";function Mt(t){const e=E.c(3),{message:o}=t,r=o===void 0?"Loading MCP Server details...":o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function Vt(t){const e=E.c(9),{error:o,onBack:r}=t,n=o instanceof Error?o.message:o;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Je,{size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==n?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==r?(l=s.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=r,e[5]=l):l=e[5];let d;return e[6]!==c||e[7]!==l?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=d):d=e[8],d}function $t(t){const e=E.c(5),{onBack:o}=t;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ue,{size:48,className:"text-muted-foreground mb-4"}),n=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let a;return e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=a):a=e[4],a}function Dt(t){const e=E.c(3),{onBack:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(et,{}),e[0]=r):r=e[0];let n;return e[1]!==o?(n=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ae,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:r})})}),e[1]=o,e[2]=n):n=e[2],n}function Ve(t){const e=E.c(26),{versions:o,selectedIndex:r,onSelect:n,isInstalling:i,variant:a,showLabel:c}=t,l=i===void 0?!1:i,d=a===void 0?"brand":a,w=c===void 0?!1:c,u=o[r],S=w?"sm":"default",v=d==="brand"?"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer":"shrink-0 cursor-pointer";let _;e[0]!==u?.server?.version||e[1]!==w?(_=w&&s.jsxs("span",{className:"mr-1",children:["v",u?.server?.version||"unknown"]}),e[0]=u?.server?.version,e[1]=w,e[2]=_):_=e[2];const p=w?14:20;let b;e[3]!==p?(b=s.jsx(ot,{size:p}),e[3]=p,e[4]=b):b=e[4];let m;e[5]!==l||e[6]!==S||e[7]!==v||e[8]!==_||e[9]!==b||e[10]!==d?(m=s.jsx(rt,{asChild:!0,children:s.jsxs(ae,{variant:d,disabled:l,size:S,className:v,children:[_,b]})}),e[5]=l,e[6]=S,e[7]=v,e[8]=_,e[9]=b,e[10]=d,e[11]=m):m=e[11];let g;if(e[12]!==l||e[13]!==n||e[14]!==r||e[15]!==o){let y;e[17]!==l||e[18]!==n||e[19]!==r?(y=(j,N)=>{const I=j._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(nt,{onClick:()=>n(N),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",j.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),N===r&&s.jsx(Ae,{size:16,className:"text-muted-foreground shrink-0"})]})},N)},e[17]=l,e[18]=n,e[19]=r,e[20]=y):y=e[20],g=o.map(y),e[12]=l,e[13]=n,e[14]=r,e[15]=o,e[16]=g}else g=e[16];let x;e[21]!==g?(x=s.jsx(it,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:g}),e[21]=g,e[22]=x):x=e[22];let T;return e[23]!==x||e[24]!==m?(T=s.jsxs(lt,{children:[m,x]}),e[23]=x,e[24]=m,e[25]=T):T=e[25],T}function Et(t){const e=E.c(46),{data:o,itemVersions:r,onInstall:n,canInstall:i,isInstalling:a,hideInstallControls:c,selectedVersionIndex:l,onVersionChange:d}=t,w=i===void 0?!0:i,u=a===void 0?!1:a,S=c===void 0?!1:c,[v,_]=z.useState(0),p=l??v;let b;e[0]!==d?(b=U=>{_(U),d?.(U)},e[0]=d,e[1]=b):b=e[1];const m=b,g=r[p]||r[0];let x;e[2]!==g?.server?.remotes?(x=g?.server?.remotes??[],e[2]=g?.server?.remotes,e[3]=x):x=e[3];const T=x;let y;e[4]!==g?.server?.packages?(y=g?.server?.packages??[],e[4]=g?.server?.packages,e[5]=y):y=e[5];const N=y.length>0,I=T.length>0,M=T.findIndex(At),h=M>=0?M:0;let K;e[6]!==h||e[7]!==N||e[8]!==I||e[9]!==n||e[10]!==p?(K=()=>{I?n(p,h,void 0):N&&n(p,void 0,0)},e[6]=h,e[7]=N,e[8]=I,e[9]=n,e[10]=p,e[11]=K):K=e[11];const R=K;let H;e[12]!==r||e[13]!==n||e[14]!==m?(H=U=>{m(U);const J=r[U],q=J?.server?.remotes??[],Z=J?.server?.packages??[];if(q.length>0){const Q=q.findIndex(Rt);n(U,Q>=0?Q:0,void 0)}else Z.length>0&&n(U,void 0,0)},e[12]=r,e[13]=n,e[14]=m,e[15]=H):H=e[15];const L=H;let V;e[16]!==o.icon||e[17]!==o.name?(V=s.jsx(Ee,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=o.icon,e[17]=o.name,e[18]=V):V=e[18];let P;e[19]!==o.name?(P=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[19]=o.name,e[20]=P):P=e[20];let O;e[21]!==o.verified?(O=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=o.verified,e[22]=O):O=e[22];let F;e[23]!==P||e[24]!==O?(F=s.jsxs("div",{className:"flex items-center gap-2",children:[P,O]}),e[23]=P,e[24]=O,e[25]=F):F=e[25];let W;e[26]!==o.shortDescription?(W=o.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.shortDescription}),e[26]=o.shortDescription,e[27]=W):W=e[27];let $;e[28]!==F||e[29]!==W?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[F,W]}),e[28]=F,e[29]=W,e[30]=$):$=e[30];let A;e[31]!==w||e[32]!==R||e[33]!==L||e[34]!==S||e[35]!==u||e[36]!==r||e[37]!==p||e[38]!==m?(A=w&&!S?s.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ae,{variant:"brand",onClick:R,disabled:u,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(Pe,{size:20}),u?"Connecting...":"Connect"]}),s.jsx(Ve,{versions:r,selectedIndex:p,onSelect:L,isInstalling:u,variant:"brand"})]}):s.jsxs(ae,{variant:"brand",onClick:R,disabled:r.length===0||u,className:"shrink-0 cursor-pointer",children:[s.jsx(Pe,{size:20}),u?"Connecting...":"Connect"]})}):S?r.length>1?s.jsx("div",{className:"shrink-0",children:s.jsx(Ve,{versions:r,selectedIndex:p,onSelect:m,isInstalling:u,variant:"outline",showLabel:!0})}):null:s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=w,e[32]=R,e[33]=L,e[34]=S,e[35]=u,e[36]=r,e[37]=p,e[38]=m,e[39]=A):A=e[39];let C;e[40]!==$||e[41]!==A?(C=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[$,A]}),e[40]=$,e[41]=A,e[42]=C):C=e[42];let k;return e[43]!==C||e[44]!==V?(k=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[V,C]}),e[43]=C,e[44]=V,e[45]=k):k=e[45],k}function Rt(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function At(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Ut(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Bt(t){const e=E.c(47),{data:o,publisherInfo:r,selectedItem:n}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const a=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let c;e[2]!==r.logo||e[3]!==a?(c=s.jsx(Ee,{icon:r.logo,name:a,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=a,e[4]=c):c=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let d;e[7]!==l?(d=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=d):d=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=w):w=e[9];let u;e[10]!==d?(u=s.jsxs("div",{children:[d,w]}),e[10]=d,e[11]=u):u=e[11];let S;e[12]!==c||e[13]!==u?(S=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,u]})}),e[12]=c,e[13]=u,e[14]=S):S=e[14];let v;e[15]!==o.version?(v=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[15]=o.version,e[16]=v):v=e[16];let _;e[17]!==o.tags?(_=o.tags&&o.tags.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.tags.map(Ot)})]}),e[17]=o.tags,e[18]=_):_=e[18];let p;e[19]!==o.categories?(p=o.categories&&o.categories.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.categories.map(zt)})]}),e[19]=o.categories,e[20]=p):p=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let m;e[23]!==o.schemaVersion?(m=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=m):m=e[24];let g;e[25]!==o.websiteUrl?(g=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(Me,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=g):g=e[26];let x;e[27]!==o.repository?(x=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(Me,{size:14})]})]}),e[27]=o.repository,e[28]=x):x=e[28];let T;e[29]!==_||e[30]!==p||e[31]!==b||e[32]!==m||e[33]!==g||e[34]!==x||e[35]!==v?(T=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[v,_,p,b,m,g,x]}),e[29]=_,e[30]=p,e[31]=b,e[32]=m,e[33]=g,e[34]=x,e[35]=v,e[36]=T):T=e[36];let y;e[37]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=y):y=e[37];let j;e[38]!==n.updated_at?(j=Ut(n.updated_at),e[38]=n.updated_at,e[39]=j):j=e[39];let N;e[40]!==j?(N=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[y,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[40]=j,e[41]=N):N=e[41];let I;return e[42]!==i||e[43]!==T||e[44]!==N||e[45]!==S?(I=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,S,T,N]}),e[42]=i,e[43]=T,e[44]=N,e[45]=S,e[46]=I):I=e[46],I}function zt(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function Ot(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}const Ft=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Gt={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Ht(t){if(!t)return"Local";try{return new URL(t).hostname}catch{return t}}function Wt(t){if(!t)return"local";try{const e=new URL(t).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function qt(t){const e=Gt[t.toLowerCase()];return e||t.replace(/[-_]/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function Kt(t){if(!t)return"http";const e=t.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Zt(t){return t.map((e,o)=>{const r=Kt(e.type),n=Ht(e.url),i=Wt(e.url),a=e.title||e.name||qt(i);return{index:o,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:a,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Qt(t){const e=E.c(2),{protocol:o,className:r}=t;let n;return e[0]!==r?(n={http:s.jsx(mt,{className:r}),sse:s.jsx(ht,{className:r}),stdio:s.jsx(vt,{className:r})},e[0]=r,e[1]=n):n=e[1],n[o]}function Xt(t){const e=E.c(10),{options:o,selected:r,onSelect:n}=t;if(o.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let a;if(e[1]!==n||e[2]!==o||e[3]!==r){let l;e[5]!==n||e[6]!==r?(l=d=>s.jsxs(ae,{variant:r===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[s.jsx(Qt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=r,e[7]=l):l=e[7],a=o.map(l),e[1]=n,e[2]=o,e[3]=r,e[4]=a}else a=e[4];let c;return e[8]!==a?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,s.jsx("div",{className:"flex gap-1",children:a})]}),e[8]=a,e[9]=c):c=e[9],c}function Yt(t){const e=E.c(11),{servers:o,onInstall:r,isInstalling:n,icon:i,mcpName:a,showStdio:c}=t,l=n===void 0?!1:n,d=c===void 0?!1:c,w=d?o:o.filter(ss),u=Zt(w),S=u.length<13?"all":"http",[v,_]=z.useState(S);let p;e:{if(v==="all"){p="all";break e}let h;if(e[0]!==v?(h=R=>R.protocol===v,e[0]=v,e[1]=h):h=e[1],u.some(h)){p=v;break e}if(u.length<13){p="all";break e}p=u[0]?.protocol??"http"}const b=p,m=b==="all"?u:u.filter(h=>h.protocol===b),g=new Set(u.map(ts));let x=Ft.filter(h=>h.value==="all"||g.has(h.value));d||(x=x.filter(es));const T=g.size<=1?x.filter(Jt):x,y="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let j;e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==r?(j=h=>s.jsx(xt,{variant:"server",icon:i??null,displayName:h.displayName,description:h.description??null,hostname:h.hostname,protocol:h.protocol,isInstalling:l,onClick:()=>r({type:h.protocol,url:h.url,name:h.name,title:h.title,description:h.description,_type:h._type,_index:h._index})},`${h.hostname}-${h.protocol}-${h.index}`),e[2]=i,e[3]=l,e[4]=a,e[5]=r,e[6]=j):j=e[6];const N=m.map(j);let I;e[7]!==N?(I=s.jsx("div",{className:y,children:N}),e[7]=N,e[8]=I):I=e[8];let M;return e[9]!==m.length?(M=m.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=m.length,e[10]=M):M=e[10],s.jsxs("div",{className:"p-5",children:[s.jsx(Xt,{options:T,selected:b,onSelect:_}),I,M]})}function Jt(t){return t.value!=="all"}function es(t){return t.value!=="stdio"}function ts(t){return t.protocol}function ss(t){return t.type?.toLowerCase()!=="stdio"}function os(t){const e=E.c(29),{data:o,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:a,onTabChange:c,servers:l,onInstallServer:d,isInstalling:w,mcpIcon:u,mcpName:S,showStdio:v}=t,_=a===void 0?!1:a;let p;e[0]!==l?(p=l===void 0?[]:l,e[0]=l,e[1]=p):p=e[1];const b=p,m=w===void 0?!1:w,g=v===void 0?!1:v;let x;e[2]!==i?(x=i.map(rs),e[2]=i,e[3]=x):x=e[3];const T=x;let y;e[4]!==r||e[5]!==n||e[6]!==c?(y=r.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(dt,{tabs:r,activeTab:n,onTabChange:c})}),e[4]=r,e[5]=n,e[6]=c,e[7]=y):y=e[7];let j;e[8]!==n||e[9]!==m||e[10]!==u||e[11]!==S||e[12]!==d||e[13]!==b||e[14]!==g?(j=n==="servers"&&b.length>0&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Yt,{servers:b,onInstall:h=>d?.(h),isInstalling:m,icon:u,mcpName:S,showStdio:g})}),e[8]=n,e[9]=m,e[10]=u,e[11]=S,e[12]=d,e[13]=b,e[14]=g,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==i.length||e[18]!==_||e[19]!==T?(N=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:_?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(De,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(at,{tools:T,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(tt,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=_,e[19]=T,e[20]=N):N=e[20];let I;e[21]!==o?.repository||e[22]!==n?(I=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(ct,{repository:o?.repository})}),e[21]=o?.repository,e[22]=n,e[23]=I):I=e[23];let M;return e[24]!==I||e[25]!==y||e[26]!==j||e[27]!==N?(M=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[y,j,N,I]}),e[24]=I,e[25]=y,e[26]=j,e[27]=N,e[28]=M):M=e[28],M}function rs(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ns(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(r=>r.app_name?.toLowerCase()===o||r.app_id?.toLowerCase()===o||r.title.toLowerCase()===o)||t.find(r=>r.title.toLowerCase().includes(o))}function is(t,e,o,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),a=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function ls(t){const e=t._meta?.["mcp.mesh"],o=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,n=ut(r.remotes?.[0]?.type),i=pt(r.$schema),a=o?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",c=Lt(r.repository),l=t.icon||t.image||t.logo||r.icons?.[0]?.src||c||null,d=t.name||t.title||t.server?.title||"Unnamed Item",w=gt(d),u=e?.friendly_name||w,S=e?.mesh_description||t.description||t.summary||r?.description||"",v=e?.short_description||null,_=e?.tags||[],p=e?.categories||[];return{name:u,description:S,shortDescription:v,icon:l,verified:t.verified||e?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:_,categories:p,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class as extends z.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store MCP server detail error:",e,o)}render(){return this.state.hasError?s.jsx(Vt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function cs(){const t=E.c(67),{org:e}=Re(),o=$e();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{appName:n}=Qe(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c,stdio:l}=Xe(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=_t.storeShowStdio(),t[2]=d):d=t[2];const[w,u]=wt(d,js),S=l==="true"?!0:l==="false"?!1:w;l!==void 0&&l==="true"!==w&&u(l==="true");const[v,_]=z.useState(null),[p,b]=z.useState(null),m=bt(),g=jt(),{data:x}=Ye.useSession(),T=Nt(g),y=a||T[0]?.id||"",j=yt(y),N=ft(j?.tools),I=j?.tools&&j.tools.find(bs)?.name||"",M=j?.tools&&j.tools.find(vs)?.name||"",h=st(y),K=!!c;let R,H;K?(R=I||M,H={name:c}):(R=N,H={});const{data:L}=St({toolCaller:h,toolName:R,toolInputParams:H,scope:y});let V=[],P=[],O=null;if(L){if(Array.isArray(L))V=L;else if(typeof L=="object"&&L!==null)if("totalCount"in L&&typeof L.totalCount=="number"&&(O=L.totalCount),"item"in L&&L.item){const f=L.item,D=f.id||"",Y=f.server,le=f._meta;let B;t[3]!==f.title||t[4]!==D||t[5]!==Y||t[6]!==le?(B=[{id:D,title:f.title,server:Y,_meta:le}],t[3]=f.title,t[4]=D,t[5]=Y,t[6]=le,t[7]=B):B=t[7],V=B}else{let f;"versions"in L&&Array.isArray(L.versions)?f="versions":"servers"in L&&Array.isArray(L.servers)?f="servers":f=Object.keys(L).find(D=>Array.isArray(L[D])),f&&(V=L[f],(f==="versions"||R?.includes("VERSIONS"))&&(P=V))}}const F=P.findIndex(gs),W=F>=0?F:0,$=p??W;let A;t[8]!==n?(A=f=>{const D=f.name||f.title||f.server.title||"";return kt(D)===n},t[8]=n,t[9]=A):A=t[9];let C=V.find(A);if(!C&&c){let f;t[10]!==c?(f=D=>D.server.name===c||D.name===c||D.title===c,t[10]=c,t[11]=f):f=t[11],C=V.find(f)}const k=C?ls(C):null,U=(k?.tools?.length||0)>0,J=C?.server?.remotes?.[0]?.url||null,q=!U&&!!J,Z=Ct({url:q?J:""}),ye=q&&Z.state==="connecting";let Q;t[12]!==Z||t[13]!==q?(Q=q&&Z.state==="ready"?(Z.tools||[]).map(hs):[],t[12]=Z,t[13]=q,t[14]=Q):Q=t[14];const Te=Q,ce=U?k?.tools||[]:Te,Be=ns(g,k?.publisher),Ne=k?is(V,k.publisher,Be,j??null,O):{count:0},ze=k?.repository?Tt(k.repository):null,Oe=C?.server?.remotes??[],Fe=C?.server?.packages??[],Se=[...Oe.map(xs),...Fe.map(ps)],de=S?Se:Se.filter(us),ee=de.length>1;let te;t[15]!==ee||t[16]!==de.length?(te={id:"servers",label:"Servers",count:de.length,visible:ee},t[15]=ee,t[16]=de.length,t[17]=te):te=t[17];const Ce=!!k?.repository&&!!ze;let se;t[18]!==Ce?(se={id:"readme",label:"README",visible:Ce},t[18]=Ce,t[19]=se):se=t[19];const we=U||Te.length>0||ye&&!!J;let oe;t[20]!==ce.length||t[21]!==we?(oe={id:"tools",label:"Tools",count:ce.length,visible:we},t[20]=ce.length,t[21]=we,t[22]=oe):oe=t[22];let me;t[23]!==te||t[24]!==se||t[25]!==oe?(me=[te,se,oe].filter(fs),t[23]=te,t[24]=se,t[25]=oe,t[26]=me):me=t[26];const G=me;let fe;t[27]!==G?(fe=G.find(ms)?.id||G.find(ds)?.id||G[0]?.id||"overview",t[27]=G,t[28]=fe):fe=t[28];const _e=fe;let ue;t[29]!==v||t[30]!==G||t[31]!==_e?(ue=v&&G.find(f=>f.id===v)?v:_e,t[29]=v,t[30]=G,t[31]=_e,t[32]=ue):ue=t[32];const Ge=ue;let pe;t[33]!==m||t[34]!==P||t[35]!==o||t[36]!==e||t[37]!==C||t[38]!==x?(pe=async(f,D,Y)=>{const le=P[f??0]||C;if(!le||!e||!x?.user?.id)return;const B=It(le,e.id,x.user.id,{remoteIndex:Y===void 0?D??0:void 0,packageIndex:Y}),qe=B.connection_type==="STDIO",Ke=!!B.connection_url,Ze=qe&&B.connection_headers&&typeof B.connection_headers=="object"&&"command"in B.connection_headers;if(!Ke&&!Ze){Le.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Ie}=await m.create.mutateAsync(B);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:Ie}})}catch(Ie){const ke=Ie;Le.error(`Failed to connect MCP Server: ${ke instanceof Error?ke.message:String(ke)}`)}},t[33]=m,t[34]=P,t[35]=o,t[36]=e,t[37]=C,t[38]=x,t[39]=pe):pe=t[39];const X=pe;let xe;t[40]!==o||t[41]!==e.slug?(xe=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[40]=o,t[41]=e.slug,t[42]=xe):xe=t[42];const re=xe;if(!C){let f;return t[43]!==re?(f=s.jsx($t,{onBack:re}),t[43]=re,t[44]=f):f=t[44],f}if(!k)return null;const He=(C?.server?.remotes?.length??0)>0,We=(C?.server?.packages?.length??0)>0,ne=He||We;let he;t[45]!==re?(he=s.jsx(Dt,{onBack:re}),t[45]=re,t[46]=he):he=t[46];let ge;t[47]!==ne?(ge=!ne&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(Pt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[47]=ne,t[48]=ge):ge=t[48];let ie;t[49]!==P||t[50]!==C?(ie=P.length>0?P:[C],t[49]=P,t[50]=C,t[51]=ie):ie=t[51];let ve;t[52]!==m.create.isPending||t[53]!==ne||t[54]!==k||t[55]!==$||t[56]!==X||t[57]!==ee||t[58]!==ie?(ve=s.jsx(Et,{data:k,itemVersions:ie,onInstall:X,canInstall:ne,isInstalling:m.create.isPending,hideInstallControls:ee,selectedVersionIndex:$,onVersionChange:b}),t[52]=m.create.isPending,t[53]=ne,t[54]=k,t[55]=$,t[56]=X,t[57]=ee,t[58]=ie,t[59]=ve):ve=t[59];let be;t[60]!==k||t[61]!==Ne||t[62]!==C?(be=s.jsx(Bt,{data:k,publisherInfo:Ne,selectedItem:C}),t[60]=k,t[61]=Ne,t[62]=C,t[63]=be):be=t[63];let je;return t[64]!==$||t[65]!==X?(je=f=>{f._type==="remote"?X($,f._index,void 0):X($,void 0,f._index)},t[64]=$,t[65]=X,t[66]=je):je=t[66],s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[he,s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[ge,ve,s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[be,s.jsx(os,{data:k,availableTabs:G,effectiveActiveTabId:Ge,effectiveTools:ce,isLoadingTools:ye,onTabChange:_,servers:Se,onInstallServer:je,isInstalling:m.create.isPending,mcpIcon:k.icon,mcpName:k.name,showStdio:S})]})]})})})]})}function ds(t){return t.id==="readme"}function ms(t){return t.id==="servers"}function fs(t){return t.visible}function us(t){return t.type?.toLowerCase()!=="stdio"}function ps(t,e){return{type:"stdio",url:void 0,name:t.name||t.identifier,title:t.name||t.identifier?.replace(/^@[^/]+\//,""),description:t.environmentVariables?.length?`Requires ${t.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:e}}function xs(t,e){return{...t,_type:"remote",_index:e}}function hs(t){return{name:t.name,description:t.description}}function gs(t){return t._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0}function vs(t){return t.name.endsWith("_GET")}function bs(t){return t.name.endsWith("_VERSIONS")}function js(){return!1}function lo(){const t=E.c(6),{org:e}=Re(),o=$e();let r;t[0]!==o||t[1]!==e.slug?(r=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=r):r=t[2];const n=r;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(z.Suspense,{fallback:s.jsx(Mt,{}),children:s.jsx(cs,{})}),t[3]=i):i=t[3];let a;return t[4]!==n?(a=s.jsx(as,{onBack:n,children:i}),t[4]=n,t[5]=a):a=t[5],a}export{lo as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as G,K as oe,a as X,v as fs,V as He,U as Ms,Q as zs,w as ue,s as qe,y as Es,x as ks,t as J,j as t,c as de,p as Ds}from"./index-Bz1LU39D.js";import{C as Bs}from"./collection-header-CUphFaJM.js";import{C as es}from"./collection-page-C8c74lBQ.js";import{C as Ze}from"./collection-search-DIEJ7x7R.js";import{C as Us}from"./collection-table-wrapper-x8zydyA0.js";import{T as Gs}from"./tool-set-selector-Dfdgsx2h.js";import{b as Ss,u as Vs}from"./use-connection-BXdeHsm0.js";import{u as os}from"./use-members-9nvpFN_1.js";import{W as $s}from"./well-known-mcp-D13f-8h2.js";import{u as Ce,a as Ne,c as ye,b as Ee,T as Se}from"./project-context-provider-_aLYBfO9.js";import{A as je}from"./avatar-KT16fAYd.js";import{B as Ie}from"./badge-8BCP2QJ_.js";import{u as fe,c as re,B as ee,I as Fs}from"./input-CtiQUsvV.js";import{C as Ks}from"./checkbox-B9Ss6ffk.js";import{f as we,a as Te,b as Ae,c as Oe,d as Re,e as _e,A as Pe,g as Le}from"./alert-dialog-B2ogXLEp.js";import{d as Is,e as ws,c as Ts,a as Qs,D as qs,f as Zs}from"./dialog-D9LHhl79.js";import{b as as,D as cs,a as ds,c as Ke,e as Ys,f as Ws,g as Hs,d as Js}from"./dropdown-menu-DjFWyTtD.js";import{i as Xs}from"./DotsHorizontal-MMZ1EZhB.js";import{i as As}from"./Loading01-CdaWSExX.js";import{i as et}from"./Lock01-txD_UwBx.js";import{s as ss}from"./Plus-CovnOzP9.js";import{s as Os}from"./Trash01-DopdNXEu.js";import{i as hs}from"./X-DcqsnRSe.js";import{S as Ge}from"./switch-zovYrKoi.js";import{c as st,E as Je}from"./empty-state-DgOO5bI1.js";import{E as tt}from"./error-boundary-uBvOVTCE.js";import{a as nt,F as gs,b as xs,c as rt,d as ps,f as bs}from"./form-orY-xngM.js";import{S as ts,a as ns,b as rs,c as is,d as ls}from"./select-Bxj6_TSM.js";import{T as it}from"./textarea-D76YOeHc.js";import{C as js}from"./card-XgDm8_H9.js";import{i as Rs}from"./DotsVertical-CzCtj25W.js";import{i as lt}from"./Key01-ChIWeKNh.js";import{s as ot}from"./XClose-D0utLGU3.js";import"./collection-display-button-DroTLKfu.js";import"./Grid01-BEpepbVy.js";import"./Check-Bkw0Gz-n.js";import"./view-mode-toggle-CVcyaB_S.js";import"./SearchMd-YxKkBPG0.js";import"./ArrowLeft-Bps-R0_t.js";import"./ChevronDown-mvTJP4-S.js";const ms=({size:s=24,color:e="currentColor",...n})=>G.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},G.createElement("path",{d:"M11.302 21.615c.221.129.332.194.488.227.122.026.298.026.42 0 .156-.034.267-.098.488-.227C14.646 20.478 20 16.908 20 12V7.217c0-.799 0-1.199-.13-1.542a2 2 0 0 0-.548-.79c-.275-.243-.65-.383-1.398-.664l-5.362-2.01c-.208-.078-.312-.117-.419-.133a1 1 0 0 0-.286 0c-.107.016-.21.055-.419.133L6.076 4.22c-.748.28-1.122.421-1.398.664a2 2 0 0 0-.547.79C4 6.018 4 6.418 4 7.217V12c0 4.908 5.354 8.478 7.302 9.615Z"}));ms.displayName="Shield01";const _s=({size:s=24,color:e="currentColor",...n})=>G.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},G.createElement("path",{d:"M20 17H4m0 0 4-4m-4 4 4 4M4 7h16m0 0-4-4m4 4-4 4"}));_s.displayName="SwitchHorizontal01";const Ps=[{name:"ORGANIZATION_CREATE",description:"Create a new organization",category:"Organizations"},{name:"ORGANIZATION_LIST",description:"List organizations",category:"Organizations"},{name:"ORGANIZATION_GET",description:"View organization details",category:"Organizations"},{name:"ORGANIZATION_UPDATE",description:"Update organization",category:"Organizations"},{name:"ORGANIZATION_DELETE",description:"Delete organization",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_SETTINGS_GET",description:"View organization settings",category:"Organizations"},{name:"ORGANIZATION_SETTINGS_UPDATE",description:"Update organization settings",category:"Organizations"},{name:"ORGANIZATION_MEMBER_ADD",description:"Add members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_REMOVE",description:"Remove members",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_MEMBER_LIST",description:"List members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_UPDATE_ROLE",description:"Update member roles",category:"Organizations"},{name:"COLLECTION_CONNECTIONS_CREATE",description:"Create connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_LIST",description:"List connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_GET",description:"View connection details",category:"Connections"},{name:"COLLECTION_CONNECTIONS_UPDATE",description:"Update connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_DELETE",description:"Delete connections",category:"Connections",dangerous:!0},{name:"CONNECTION_TEST",description:"Test connections",category:"Connections"},{name:"DATABASES_RUN_SQL",description:"Run SQL queries",category:"Connections",dangerous:!0},{name:"COLLECTION_GATEWAY_CREATE",description:"Create gateways",category:"Gateways"},{name:"COLLECTION_GATEWAY_LIST",description:"List gateways",category:"Gateways"},{name:"COLLECTION_GATEWAY_GET",description:"View gateway details",category:"Gateways"},{name:"COLLECTION_GATEWAY_UPDATE",description:"Update gateways",category:"Gateways"},{name:"COLLECTION_GATEWAY_DELETE",description:"Delete gateways",category:"Gateways",dangerous:!0},{name:"MONITORING_LOGS_LIST",description:"List monitoring logs",category:"Monitoring"},{name:"MONITORING_STATS",description:"View monitoring statistics",category:"Monitoring"},{name:"API_KEY_CREATE",description:"Create API key",category:"API Keys"},{name:"API_KEY_LIST",description:"List API keys",category:"API Keys"},{name:"API_KEY_UPDATE",description:"Update API key",category:"API Keys"},{name:"API_KEY_DELETE",description:"Delete API key",category:"API Keys",dangerous:!0},{name:"EVENT_PUBLISH",description:"Publish events",category:"Event Bus"},{name:"EVENT_SUBSCRIBE",description:"Subscribe to events",category:"Event Bus"},{name:"EVENT_UNSUBSCRIBE",description:"Unsubscribe from events",category:"Event Bus"},{name:"EVENT_CANCEL",description:"Cancel recurring events",category:"Event Bus"},{name:"EVENT_ACK",description:"Acknowledge event delivery",category:"Event Bus"},{name:"EVENT_SUBSCRIPTION_LIST",description:"List event subscriptions",category:"Event Bus"},{name:"EVENT_SYNC_SUBSCRIPTIONS",description:"Sync subscriptions to desired state",category:"Event Bus"},{name:"USER_GET",description:"Get a user by id",category:"Users"}],at={ORGANIZATION_CREATE:"Create organization",ORGANIZATION_LIST:"List organizations",ORGANIZATION_GET:"View organization details",ORGANIZATION_UPDATE:"Update organization",ORGANIZATION_DELETE:"Delete organization",ORGANIZATION_SETTINGS_GET:"View organization settings",ORGANIZATION_SETTINGS_UPDATE:"Update organization settings",ORGANIZATION_MEMBER_LIST:"List members",ORGANIZATION_MEMBER_ADD:"Add members",ORGANIZATION_MEMBER_REMOVE:"Remove members",ORGANIZATION_MEMBER_UPDATE_ROLE:"Update member roles",COLLECTION_CONNECTIONS_LIST:"List connections",COLLECTION_CONNECTIONS_GET:"View connection details",COLLECTION_CONNECTIONS_CREATE:"Create connections",COLLECTION_CONNECTIONS_UPDATE:"Update connections",COLLECTION_CONNECTIONS_DELETE:"Delete connections",CONNECTION_TEST:"Test connections",DATABASES_RUN_SQL:"Run SQL queries",COLLECTION_GATEWAY_CREATE:"Create gateways",COLLECTION_GATEWAY_LIST:"List gateways",COLLECTION_GATEWAY_GET:"View gateway details",COLLECTION_GATEWAY_UPDATE:"Update gateways",COLLECTION_GATEWAY_DELETE:"Delete gateways",MONITORING_LOGS_LIST:"List monitoring logs",MONITORING_STATS:"View monitoring statistics",API_KEY_CREATE:"Create API key",API_KEY_LIST:"List API keys",API_KEY_UPDATE:"Update API key",API_KEY_DELETE:"Delete API key",EVENT_PUBLISH:"Publish events",EVENT_SUBSCRIBE:"Subscribe to events",EVENT_UNSUBSCRIBE:"Unsubscribe from events",EVENT_CANCEL:"Cancel recurring events",EVENT_ACK:"Acknowledge event delivery",EVENT_SUBSCRIPTION_LIST:"List event subscriptions",EVENT_SYNC_SUBSCRIPTIONS:"Sync subscriptions to desired state",USER_GET:"Get user by id"};function ct(){const s={Organizations:[],Connections:[],Gateways:[],Monitoring:[],Users:[],"API Keys":[],"Event Bus":[]};for(const e of Ps)s[e.category]?.push(e);return s}function dt(){return Ps.map(s=>({value:s.name,label:at[s.name],dangerous:s.dangerous}))}const Cs=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function mt(s){return s.replace(/-/g," ")}function ut(s){if(!s)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1};const e=[];let n=!1;const l=[];let a=!1;const i=new Set;let h=!1;for(const[o,x]of Object.entries(s)){if(o===$s.SELF){x.includes("*")?n=!0:e.push(...x);continue}if(o==="*"){if(a=!0,x.includes("*"))h=!0;else for(const y of x)i.add(y);continue}if(l.push(o),x.includes("*"))h=!0;else for(const y of x)i.add(y)}return{staticPermissions:e,allowsAllStaticPermissions:n,connectionIds:l,allowsAllConnections:a,toolNames:Array.from(i),allowsAllTools:h}}function us(){const{locator:s}=Ce(),{data:e,isLoading:n,error:l,refetch:a}=Ss({queryKey:oe.organizationRoles(s),queryFn:async()=>{try{const o=await X.organization.listRoles();return o?.error?(console.error("[useOrganizationRoles] API error:",o.error),[]):o?.data??[]}catch(o){return console.error("[useOrganizationRoles] Fetch error:",o),[]}},staleTime:3e4}),i=Cs.map(o=>({role:o.value,label:o.label,isBuiltin:o.isBuiltin}));if(e&&Array.isArray(e))for(const o of e){const x=o.role;if(!x||Cs.some(j=>j.value===x))continue;const{staticPermissions:y,allowsAllStaticPermissions:f,connectionIds:T,allowsAllConnections:d,toolNames:S,allowsAllTools:u}=ut(o.permission);i.push({id:o.id,role:x,label:mt(x),isBuiltin:!1,permission:o.permission??void 0,staticPermissionCount:f?-1:y.length,allowsAllStaticPermissions:f,connectionCount:d?-1:T.length,allowsAllConnections:d,toolCount:u?-1:S.length,allowsAllTools:u})}const h=i.filter(o=>!o.isBuiltin);return{roles:i,customRoles:h,builtinRoles:i.filter(o=>o.isBuiltin),isLoading:n,error:l,refetch:a}}const ft=fs({role:fs({id:ue().optional(),slug:ue().optional(),label:ue()}),allowAllStaticPermissions:zs(),staticPermissions:He(ue()),toolSet:Ms(ue(),He(ue())),memberIds:He(ue())});function Ls(s){return s?s.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}const ht=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Xe=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function gt(s){if(!s)return"bg-neutral-400";let e=0;for(let l=0;l<s.length;l++){const a=s.charCodeAt(l);e=(e<<5)-e+a,e=e&e}const n=Math.abs(e)%Xe.length;return Xe[n]??Xe[0]}function Ve(){return{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},memberIds:[]}}function xt(s){const e=de.c(39),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:a,onPermissionsChange:i,readOnly:h}=s,o=h===void 0?!1:h,[x,y]=G.useState(""),f=G.useDeferredValue(x);let T,d,S,u,j;if(e[0]!==n||e[1]!==f||e[2]!==a||e[3]!==i||e[4]!==o||e[5]!==x||e[6]!==l){const g=ct(),c=dt(),v=c.filter(E=>E.label.toLowerCase().includes(f.toLowerCase())),I=E=>{if(l.includes(E))i(l.filter(_=>_!==E));else{const _=[...l,E];_.length===c.length?(a(!0),i([])):i(_)}};S="flex flex-col h-full",e[12]!==x?(u=t.jsx("div",{className:"border-b border-border",children:t.jsx(Ze,{value:x,onChange:y,placeholder:"Search permissions...",className:"border-b-0"})}),e[12]=x,e[13]=u):u=e[13];const P=!o&&"hover:bg-muted/50 cursor-pointer";let w;e[14]!==P?(w=re("flex items-center justify-between px-4 py-3 rounded-lg",P),e[14]=P,e[15]=w):w=e[15];let O;e[16]!==n||e[17]!==a||e[18]!==i||e[19]!==o?(O=()=>{if(o)return;a(!n),i([])},e[16]=n,e[17]=a,e[18]=i,e[19]=o,e[20]=O):O=e[20];let A;e[21]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{className:"text-sm font-medium",children:"All organization permissions"}),e[21]=A):A=e[21];let L;e[22]!==n||e[23]!==a||e[24]!==i||e[25]!==o?(L=t.jsx("div",{onClick:vt,children:o?t.jsx(Ne,{children:t.jsxs(ye,{children:[t.jsx(Ee,{asChild:!0,children:t.jsx("div",{children:t.jsx(Ge,{checked:n,disabled:o,onCheckedChange:E=>{o||(a(E),i([]))}})})}),t.jsx(Se,{children:t.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):t.jsx(Ge,{checked:n,disabled:o,onCheckedChange:E=>{o||(a(E),i([]))}})}),e[22]=n,e[23]=a,e[24]=i,e[25]=o,e[26]=L):L=e[26],e[27]!==L||e[28]!==w||e[29]!==O?(j=t.jsx("div",{className:"border-b border-border",children:t.jsxs("div",{className:w,onClick:O,children:[A,L]})}),e[27]=L,e[28]=w,e[29]=O,e[30]=j):j=e[30],T="flex-1 overflow-auto",d=Object.entries(g).map(E=>{const[_,z]=E,N=v.filter(m=>z.some(M=>M.name===m.value));return N.length===0?null:t.jsxs("div",{className:"mb-6 last:mb-0",children:[t.jsx("h4",{className:"text-sm font-medium p-3 pb-1.5 text-muted-foreground/75",children:_}),t.jsx("div",{className:"space-y-1",children:N.map(m=>t.jsxs("div",{className:re("flex items-center justify-between gap-3 px-4 py-3",!o&&"hover:bg-muted/50 cursor-pointer"),onClick:()=>{if(!o)if(n){a(!1);const M=c.map(Ct);i(M.filter(V=>V!==m.value))}else I(m.value)},children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("span",{className:"text-sm",children:m.label})}),t.jsx("div",{onClick:jt,children:o?t.jsx(Ne,{children:t.jsxs(ye,{children:[t.jsx(Ee,{asChild:!0,children:t.jsx("div",{children:t.jsx(Ge,{checked:n||l.includes(m.value),disabled:o,onCheckedChange:()=>{if(!o)if(n){a(!1);const M=c.map(bt);i(M.filter(V=>V!==m.value))}else I(m.value)}})})}),t.jsx(Se,{children:t.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):t.jsx(Ge,{checked:n||l.includes(m.value),disabled:o,onCheckedChange:()=>{if(!o)if(n){a(!1);const M=c.map(pt);i(M.filter(V=>V!==m.value))}else I(m.value)}})})]},m.value))})]},_)}),e[0]=n,e[1]=f,e[2]=a,e[3]=i,e[4]=o,e[5]=x,e[6]=l,e[7]=T,e[8]=d,e[9]=S,e[10]=u,e[11]=j}else T=e[7],d=e[8],S=e[9],u=e[10],j=e[11];let p;e[31]!==T||e[32]!==d?(p=t.jsx("div",{className:T,children:d}),e[31]=T,e[32]=d,e[33]=p):p=e[33];let C;return e[34]!==S||e[35]!==u||e[36]!==j||e[37]!==p?(C=t.jsxs("div",{className:S,children:[u,j,p]}),e[34]=S,e[35]=u,e[36]=j,e[37]=p,e[38]=C):C=e[38],C}function pt(s){return s.value}function bt(s){return s.value}function jt(s){return s.stopPropagation()}function Ct(s){return s.value}function vt(s){return s.stopPropagation()}function Nt(s){const e=de.c(56),{open:n,onOpenChange:l,selectedMemberIds:a,onAddMembers:i}=s,[h,o]=G.useState(""),x=G.useDeferredValue(h);let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[f,T]=G.useState(y),{data:d}=os();let S,u,j,p,C,g,c,v,I,P,w;if(e[1]!==d?.data?.members||e[2]!==x||e[3]!==i||e[4]!==l||e[5]!==n||e[6]!==f||e[7]!==h||e[8]!==a){const M=d?.data?.members??[];let V;e[20]!==x?(V=D=>{const r=x.toLowerCase();return D.user?.name?.toLowerCase().includes(r)||D.user?.email?.toLowerCase().includes(r)},e[20]=x,e[21]=V):V=e[21];const se=M.filter(V),F=yt;let K;e[22]!==a?(K=D=>a.includes(D),e[22]=a,e[23]=K):K=e[23];const Q=K;let Y;e[24]!==f?(Y=D=>{f.includes(D)?T(f.filter(r=>r!==D)):T([...f,D])},e[24]=f,e[25]=Y):Y=e[25];const ne=Y;let te;e[26]!==i||e[27]!==l||e[28]!==f?(te=()=>{i(f),T([]),l(!1)},e[26]=i,e[27]=l,e[28]=f,e[29]=te):te=e[29],j=te,u=we,P=n,w=l,S=Te,v="sm:max-w-md p-0 overflow-hidden",e[30]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs(Ae,{className:"px-6 pt-6",children:[t.jsx(Oe,{children:"Add Members to Role"}),t.jsx(Re,{children:"Select members to add to this role."})]}),e[30]=I):I=e[30],g="flex flex-col h-80",e[31]!==h?(c=t.jsx(Ze,{value:h,onChange:o,placeholder:"Search members...",className:"border-b border-t-0 border-x-0 rounded-none"}),e[31]=h,e[32]=c):c=e[32],p="flex-1 overflow-auto",C=se.length===0?t.jsx("div",{className:"flex items-center justify-center h-full px-6",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:h?"No members found":"No members available"})}):t.jsx("div",{className:"px-6 py-2 space-y-1",children:se.map(D=>{const r=F(D),b=Q(D.id),$=f.includes(D.id);return t.jsxs("label",{className:re("flex items-center gap-3 p-2 rounded-lg",!r||b?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[t.jsx(Ks,{checked:$||b,onCheckedChange:()=>{r&&!b&&ne(D.id)},disabled:!r||b}),t.jsx(je,{url:D.user?.image??void 0,fallback:Ls(D.user?.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.user?.name||"Unknown"}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.user?.email})]}),!r&&t.jsx(Ie,{variant:"secondary",className:"shrink-0",children:"Owner"}),b&&r&&t.jsx(Ie,{variant:"outline",className:"shrink-0",children:"Added"})]},D.id)})}),e[1]=d?.data?.members,e[2]=x,e[3]=i,e[4]=l,e[5]=n,e[6]=f,e[7]=h,e[8]=a,e[9]=S,e[10]=u,e[11]=j,e[12]=p,e[13]=C,e[14]=g,e[15]=c,e[16]=v,e[17]=I,e[18]=P,e[19]=w}else S=e[9],u=e[10],j=e[11],p=e[12],C=e[13],g=e[14],c=e[15],v=e[16],I=e[17],P=e[18],w=e[19];let O;e[33]!==p||e[34]!==C?(O=t.jsx("div",{className:p,children:C}),e[33]=p,e[34]=C,e[35]=O):O=e[35];let A;e[36]!==O||e[37]!==g||e[38]!==c?(A=t.jsxs("div",{className:g,children:[c,O]}),e[36]=O,e[37]=g,e[38]=c,e[39]=A):A=e[39];let L;e[40]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(Pe,{children:"Cancel"}),e[40]=L):L=e[40];const E=f.length===0,_=f.length>0&&`(${f.length})`;let z;e[41]!==j||e[42]!==E||e[43]!==_?(z=t.jsxs(_e,{className:"px-6 pb-6",children:[L,t.jsxs(Le,{onClick:j,disabled:E,children:["Add ",_]})]}),e[41]=j,e[42]=E,e[43]=_,e[44]=z):z=e[44];let N;e[45]!==S||e[46]!==A||e[47]!==z||e[48]!==v||e[49]!==I?(N=t.jsxs(S,{className:v,children:[I,A,z]}),e[45]=S,e[46]=A,e[47]=z,e[48]=v,e[49]=I,e[50]=N):N=e[50];let m;return e[51]!==u||e[52]!==N||e[53]!==P||e[54]!==w?(m=t.jsx(u,{open:P,onOpenChange:w,children:N}),e[51]=u,e[52]=N,e[53]=P,e[54]=w,e[55]=m):m=e[55],m}function yt(s){return s.role!=="owner"}function Et(s){const e=de.c(40),{memberIds:n,onMemberIdsChange:l,readOnly:a}=s,i=a===void 0?!1:a,[h,o]=G.useState(""),x=G.useDeferredValue(h),[y,f]=G.useState(!1),{data:T}=os();let d,S,u,j,p;if(e[0]!==T?.data?.members||e[1]!==x||e[2]!==n||e[3]!==l||e[4]!==i||e[5]!==h){const v=T?.data?.members??[];let I;e[11]!==n?(I=N=>n.includes(N.id),e[11]=n,e[12]=I):I=e[12];const P=v.filter(I);let w;e[13]!==x?(w=N=>{const m=x.toLowerCase();return N.user?.name?.toLowerCase().includes(m)||N.user?.email?.toLowerCase().includes(m)},e[13]=x,e[14]=w):w=e[14];const O=P.filter(w);let A;e[15]!==n||e[16]!==l?(A=N=>{l(n.filter(m=>m!==N))},e[15]=n,e[16]=l,e[17]=A):A=e[17];const L=A;let E;e[18]!==n||e[19]!==l?(E=N=>{l([...n,...N])},e[18]=n,e[19]=l,e[20]=E):E=e[20],d=E,j="flex flex-col h-full";let _;e[21]!==h?(_=t.jsx(Ze,{value:h,onChange:o,placeholder:"Search members...",className:"flex-1 border-b-0"}),e[21]=h,e[22]=_):_=e[22];let z;e[23]!==i?(z=i?t.jsx("div",{className:"pr-4",children:t.jsx(Ne,{children:t.jsxs(ye,{children:[t.jsx(Ee,{asChild:!0,children:t.jsx("div",{children:t.jsxs(ee,{variant:"outline",size:"sm",disabled:!0,children:[t.jsx(ss,{size:16}),"Add Member"]})})}),t.jsx(Se,{children:t.jsx("p",{children:"Owner membership cannot be changed"})})]})})}):t.jsx("div",{className:"pr-4",children:t.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>f(!0),children:[t.jsx(ss,{size:16}),"Add Member"]})}),e[23]=i,e[24]=z):z=e[24],e[25]!==_||e[26]!==z?(p=t.jsxs("div",{className:"flex items-center border-b border-border",children:[_,z]}),e[25]=_,e[26]=z,e[27]=p):p=e[27],S="flex-1 overflow-auto",u=P.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsxs("div",{className:"text-center",children:[t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No members"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to this role to grant them the configured permissions."})]})}):O.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',h,'"']})}):t.jsx("div",{className:"p-4 space-y-2",children:O.map(N=>t.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[t.jsx(je,{url:N.user?.image??void 0,fallback:Ls(N.user?.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:N.user?.name||"Unknown"}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.user?.email})]}),i?t.jsx(Ne,{children:t.jsxs(ye,{children:[t.jsx(Ee,{asChild:!0,children:t.jsx("div",{children:t.jsx(ee,{variant:"ghost",size:"sm",disabled:!0,children:t.jsx(hs,{size:16})})})}),t.jsx(Se,{children:t.jsx("p",{children:"Owner membership cannot be changed"})})]})}):t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>L(N.id),children:t.jsx(hs,{size:16})})]},N.id))}),e[0]=T?.data?.members,e[1]=x,e[2]=n,e[3]=l,e[4]=i,e[5]=h,e[6]=d,e[7]=S,e[8]=u,e[9]=j,e[10]=p}else d=e[6],S=e[7],u=e[8],j=e[9],p=e[10];let C;e[28]!==S||e[29]!==u?(C=t.jsx("div",{className:S,children:u}),e[28]=S,e[29]=u,e[30]=C):C=e[30];let g;e[31]!==y||e[32]!==d||e[33]!==n?(g=t.jsx(Nt,{open:y,onOpenChange:f,selectedMemberIds:n,onAddMembers:d}),e[31]=y,e[32]=d,e[33]=n,e[34]=g):g=e[34];let c;return e[35]!==j||e[36]!==p||e[37]!==C||e[38]!==g?(c=t.jsxs("div",{className:j,children:[p,C,g]}),e[35]=j,e[36]=p,e[37]=C,e[38]=g,e[39]=c):c=e[39],c}function St(s){const e=de.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(As,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let l;return e[1]!==s?(l=t.jsx(G.Suspense,{fallback:n,children:t.jsx(Et,{...s})}),e[1]=s,e[2]=l):l=e[2],l}const It={owner:[],admin:[],user:[]};function $e(s,e){const n=s==="owner"||s==="admin",l=e.filter(a=>a.role===s);return{role:{slug:s,label:s.charAt(0).toUpperCase()+s.slice(1)},allowAllStaticPermissions:n,staticPermissions:It[s],toolSet:{},memberIds:l.map(a=>a.id)}}function wt({trigger:s,onSuccess:e}){const[n,l]=G.useState(!1),[a,i]=G.useState("mcp"),{locator:h}=Ce(),o=qe(),x=Vs()??[],{customRoles:y,refetch:f}=us(),{data:T}=Ss({queryKey:oe.members(h),queryFn:()=>X.organization.listMembers()}),d=Es({resolver:ks(ft),defaultValues:Ve()}),S=d.formState.isValid,u=d.formState.isDirty,[j,p]=G.useState(null),[C,g]=G.useState(null),c=!d.watch("role.id")&&!d.watch("role.slug")&&!C,[v,I]=G.useState(null),[P,w]=G.useState(!1),[O,A]=G.useState(null),L=r=>{const b=r.permission||{},$=b.self||[],le=$.includes("*"),ie=le?[]:$.filter(k=>k!=="*"),W={};for(const[k,B]of Object.entries(b))if(k!=="self")if(k==="*")for(const Z of x)B.includes("*")?W[Z.id]=Z.tools?.map(ae=>ae.name)??[]:W[Z.id]=B;else{const Z=x.find(ae=>ae.id===k);Z&&(B.includes("*")?W[k]=Z.tools?.map(ae=>ae.name)??[]:W[k]=B)}const me=(T?.data?.members??[]).filter(k=>k.role===r.role).map(k=>k.id);return{role:{id:r.id,slug:r.role,label:r.label},allowAllStaticPermissions:le,staticPermissions:ie,toolSet:W,memberIds:me}},E=r=>{const b=L(r);d.reset(b),p(r.id??null),g(null)},_=()=>{d.reset(Ve()),p(null),g(null),i("mcp")},z=r=>{u&&S?(A(()=>()=>E(r)),w(!0)):E(r)},N=async()=>{u&&S&&await Y(),_()},m=r=>{if(u&&S)A(()=>()=>{const b=$e(r,T?.data?.members??[]);d.reset(b),g(r),p(null),i("org")}),w(!0);else{const b=$e(r,T?.data?.members??[]);d.reset(b),g(r),p(null),i("org")}},M=r=>{if(!r&&d.formState.isDirty&&S){A(()=>()=>{l(!1),d.reset(Ve()),g(null)}),w(!0);return}if(l(r),!r)d.reset(Ve()),g(null),p(null);else{const b=y[0];if(b)E(b);else{const $=$e("user",T?.data?.members??[]);d.reset($),g("user"),p(null),i("org")}}},V=()=>{w(!1),O&&(O(),A(null))},se=r=>{const b={};r.allowAllStaticPermissions?b.self=["*"]:r.staticPermissions.length>0&&(b.self=r.staticPermissions);for(const[$,le]of Object.entries(r.toolSet))if(le.length>0){const W=x.find(q=>q.id===$)?.tools?.map(q=>q.name)??[];W.length>0&&W.every(q=>le.includes(q))?b[$]=["*"]:b[$]=le}return b},F=fe({mutationFn:async r=>{const b=se(r),$=r.role.slug||r.role.label.toLowerCase().replace(/\s+/g,"-");if(r.role.slug&&!r.role.id){const W=(T?.data?.members??[]).filter(k=>k.role===r.role.slug).map(k=>k.id),q=r.memberIds.filter(k=>!W.includes(k)),me=W.filter(k=>!r.memberIds.includes(k));for(const k of q){const B=await X.organization.updateMemberRole({memberId:k,role:[r.role.slug]});if(B?.error)throw new Error(B.error.message)}for(const k of me){const B=await X.organization.updateMemberRole({memberId:k,role:["user"]});if(B?.error)throw new Error(B.error.message)}return r}else if(r.role.id){const ie=await X.organization.updateRole({roleId:r.role.id,data:{permission:b}});if(ie?.error)throw new Error(ie.error.message);const q=(T?.data?.members??[]).filter(B=>B.role===r.role.slug).map(B=>B.id),me=r.memberIds.filter(B=>!q.includes(B)),k=q.filter(B=>!r.memberIds.includes(B));for(const B of me){const Z=await X.organization.updateMemberRole({memberId:B,role:[r.role.slug]});if(Z?.error)throw new Error(Z.error.message)}for(const B of k){const Z=await X.organization.updateMemberRole({memberId:B,role:["user"]});if(Z?.error)throw new Error(Z.error.message)}return r}else{const ie=await X.organization.createRole({role:$,permission:b});if(ie?.error)throw new Error(ie.error.message);for(const W of r.memberIds){const q=await X.organization.updateMemberRole({memberId:W,role:[$]});if(q?.error)throw new Error(q.error.message)}return{...r,role:{...r.role,id:ie.data?.roleData?.id,slug:$}}}},onSuccess:(r,b)=>{o.invalidateQueries({queryKey:oe.members(h)}),o.invalidateQueries({queryKey:oe.organizationRoles(h)});const $=!b.role.id&&!b.role.slug,le=b.role.slug&&!b.role.id;J.success(le?"Members updated successfully!":$?"Role created successfully!":"Role updated successfully!"),f(),d.reset(r),r.role.id&&p(r.role.id),e?.()},onError:r=>{J.error(r instanceof Error?r.message:"Failed to save role")}}),K=fe({mutationFn:async r=>{const b=await X.organization.deleteRole({roleId:r});if(b?.error)throw new Error(b.error.message);return b?.data},onSuccess:()=>{if(o.invalidateQueries({queryKey:oe.members(h)}),o.invalidateQueries({queryKey:oe.organizationRoles(h)}),J.success("Role deleted successfully!"),f(),v?.id===j){const r=y.filter(b=>b.id!==v?.id);if(r[0])E(r[0]);else{const b=$e("user",T?.data?.members??[]);d.reset(b),g("user"),p(null),i("org")}}},onError:r=>{J.error(r instanceof Error?r.message:"Failed to delete role")}}),Q=F.isPending||K.isPending,Y=async()=>{const r=d.getValues();if(!r.role.label.trim()){J.error("Role name is required"),d.setFocus("role.label");return}await F.mutateAsync(r)},ne=d.handleSubmit(r=>{if(!r.role.label.trim()){J.error("Role name is required"),d.setFocus("role.label");return}F.mutate(r)}),te=r=>{r.id&&I({id:r.id,label:r.label})},D=()=>{v?.id&&K.mutate(v.id),I(null)};return t.jsxs(Is,{open:n,onOpenChange:M,children:[t.jsx(ws,{asChild:!0,children:s}),t.jsx(Ts,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 overflow-hidden w-[95vw]",children:t.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[t.jsxs("div",{className:"w-full sm:w-64 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[t.jsx("div",{className:"flex-1 overflow-auto px-3.5 py-3.5 pt-3.5",children:t.jsxs("div",{className:"flex flex-col gap-1",children:[ht.map(r=>{const b=C===r.role;return t.jsxs("div",{className:re("flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden cursor-pointer transition-colors",b?"bg-accent":"hover:bg-muted/50"),onClick:()=>m(r.role),children:[t.jsx("div",{className:re("shrink-0 size-3 rounded-full",r.color)}),t.jsx("p",{className:"text-sm font-medium truncate flex-1",children:r.label}),t.jsx(et,{size:14,className:"text-muted-foreground shrink-0"})]},r.role)}),y.map(r=>{const b=j===r.id;return t.jsxs("div",{className:re("group flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden transition-colors cursor-pointer",b?"bg-accent":"hover:bg-muted/50"),onClick:()=>z(r),children:[t.jsx("div",{className:re("shrink-0 size-3 rounded-full",gt(r.label))}),t.jsx("p",{className:"text-sm font-medium truncate flex-1",children:r.label}),t.jsxs(as,{children:[t.jsx(cs,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon",className:re("size-5 shrink-0 transition-opacity opacity-0 pointer-events-none","group-hover:opacity-100 group-hover:pointer-events-auto",b&&"opacity-100 pointer-events-auto"),onClick:$=>$.stopPropagation(),children:t.jsx(Xs,{size:14})})}),t.jsx(ds,{align:"end",children:t.jsxs(Ke,{className:"text-destructive",onClick:$=>{$.stopPropagation(),te(r)},children:[t.jsx(Os,{size:16}),"Delete"]})})]})]},r.id)}),c&&t.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden bg-accent",children:[t.jsx("div",{className:"shrink-0 size-3 rounded-full bg-neutral-400"}),t.jsx(Fs,{...d.register("role.label"),placeholder:"Enter role name",className:"flex-1 text-sm font-medium border-0 shadow-none h-auto px-0 py-0 focus-visible:ring-0 bg-transparent",autoFocus:!0}),t.jsx(Ie,{variant:"secondary",className:"shrink-0 text-xs px-1.5 py-0",children:"New"})]})]})}),t.jsx("div",{className:"px-3.5 pb-3.5",children:t.jsxs(ee,{variant:"outline",size:"default",onClick:N,disabled:Q||u,className:"w-full h-10",children:[t.jsx(ss,{size:16}),"Create new role"]})})]}),t.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[t.jsxs("div",{className:"h-12 border-b border-border px-4 py-3.5 flex items-center gap-2 shrink-0",children:[!C&&t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>i("mcp"),className:re("h-8 rounded-lg px-2 py-1",a==="mcp"?"bg-muted border-input text-foreground":"border-input text-muted-foreground bg-transparent"),children:"MCP Permissions"}),t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>i("org"),className:re("h-8 rounded-lg px-2 py-1",a==="org"?"bg-muted border-input text-foreground":"border-input text-muted-foreground bg-transparent"),children:"Organization Permissions"}),t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>i("members"),className:re("h-8 rounded-lg px-2 py-1",a==="members"?"bg-muted border-input text-foreground":"border-input text-muted-foreground bg-transparent"),children:"Members"})]}),t.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[a==="mcp"&&!C&&t.jsx(Gs,{toolSet:d.watch("toolSet"),onToolSetChange:r=>d.setValue("toolSet",r,{shouldDirty:!0})}),a==="org"&&t.jsx(xt,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:r=>d.setValue("allowAllStaticPermissions",r,{shouldDirty:!0}),onPermissionsChange:r=>d.setValue("staticPermissions",r,{shouldDirty:!0}),readOnly:!!C}),a==="members"&&t.jsx(St,{memberIds:d.watch("memberIds"),onMemberIdsChange:r=>d.setValue("memberIds",r,{shouldDirty:!0}),readOnly:C==="owner"})]}),(!C||C!=="owner")&&t.jsxs("div",{className:"border-t border-border px-5 py-5 flex items-center justify-end gap-2.5 shrink-0",children:[t.jsx(ee,{variant:"outline",onClick:()=>M(!1),disabled:Q,className:"h-10",children:"Cancel"}),t.jsx(ee,{onClick:ne,disabled:Q||!S||!d.formState.isDirty,className:"h-10",children:F.isPending?"Saving...":c?"Create Role":"Save Changes"})]})]})]})}),t.jsx(we,{open:v!==null,onOpenChange:r=>!r&&I(null),children:t.jsxs(Te,{children:[t.jsxs(Ae,{children:[t.jsx(Oe,{children:"Delete Role"}),t.jsxs(Re,{children:['Are you sure you want to delete the "',v?.label,'" role? This action cannot be undone.']})]}),t.jsxs(_e,{children:[t.jsx(Pe,{children:"Cancel"}),t.jsx(Le,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(we,{open:P,onOpenChange:w,children:t.jsxs(Te,{children:[t.jsxs(Ae,{children:[t.jsx(Oe,{children:"Discard Changes"}),t.jsx(Re,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),t.jsxs(_e,{children:[t.jsx(Pe,{onClick:()=>A(null),children:"Keep Editing"}),t.jsx(Le,{onClick:V,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Discard"})]})]})})]})}const Tt=ue().email("Invalid email address");function At(s){if(!s.trim())return[];const e=s.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function Ot({trigger:s}){const[e,n]=G.useState(!1),{locator:l}=Ce(),a=qe(),{data:i}=X.useSession(),h=i?.user?.email,{roles:o,isLoading:x}=us(),y=o.filter(g=>g.role!=="owner"),f=Es({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),T=f.watch("emailsText"),d=f.watch("role"),u=At(T).filter(g=>{const c=Tt.safeParse(g).success,v=!h||g!==h.toLowerCase();return c&&v}),j=fe({mutationFn:async({emails:g,role:c})=>{if(!c)throw new Error("Please select a role");const v=await Promise.allSettled(g.map(async P=>{const w=await X.organization.inviteMember({email:P,role:c});if(w.error)throw new Error(w.error.message);return w.data})),I=v.filter(P=>P.status==="rejected");if(I.length>0)throw new Error(`Failed to invite ${I.length} member${I.length>1?"s":""}`);return v},onSuccess:(g,{emails:c})=>{a.invalidateQueries({queryKey:oe.members(l)}),a.invalidateQueries({queryKey:oe.invitations(l)}),J.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),f.reset({emailsText:"",role:"user"}),n(!1)},onError:g=>{J.error(g instanceof Error?g.message:"Failed to invite members")}}),p=g=>{if(u.length===0){J.error("Please enter at least one valid email address");return}if(!g.role){J.error("Please select a role");return}j.mutate({emails:u,role:g.role})},C=u.length>0&&!!d;return t.jsxs(Is,{open:e,onOpenChange:n,children:[t.jsx(ws,{asChild:!0,children:s}),t.jsxs(Ts,{className:"sm:max-w-lg",children:[t.jsx(Qs,{children:t.jsx(qs,{children:"Invite members"})}),t.jsx(nt,{...f,children:t.jsxs("form",{onSubmit:f.handleSubmit(p),className:"space-y-4",children:[t.jsx(gs,{control:f.control,name:"emailsText",render:({field:g})=>t.jsxs(xs,{children:[t.jsx(rt,{children:"Email addresses"}),t.jsx(ps,{children:t.jsx(it,{...g,disabled:j.isPending,placeholder:`Enter email addresses separated by commas or new lines
|
|
2
|
-
e.g. user1@example.com, user2@example.com
|
|
3
|
-
or one per line`,className:"min-h-[120px] resize-none"})}),t.jsx(bs,{})]})}),t.jsx(gs,{control:f.control,name:"role",render:({field:g})=>t.jsxs(xs,{children:[t.jsx(ps,{children:t.jsxs(ts,{value:g.value,onValueChange:g.onChange,disabled:j.isPending||x,children:[t.jsx(ns,{className:"w-full",children:t.jsx(rs,{placeholder:"Select a role"})}),t.jsx(is,{children:y.map(c=>{const v=[];return c.isBuiltin||(c.allowsAllStaticPermissions?v.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&v.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?v.push("All connections"):c.connectionCount&&c.connectionCount>0&&v.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?v.push("all tools"):c.toolCount&&c.toolCount>0&&v.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),t.jsx(ls,{value:c.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:c.label}),!c.isBuiltin&&v.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:v.join(", ")})]})},c.role)})})]})}),t.jsx(bs,{})]})}),t.jsxs(Zs,{children:[t.jsx(ee,{variant:"outline",onClick:()=>{f.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:j.isPending,children:"Cancel"}),t.jsx(ee,{type:"submit",disabled:j.isPending||!C,children:j.isPending?"Inviting...":`Invite ${u.length||0} Member${u.length!==1?"s":""}`})]})]})})]})]})}function Rt(){const s=de.c(6),{locator:e}=Ce();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n=st(),s[0]=n):n=s[0];const l=n;let a;s[1]!==e?(a=oe.invitations(e),s[1]=e,s[2]=a):a=s[2];let i;s[3]===Symbol.for("react.memo_cache_sentinel")?(i=async()=>(await l("ORGANIZATION_GET",{}))?.invitations??[],s[3]=i):i=s[3];let h;return s[4]!==a?(h={queryKey:a,queryFn:i},s[4]=a,s[5]=h):h=s[5],Ds(h)}function _t(){const s=de.c(5),{locator:e}=Ce(),n=qe();let l;s[0]!==e||s[1]!==n?(l={mutationFn:Lt,onSuccess:()=>{n.invalidateQueries({queryKey:oe.invitations(e)}),J.success("Invitation cancelled")},onError:Pt},s[0]=e,s[1]=n,s[2]=l):l=s[2];const a=fe(l);let i;return s[3]!==a?(i={cancel:a},s[3]=a,s[4]=i):i=s[4],i}function Pt(s){J.error(s instanceof Error?s.message:"Failed to cancel invitation")}async function Lt(s){const e=await X.organization.cancelInvitation({invitationId:s});if(e?.error)throw new Error(e.error.message);return e.data}const vs=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],Mt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Qe(s){return s?s.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function zt(s){const e=new Map;for(const[n,l]of Object.entries(Mt))e.set(n,l);for(let n=0;n<s.length;n++){const l=s[n];l&&!e.has(l.role)&&e.set(l.role,vs[n%vs.length]??"bg-neutral-400")}return e}function kt(s){return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Fe(s){const e=de.c(79),{role:n,memberId:l,isOwner:a,roleColorMap:i,selectableRoles:h,onRoleChange:o,size:x,className:y}=s,f=x===void 0?"xs":x;let T,d,S,u,j,p,C,g,c,v,I;if(e[0]!==y||e[1]!==a||e[2]!==l||e[3]!==o||e[4]!==n||e[5]!==i||e[6]!==h||e[7]!==f){I=Symbol.for("react.early_return_sentinel");e:{const N=i.get(n)??"bg-neutral-400";if(a){let m;e[19]!==l||e[20]!==o?(m=D=>o(l,D),e[19]=l,e[20]=o,e[21]=m):m=e[21];let M;e[22]!==n?(M=t.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=M):M=e[23];const V=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("div",{className:re("size-2 rounded-full shrink-0",N)}),M]});let se;e[24]!==V?(se=t.jsx(rs,{children:V}),e[24]=V,e[25]=se):se=e[25];let F;e[26]!==y||e[27]!==f||e[28]!==se?(F=t.jsx(ns,{size:f,className:y,children:se}),e[26]=y,e[27]=f,e[28]=se,e[29]=F):F=e[29];let K;if(e[30]!==i||e[31]!==h){let D;e[33]!==i?(D=r=>{const b=i.get(r.role)??"bg-neutral-400";return t.jsx(ls,{value:r.role,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:re("size-3 rounded-full",b)}),t.jsx("span",{className:"capitalize",children:r.label})]})},r.role)},e[33]=i,e[34]=D):D=e[34],K=h.map(D),e[30]=i,e[31]=h,e[32]=K}else K=e[32];let Q;e[35]!==K?(Q=t.jsx(is,{children:K}),e[35]=K,e[36]=Q):Q=e[36];let Y;e[37]!==a||e[38]!==n||e[39]!==m||e[40]!==F||e[41]!==Q?(Y=t.jsx(Ee,{asChild:!0,children:t.jsx("div",{className:"w-fit",children:t.jsxs(ts,{value:n,onValueChange:m,disabled:a,children:[F,Q]})})}),e[37]=a,e[38]=n,e[39]=m,e[40]=F,e[41]=Q,e[42]=Y):Y=e[42];let ne;e[43]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{children:t.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=ne):ne=e[43];let te;e[44]!==Y?(te=t.jsx(Ne,{children:t.jsxs(ye,{children:[Y,ne]})}),e[44]=Y,e[45]=te):te=e[45],I=te;break e}S=ts,g=n,e[46]!==l||e[47]!==o?(c=m=>o(l,m),e[46]=l,e[47]=o,e[48]=c):c=e[48],v=a,d=ns,p=f,C=y,T=rs,j="flex items-center gap-2 min-w-0",u=re("size-2 rounded-full shrink-0",N)}e[0]=y,e[1]=a,e[2]=l,e[3]=o,e[4]=n,e[5]=i,e[6]=h,e[7]=f,e[8]=T,e[9]=d,e[10]=S,e[11]=u,e[12]=j,e[13]=p,e[14]=C,e[15]=g,e[16]=c,e[17]=v,e[18]=I}else T=e[8],d=e[9],S=e[10],u=e[11],j=e[12],p=e[13],C=e[14],g=e[15],c=e[16],v=e[17],I=e[18];if(I!==Symbol.for("react.early_return_sentinel"))return I;let P;e[49]!==u?(P=t.jsx("div",{className:u}),e[49]=u,e[50]=P):P=e[50];let w;e[51]!==n?(w=t.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=w):w=e[52];let O;e[53]!==P||e[54]!==w||e[55]!==j?(O=t.jsxs("div",{className:j,children:[P,w]}),e[53]=P,e[54]=w,e[55]=j,e[56]=O):O=e[56];let A;e[57]!==T||e[58]!==O?(A=t.jsx(T,{children:O}),e[57]=T,e[58]=O,e[59]=A):A=e[59];let L;e[60]!==d||e[61]!==A||e[62]!==p||e[63]!==C?(L=t.jsx(d,{size:p,className:C,children:A}),e[60]=d,e[61]=A,e[62]=p,e[63]=C,e[64]=L):L=e[64];let E;if(e[65]!==i||e[66]!==h){let N;e[68]!==i?(N=m=>{const M=i.get(m.role)??"bg-neutral-400";return t.jsx(ls,{value:m.role,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:re("size-3 rounded-full",M)}),t.jsx("span",{className:"capitalize",children:m.label})]})},m.role)},e[68]=i,e[69]=N):N=e[69],E=h.map(N),e[65]=i,e[66]=h,e[67]=E}else E=e[67];let _;e[70]!==E?(_=t.jsx(is,{children:E}),e[70]=E,e[71]=_):_=e[71];let z;return e[72]!==S||e[73]!==L||e[74]!==_||e[75]!==g||e[76]!==c||e[77]!==v?(z=t.jsxs(S,{value:g,onValueChange:c,disabled:v,children:[L,_]}),e[72]=S,e[73]=L,e[74]=_,e[75]=g,e[76]=c,e[77]=v,e[78]=z):z=e[78],z}function Ns(s){const e=de.c(51),{member:n,roles:l,onChangeRole:a,onRemove:i,isUpdating:h}=s,o=h===void 0?!1:h,x=n.role==="owner";let y,f,T,d,S,u,j,p,C;if(e[0]!==x||e[1]!==o||e[2]!==n.id||e[3]!==n.role||e[4]!==a||e[5]!==l){let L;e[15]!==n.role?(L=m=>m.role!==n.role&&m.role!=="owner",e[15]=n.role,e[16]=L):L=e[16];const E=l.filter(L);d=as;let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Rs,{size:20}),e[17]=_):_=e[17],e[18]!==x?(C=t.jsx(cs,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:x,onClick:Bt,children:_})}),e[18]=x,e[19]=C):C=e[19],T=ds,j="end",p=Dt,f=Ys;let z;e[20]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(_s,{size:16}),e[20]=z):z=e[20],e[21]!==o?(u=t.jsxs(Ws,{disabled:o,children:[z,"Change Role"]}),e[21]=o,e[22]=u):u=e[22],y=Hs;let N;e[23]!==o||e[24]!==n.id||e[25]!==a?(N=m=>{const M=[];return m.isBuiltin||(m.allowsAllStaticPermissions?M.push("Full org access"):m.staticPermissionCount&&m.staticPermissionCount>0&&M.push(`${m.staticPermissionCount} org perm${m.staticPermissionCount!==1?"s":""}`),m.allowsAllConnections?M.push("All connections"):m.connectionCount&&m.connectionCount>0&&M.push(`${m.connectionCount} connection${m.connectionCount!==1?"s":""}`),(m.connectionCount!==0||m.allowsAllConnections)&&(m.allowsAllTools?M.push("all tools"):m.toolCount&&m.toolCount>0&&M.push(`${m.toolCount} tool${m.toolCount!==1?"s":""}`))),t.jsxs(Ke,{onClick:V=>{V.stopPropagation(),a(n.id,m.role)},disabled:o,children:[m.isBuiltin?t.jsx(ms,{size:16}):t.jsx(lt,{size:16}),t.jsxs("span",{className:"flex flex-col",children:[t.jsx("span",{children:m.label}),!m.isBuiltin&&M.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:M.join(", ")})]})]},m.role)},e[23]=o,e[24]=n.id,e[25]=a,e[26]=N):N=e[26],S=E.map(N),e[0]=x,e[1]=o,e[2]=n.id,e[3]=n.role,e[4]=a,e[5]=l,e[6]=y,e[7]=f,e[8]=T,e[9]=d,e[10]=S,e[11]=u,e[12]=j,e[13]=p,e[14]=C}else y=e[6],f=e[7],T=e[8],d=e[9],S=e[10],u=e[11],j=e[12],p=e[13],C=e[14];let g;e[27]!==y||e[28]!==S?(g=t.jsx(y,{children:S}),e[27]=y,e[28]=S,e[29]=g):g=e[29];let c;e[30]!==f||e[31]!==u||e[32]!==g?(c=t.jsxs(f,{children:[u,g]}),e[30]=f,e[31]=u,e[32]=g,e[33]=c):c=e[33];let v;e[34]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Js,{}),e[34]=v):v=e[34];let I;e[35]!==n.id||e[36]!==i?(I=L=>{L.stopPropagation(),i(n.id)},e[35]=n.id,e[36]=i,e[37]=I):I=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Os,{size:16}),e[38]=P):P=e[38];let w;e[39]!==I?(w=t.jsxs(Ke,{variant:"destructive",onClick:I,children:[P,"Remove Member"]}),e[39]=I,e[40]=w):w=e[40];let O;e[41]!==T||e[42]!==w||e[43]!==j||e[44]!==p||e[45]!==c?(O=t.jsxs(T,{align:j,onClick:p,children:[c,v,w]}),e[41]=T,e[42]=w,e[43]=j,e[44]=p,e[45]=c,e[46]=O):O=e[46];let A;return e[47]!==d||e[48]!==O||e[49]!==C?(A=t.jsxs(d,{children:[C,O]}),e[47]=d,e[48]=O,e[49]=C,e[50]=A):A=e[50],A}function Dt(s){return s.stopPropagation()}function Bt(s){return s.stopPropagation()}function ys(s){const e=de.c(8),{invitationId:n,onCancel:l,isCancelling:a}=s,i=a===void 0?!1:a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(cs,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Gt,children:t.jsx(Rs,{size:20})})}),e[0]=h):h=e[0];let o;e[1]!==n||e[2]!==l?(o=f=>{f.stopPropagation(),l(n)},e[1]=n,e[2]=l,e[3]=o):o=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(ot,{size:16}),e[4]=x):x=e[4];let y;return e[5]!==i||e[6]!==o?(y=t.jsxs(as,{children:[h,t.jsx(ds,{align:"end",onClick:Ut,children:t.jsxs(Ke,{variant:"destructive",onClick:o,disabled:i,children:[x,"Cancel Invitation"]})})]}),e[5]=i,e[6]=o,e[7]=y):y=e[7],y}function Ut(s){return s.stopPropagation()}function Gt(s){return s.stopPropagation()}function Vt(){const s=de.c(74),{data:e}=os(),{data:n}=Rt(),l=_t(),a=qe(),{locator:i}=Ce(),[h,o]=G.useState(null),[x,y]=G.useState(null),[f,T]=G.useState(""),[d,S]=G.useState("table"),[u,j]=G.useState("member"),[p,C]=G.useState("asc"),g=e?.data?.members;let c;s[0]!==u?(c=R=>{u===R?C(sn):(j(R),C("asc"))},s[0]=u,s[1]=c):c=s[1];const v=c;let I=g??[],P=n??[];if(f){const R=f.toLowerCase();I=I.filter(U=>U.user?.name?.toLowerCase().includes(R)||U.user?.email?.toLowerCase().includes(R)||U.role?.toLowerCase().includes(R)),P=P.filter(U=>U.email?.toLowerCase().includes(R)||U.role?.toLowerCase().includes(R))}if(u&&p){let R;s[2]!==p||s[3]!==u?(R=(U,H)=>{let ce,ve;e:switch(u){case"member":{ce=U.user?.name||"",ve=H.user?.name||"";break e}case"role":{ce=U.role||"",ve=H.role||"";break e}case"joined":{ce=U.createdAt?typeof U.createdAt=="string"?U.createdAt:U.createdAt.toISOString():"",ve=H.createdAt?typeof H.createdAt=="string"?H.createdAt:H.createdAt.toISOString():"";break e}default:return 0}return p==="asc"?ce.localeCompare(ve):ve.localeCompare(ce)},s[2]=p,s[3]=u,s[4]=R):R=s[4],I=[...I].sort(R)}const w=I;let O;s[5]!==i||s[6]!==a?(O={mutationFn:en,onSuccess:()=>{a.invalidateQueries({queryKey:oe.members(i)}),J.success("Member has been removed from the organization"),o(null)},onError:Xt},s[5]=i,s[6]=a,s[7]=O):O=s[7];const A=fe(O);let L;s[8]!==i||s[9]!==a?(L={mutationFn:Jt,onSuccess:()=>{a.invalidateQueries({queryKey:oe.members(i)}),J.success("Member's role has been updated")},onError:Ht},s[8]=i,s[9]=a,s[10]=L):L=s[10];const E=fe(L);let _;s[11]!==i||s[12]!==a?(_={mutationFn:Wt,onSuccess:()=>{a.invalidateQueries({queryKey:oe.invitations(i)}),J.success("Invitation role has been updated")},onError:Yt},s[11]=i,s[12]=a,s[13]=_):_=s[13];const z=fe(_),{roles:N,customRoles:m}=us();let M;s[14]!==m?(M=zt(m),s[14]=m,s[15]=M):M=s[15];const V=M;let se;s[16]!==N?(se=N.filter(Zt),s[16]=N,s[17]=se):se=s[17];const F=se;let K;s[18]===Symbol.for("react.memo_cache_sentinel")?(K={id:"member",header:"Member",render:qt,cellClassName:"flex-1 min-w-0",sortable:!0},s[18]=K):K=s[18];let Q;s[19]!==V||s[20]!==F||s[21]!==z||s[22]!==E?(Q={id:"role",header:"Role",render:R=>R.type==="member"?t.jsx(Fe,{role:R.data.role,memberId:R.data.id,isOwner:R.data.role==="owner",roleColorMap:V,selectableRoles:F,onRoleChange:(U,H)=>E.mutate({memberId:U,role:H}),className:"w-36"}):t.jsx(Fe,{role:R.data.role,memberId:R.data.id,isOwner:!1,roleColorMap:V,selectableRoles:F,onRoleChange:(U,H)=>z.mutate({invitationId:U,role:H,email:R.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},s[19]=V,s[20]=F,s[21]=z,s[22]=E,s[23]=Q):Q=s[23];let Y;s[24]===Symbol.for("react.memo_cache_sentinel")?(Y={id:"joined",header:"Joined",render:Qt,cellClassName:"w-48 shrink-0",sortable:!0},s[24]=Y):Y=s[24];let ne;s[25]!==l.cancel.isPending||s[26]!==N||s[27]!==E?(ne={id:"actions",header:"",render:R=>R.type==="member"?t.jsx(Ns,{member:R.data,roles:N,onChangeRole:(U,H)=>E.mutate({memberId:U,role:H}),onRemove:o,isUpdating:E.isPending}):t.jsx(ys,{invitationId:R.data.id,onCancel:y,isCancelling:l.cancel.isPending}),cellClassName:"w-12 shrink-0"},s[25]=l.cancel.isPending,s[26]=N,s[27]=E,s[28]=ne):ne=s[28];let te;s[29]!==Q||s[30]!==ne?(te=[K,Q,Y,ne],s[29]=Q,s[30]=ne,s[31]=te):te=s[31];const D=te;let r;s[32]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(wt,{trigger:t.jsxs(ee,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:[t.jsx(ms,{size:16}),"Manage Roles"]})}),s[32]=r):r=s[32];let b;s[33]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs("div",{className:"flex items-center gap-2",children:[r,t.jsx(Ot,{trigger:t.jsx(ee,{size:"sm",children:"Invite Member"})})]}),s[33]=b):b=s[33];const $=b,le=[...w.map(Kt),...P.filter(Ft).map($t)],ie=es,W=!!x;let q;s[34]===Symbol.for("react.memo_cache_sentinel")?(q=()=>y(null),s[34]=q):q=s[34];let me;s[35]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsxs(Ae,{children:[t.jsx(Oe,{children:"Cancel Invitation"}),t.jsx(Re,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),s[35]=me):me=s[35];let k;s[36]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Pe,{children:"Keep Invitation"}),s[36]=k):k=s[36];let B;s[37]!==l.cancel||s[38]!==x?(B=()=>{x&&(l.cancel.mutate(x),y(null))},s[37]=l.cancel,s[38]=x,s[39]=B):B=s[39];let Z;s[40]!==l.cancel.isPending||s[41]!==B?(Z=t.jsxs(Te,{children:[me,t.jsxs(_e,{children:[k,t.jsx(Le,{onClick:B,disabled:l.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),s[40]=l.cancel.isPending,s[41]=B,s[42]=Z):Z=s[42];let ae;s[43]!==W||s[44]!==Z?(ae=t.jsx(we,{open:W,onOpenChange:q,children:Z}),s[43]=W,s[44]=Z,s[45]=ae):ae=s[45];const Ye=!!h;let Me;s[46]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>o(null),s[46]=Me):Me=s[46];let ze;s[47]===Symbol.for("react.memo_cache_sentinel")?(ze=t.jsxs(Ae,{children:[t.jsx(Oe,{children:"Remove Member"}),t.jsx(Re,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),s[47]=ze):ze=s[47];let ke;s[48]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx(Pe,{children:"Cancel"}),s[48]=ke):ke=s[48];let he;s[49]!==h||s[50]!==A?(he=()=>h&&A.mutate(h),s[49]=h,s[50]=A,s[51]=he):he=s[51];let ge;s[52]!==A.isPending||s[53]!==he?(ge=t.jsxs(Te,{children:[ze,t.jsxs(_e,{children:[ke,t.jsx(Le,{onClick:he,disabled:A.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),s[52]=A.isPending,s[53]=he,s[54]=ge):ge=s[54];let xe;s[55]!==Ye||s[56]!==ge?(xe=t.jsx(we,{open:Ye,onOpenChange:Me,children:ge}),s[55]=Ye,s[56]=ge,s[57]=xe):xe=s[57];let De;s[58]===Symbol.for("react.memo_cache_sentinel")?(De=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],s[58]=De):De=s[58];let pe;s[59]!==v||s[60]!==p||s[61]!==u||s[62]!==d?(pe=t.jsx(Bs,{title:"Members",viewMode:d,onViewModeChange:S,sortKey:u,sortDirection:p,onSort:v,sortOptions:De,ctaButton:$}),s[59]=v,s[60]=p,s[61]=u,s[62]=d,s[63]=pe):pe=s[63];let Be;s[64]===Symbol.for("react.memo_cache_sentinel")?(Be=R=>{R.key==="Escape"&&(T(""),R.target.blur())},s[64]=Be):Be=s[64];let be;s[65]!==f?(be=t.jsx(Ze,{value:f,onChange:T,placeholder:"Search members...",onKeyDown:Be}),s[65]=f,s[66]=be):be=s[66];const We=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:le.length===0?t.jsx(Je,{title:"No members found",description:f?`No members match "${f}"`:"Invite members to get started."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:le.map(R=>{if(R.type==="invitation")return t.jsxs(js,{className:"transition-colors relative opacity-75",children:[t.jsx("div",{className:"absolute top-4 right-4 z-10",children:t.jsx(ys,{invitationId:R.data.id,onCancel:y,isCancelling:l.cancel.isPending})}),t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(je,{fallback:Qe(R.data.email),shape:"circle",size:"lg",className:"shrink-0"}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:R.data.email}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(Ie,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),t.jsx(Fe,{role:R.data.role,memberId:R.data.id,isOwner:!1,roleColorMap:V,selectableRoles:F,onRoleChange:(H,ce)=>z.mutate({invitationId:H,role:ce,email:R.data.email}),className:"w-fit"})]})]})]},`inv-${R.data.id}`);const U=R.data;return t.jsxs(js,{className:"transition-colors relative",children:[t.jsx("div",{className:"absolute top-4 right-4 z-10",children:t.jsx(Ns,{member:U,roles:N,onChangeRole:(H,ce)=>E.mutate({memberId:H,role:ce}),onRemove:o,isUpdating:E.isPending})}),t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(je,{url:U.user?.image??void 0,fallback:Qe(U.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:U.user?.name||"Unknown"}),t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:U.user?.email}),t.jsx(Fe,{role:U.role,memberId:U.id,isOwner:U.role==="owner",roleColorMap:V,selectableRoles:F,onRoleChange:(H,ce)=>E.mutate({memberId:H,role:ce}),className:"w-fit"})]})]})]},U.id)})})}):t.jsx(Us,{columns:D,data:le,isLoading:!1,sortKey:u,sortDirection:p,onSort:v,emptyState:f?t.jsx(Je,{title:"No members found",description:`No members match "${f}"`}):t.jsx(Je,{title:"No members found",description:"Invite members to get started."})});let Ue;return s[67]!==ie||s[68]!==ae||s[69]!==xe||s[70]!==pe||s[71]!==be||s[72]!==We?(Ue=t.jsxs(ie,{children:[ae,xe,pe,be,We]}),s[67]=ie,s[68]=ae,s[69]=xe,s[70]=pe,s[71]=be,s[72]=We,s[73]=Ue):Ue=s[73],Ue}function $t(s){return{type:"invitation",data:s}}function Ft(s){return s.status==="pending"}function Kt(s){return{type:"member",data:s}}function Qt(s){return s.type==="member"?t.jsx("span",{className:"text-sm text-foreground",children:s.data.createdAt?kt(s.data.createdAt):"N/A"}):t.jsx(Ie,{variant:"outline",children:"Pending"})}function qt(s){return s.type==="member"?t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(je,{url:s.data.user?.image??void 0,fallback:Qe(s.data.user?.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:s.data.user?.name||"Unknown"}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:s.data.user?.email})]})]}):t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(je,{fallback:Qe(s.data.email),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:s.data.email}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function Zt(s){return s.role!=="owner"}function Yt(s){J.error(s instanceof Error?s.message:"Failed to update invitation role")}async function Wt(s){const{invitationId:e,role:n,email:l}=s,a=await X.organization.cancelInvitation({invitationId:e});if(a?.error)throw new Error(a.error.message);const i=await X.organization.inviteMember({email:l,role:n});if(i?.error)throw new Error(i.error.message)}function Ht(s){J.error(s instanceof Error?s.message:"Failed to update role")}async function Jt(s){const{memberId:e,role:n}=s,l=await X.organization.updateMemberRole({memberId:e,role:[n]});if(l?.error)throw new Error(l.error.message)}function Xt(s){J.error(s instanceof Error?s.message:"Failed to remove member")}async function en(s){const e=await X.organization.removeMember({memberIdOrEmail:s});if(e?.error)throw new Error(e.error.message)}function sn(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function $n(){const s=de.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(es,{children:t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),s[0]=e):e=s[0];let n;return s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(tt,{fallback:e,children:t.jsx(G.Suspense,{fallback:t.jsx(es,{children:t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(As,{size:32,className:"animate-spin text-muted-foreground"})})}),children:t.jsx(Vt,{})})}),s[1]=n):n=s[1],n}export{$n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as e}from"./index-Bz1LU39D.js";import{i as n}from"./Loading01-CdaWSExX.js";import{h as l}from"./mcp-oauth-BzcB2WNx.js";import"./auth-CNkA6dk2.js";function x(){const[s,c]=i.useState(null),[r,a]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":r?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):r?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{x as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a1 as ie,c as _,r as D,p as ae,K as X,am as ce,j as s,f as se,a as me,k as de,q as fe}from"./index-Bz1LU39D.js";import{b as ue,c as xe}from"./well-known-mcp-D13f-8h2.js";import{C as ge}from"./collection-header-CUphFaJM.js";import{I as pe,i as le}from"./FilterLines-CBfbdjv3.js";import{n as he}from"./Inbox01-DkMyh-FB.js";import{i as Y}from"./Loading01-CdaWSExX.js";import{i as re}from"./SearchMd-YxKkBPG0.js";import{c as je,a as ne,u as ve}from"./use-connection-BXdeHsm0.js";import{c as ye,E as Ne}from"./empty-state-DgOO5bI1.js";import{a as Ce,f as be,b as Se}from"./registry-utils-BIzwINzW.js";import{u as J}from"./project-context-provider-_aLYBfO9.js";import{s as we}from"./slugify-CEUa2lfQ.js";import{C as Te}from"./collection-search-DIEJ7x7R.js";import{M as ee}from"./mcp-server-card-BawKO-ZK.js";import{B as H,I as Ie}from"./input-CtiQUsvV.js";import{P as Re,a as $e,b as ke}from"./popover-QWczrvYc.js";import{i as Pe}from"./Check-Bkw0Gz-n.js";import{t as ze}from"./ChevronDown-mvTJP4-S.js";import{s as U}from"./XClose-D0utLGU3.js";import{d as Fe,a as Le,b as Ke,c as Ae,S as Ee}from"./select-Bxj6_TSM.js";import{s as De}from"./Plus-CovnOzP9.js";import{a as Be}from"./use-binding-UNVemCFv.js";import{L as Me,u as Oe}from"./localstorage-keys-5oG1CfEQ.js";import"./collection-display-button-DroTLKfu.js";import"./dropdown-menu-DjFWyTtD.js";import"./Grid01-BEpepbVy.js";import"./view-mode-toggle-CVcyaB_S.js";import"./Lock01-txD_UwBx.js";import"./Terminal-DYwA22tz.js";import"./card-XgDm8_H9.js";import"./github-icon-Dp3wHhYE.js";import"./auth-CNkA6dk2.js";function Ve(t,e){return ie(t,pe,e)}function We(t,e){const l=_.c(4),[n,c]=D.useState(t),r=D.useRef(null),i=D.useRef(!0);let o,p;return l[0]!==e||l[1]!==t?(o=()=>{if(i.current){i.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{c(t)},e),()=>{r.current&&clearTimeout(r.current)}},p=[t,e],l[0]=e,l[1]=t,l[2]=o,l[3]=p):(o=l[2],p=l[3]),D.useEffect(o,p),n}function qe(t){const e=_.c(14),l=D.useRef(null),n=`scroll-position:${t}`,c=D.useRef(null);let r;e[0]!==n?(r=()=>{l.current&&sessionStorage.setItem(n,String(l.current.scrollTop))},e[0]=n,e[1]=r):r=e[1];const i=r;let o;e[2]!==n?(o=()=>{if(c.current===n)return;const f=sessionStorage.getItem(n);if(f&&l.current){const y=Number.parseInt(f,10);l.current.scrollTop=y}c.current=n},e[2]=n,e[3]=o):o=e[3];const p=o;let j;e[4]!==p||e[5]!==n?(j=()=>{c.current!==n&&p()},e[4]=p,e[5]=n,e[6]=j):j=e[6];const u=j;let a;e[7]!==p||e[8]!==n?(a=f=>{l.current=f,f&&c.current!==n&&requestAnimationFrame(()=>{p()})},e[7]=p,e[8]=n,e[9]=a):a=e[9];const v=a;let d;return e[10]!==u||e[11]!==i||e[12]!==v?(d={scrollRef:v,saveScrollPosition:i,handleScroll:u},e[10]=u,e[11]=i,e[12]=v,e[13]=d):d=e[13],d}const _e=24;function Qe(t){const e=_.c(52),{registryId:l,listToolName:n,filtersToolName:c,search:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[o,p]=D.useState(i);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[1]=j):j=e[1];const[u,a]=D.useState(j);let v;e[2]!==l?(v=ye(l),e[2]=l,e[3]=v):v=e[3];const d=v,f=!!c;let y;e[4]!==c||e[5]!==l?(y=X.toolCall(l,c||"no-filters","{}"),e[4]=c,e[5]=l,e[6]=y):y=e[6];let N;e[7]!==c||e[8]!==d?(N=async()=>c?await d(c,{}):{tags:[],categories:[]},e[7]=c,e[8]=d,e[9]=N):N=e[9];let S;e[10]!==y||e[11]!==N?(S={queryKey:y,queryFn:N,staleTime:36e5},e[10]=y,e[11]=N,e[12]=S):S=e[12];const{data:k}=ae(S);let $,w,b;if(e[13]!==n||e[14]!==l||e[15]!==r||e[16]!==u||e[17]!==o){const V=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;$={limit:_e,...o.length>0&&{tags:o},...u.length>0&&{categories:u},...V&&{where:V}},b=Ve,w=X.toolCall(l,n,JSON.stringify($)),e[13]=n,e[14]=l,e[15]=r,e[16]=u,e[17]=o,e[18]=$,e[19]=w,e[20]=b}else $=e[18],w=e[19],b=e[20];let C;e[21]!==$||e[22]!==n||e[23]!==d?(C=async V=>{const{pageParam:Z}=V,oe=Z?{...$,cursor:Z}:$;return await d(n,oe)},e[21]=$,e[22]=n,e[23]=d,e[24]=C):C=e[24];let T;e[25]!==w||e[26]!==C?(T={queryKey:w,queryFn:C,initialPageParam:void 0,getNextPageParam:Ge,staleTime:36e5,placeholderData:ce},e[25]=w,e[26]=C,e[27]=T):T=e[27];const{data:P,fetchNextPage:z,hasNextPage:L,isFetchingNextPage:I,isFetching:m,isLoading:x}=b(T);let h;e:{if(!P?.pages||P.pages.length===0){h=null;break e}const V=P.pages[0];if(typeof V=="object"&&V!==null&&"totalCount"in V&&typeof V.totalCount=="number"){h=V.totalCount;break e}h=null}const R=h,F=P?.pages;let g;e[28]!==F?(g=Ce(F),e[28]=F,e[29]=g):g=e[29];const K=g;let A;e[30]!==r||e[31]!==u.length||e[32]!==o.length?(A=o.length>0||u.length>0||!!r?.trim(),e[30]=r,e[31]=u.length,e[32]=o.length,e[33]=A):A=e[33];const E=A,W=m&&!I&&!x&&E;let M;e[34]!==z||e[35]!==L||e[36]!==I?(M=()=>{L&&!I&&z()},e[34]=z,e[35]=L,e[36]=I,e[37]=M):M=e[37];const q=M,Q=L??!1,B=f?k?.tags:void 0,O=f?k?.categories:void 0;let G;return e[38]!==E||e[39]!==m||e[40]!==I||e[41]!==W||e[42]!==x||e[43]!==K||e[44]!==q||e[45]!==u||e[46]!==o||e[47]!==Q||e[48]!==B||e[49]!==O||e[50]!==R?(G={items:K,totalCount:R,hasMore:Q,isLoadingMore:I,isFiltering:W,isInitialLoading:x,isFetching:m,loadMore:q,availableTags:B,availableCategories:O,selectedTags:o,selectedCategories:u,setSelectedTags:p,setSelectedCategories:a,hasActiveFilters:E},e[38]=E,e[39]=m,e[40]=I,e[41]=W,e[42]=x,e[43]=K,e[44]=q,e[45]=u,e[46]=o,e[47]=Q,e[48]=B,e[49]=O,e[50]=R,e[51]=G):G=e[51],G}function Ge(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function He(t,e){return[...t].sort((l,n)=>n.count-l.count).slice(0,e)}function te(t){const e=_.c(52),{label:l,items:n,selectedItems:c,onToggle:r,onClear:i}=t,[o,p]=D.useState(""),[j,u]=D.useState(!1);let a,v,d,f,y,N,S,k,$,w,b;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==j||e[4]!==o||e[5]!==c){const I=[...o?n.filter(A=>A.value.toLowerCase().includes(o.toLowerCase())):n].sort(Ue);d=c.length,v=Re,$=j,w=u;let m;e[17]!==l?(m=s.jsx("span",{children:l}),e[17]=l,e[18]=m):m=e[18];let x;e[19]!==d?(x=d>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:d}),e[19]=d,e[20]=x):x=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ze,{size:14,className:"opacity-50"}),e[21]=h):h=e[21],e[22]!==x||e[23]!==m?(b=s.jsx($e,{asChild:!0,children:s.jsxs(H,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[m,x,h]})}),e[22]=x,e[23]=m,e[24]=b):b=e[24],a=ke,N="w-64 p-0",S="start";let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(re,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=R):R=e[25];let F;e[26]!==l?(F=l.toLowerCase(),e[26]=l,e[27]=F):F=e[27];const g=`Search ${F}...`;let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=A=>p(A.target.value),e[28]=K):K=e[28],e[29]!==o||e[30]!==g?(k=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[R,s.jsx(Ie,{type:"text",placeholder:g,value:o,onChange:K,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[29]=o,e[30]=g,e[31]=k):k=e[31],f="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",y=I.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):I.map(A=>{const E=c.includes(A.value);return s.jsxs("button",{onClick:()=>r(A.value),className:`w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors ${E?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"}`,children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[E&&s.jsx(Pe,{size:16,className:"text-muted-foreground shrink-0"}),A.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:A.count})]},A.value)}),e[0]=n,e[1]=l,e[2]=r,e[3]=j,e[4]=o,e[5]=c,e[6]=a,e[7]=v,e[8]=d,e[9]=f,e[10]=y,e[11]=N,e[12]=S,e[13]=k,e[14]=$,e[15]=w,e[16]=b}else a=e[6],v=e[7],d=e[8],f=e[9],y=e[10],N=e[11],S=e[12],k=e[13],$=e[14],w=e[15],b=e[16];let C;e[32]!==f||e[33]!==y?(C=s.jsx("div",{className:f,children:y}),e[32]=f,e[33]=y,e[34]=C):C=e[34];let T;e[35]!==l||e[36]!==i||e[37]!==d?(T=d>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(H,{variant:"ghost",size:"sm",onClick:i,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=i,e[37]=d,e[38]=T):T=e[38];let P;e[39]!==a||e[40]!==T||e[41]!==N||e[42]!==S||e[43]!==k||e[44]!==C?(P=s.jsxs(a,{className:N,align:S,children:[k,C,T]}),e[39]=a,e[40]=T,e[41]=N,e[42]=S,e[43]=k,e[44]=C,e[45]=P):P=e[45];let z;return e[46]!==v||e[47]!==P||e[48]!==$||e[49]!==w||e[50]!==b?(z=s.jsxs(v,{open:$,onOpenChange:w,children:[b,P]}),e[46]=v,e[47]=P,e[48]=$,e[49]=w,e[50]=b,e[51]=z):z=e[51],z}function Ue(t,e){return e.count-t.count}function Ye(t){const e=_.c(67),{availableTags:l,availableCategories:n,selectedTags:c,selectedCategories:r,onTagChange:i,onCategoryChange:o}=t,p=l&&l.length>0||n&&n.length>0,j=c.length>0||r.length>0;if(!p)return null;let u;e[0]!==i||e[1]!==c?(u=m=>{c.includes(m)?i(c.filter(x=>x!==m)):i([...c,m])},e[0]=i,e[1]=c,e[2]=u):u=e[2];const a=u;let v;e[3]!==o||e[4]!==r?(v=m=>{r.includes(m)?o(r.filter(x=>x!==m)):o([...r,m])},e[3]=o,e[4]=r,e[5]=v):v=e[5];const d=v;let f;e[6]!==o||e[7]!==i?(f=()=>{i([]),o([])},e[6]=o,e[7]=i,e[8]=f):f=e[8];const y=f;let N,S,k,$,w,b,C;if(e[9]!==n||e[10]!==l||e[11]!==o||e[12]!==i||e[13]!==r||e[14]!==c||e[15]!==d||e[16]!==a){const m=n?He(n,6):[];N=r,S=c,C=new Set(m.map(Je)),w="flex items-center border-b border-border";let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(le,{size:16})}),e[24]=x):x=e[24];let h;e[25]!==n||e[26]!==o||e[27]!==r||e[28]!==d?(h=n&&n.length>0&&s.jsx(te,{label:"Categories",items:n,selectedItems:r,onToggle:d,onClear:()=>o([])}),e[25]=n,e[26]=o,e[27]=r,e[28]=d,e[29]=h):h=e[29];let R;e[30]!==l||e[31]!==i||e[32]!==c||e[33]!==a?(R=l&&l.length>0&&s.jsx(te,{label:"Tags",items:l,selectedItems:c,onToggle:a,onClear:()=>i([])}),e[30]=l,e[31]=i,e[32]=c,e[33]=a,e[34]=R):R=e[34],e[35]!==R||e[36]!==h?(b=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[x,h,R]}),e[35]=R,e[36]=h,e[37]=b):b=e[37],k="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==r||e[39]!==d?(F=g=>{const K=r.includes(g.value);return s.jsxs("div",{onClick:()=>d(g.value),className:`inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer ${K?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"}`,children:[s.jsx("span",{children:g.value}),K&&s.jsx("span",{onClick:A=>{A.stopPropagation(),d(g.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(U,{size:12})})]},g.value)},e[38]=r,e[39]=d,e[40]=F):F=e[40],$=m.map(F),e[9]=n,e[10]=l,e[11]=o,e[12]=i,e[13]=r,e[14]=c,e[15]=d,e[16]=a,e[17]=N,e[18]=S,e[19]=k,e[20]=$,e[21]=w,e[22]=b,e[23]=C}else N=e[17],S=e[18],k=e[19],$=e[20],w=e[21],b=e[22],C=e[23];let T;if(e[41]!==N||e[42]!==d||e[43]!==C){let m;e[45]!==C?(m=h=>!C.has(h),e[45]=C,e[46]=m):m=e[46];let x;e[47]!==d?(x=h=>s.jsxs("div",{onClick:()=>d(h),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:h}),s.jsx("span",{onClick:R=>{R.stopPropagation(),d(h)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(U,{size:12})})]},`cat-${h}`),e[47]=d,e[48]=x):x=e[48],T=N.filter(m).map(x),e[41]=N,e[42]=d,e[43]=C,e[44]=T}else T=e[44];let P;if(e[49]!==S||e[50]!==a){let m;e[52]!==a?(m=x=>s.jsxs("div",{onClick:()=>a(x),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:x}),s.jsx("span",{onClick:h=>{h.stopPropagation(),a(x)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(U,{size:12})})]},`tag-${x}`),e[52]=a,e[53]=m):m=e[53],P=S.map(m),e[49]=S,e[50]=a,e[51]=P}else P=e[51];let z;e[54]!==y||e[55]!==j?(z=j&&s.jsxs(H,{variant:"ghost",size:"sm",onClick:y,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(U,{size:14}),"Clear all"]}),e[54]=y,e[55]=j,e[56]=z):z=e[56];let L;e[57]!==z||e[58]!==k||e[59]!==$||e[60]!==T||e[61]!==P?(L=s.jsxs("div",{className:k,children:[$,T,P,z]}),e[57]=z,e[58]=k,e[59]=$,e[60]=T,e[61]=P,e[62]=L):L=e[62];let I;return e[63]!==L||e[64]!==w||e[65]!==b?(I=s.jsxs("div",{className:w,children:[b,L]}),e[63]=L,e[64]=w,e[65]=b,e[66]=I):I=e[66],I}function Je(t){return t.value}function Ze(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(n=>(n.name||n.title||"").toLowerCase().includes(l)||(n.description||n.server.description||"").toLowerCase().includes(l))}function Xe(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function et(t){const e=_.c(54),{registryId:l,listToolName:n,filtersToolName:c}=t,[r,i]=D.useState(""),o=We(r,300),p=se(),{org:j}=J(),{scrollRef:u,saveScrollPosition:a,handleScroll:v}=qe(`store-discovery:${l}`);let d;e[0]!==o||e[1]!==c||e[2]!==n||e[3]!==l?(d={registryId:l,listToolName:n,filtersToolName:c,search:o},e[0]=o,e[1]=c,e[2]=n,e[3]=l,e[4]=d):d=e[4];const{items:f,hasMore:y,isLoadingMore:N,isInitialLoading:S,isFetching:k,loadMore:$,availableTags:w,availableCategories:b,selectedTags:C,selectedCategories:T,setSelectedTags:P,setSelectedCategories:z,hasActiveFilters:L}=Qe(d);let I,m,x,h;e[5]!==o||e[6]!==k||e[7]!==S||e[8]!==f||e[9]!==r?(I=r?Ze(f,r):f,m=(r!==o||k)&&!S&&!!r,h=I.filter(Xe),x=I.filter(B=>!h.find(O=>O.id===B.id)),e[5]=o,e[6]=k,e[7]=S,e[8]=f,e[9]=r,e[10]=I,e[11]=m,e[12]=x,e[13]=h):(I=e[10],m=e[11],x=e[12],h=e[13]);const R=x;let F;e[14]!==p||e[15]!==j.slug||e[16]!==l||e[17]!==a?(F=B=>{a();const O=we(B.name||B.title||B.server.title||""),G=B.server.name;p({to:"/$org/store/$appName",params:{org:j.slug,appName:O},search:{registryId:l,serverName:G}})},e[14]=p,e[15]=j.slug,e[16]=l,e[17]=a,e[18]=F):F=e[18];const g=F;let K;e[19]!==v||e[20]!==y||e[21]!==N||e[22]!==$?(K=B=>{if(v(),!y||N)return;const O=B.currentTarget;O.scrollHeight-O.scrollTop-O.clientHeight<200&&$()},e[19]=v,e[20]=y,e[21]=N,e[22]=$,e[23]=K):K=e[23];const A=K;let E;e[24]!==m||e[25]!==r?(E=s.jsx(Te,{value:r,onChange:i,placeholder:"Search for an MCP Server...",isSearching:m}),e[24]=m,e[25]=r,e[26]=E):E=e[26];let W;e[27]!==b||e[28]!==w||e[29]!==T||e[30]!==C||e[31]!==z||e[32]!==P?(W=s.jsx(Ye,{availableTags:w,availableCategories:b,selectedTags:C,selectedCategories:T,onTagChange:P,onCategoryChange:z}),e[27]=b,e[28]=w,e[29]=T,e[30]=C,e[31]=z,e[32]=P,e[33]=W):W=e[33];let M;e[34]!==R||e[35]!==I||e[36]!==g||e[37]!==L||e[38]!==y||e[39]!==S||e[40]!==N||e[41]!==m||e[42]!==f||e[43]!==r||e[44]!==h?(M=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:S?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Y,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):f.length===0&&!L?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(he,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):f.length===0&&L&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(le,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&I.length===0&&!m?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(re,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[m&&I.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Y,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),h.length>0&&s.jsx(ee,{items:h,title:"Verified",onItemClick:g}),R.length>0&&s.jsx(ee,{items:R,title:h.length>0?"All":"",onItemClick:g}),y&&N&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(Y,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=R,e[35]=I,e[36]=g,e[37]=L,e[38]=y,e[39]=S,e[40]=N,e[41]=m,e[42]=f,e[43]=r,e[44]=h,e[45]=M):M=e[45];let q;e[46]!==A||e[47]!==u||e[48]!==M?(q=s.jsx("div",{ref:u,className:"flex-1 overflow-y-auto",onScroll:A,children:M}),e[46]=A,e[47]=u,e[48]=M,e[49]=q):q=e[49];let Q;return e[50]!==E||e[51]!==W||e[52]!==q?(Q=s.jsxs("div",{className:"flex flex-col h-full",children:[E,W,q]}),e[50]=E,e[51]=W,e[52]=q,e[53]=Q):Q=e[53],Q}function tt(t){const e=_.c(8),{registryId:l}=t,n=je(l),c=n?.tools;let r;e[0]!==c?(r=be(c),e[0]=c,e[1]=r):r=e[1];const i=r;if(!i)throw new Error("This registry does not support listing store items.");const o=n?.tools;let p;e[2]!==o?(p=Se(o),e[2]=o,e[3]=p):p=e[3];const u=p||void 0;let a;return e[4]!==i||e[5]!==l||e[6]!==u?(a=s.jsx(et,{registryId:l,listToolName:i,filtersToolName:u}),e[4]=i,e[5]=l,e[6]=u,e[7]=a):a=e[7],a}function st(t){const e=_.c(15),{registries:l,value:n,onValueChange:c,onAddWellKnown:r,wellKnownRegistries:i,placeholder:o}=t,p=o===void 0?"Select a registry...":o;let j;e[0]!==p?(j=s.jsx(Le,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ke,{placeholder:p})}),e[0]=p,e[1]=j):j=e[1];let u;e[2]!==l?(u=l.map(lt),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==r||e[5]!==i?(a=i.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),i.map(f=>s.jsxs("button",{onClick:y=>{y.preventDefault(),y.stopPropagation(),r(f)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[f.icon?s.jsx("img",{src:f.icon,alt:f.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:f.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:f.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(De,{size:16})})]},f.id??f.title))]}),e[4]=r,e[5]=i,e[6]=a):a=e[6];let v;e[7]!==u||e[8]!==a?(v=s.jsxs(Ae,{children:[u,a]}),e[7]=u,e[8]=a,e[9]=v):v=e[9];let d;return e[10]!==c||e[11]!==j||e[12]!==v||e[13]!==n?(d=s.jsxs(Ee,{value:n,onValueChange:c,children:[j,v]}),e[10]=c,e[11]=j,e[12]=v,e[13]=n,e[14]=d):d=e[14],d}function lt(t){return s.jsx(Fe,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function rt({registries:t,onConnected:e}){const l=ne(),{org:{slug:n}}=J(),{data:c}=me.useSession(),r=se(),[i,o]=D.useState(!1),p=t[0],j=async()=>{if(!(!p||!c?.user?.id)){o(!0);try{const a=await l.create.mutateAsync(p);e?.(a.id)}finally{o(!1)}}},u=()=>{r({to:"/$org/mcps",params:{org:n},search:{action:"create"}})};return s.jsx(Ne,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"outline",onClick:j,disabled:i||!p,children:[p?.icon&&s.jsx("img",{src:p.icon,alt:"",className:"size-4"}),i?"Installing...":"Install Registry"]}),s.jsx(H,{variant:"outline",onClick:u,children:"Custom Connection"})]})})}function Ot(){const t=_.c(41),{org:e}=J(),l=ve(),n=ne(),c=de(),r=c.location.pathname.includes("/store/")&&c.location.pathname.split("/").length>3,i=Be(l);let o;t[0]!==i?(o=i.map(it),t[0]=i,t[1]=o):o=t[1];const p=o;let j;t[2]!==e.slug?(j=Me.selectedRegistry(e.slug),t[2]=e.slug,t[3]=j):j=t[3];const[u,a]=Oe(j,ot);let v;if(t[4]!==i||t[5]!==u){let g;t[7]!==u?(g=K=>K.id===u,t[7]=u,t[8]=g):g=t[8],v=i.find(g),t[4]=i,t[5]=u,t[6]=v}else v=t[6];const f=v?.id||i[0]?.id||"";let y;t[9]!==e.id?(y=ue(e.id),t[9]=e.id,t[10]=y):y=t[10];let N;t[11]!==y?(N=[y],t[11]=y,t[12]=N):N=t[12];const S=N;let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k=[xe()],t[13]=k):k=t[13];const $=k;let w;t[14]!==n.create||t[15]!==a?(w=async g=>{const K=await n.create.mutateAsync(g);a(K.id)},t[14]=n.create,t[15]=a,t[16]=w):w=t[16];const b=w;let C;t[17]!==i?(C=new Set(i.map(nt)),t[17]=i,t[18]=C):C=t[18];const T=C;let P;t[19]!==T||t[20]!==S?(P=S.filter(g=>g.id&&!T.has(g.id)),t[19]=T,t[20]=S,t[21]=P):P=t[21];const z=P;let L;t[22]!==T?(L=$.filter(g=>g.id&&!T.has(g.id)),t[22]=T,t[23]=L):L=t[23];const I=L;if(r){let g;return t[24]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{}),t[24]=g):g=t[24],g}let m;t[25]!==b?(m=async g=>b(g),t[25]=b,t[26]=m):m=t[26];let x;t[27]!==z||t[28]!==f||t[29]!==p||t[30]!==a||t[31]!==m?(x=s.jsx(ge,{title:"Store",ctaButton:s.jsx(st,{wellKnownRegistries:z,registries:p,value:f,onValueChange:a,onAddWellKnown:m,placeholder:"Select store..."})}),t[27]=z,t[28]=f,t[29]=p,t[30]=a,t[31]=m,t[32]=x):x=t[32];let h;t[33]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Y,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=h):h=t[33];let R;t[34]!==I||t[35]!==f||t[36]!==a?(R=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(D.Suspense,{fallback:h,children:f?s.jsx(tt,{registryId:f}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(rt,{registries:I,onConnected:g=>{a(g)}})})})}),t[34]=I,t[35]=f,t[36]=a,t[37]=R):R=t[37];let F;return t[38]!==x||t[39]!==R?(F=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[x,R]}),t[38]=x,t[39]=R,t[40]=F):F=t[40],F}function nt(t){return t.id}function ot(t){return t??""}function it(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Ot as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as _,c as v,j as n}from"./index-Bz1LU39D.js";import{B as z}from"./input-CtiQUsvV.js";import{u as k,b as y,T as E,a as B,c as S}from"./project-context-provider-_aLYBfO9.js";import{u as w,a as A}from"./use-organization-settings-DBRSoBd0.js";const C=({size:c=24,color:e="currentColor",...r})=>_.createElement("svg",{viewBox:"0 0 24 24",width:c,height:c,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},_.createElement("path",{d:"M12 15v7M8 7.308v2.13c0 .209 0 .313-.02.412a1.001 1.001 0 0 1-.09.254c-.045.09-.11.172-.24.334L6.08 12.4c-.666.833-.999 1.249-.999 1.599a1 1 0 0 0 .376.782C5.731 15 6.264 15 7.33 15h9.342c1.066 0 1.599 0 1.873-.219A1 1 0 0 0 18.92 14c0-.35-.333-.766-1-1.599l-1.569-1.962c-.13-.162-.195-.243-.241-.334a1.004 1.004 0 0 1-.09-.254C16 9.75 16 9.647 16 9.44V7.31c0-.116 0-.174.007-.23.006-.05.015-.1.029-.15a2.02 2.02 0 0 1 .079-.215l1.008-2.52c.294-.735.44-1.102.38-1.397a1 1 0 0 0-.427-.63C16.825 2 16.429 2 15.637 2H8.364c-.792 0-1.188 0-1.44.167a1 1 0 0 0-.426.63c-.06.295.086.662.38 1.397l1.008 2.52c.043.107.064.16.08.215a1 1 0 0 1 .028.15c.006.056.006.114.006.23Z"}));C.displayName="Pin01";function O(c){const e=v.c(19),{title:r,url:t,icon:f}=c,{org:P}=k(),i=w(P.id),h=A(P.id);let l;e[0]!==i?.sidebar_items||e[1]!==t?(l=i?.sidebar_items?.some(p=>p.url===t),e[0]=i?.sidebar_items,e[1]=t,e[2]=l):l=e[2];const a=!!l;let d;e[3]!==h.update||e[4]!==f||e[5]!==a||e[6]!==i?.sidebar_items||e[7]!==r||e[8]!==t?(d=async()=>{const p=i?.sidebar_items||[];let j;a?j=p.filter(T=>T.url!==t):j=[...p,{title:r,url:t,icon:f}],await h.update.mutateAsync({sidebar_items:j})},e[3]=h.update,e[4]=f,e[5]=a,e[6]=i?.sidebar_items,e[7]=r,e[8]=t,e[9]=d):d=e[9];const b=d,x=a?"secondary":"outline";let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(C,{size:16}),e[10]=m):m=e[10];let s;e[11]!==b||e[12]!==x?(s=n.jsx(y,{asChild:!0,children:n.jsx(z,{onClick:b,size:"icon",variant:x,className:"size-7 border border-input",children:m})}),e[11]=b,e[12]=x,e[13]=s):s=e[13];const g=a?"Pinned":"Pin to sidebar";let o;e[14]!==g?(o=n.jsx(E,{children:g}),e[14]=g,e[15]=o):o=e[15];let u;return e[16]!==s||e[17]!==o?(u=n.jsx(B,{children:n.jsxs(S,{children:[s,o]})}),e[16]=s,e[17]=o,e[18]=u):u=e[18],u}export{O as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,av as O,ai as $,j as c,ay as z,ac as L,aE as G,aa as _,ad as w,af as g,aw as E,ae as j,ax as H,aT as K,aU as U,aV as V,aW as W,aX as B,az as X,aA as Z,aB as q,c as R}from"./index-Bz1LU39D.js";import{c as J}from"./input-CtiQUsvV.js";var m="Popover",[b]=L(m,[O]),P=O(),[Q,u]=b(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=P(e),l=i.useRef(null),[d,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(z,{...p,children:c.jsx(Q,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:d,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=u(F,o),a=P(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(E,{...a,...r,ref:e})});Y.displayName=F;var y="PopoverTrigger",S=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(y,o),a=P(o),s=_(e,n.triggerRef),p=c.jsx(w.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:s,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(E,{asChild:!0,...a,children:p})});S.displayName=y;var A="PopoverPortal",[ee,oe]=b(A,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=u(A,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})})})};D.displayName=A;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=u(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})})});M.displayName=v;var te=V("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=_(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return K(s)},[]),c.jsx(U,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,d=p.button===2||l;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(T,{...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()}})}),T=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,...x}=t,f=u(v,o),C=P(o);return W(),c.jsx(B,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(X,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":I(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)"}})})})}),k="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(k,o);return c.jsx(w.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=k;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(q,{...n,...r,ref:e})});ce.displayName=se;function I(t){return t?"open":"closed"}var ie=N,pe=S,le=D,de=M;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 ge(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 Pe(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=J("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 d;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(d=c.jsx(le,{children:c.jsx(de,{"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]=d):d=e[11],d}export{ve as P,ge as a,Pe as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as d,ad as H,ac as Z,av as $,aa as G,aw as ee,af as C,ae as z,ax as te,az as oe,aA as re,bx as ne,aE as se,ai as ae,ay as ie,aB as le,c as j}from"./index-Bz1LU39D.js";import{c as ce}from"./input-CtiQUsvV.js";var ue=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),de="VisuallyHidden",V=i.forwardRef((o,e)=>d.jsx(H.span,{...o,ref:e,style:{...ue,...o.style}}));V.displayName=de;var pe=V,[O]=Z("Tooltip",[$]),D=$(),F="TooltipProvider",fe=700,L="tooltip.open",[ve,k]=O(F),B=o=>{const{__scopeTooltip:e,delayDuration:t=fe,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=i.useRef(!0),c=i.useRef(!1),a=i.useRef(0);return i.useEffect(()=>{const u=a.current;return()=>window.clearTimeout(u)},[]),d.jsx(ve,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:i.useCallback(()=>{window.clearTimeout(a.current),l.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:i.useCallback(u=>{c.current=u},[]),disableHoverableContent:n,children:s})};B.displayName=F;var R="Tooltip",[xe,_]=O(R),U=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=o,a=k(R,o.__scopeTooltip),u=D(e),[p,v]=i.useState(null),x=se(),f=i.useRef(0),h=l??a.disableHoverableContent,m=c??a.delayDuration,g=i.useRef(!1),[y,T]=ae({prop:r,defaultProp:n??!1,onChange:M=>{M?(a.onOpen(),document.dispatchEvent(new CustomEvent(L))):a.onClose(),s?.(M)},caller:R}),w=i.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),P=i.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,T(!0)},[T]),E=i.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),I=i.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,T(!0),f.current=0},m)},[m,T]);return i.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(ie,{...u,children:d.jsx(xe,{scope:e,contentId:x,open:y,stateAttribute:w,trigger:p,onTriggerChange:v,onTriggerEnter:i.useCallback(()=>{a.isOpenDelayedRef.current?I():P()},[a.isOpenDelayedRef,I,P]),onTriggerLeave:i.useCallback(()=>{h?E():(window.clearTimeout(f.current),f.current=0)},[E,h]),onOpen:P,onClose:E,disableHoverableContent:h,children:t})})};U.displayName=R;var A="TooltipTrigger",Y=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(A,t),s=k(A,t),l=D(t),c=i.useRef(null),a=G(e,c,n.onTriggerChange),u=i.useRef(!1),p=i.useRef(!1),v=i.useCallback(()=>u.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),d.jsx(ee,{asChild:!0,...l,children:d.jsx(H.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:a,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{u.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});Y.displayName=A;var N="TooltipPortal",[he,ge]=O(N,{forceMount:void 0}),W=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(N,e);return d.jsx(he,{scope:e,forceMount:t,children:d.jsx(z,{present:t||s.open,children:d.jsx(te,{asChild:!0,container:n,children:r})})})};W.displayName=N;var b="TooltipContent",q=i.forwardRef((o,e)=>{const t=ge(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return d.jsx(z,{present:r||l.open,children:l.disableHoverableContent?d.jsx(X,{side:n,...s,ref:e}):d.jsx(me,{side:n,...s,ref:e})})}),me=i.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=i.useRef(null),s=G(e,n),[l,c]=i.useState(null),{trigger:a,onClose:u}=t,p=n.current,{onPointerInTransitChange:v}=r,x=i.useCallback(()=>{c(null),v(!1)},[v]),f=i.useCallback((h,m)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},T=be(y,g.getBoundingClientRect()),w=we(y,T),P=Pe(m.getBoundingClientRect()),E=Re([...w,...P]);c(E),v(!0)},[v]);return i.useEffect(()=>()=>x(),[x]),i.useEffect(()=>{if(a&&p){const h=g=>f(g,p),m=g=>f(g,a);return a.addEventListener("pointerleave",h),p.addEventListener("pointerleave",m),()=>{a.removeEventListener("pointerleave",h),p.removeEventListener("pointerleave",m)}}},[a,p,f,x]),i.useEffect(()=>{if(l){const h=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},T=a?.contains(g)||p?.contains(g),w=!Ee(y,l);T?x():w&&(x(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[a,p,l,u,x]),d.jsx(X,{...o,ref:s})}),[Te,ye]=O(R,{isInside:!1}),Ce=ne("TooltipContent"),X=i.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=o,a=_(b,t),u=D(t),{onClose:p}=a;return i.useEffect(()=>(document.addEventListener(L,p),()=>document.removeEventListener(L,p)),[p]),i.useEffect(()=>{if(a.trigger){const v=x=>{x.target?.contains(a.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[a.trigger,p]),d.jsx(oe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:d.jsxs(re,{"data-state":a.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(Ce,{children:r}),d.jsx(Te,{scope:t,isInside:!0,children:d.jsx(pe,{id:a.contentId,role:"tooltip",children:n||r})})]})})});q.displayName=b;var J="TooltipArrow",K=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=D(t);return ye(J,t).isInside?null:d.jsx(le,{...n,...r,ref:e})});K.displayName=J;function be(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function we(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function Pe(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function Ee(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const c=e[s],a=e[l],u=c.x,p=c.y,v=a.x,x=a.y;p>r!=x>r&&t<(v-u)*(r-p)/(x-p)+u&&(n=!n)}return n}function Re(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),je(e)}function je(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var _e=B,Oe=U,De=Y,Le=W,Ae=q,ke=K;function Ne(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=d.jsx(_e,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function He(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=d.jsx(Ne,{children:d.jsx(Oe,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function $e(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=d.jsx(De,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Ge(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let c;e[5]!==r?(c=ce("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=c):c=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(ke,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==c?(u=d.jsx(Le,{children:d.jsxs(Ae,{"data-slot":"tooltip-content",sideOffset:l,className:c,...n,children:[t,a]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=c,e[12]=u):u=e[12],u}const S="org-admin",Ie={from({org:o,project:e}){if(o?.includes("/")||e.includes("/"))throw new Error("Org or project cannot contain slashes");return`${o}/${e}`},parse(o){o.startsWith("/")&&(o=o.slice(1));const[e,t]=o.split("/");if(!e||!t)throw new Error("Invalid locator");return{org:e,project:t}},isOrgAdminProject(o){return o.split("/")[1]===S},adminProject(o){return`${o}/${S}`}},Q=i.createContext(void 0),ze=()=>{const o=i.useContext(Q);if(!o)throw new Error("useProjectContext must be used within a ProjectContextProvider");return o},Ve=o=>{const e=j.c(10),{children:t,org:r,project:n}=o;let s;e[0]!==r.slug||e[1]!==n.slug?(s=Ie.from({org:r.slug,project:n.slug}),e[0]=r.slug,e[1]=n.slug,e[2]=s):s=e[2];const l=s;let c;e[3]!==l||e[4]!==r||e[5]!==n?(c={org:r,project:n,locator:l},e[3]=l,e[4]=r,e[5]=n,e[6]=c):c=e[6];const a=c;let u;return e[7]!==t||e[8]!==a?(u=d.jsx(Q.Provider,{value:a,children:t}),e[7]=t,e[8]=a,e[9]=u):u=e[9],u};export{Ie as L,S as O,Ve as P,Ge as T,ue as V,Ne as a,$e as b,He as c,ze as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as f,a7 as Pn,c as He,j as he}from"./index-Bz1LU39D.js";import{c as Je}from"./input-CtiQUsvV.js";const Ye=({size:n=24,color:e="currentColor",...t})=>f.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},f.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));Ye.displayName="DotsGrid";const Ee=f.createContext(null);Ee.displayName="PanelGroupContext";const A={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},_e=10,ne=f.useLayoutEffect,Fe=Pn.useId,wn=typeof Fe=="function"?Fe:()=>null;let En=0;function Ge(n=null){const e=wn(),t=f.useRef(n||e||null);return t.current===null&&(t.current=""+En++),n??t.current}function Qe({children:n,className:e="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:a,minSize:s,onCollapse:h,onExpand:w,onResize:p,order:u,style:v,tagName:z="div",...C}){const E=f.useContext(Ee);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:S,expandPanel:L,getPanelSize:N,getPanelStyle:D,groupId:V,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:F,resizePanel:q,unregisterPanel:W}=E,G=Ge(l),M=f.useRef({callbacks:{onCollapse:h,onExpand:w,onResize:p},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:a,minSize:s},id:G,idIsFromProps:l!==void 0,order:u});f.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:_,constraints:H}=M.current,B={...H};M.current.id=G,M.current.idIsFromProps=l!==void 0,M.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,H.collapsedSize=t,H.collapsible=r,H.defaultSize=i,H.maxSize=a,H.minSize=s,(B.collapsedSize!==H.collapsedSize||B.collapsible!==H.collapsible||B.maxSize!==H.maxSize||B.minSize!==H.minSize)&&P(M.current,B)}),ne(()=>{const _=M.current;return F(_),()=>{W(_)}},[u,G,F,W]),f.useImperativeHandle(o,()=>({collapse:()=>{S(M.current)},expand:_=>{L(M.current,_)},getId(){return G},getSize(){return N(M.current)},isCollapsed(){return R(M.current)},isExpanded(){return!R(M.current)},resize:_=>{q(M.current,_)}}),[S,L,N,R,G,q]);const Y=D(M.current,i);return f.createElement(z,{...C,children:n,className:e,id:G,style:{...Y,...v},[A.groupId]:V,[A.panel]:"",[A.panelCollapsible]:r||void 0,[A.panelId]:G,[A.panelSize]:parseFloat(""+Y.flexGrow).toFixed(1)})}const en=f.forwardRef((n,e)=>f.createElement(Qe,{...n,forwardedRef:e}));Qe.displayName="Panel";en.displayName="forwardRef(Panel)";let De=null,Se=-1,J=null;function Cn(n,e){if(e){const t=(e&ln)!==0,r=(e&an)!==0,i=(e&sn)!==0,o=(e&un)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function In(){J!==null&&(document.head.removeChild(J),De=null,J=null,Se=-1)}function ke(n,e){var t,r;const i=Cn(n,e);if(De!==i){if(De=i,J===null&&(J=document.createElement("style"),document.head.appendChild(J)),Se>=0){var o;(o=J.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=J.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function nn(n){return n.type==="keydown"}function tn(n){return n.type.startsWith("pointer")}function rn(n){return n.type.startsWith("mouse")}function Ce(n){if(tn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(rn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Rn(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ln(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function kn(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:Ve(n),b:Ve(e)};let r;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),r=n;x(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ue(Ke(t.a)),b:Ue(Ke(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let a=o.length;for(;a--;){const s=o[a];if(s===l.a)return 1;if(s===l.b)return-1}}return Math.sign(i.a-i.b)}const An=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Mn(n){var e;const t=getComputedStyle((e=on(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Nn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Mn(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||An.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ke(n){let e=n.length;for(;e--;){const t=n[e];if(x(t,"Missing node"),Nn(t))return t}return null}function Ue(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Ve(n){const e=[];for(;n;)e.push(n),n=on(n);return e}function on(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const ln=1,an=2,sn=4,un=8,$n=Rn()==="coarse";let U=[],ae=!1,ee=new Map,Ie=new Map;const ze=new Set;function Dn(n,e,t,r,i){var o;const{ownerDocument:l}=e,a={direction:t,element:e,hitAreaMargins:r,setResizeHandlerState:i},s=(o=ee.get(l))!==null&&o!==void 0?o:0;return ee.set(l,s+1),ze.add(a),Pe(),function(){var w;Ie.delete(n),ze.delete(a);const p=(w=ee.get(l))!==null&&w!==void 0?w:1;if(ee.set(l,p-1),Pe(),p===1&&ee.delete(l),U.includes(a)){const u=U.indexOf(a);u>=0&&U.splice(u,1),Te(),i("up",!0,null)}}}function Hn(n){const{target:e}=n,{x:t,y:r}=Ce(n);ae=!0,Be({target:e,x:t,y:r}),Pe(),U.length>0&&(we("down",n),n.preventDefault(),cn(e)||n.stopImmediatePropagation())}function Ae(n){const{x:e,y:t}=Ce(n);if(ae&&n.buttons===0&&(ae=!1,we("up",n)),!ae){const{target:r}=n;Be({target:r,x:e,y:t})}we("move",n),Te(),U.length>0&&n.preventDefault()}function Me(n){const{target:e}=n,{x:t,y:r}=Ce(n);Ie.clear(),ae=!1,U.length>0&&(n.preventDefault(),cn(e)||n.stopImmediatePropagation()),we("up",n),Be({target:e,x:t,y:r}),Te(),Pe()}function cn(n){let e=n;for(;e;){if(e.hasAttribute(A.resizeHandle))return!0;e=e.parentElement}return!1}function Be({target:n,x:e,y:t}){U.splice(0);let r=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(r=n),ze.forEach(i=>{const{element:o,hitAreaMargins:l}=i,a=o.getBoundingClientRect(),{bottom:s,left:h,right:w,top:p}=a,u=$n?l.coarse:l.fine;if(e>=h-u&&e<=w+u&&t>=p-u&&t<=s+u){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&kn(r,o)>0){let z=r,C=!1;for(;z&&!z.contains(o);){if(Ln(z.getBoundingClientRect(),a)){C=!0;break}z=z.parentElement}if(C)return}U.push(i)}})}function Ne(n,e){Ie.set(n,e)}function Te(){let n=!1,e=!1;U.forEach(r=>{const{direction:i}=r;i==="horizontal"?n=!0:e=!0});let t=0;Ie.forEach(r=>{t|=r}),n&&e?ke("intersection",t):n?ke("horizontal",t):e?ke("vertical",t):In()}let $e=new AbortController;function Pe(){$e.abort(),$e=new AbortController;const n={capture:!0,signal:$e.signal};ze.size&&(ae?(U.length>0&&ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("contextmenu",Me,n),r.addEventListener("pointerleave",Ae,n),r.addEventListener("pointermove",Ae,n))}),window.addEventListener("pointerup",Me,n),window.addEventListener("pointercancel",Me,n)):ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("pointerdown",Hn,n),r.addEventListener("pointermove",Ae,n))}))}function we(n,e){ze.forEach(t=>{const{setResizeHandlerState:r}=t,i=U.includes(t);r(n,i,e)})}function _n(){const[n,e]=f.useState(0);return f.useCallback(()=>e(t=>t+1),[])}function x(n,e){if(!n)throw console.error(e),Error(e)}function te(n,e,t=_e){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function X(n,e,t=_e){return te(n,e,t)===0}function j(n,e,t){return te(n,e,t)===0}function Gn(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++){const i=n[r],o=e[r];if(!j(i,o,t))return!1}return!0}function le({panelConstraints:n,panelIndex:e,size:t}){const r=n[e];x(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:a=0}=r;if(te(t,a)<0)if(o){const s=(i+a)/2;te(t,s)<0?t=i:t=a}else t=a;return t=Math.min(l,t),t=parseFloat(t.toFixed(_e)),t}function ge({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(j(n,0))return e;const l=[...e],[a,s]=r;x(a!=null,"Invalid first pivot index"),x(s!=null,"Invalid second pivot index");let h=0;if(o==="keyboard"){{const p=n<0?s:a,u=t[p];x(u,`Panel constraints not found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,v)){const S=C-E;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}{const p=n<0?a:s,u=t[p];x(u,`No panel constraints found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,C)){const S=E-v;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}}{const p=n<0?1:-1;let u=n<0?s:a,v=0;for(;;){const C=e[u];x(C!=null,`Previous layout not found for panel index ${u}`);const S=le({panelConstraints:t,panelIndex:u,size:100})-C;if(v+=S,u+=p,u<0||u>=t.length)break}const z=Math.min(Math.abs(n),Math.abs(v));n=n<0?0-z:z}{let u=n<0?a:s;for(;u>=0&&u<t.length;){const v=Math.abs(n)-Math.abs(h),z=e[u];x(z!=null,`Previous layout not found for panel index ${u}`);const C=z-v,E=le({panelConstraints:t,panelIndex:u,size:C});if(!j(z,E)&&(h+=z-E,l[u]=E,h.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?u--:u++}}if(Gn(i,l))return i;{const p=n<0?s:a,u=e[p];x(u!=null,`Previous layout not found for panel index ${p}`);const v=u+h,z=le({panelConstraints:t,panelIndex:p,size:v});if(l[p]=z,!j(z,v)){let C=v-z,S=n<0?s:a;for(;S>=0&&S<t.length;){const L=l[S];x(L!=null,`Previous layout not found for panel index ${S}`);const N=L+C,D=le({panelConstraints:t,panelIndex:S,size:N});if(j(L,D)||(C-=D-L,l[S]=D),j(C,0))break;n>0?S--:S++}}}const w=l.reduce((p,u)=>u+p,0);return j(w,100)?l:i}function Bn({layout:n,panelsArray:e,pivotIndices:t}){let r=0,i=100,o=0,l=0;const a=t[0];x(a!=null,"No pivot index found"),e.forEach((p,u)=>{const{constraints:v}=p,{maxSize:z=100,minSize:C=0}=v;u===a?(r=C,i=z):(o+=C,l+=z)});const s=Math.min(i,100-o),h=Math.max(r,100-l),w=n[a];return{valueMax:s,valueMin:h,valueNow:w}}function ye(n,e=document){return Array.from(e.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${n}"]`))}function fn(n,e,t=document){const i=ye(n,t).findIndex(o=>o.getAttribute(A.resizeHandleId)===e);return i??null}function dn(n,e,t){const r=fn(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function pn(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return r||null}function Re(n,e=document){const t=e.querySelector(`[${A.resizeHandleId}="${n}"]`);return t||null}function Tn(n,e,t,r=document){var i,o,l,a;const s=Re(e,r),h=ye(n,r),w=s?h.indexOf(s):-1,p=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,u=(l=(a=t[w+1])===null||a===void 0?void 0:a.id)!==null&&l!==void 0?l:null;return[p,u]}function Wn({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){f.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const a=ye(t,o);for(let s=0;s<i.length-1;s++){const{valueMax:h,valueMin:w,valueNow:p}=Bn({layout:r,panelsArray:i,pivotIndices:[s,s+1]}),u=a[s];if(u!=null){const v=i[s];x(v,`No panel data found for index "${s}"`),u.setAttribute("aria-controls",v.id),u.setAttribute("aria-valuemax",""+Math.round(h)),u.setAttribute("aria-valuemin",""+Math.round(w)),u.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{a.forEach((s,h)=>{s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")})}},[t,r,i,o]),f.useEffect(()=>{if(!o)return;const a=e.current;x(a,"Eager values not found");const{panelDataArray:s}=a,h=pn(t,o);x(h!=null,`No group found for id "${t}"`);const w=ye(t,o);x(w,`No resize handles found for group id "${t}"`);const p=w.map(u=>{const v=u.getAttribute(A.resizeHandleId);x(v,"Resize handle element has no handle id attribute");const[z,C]=Tn(t,v,s,o);if(z==null||C==null)return()=>{};const E=S=>{if(!S.defaultPrevented)switch(S.key){case"Enter":{S.preventDefault();const L=s.findIndex(N=>N.id===z);if(L>=0){const N=s[L];x(N,`No panel data found for index ${L}`);const D=r[L],{collapsedSize:V=0,collapsible:R,minSize:P=0}=N.constraints;if(D!=null&&R){const F=ge({delta:j(D,V)?P-V:V-D,initialLayout:r,panelConstraints:s.map(q=>q.constraints),pivotIndices:dn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==F&&l(F)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,n,e,t,r,i,l])}function Ze(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function gn(n,e){const t=n==="horizontal",{x:r,y:i}=Ce(e);return t?r:i}function jn(n,e,t,r,i){const o=t==="horizontal",l=Re(e,i);x(l,`No resize handle element found for id "${e}"`);const a=l.getAttribute(A.groupId);x(a,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=r;const h=gn(t,n),w=pn(a,i);x(w,`No group element found for id "${a}"`);const p=w.getBoundingClientRect(),u=o?p.width:p.height;return(h-s)/u*100}function Fn(n,e,t,r,i,o){if(nn(n)){const l=t==="horizontal";let a=0;n.shiftKey?a=100:i!=null?a=i:a=10;let s=0;switch(n.key){case"ArrowDown":s=l?0:a;break;case"ArrowLeft":s=l?-a:0;break;case"ArrowRight":s=l?a:0;break;case"ArrowUp":s=l?0:-a;break;case"End":s=100;break;case"Home":s=-100;break}return s}else return r==null?0:jn(n,e,t,r,o)}function Kn({panelDataArray:n}){const e=Array(n.length),t=n.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;a!=null&&(r++,e[o]=a,i-=a)}for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;if(a!=null)continue;const s=n.length-r,h=i/s;r++,e[o]=h,i-=h}return e}function oe(n,e,t){e.forEach((r,i)=>{const o=n[i];x(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:a,id:s}=o,{collapsedSize:h=0,collapsible:w}=a,p=t[s];if(p==null||r!==p){t[s]=r;const{onCollapse:u,onExpand:v,onResize:z}=l;z&&z(r,p),w&&(u||v)&&(v&&(p==null||X(p,h))&&!X(r,h)&&v(),u&&(p==null||!X(p,h))&&X(r,h)&&u())}})}function be(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function Un({defaultSize:n,dragState:e,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let a;return l==null?a=n!=null?n.toPrecision(o):"1":r.length===1?a="1":a=l.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Vn(n,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...i)},e)}}function Oe(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function mn(n){return`react-resizable-panels:${n}`}function hn(n){return n.map(e=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=e;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function zn(n,e){try{const t=mn(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Zn(n,e,t){var r,i;const o=(r=zn(n,t))!==null&&r!==void 0?r:{},l=hn(e);return(i=o[l])!==null&&i!==void 0?i:null}function On(n,e,t,r,i){var o;const l=mn(n),a=hn(e),s=(o=zn(n,i))!==null&&o!==void 0?o:{};s[a]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(s))}catch(h){console.error(h)}}function qe({layout:n,panelConstraints:e}){const t=[...n],r=t.reduce((o,l)=>o+l,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!j(r,100)&&t.length>0)for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=100/r*l;t[o]=a}let i=0;for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=le({panelConstraints:e,panelIndex:o,size:l});l!=a&&(i+=l-a,t[o]=a)}if(!j(i,0))for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=l+i,s=le({panelConstraints:e,panelIndex:o,size:a});if(l!==s&&(i-=s-l,t[o]=s,j(i,0)))break}return t}const qn=100,me={getItem:n=>(Oe(me),me.getItem(n)),setItem:(n,e)=>{Oe(me),me.setItem(n,e)}},Xe={};function yn({autoSaveId:n=null,children:e,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:a=null,storage:s=me,style:h,tagName:w="div",...p}){const u=Ge(o),v=f.useRef(null),[z,C]=f.useState(null),[E,S]=f.useState([]),L=_n(),N=f.useRef({}),D=f.useRef(new Map),V=f.useRef(0),R=f.useRef({autoSaveId:n,direction:r,dragState:z,id:u,keyboardResizeBy:a,onLayout:l,storage:s}),P=f.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});f.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f.useImperativeHandle(i,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:c}=P.current;return c},setLayout:c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current,d=qe({layout:c,panelConstraints:g.map(y=>y.constraints)});Ze(b,d)||(S(d),P.current.layout=d,m&&m(d),oe(g,d,N.current))}}),[]),ne(()=>{R.current.autoSaveId=n,R.current.direction=r,R.current.dragState=z,R.current.id=u,R.current.onLayout=l,R.current.storage=s}),Wn({committedValuesRef:R,eagerValuesRef:P,groupId:u,layout:E,panelDataArray:P.current.panelDataArray,setLayout:S,panelGroupElement:v.current}),f.useEffect(()=>{const{panelDataArray:c}=P.current;if(n){if(E.length===0||E.length!==c.length)return;let m=Xe[n];m==null&&(m=Vn(On,qn),Xe[n]=m);const b=[...c],g=new Map(D.current);m(n,b,g,E,s)}},[n,E,s]),f.useEffect(()=>{});const F=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(Z=>Z.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:$}=Q(g,c,b);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!X(I,y)){D.current.set(c.id,I);const O=ie(g,c)===g.length-1?I-y:y-I,k=ge({delta:O,initialLayout:b,panelConstraints:d,pivotIndices:$,prevLayout:b,trigger:"imperative-api"});be(b,k)||(S(k),P.current.layout=k,m&&m(k),oe(g,k,N.current))}}},[]),q=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current;if(c.constraints.collapsible){const y=d.map(K=>K.constraints),{collapsedSize:I=0,panelSize:$=0,minSize:Z=0,pivotIndices:O}=Q(d,c,g),k=m??Z;if(X($,I)){const K=D.current.get(c.id),de=K!=null&&K>=k?K:k,Le=ie(d,c)===d.length-1?$-de:de-$,T=ge({delta:Le,initialLayout:g,panelConstraints:y,pivotIndices:O,prevLayout:g,trigger:"imperative-api"});be(g,T)||(S(T),P.current.layout=T,b&&b(T),oe(d,T,N.current))}}},[]),W=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{panelSize:g}=Q(b,c,m);return x(g!=null,`Panel size not found for panel "${c.id}"`),g},[]),G=f.useCallback((c,m)=>{const{panelDataArray:b}=P.current,g=ie(b,c);return Un({defaultSize:m,dragState:z,layout:E,panelData:b,panelIndex:g})},[z,E]),M=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),d===!0&&X(y,g)},[]),Y=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),!d||te(y,g)>0},[]),_=f.useCallback(c=>{const{panelDataArray:m}=P.current;m.push(c),m.sort((b,g)=>{const d=b.order,y=g.order;return d==null&&y==null?0:d==null?-1:y==null?1:d-y}),P.current.panelDataArrayChanged=!0,L()},[L]);ne(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:c,onLayout:m,storage:b}=R.current,{layout:g,panelDataArray:d}=P.current;let y=null;if(c){const $=Zn(c,d,b);$&&(D.current=new Map(Object.entries($.expandToSizes)),y=$.layout)}y==null&&(y=Kn({panelDataArray:d}));const I=qe({layout:y,panelConstraints:d.map($=>$.constraints)});Ze(g,I)||(S(I),P.current.layout=I,m&&m(I),oe(d,I,N.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const H=f.useCallback(c=>{let m=!1;const b=v.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(m=!0),function(d){d.preventDefault();const y=v.current;if(!y)return()=>null;const{direction:I,dragState:$,id:Z,keyboardResizeBy:O,onLayout:k}=R.current,{layout:K,panelDataArray:de}=P.current,{initialLayout:ve}=$??{},Le=dn(Z,c,y);let T=Fn(d,c,I,$,O,y);const We=I==="horizontal";We&&m&&(T=-T);const bn=de.map(Sn=>Sn.constraints),pe=ge({delta:T,initialLayout:ve??K,panelConstraints:bn,pivotIndices:Le,prevLayout:K,trigger:nn(d)?"keyboard":"mouse-or-touch"}),je=!be(K,pe);(tn(d)||rn(d))&&V.current!=T&&(V.current=T,!je&&T!==0?We?Ne(c,T<0?ln:an):Ne(c,T<0?sn:un):Ne(c,0)),je&&(S(pe),P.current.layout=pe,k&&k(pe),oe(de,pe,N.current))}},[]),B=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current,y=d.map(K=>K.constraints),{panelSize:I,pivotIndices:$}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const O=ie(d,c)===d.length-1?I-m:m-I,k=ge({delta:O,initialLayout:g,panelConstraints:y,pivotIndices:$,prevLayout:g,trigger:"imperative-api"});be(g,k)||(S(k),P.current.layout=k,b&&b(k),oe(d,k,N.current))},[]),se=f.useCallback((c,m)=>{const{layout:b,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:$,maxSize:Z=100,minSize:O=0}=c.constraints,{panelSize:k}=Q(g,c,b);k!=null&&(y&&$&&X(k,d)?X(d,I)||B(c,I):k<O?B(c,O):k>Z&&B(c,Z))},[B]),ue=f.useCallback((c,m)=>{const{direction:b}=R.current,{layout:g}=P.current;if(!v.current)return;const d=Re(c,v.current);x(d,`Drag handle element not found for id "${c}"`);const y=gn(b,m);C({dragHandleId:c,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:y,initialLayout:g})},[]),ce=f.useCallback(()=>{C(null)},[]),xe=f.useCallback(c=>{const{panelDataArray:m}=P.current,b=ie(m,c);b>=0&&(m.splice(b,1),delete N.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:F,direction:r,dragState:z,expandPanel:q,getPanelSize:W,getPanelStyle:G,groupId:u,isPanelCollapsed:M,isPanelExpanded:Y,reevaluatePanelConstraints:se,registerPanel:_,registerResizeHandle:H,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:xe,panelGroupElement:v.current}),[F,z,r,q,W,G,u,M,Y,se,_,H,B,ue,ce,xe]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return f.createElement(Ee.Provider,{value:re},f.createElement(w,{...p,children:e,className:t,id:o,ref:v,style:{...fe,...h},[A.group]:"",[A.groupDirection]:r,[A.groupId]:u}))}const xn=f.forwardRef((n,e)=>f.createElement(yn,{...n,forwardedRef:e}));yn.displayName="PanelGroup";xn.displayName="forwardRef(PanelGroup)";function ie(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Q(n,e,t){const r=ie(n,e),o=r===n.length-1?[r-1,r]:[r,r+1],l=t[r];return{...e.constraints,panelSize:l,pivotIndices:o}}function Xn({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:r}){f.useEffect(()=>{if(n||t==null||r==null)return;const i=Re(e,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const a=i.getAttribute(A.groupId);x(a,`No group element found for id "${a}"`);const s=ye(a,r),h=fn(a,e,r);x(h!==null,`No resize element found for id "${e}"`);const w=l.shiftKey?h>0?h-1:s.length-1:h+1<s.length?h+1:0;s[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,n,e,t])}function vn({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:a,onFocus:s,onPointerDown:h,onPointerUp:w,style:p={},tabIndex:u=0,tagName:v="div",...z}){var C,E;const S=f.useRef(null),L=f.useRef({onClick:l,onDragging:a,onPointerDown:h,onPointerUp:w});f.useEffect(()=>{L.current.onClick=l,L.current.onDragging=a,L.current.onPointerDown=h,L.current.onPointerUp=w});const N=f.useContext(Ee);if(N===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:V,registerResizeHandle:R,startDragging:P,stopDragging:F,panelGroupElement:q}=N,W=Ge(i),[G,M]=f.useState("inactive"),[Y,_]=f.useState(!1),[H,B]=f.useState(null),se=f.useRef({state:G});ne(()=>{se.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(W);B(()=>re)}},[t,W,R]);const ue=(C=r?.coarse)!==null&&C!==void 0?C:15,ce=(E=r?.fine)!==null&&E!==void 0?E:5;f.useEffect(()=>{if(t||H==null)return;const re=S.current;x(re,"Element ref not attached");let fe=!1;return Dn(W,re,D,{coarse:ue,fine:ce},(m,b,g)=>{if(!b){M("inactive");return}switch(m){case"down":{M("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(W,g);const{onDragging:d,onPointerDown:y}=L.current;d?.(!0),y?.();break}case"move":{const{state:d}=se.current;fe=!0,d!=="drag"&&M("hover"),x(g,'Expected event to be defined for "move" action'),H(g);break}case"up":{M("hover"),F();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y?.(!1),I?.(),fe||d?.();break}}})},[ue,D,t,ce,R,W,H,P,F]),Xn({disabled:t,handleId:W,resizeHandler:H,panelGroupElement:q});const xe={touchAction:"none",userSelect:"none"};return f.createElement(v,{...z,children:n,className:e,id:i,onBlur:()=>{_(!1),o?.()},onFocus:()=>{_(!0),s?.()},ref:S,role:"separator",style:{...xe,...p},tabIndex:u,[A.groupDirection]:D,[A.groupId]:V,[A.resizeHandle]:"",[A.resizeHandleActive]:G==="drag"?"pointer":Y?"keyboard":void 0,[A.resizeHandleEnabled]:!t,[A.resizeHandleId]:W,[A.resizeHandleState]:G})}vn.displayName="PanelResizeHandle";function Qn(n){const e=He.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=Je("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[3]=t,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=he.jsx(xn,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function et(n){const e=He.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let r;return e[2]!==t?(r=he.jsx(en,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=r):r=e[3],r}function nt(n){const e=He.c(12);let t,r,i;e[0]!==n?({withHandle:i,className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i):(t=e[1],r=e[2],i=e[3]);let o;e[4]!==t?(o=Je("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=o):o=e[5];let l;e[6]!==i?(l=i&&he.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:he.jsx(Ye,{className:"size-2.5"})}),e[6]=i,e[7]=l):l=e[7];let a;return e[8]!==r||e[9]!==o||e[10]!==l?(a=he.jsx(vn,{"data-slot":"resizable-handle",className:o,...r,children:l}),e[8]=r,e[9]=o,e[10]=l,e[11]=a):a=e[11],a}export{et as R,nt as a,Qn as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as x,j as u}from"./index-Bz1LU39D.js";import{c,B as p}from"./input-CtiQUsvV.js";import{B as g}from"./badge-8BCP2QJ_.js";function j(f){const e=x.c(12),{tabs:d,activeTab:n,onTabChange:s,className:l}=f;let t;e[0]!==l?(t=c("flex items-center gap-2 overflow-x-auto no-scrollbar",l),e[0]=l,e[1]=t):t=e[1];let o;if(e[2]!==n||e[3]!==s||e[4]!==d){let i;e[6]!==n||e[7]!==s?(i=r=>{const m=n===r.id;return u.jsxs(p,{variant:"outline",size:"sm",onClick:()=>s(r.id),className:c("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",m&&"bg-muted border-input text-foreground font-medium",!m&&"text-muted-foreground font-normal"),children:[r.label,r.count!==void 0&&u.jsx(g,{variant:"secondary",className:c("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",m?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:r.count})]},r.id)},e[6]=n,e[7]=s,e[8]=i):i=e[8],o=d.map(i),e[2]=n,e[3]=s,e[4]=d,e[5]=o}else o=e[5];let a;return e[9]!==t||e[10]!==o?(a=u.jsx("div",{className:t,children:o}),e[9]=t,e[10]=o,e[11]=a):a=e[11],a}export{j as R};
|