import{S as he,i as ge,s as be,y as R,z as U,A as j,g as C,d as E,B as z,R as te,k as D,a as M,e as Y,l as T,m as B,h as g,c as H,n as P,b as S,J as I,v as G,f as J,a1 as X,a5 as $e,q as A,r as q,u as F,a3 as pe,a6 as _e,a7 as ve,H as ne,K as ke,a8 as Ce,P as we}from"../chunks/index.01827105.js";import{g as ye}from"../chunks/navigation.29c1b9b9.js";import{P as Ee,q as Ie,d as Se,a as Ve,h as me}from"../chunks/Page.635e2ebb.js";import{g as De,C as Te,t as Be,a as Pe,I as re,d as Ne,b as Ae,c as qe,V as Le,T as Oe}from"../chunks/ConceptView.0172a944.js";import{a as Re,B as Ue}from"../chunks/taskMonitoringStore.f29f8009.js";import{g as je,M as ze}from"../chunks/urlHashStore.8012d85b.js";import{c as le,S as de}from"../chunks/utils.fafae123.js";function se(o,t,n){const e=o.slice();return e[3]=t[n].namespace,e[14]=t[n].concepts,e}function ae(o,t,n){const e=o.slice();e[24]=t[n];const l=e[24].acls.write;return e[25]=l,e}function Me(o){let t,n,e=o[7],l=[];for(let s=0;sE(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;sE(_[i],1,1,()=>{_[i]=null});return{c(){t=D("div"),n=D("div"),$.c(),e=M(),l=D("div"),u&&u.c(),c=M();for(let i=0;i<_.length;i+=1)_[i].c();s=Y(),this.h()},l(i){t=T(i,"DIV",{class:!0});var h=B(t);n=T(h,"DIV",{});var f=B(n);$.l(f),f.forEach(g),e=H(h),l=T(h,"DIV",{class:!0});var N=B(l);u&&u.l(N),N.forEach(g),h.forEach(g),c=H(i);for(let b=0;b<_.length;b+=1)_[b].l(i);s=Y(),this.h()},h(){P(l,"class","opacity-70"),P(t,"class","flex flex-row justify-between border-b border-gray-200 bg-neutral-50 p-3 text-sm opacity-80 hover:bg-gray-100")},m(i,h){S(i,t,h),I(t,n),$.m(n,null),I(t,e),I(t,l),u&&u.m(l,null),S(i,c,h);for(let f=0;f<_.length;f+=1)_[f]&&_[f].m(i,h);S(i,s,h),p=!0,r||(m=_e(me.call(null,l,{text:"Your concepts are only visible to you when logged in with Google."})),r=!0)},p(i,h){if(v===(v=w(i))&&$?$.p(i,h):($.d(1),$=v(i),$&&($.c(),$.m(n,null))),i[3]===i[1]?u?h&130&&C(u,1):(u=ce(),u.c(),C(u,1),u.m(l,null)):u&&(G(),E(u,1,1,()=>{u=null}),J()),h&145){d=i[14];let f;for(f=0;f{V[L]=null}),J()),~n?(e=V[n],e?e.p(a,k):(e=V[n]=_[n](a),e.c()),C(e,1),e.m(t,null)):e=null);let O=r;r=N(a),r===O?~r&&f[r].p(a,k):(m&&(G(),E(f[O],1,1,()=>{f[O]=null}),J()),~r?(m=f[r],m?m.p(a,k):(m=f[r]=h[r](a),m.c()),C(m,1),m.m(p,null)):m=null),a[4]?b?(b.p(a,k),k&16&&C(b,1)):(b=ue(a),b.c(),C(b,1),b.m(u.parentNode,u)):b&&(G(),E(b,1,1,()=>{b=null}),J())},i(a){d||(C(e),C(m),C(v.$$.fragment,a),C(b),d=!0)},o(a){E(e),E(m),E(v.$$.fragment,a),E(b),d=!1},d(a){a&&g(t),~n&&V[n].d(),a&&g(l),a&&g(c),~r&&f[r].d(),a&&g(w),z(v,a),a&&g($),b&&b.d(a),a&&g(u)}}}function Xe(o){let t;return{c(){t=A("Add Concept")},l(n){t=q(n,"Add Concept")},m(n,e){S(n,t,e)},d(n){n&&g(t)}}}function Ze(o){let t,n,e;return n=new Ue({props:{size:"small",$$slots:{default:[Xe]},$$scope:{ctx:o}}}),n.$on("click",o[17]),{c(){t=D("div"),R(n.$$.fragment),this.h()},l(l){t=T(l,"DIV",{slot:!0});var c=B(t);U(n.$$.fragment,c),c.forEach(g),this.h()},h(){P(t,"slot","header-right")},m(l,c){S(l,t,c),j(n,t,null),e=!0},p(l,c){const s={};c&268435456&&(s.$$scope={dirty:c,ctx:l}),n.$set(s)},i(l){e||(C(n.$$.fragment,l),e=!0)},o(l){E(n.$$.fragment,l),e=!1},d(l){l&&g(t),z(n)}}}function xe(o){let t,n;return t=new Ee({props:{title:"Concepts",$$slots:{"header-right":[Ze],default:[We]},$$scope:{ctx:o}}}),{c(){R(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,l){j(t,e,l),n=!0},p(e,[l]){const c={};l&268436439&&(c.$$scope={dirty:l,ctx:e}),t.$set(c)},i(e){n||(C(t.$$.fragment,e),n=!0)},o(e){E(t.$$.fragment,e),n=!1},d(e){z(t,e)}}}function et(o,t,n){let e,l,c,s,p,r,m,w,v,$=X,u=()=>($(),$=$e(s,y=>n(9,v=y)),s);o.$$.on_destroy.push(()=>$());let d,_;const V=je();te(o,V,y=>n(16,w=y));let i=null;const h=Ie();te(o,h,y=>n(2,m=y));const f=Se();te(o,f,y=>n(8,p=y));const N=Re();te(o,N,y=>n(15,r=y));function b(){if(i==null)return;const{namespace:y,name:Q}=i;p.mutate([y,Q],{onSuccess:()=>{var W;for(const[Z,x]of Object.entries(Ne)){const ee=(W=ve(qe[Z]).selectRowsSchema)==null?void 0:W.data;x.deleteConcept(y,Q,ee)}n(4,i=null)}})}const a=()=>Be({command:Pe.CreateConcept,onCreate:y=>ye(le(y.detail.namespace,y.detail.name))}),k=y=>n(4,i={namespace:y.namespace,name:y.name}),L=()=>n(4,i=null),O=()=>n(4,i=null),K=()=>b();return o.$$.update=()=>{var y,Q,W,Z;o.$$.dirty&65545&&w.onUrlChange("concepts",x=>{if(x=="")n(3,d=void 0),n(0,_=void 0);else{const[ee,oe]=x.split("/");(d!=ee||_!=oe)&&(n(3,d=ee),n(0,_=oe))}}),o.$$.dirty&32768&&n(1,e=(Q=(y=r.data)==null?void 0:y.user)==null?void 0:Q.id),o.$$.dirty&6&&n(7,l=De(m.data||[],e)),o.$$.dirty&32768&&n(6,c=(Z=(W=r.data)==null?void 0:W.user)==null?void 0:Z.given_name),o.$$.dirty&9&&u(n(5,s=d&&_?Ve(d,_):void 0))},[_,e,m,d,i,s,c,l,p,v,V,f,N,b,h,r,w,a,k,L,O,K]}class ct extends he{constructor(t){super(),ge(this,t,et,xe,be,{})}}export{ct as component};