UNPKG

decocms

Version:

Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools

2 lines (1 loc) • 1.6 kB
import{c as w,b as S,l as x,a6 as T,r as V}from"./index-ztdGKvBm.js";import{u as b}from"./use-in-settings-CFQ9B3W2.js";import{u as h}from"./use-project-scope-BwqdbGG4.js";import{a as v}from"./thread-route-CfpvvkkL.js";import{a as _}from"./repository-binding-D_Xc1yRH.js";function $(){const t=w.c(16),e=S(),o=h(),r=_(o),c=b();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={select:j},t[0]=i):i=t[0];const s=x(i),n=s?.mainView==="overview";let a;t[1]!==r?.title||t[2]!==e?(a=r?.title??e("common.loading"),t[1]=r?.title,t[2]=e,t[3]=a):a=t[3];const m=a;let l;t[4]!==n||t[5]!==s?.mainView||t[6]!==s?.pageTitle||t[7]!==m||t[8]!==o||t[9]!==e?(l=n?o?m:e("sidebar.navDestinations.home"):s?.mainView==="files"?e("sidebar.navDestinations.context"):e(s?.pageTitle??"page.view"),t[4]=n,t[5]=s?.mainView,t[6]=s?.pageTitle,t[7]=m,t[8]=o,t[9]=e,t[10]=l):l=t[10];const p=l,f=o?r:null;let u;return t[11]!==c||t[12]!==n||t[13]!==f||t[14]!==p?(u={project:f,title:p,isHome:n,inSettings:c},t[11]=c,t[12]=n,t[13]=f,t[14]=p,t[15]=u):u=t[15],u}function j(t){return t.matches.findLast(C)?.staticData}function C(t){return t.staticData.pageTitle}let g=null;const d=new Set,I=t=>(d.add(t),()=>{d.delete(t)});function H(){const t=w.c(5),e=$(),{org:o}=T(),r=v(),c=V.useSyncExternalStore(I,D,y);if(e.inSettings)return null;const i=`${o.id}:${r??""}:${e.project?.id??""}:${e.title}`;if(i===c)return null;let s;t[0]!==i?(s=()=>{g=i;for(const a of d)a()},t[0]=i,t[1]=s):s=t[1];let n;return t[2]!==s||t[3]!==e?(n={...e,dismiss:s},t[2]=s,t[3]=e,t[4]=n):n=t[4],n}function y(){return g}function D(){return g}export{$ as a,H as u};