import{S as me,i as de,s as he,y as O,z as R,A as j,g as w,d as I,B as z,R as x,k as S,a as M,e as J,l as T,m as B,h as g,c as U,n as P,b as D,J as V,v as K,f as G,a1 as W,a5 as ge,q,r as A,u as Y,a3 as ie,a6 as fe,a7 as be,H as ee,K as $e,a8 as ve,P as ke}from"../chunks/index.01827105.js";import{g as ye}from"../chunks/navigation.d2b4b49c.js";import{P as Ce,q as we,d as Ee,a as Ie,h as ue}from"../chunks/Page.635e2ebb.js";import{g as Ve,C as De,t as Se,a as Te,I as ne,d as Be,b as Pe,c as Ne,V as qe,T as Ae}from"../chunks/ConceptView.4261977c.js";import{a as He,B as Le}from"../chunks/taskMonitoringStore.f29f8009.js";import{M as Oe,u as Re}from"../chunks/urlHashStore.ac1cecd5.js";import{c as te,S as _e}from"../chunks/utils.9f56da00.js";function le(o,t,n){const e=o.slice();return e[3]=t[n].namespace,e[13]=t[n].concepts,e}function oe(o,t,n){const e=o.slice();e[23]=t[n];const l=e[23].acls.write;return e[24]=l,e}function je(o){let t,n,e=o[7],l=[];for(let a=0;aI(l[a],1,1,()=>{l[a]=null});return{c(){for(let a=0;aI(p[u],1,1,()=>{p[u]=null});return{c(){t=S("div"),n=S("div"),b.c(),e=M(),l=S("div"),f&&f.c(),c=M();for(let u=0;u{f=null}),G()),d&145){h=u[13];let i;for(i=0;i{E[H]=null}),G()),~n?(e=E[n],e?e.p(s,C):(e=E[n]=p[n](s),e.c()),w(e,1),e.m(t,null)):e=null);let L=r;r=N(s),r===L?~r&&i[r].p(s,C):(m&&(K(),I(i[L],1,1,()=>{i[L]=null}),G()),~r?(m=i[r],m?m.p(s,C):(m=i[r]=d[r](s),m.c()),w(m,1),m.m(_,null)):m=null),s[4]?$?($.p(s,C),C&16&&w($,1)):($=ce(s),$.c(),w($,1),$.m(f.parentNode,f)):$&&(K(),I($,1,1,()=>{$=null}),G())},i(s){h||(w(e),w(m),w(v.$$.fragment,s),w($),h=!0)},o(s){I(e),I(m),I(v.$$.fragment,s),I($),h=!1},d(s){s&&g(t),~n&&E[n].d(),s&&g(l),s&&g(c),~r&&i[r].d(),s&&g(y),z(v,s),s&&g(b),$&&$.d(s),s&&g(f)}}}function Qe(o){let t;return{c(){t=q("Add Concept")},l(n){t=A(n,"Add Concept")},m(n,e){D(n,t,e)},d(n){n&&g(t)}}}function We(o){let t,n,e;return n=new Le({props:{size:"small",$$slots:{default:[Qe]},$$scope:{ctx:o}}}),n.$on("click",o[16]),{c(){t=S("div"),O(n.$$.fragment),this.h()},l(l){t=T(l,"DIV",{slot:!0});var c=B(t);R(n.$$.fragment,c),c.forEach(g),this.h()},h(){P(t,"slot","header-right")},m(l,c){D(l,t,c),j(n,t,null),e=!0},p(l,c){const a={};c&134217728&&(a.$$scope={dirty:c,ctx:l}),n.$set(a)},i(l){e||(w(n.$$.fragment,l),e=!0)},o(l){I(n.$$.fragment,l),e=!1},d(l){l&&g(t),z(n)}}}function Xe(o){let t,n;return t=new Ce({props:{title:"Concepts",$$slots:{"header-right":[We],default:[Fe]},$$scope:{ctx:o}}}),{c(){O(t.$$.fragment)},l(e){R(t.$$.fragment,e)},m(e,l){j(t,e,l),n=!0},p(e,[l]){const c={};l&134218711&&(c.$$scope={dirty:l,ctx:e}),t.$set(c)},i(e){n||(w(t.$$.fragment,e),n=!0)},o(e){I(t.$$.fragment,e),n=!1},d(e){z(t,e)}}}function Ze(o,t,n){let e,l,c,a,_,r,m,y,v,b=W,f=()=>(b(),b=ge(a,k=>n(9,v=k)),a);x(o,Re,k=>n(15,y=k)),o.$$.on_destroy.push(()=>b());let h,p,E=null;const u=we();x(o,u,k=>n(2,m=k));const d=Ee();x(o,d,k=>n(8,_=k));const i=He();x(o,i,k=>n(14,r=k));function N(){if(E==null)return;const{namespace:k,name:F}=E;_.mutate([k,F],{onSuccess:()=>{var Q;for(const[X,Z]of Object.entries(Be)){const pe=(Q=be(Ne[X]).selectRowsSchema)==null?void 0:Q.data;Z.deleteConcept(k,F,pe)}n(4,E=null)}})}const $=()=>Se({command:Te.CreateConcept,onCreate:k=>ye(te(k.detail.namespace,k.detail.name))}),s=k=>n(4,E={namespace:k.namespace,name:k.name}),C=()=>n(4,E=null),H=()=>n(4,E=null),L=()=>N();return o.$$.update=()=>{var k,F,Q,X;o.$$.dirty&32768&&y.onHashChange("",()=>{n(3,h=void 0),n(0,p=void 0)}),o.$$.dirty&32768&&y.onHashChange("/(?.+)/(?.+)",Z=>{n(3,h=Z.namespace),n(0,p=Z.conceptName)}),o.$$.dirty&16384&&n(1,e=(F=(k=r.data)==null?void 0:k.user)==null?void 0:F.id),o.$$.dirty&6&&n(7,l=Ve(m.data||[],e)),o.$$.dirty&16384&&n(6,c=(X=(Q=r.data)==null?void 0:Q.user)==null?void 0:X.given_name),o.$$.dirty&9&&f(n(5,a=h&&p?Ie(h,p):void 0))},[p,e,m,h,E,a,c,l,_,v,d,i,N,u,r,y,$,s,C,H,L]}class at extends me{constructor(t){super(),de(this,t,Ze,Xe,he,{})}}export{at as component};