import{S as ke,i as we,s as ye,y as L,z as O,A as U,g as $,d as v,B as A,O as te,a as q,c as F,b as H,h,k as w,l as y,m as E,n as C,a0 as _,v as x,f as ee,w as Ee,U as Ce,q as B,r as M,F as Z,G as ie,u as se,V as Ie,e as re,a1 as ae,a7 as Te,a8 as Me,L as De,ab as Le,ad as Oe}from"../chunks/index.ad1b71d6.js";import{g as fe}from"../chunks/navigation.a4a8591e.js";import{P as Ue}from"../chunks/Page.c77035fc.js";import{F as Ae,i as Ve,a as He,G as qe,H as Ne,I as Fe,M as ze,J as Ge,K as je,h as Se,L as Re,N as Je,P as Ke,d as Pe,c as Qe,m as We,R as Xe,e as Be,U as _e,V as Ye}from"../chunks/Commands.e655848c.js";import{T as Ze}from"../chunks/TextArea.f2b44cf3.js";import{T as xe}from"../chunks/TrashCan.29665d4a.js";import{V as et,a as tt,I as he,S as nt,C as lt}from"../chunks/ConceptView.e6fcd250.js";import{M as st}from"../chunks/ToastNotification.765f706b.js";import{S as at}from"../chunks/Settings.36556580.js";import{f as ot}from"../chunks/notificationsStore.c57034ed.js";function rt(a){let e,n,t,l,o,i,r,s,u,m,p,f,c,d,b,k,K,G,R,N,W,j,D,T,S,g,V,z,P;function J(I){a[19](I)}let X={invalid:a[5]!=a[7]};return a[5]!==void 0&&(X.value=a[5]),N=new Je({props:X}),Ee.push(()=>Ce(N,"value",J)),S=new xe({}),{c(){e=w("div"),n=w("section"),t=w("section"),l=w("div"),o=B("Delete this concept"),i=q(),r=w("div"),s=w("p"),u=B("This action cannot be undone."),m=q(),p=w("p"),f=B(`This will permanently delete the
                    `),c=w("span"),d=B(a[7]),b=B(` dataset and all its files. Please
                    type
                    `),k=w("span"),K=B(a[7]),G=B(" to confirm."),R=q(),L(N.$$.fragment),j=q(),D=w("button"),T=B(`I understand, delete this concept
                  `),L(S.$$.fragment),this.h()},l(I){e=y(I,"DIV",{class:!0});var Q=E(e);n=y(Q,"SECTION",{class:!0});var ne=E(n);t=y(ne,"SECTION",{class:!0});var Y=E(t);l=y(Y,"DIV",{class:!0});var ue=E(l);o=M(ue,"Delete this concept"),ue.forEach(h),i=F(Y),r=y(Y,"DIV",{class:!0});var oe=E(r);s=y(oe,"P",{class:!0});var pe=E(s);u=M(pe,"This action cannot be undone."),pe.forEach(h),m=F(oe),p=y(oe,"P",{});var le=E(p);f=M(le,`This will permanently delete the
                    `),c=y(le,"SPAN",{class:!0});var de=E(c);d=M(de,a[7]),de.forEach(h),b=M(le,` dataset and all its files. Please
                    type
                    `),k=y(le,"SPAN",{class:!0});var me=E(k);K=M(me,a[7]),me.forEach(h),G=M(le," to confirm."),le.forEach(h),oe.forEach(h),R=F(Y),O(N.$$.fragment,Y),j=F(Y),D=y(Y,"BUTTON",{class:!0});var ce=E(D);T=M(ce,`I understand, delete this concept
                  `),O(S.$$.fragment,ce),ce.forEach(h),Y.forEach(h),ne.forEach(h),Q.forEach(h),this.h()},h(){C(l,"class","text-lg text-gray-700"),C(s,"class","mb-2"),C(c,"class","font-bold"),C(k,"class","font-bold"),C(r,"class","mb-4 text-sm text-gray-500"),C(D,"class","mt-2 flex cursor-pointer flex-row justify-between p-4 text-left outline-red-400 hover:bg-gray-200"),D.disabled=g=a[5]!=a[7],Z(D,"cursor-not-allowed",a[5]!=a[7]),Z(D,"outline",a[5]==a[7]),Z(D,"opacity-50",a[5]!=a[7]),C(t,"class","flex flex-col gap-y-1"),C(n,"class","flex flex-col gap-y-1"),C(e,"class","flex flex-col gap-y-6")},m(I,Q){H(I,e,Q),_(e,n),_(n,t),_(t,l),_(l,o),_(t,i),_(t,r),_(r,s),_(s,u),_(r,m),_(r,p),_(p,f),_(p,c),_(c,d),_(p,b),_(p,k),_(k,K),_(p,G),_(t,R),U(N,t,null),_(t,j),_(t,D),_(D,T),U(S,D,null),V=!0,z||(P=ie(D,"click",a[20]),z=!0)},p(I,Q){(!V||Q&128)&&se(d,I[7]),(!V||Q&128)&&se(K,I[7]);const ne={};Q&160&&(ne.invalid=I[5]!=I[7]),!W&&Q&32&&(W=!0,ne.value=I[5],Ie(()=>W=!1)),N.$set(ne),(!V||Q&160&&g!==(g=I[5]!=I[7]))&&(D.disabled=g),(!V||Q&160)&&Z(D,"cursor-not-allowed",I[5]!=I[7]),(!V||Q&160)&&Z(D,"outline",I[5]==I[7]),(!V||Q&160)&&Z(D,"opacity-50",I[5]!=I[7])},i(I){V||($(N.$$.fragment,I),$(S.$$.fragment,I),V=!0)},o(I){v(N.$$.fragment,I),v(S.$$.fragment,I),V=!1},d(I){I&&h(e),A(N),A(S),z=!1,P()}}}function it(a){let e,n,t,l;const o=[ft,ct],i=[];function r(s,u){return s[3].isFetching?0:1}return e=r(a),n=i[e]=o[e](a),{c(){n.c(),t=re()},l(s){n.l(s),t=re()},m(s,u){i[e].m(s,u),H(s,t,u),l=!0},p(s,u){let m=e;e=r(s),e===m?i[e].p(s,u):(x(),v(i[m],1,1,()=>{i[m]=null}),ee(),n=i[e],n?n.p(s,u):(n=i[e]=o[e](s),n.c()),$(n,1),n.m(t.parentNode,t))},i(s){l||($(n),l=!0)},o(s){v(n),l=!1},d(s){i[e].d(s),s&&h(t)}}}function ct(a){let e,n,t,l,o,i,r,s,u,m,p,f,c,d,b,k,K,G,R,N;i=new Ze({props:{value:a[6].description||void 0,cols:50,placeholder:"Enter a description...",rows:3,class:"mb-2"}}),i.$on("input",a[13]),c=new Ke({props:{labelText:"Publicly visible",checked:a[6].is_public}}),c.$on("check",a[18]);const W=[pt,ut],j=[];function D(T,S){return T[6].is_public?0:1}return b=D(a),k=j[b]=W[b](a),{c(){e=w("div"),n=w("section"),t=w("div"),l=B("Description"),o=q(),L(i.$$.fragment),r=q(),s=w("section"),u=w("div"),m=B("Visibility"),p=q(),f=w("div"),L(c.$$.fragment),d=q(),k.c(),K=q(),G=w("div"),R=B(`Setting the concept to publicly visible will allow any user with access to this
                  Lilac instance to view this concept.`),this.h()},l(T){e=y(T,"DIV",{class:!0});var S=E(e);n=y(S,"SECTION",{class:!0});var g=E(n);t=y(g,"DIV",{class:!0});var V=E(t);l=M(V,"Description"),V.forEach(h),o=F(g),O(i.$$.fragment,g),g.forEach(h),r=F(S),s=y(S,"SECTION",{class:!0});var z=E(s);u=y(z,"DIV",{class:!0});var P=E(u);m=M(P,"Visibility"),P.forEach(h),p=F(z),f=y(z,"DIV",{class:!0});var J=E(f);O(c.$$.fragment,J),d=F(J),k.l(J),J.forEach(h),K=F(z),G=y(z,"DIV",{class:!0});var X=E(G);R=M(X,`Setting the concept to publicly visible will allow any user with access to this
                  Lilac instance to view this concept.`),X.forEach(h),z.forEach(h),S.forEach(h),this.h()},h(){C(t,"class","text-base"),C(n,"class","flex flex-col gap-y-1"),C(u,"class","text-base"),C(f,"class","flex flex-row items-center"),C(G,"class","text-xs font-light"),C(s,"class","flex flex-col gap-y-1"),C(e,"class","flex flex-col gap-y-6")},m(T,S){H(T,e,S),_(e,n),_(n,t),_(t,l),_(n,o),U(i,n,null),_(e,r),_(e,s),_(s,u),_(u,m),_(s,p),_(s,f),U(c,f,null),_(f,d),j[b].m(f,null),_(s,K),_(s,G),_(G,R),N=!0},p(T,S){const g={};S&64&&(g.value=T[6].description||void 0),i.$set(g);const V={};S&64&&(V.checked=T[6].is_public),c.$set(V);let z=b;b=D(T),b!==z&&(x(),v(j[z],1,1,()=>{j[z]=null}),ee(),k=j[b],k||(k=j[b]=W[b](T),k.c()),$(k,1),k.m(f,null))},i(T){N||($(i.$$.fragment,T),$(c.$$.fragment,T),$(k),N=!0)},o(T){v(i.$$.fragment,T),v(c.$$.fragment,T),v(k),N=!1},d(T){T&&h(e),A(i),A(c),j[b].d()}}}function ft(a){let e,n;return e=new Pe({}),{c(){L(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){U(e,t,l),n=!0},p:ae,i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function ut(a){let e,n;return e=new et({}),{c(){L(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){U(e,t,l),n=!0},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function pt(a){let e,n;return e=new tt({}),{c(){L(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){U(e,t,l),n=!0},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function dt(a){let e,n,t,l,o,i,r,s;t=new Re({props:{items:[{title:"General",value:"general"},{title:"Administration",value:"administration"}],item:a[4]}}),t.$on("select",a[17]);const u=[it,rt],m=[];function p(f,c){return f[4]==="general"?0:f[4]==="administration"?1:-1}return~(i=p(a))&&(r=m[i]=u[i](a)),{c(){e=w("div"),n=w("div"),L(t.$$.fragment),l=q(),o=w("div"),r&&r.c(),this.h()},l(f){e=y(f,"DIV",{class:!0});var c=E(e);n=y(c,"DIV",{class:!0});var d=E(n);O(t.$$.fragment,d),d.forEach(h),l=F(c),o=y(c,"DIV",{class:!0});var b=E(o);r&&r.l(b),b.forEach(h),c.forEach(h),this.h()},h(){C(n,"class","-ml-4 mr-4 w-96 grow-0 p-1"),C(o,"class","flex w-full flex-col gap-y-6 rounded border border-gray-300 bg-white p-4"),C(e,"class","flex flex-row")},m(f,c){H(f,e,c),_(e,n),U(t,n,null),_(e,l),_(e,o),~i&&m[i].m(o,null),s=!0},p(f,c){const d={};c&16&&(d.item=f[4]),t.$set(d);let b=i;i=p(f),i===b?~i&&m[i].p(f,c):(r&&(x(),v(m[b],1,1,()=>{m[b]=null}),ee()),~i?(r=m[i],r?r.p(f,c):(r=m[i]=u[i](f),r.c()),$(r,1),r.m(o,null)):r=null)},i(f){s||($(t.$$.fragment,f),$(r),s=!0)},o(f){v(t.$$.fragment,f),v(r),s=!1},d(f){f&&h(e),A(t),~i&&m[i].d()}}}function mt(a){let e,n,t,l,o,i;return e=new ze({props:{label:a[2],title:"Concept settings"}}),t=new Ge({props:{hasForm:!0,$$slots:{default:[dt]},$$scope:{ctx:a}}}),o=new je({props:{danger:a[4]==="administration",primaryButtonText:"Save",secondaryButtonText:"Cancel",primaryButtonDisabled:a[4]==="administration"}}),o.$on("click:button--secondary",close),{c(){L(e.$$.fragment),n=q(),L(t.$$.fragment),l=q(),L(o.$$.fragment)},l(r){O(e.$$.fragment,r),n=F(r),O(t.$$.fragment,r),l=F(r),O(o.$$.fragment,r)},m(r,s){U(e,r,s),H(r,n,s),U(t,r,s),H(r,l,s),U(o,r,s),i=!0},p(r,s){const u={};s&4&&(u.label=r[2]),e.$set(u);const m={};s&8389118&&(m.$$scope={dirty:s,ctx:r}),t.$set(m);const p={};s&16&&(p.danger=r[4]==="administration"),s&16&&(p.primaryButtonDisabled=r[4]==="administration"),o.$set(p)},i(r){i||($(e.$$.fragment,r),$(t.$$.fragment,r),$(o.$$.fragment,r),i=!0)},o(r){v(e.$$.fragment,r),v(t.$$.fragment,r),v(o.$$.fragment,r),i=!1},d(r){A(e,r),r&&h(n),A(t,r),r&&h(l),A(o,r)}}}function _t(a){let e,n;return e=new Ae({props:{open:a[0],$$slots:{default:[mt]},$$scope:{ctx:a}}}),e.$on("submit",a[12]),e.$on("close",a[21]),{c(){L(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){U(e,t,l),n=!0},p(t,[l]){const o={};l&1&&(o.open=t[0]),l&8389118&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function ht(a,e,n){let t,l,o,i,r,s,u,{namespace:m}=e,{conceptName:p}=e;const f=Ve();te(a,f,g=>n(3,s=g));const c=He();te(a,c,g=>n(16,r=g));let{open:d=!1}=e,b="general";const k=qe();te(a,k,g=>n(22,i=g));function K(){n(0,d=!1),l!=null&&i.mutate([m,p,l])}function G(g){const V=g.target.value;n(6,l={...l,description:V})}let R="";const N=Ne();te(a,N,g=>n(8,u=g));const W=g=>n(4,b=g.detail),j=g=>n(6,l={...l,is_public:g.detail});function D(g){R=g,n(5,R)}const T=()=>u.mutate([m,p],{onSuccess:()=>fe(Se())}),S=()=>n(0,d=!1);return a.$$set=g=>{"namespace"in g&&n(1,m=g.namespace),"conceptName"in g&&n(2,p=g.conceptName),"open"in g&&n(0,d=g.open)},a.$$.update=()=>{var g;a.$$.dirty&14&&n(15,t=(g=s.data)==null?void 0:g.find(V=>V.namespace===m&&V.name===p)),a.$$.dirty&32768&&n(6,l=(t==null?void 0:t.metadata)||{}),a.$$.dirty&65542&&n(7,o=Fe(m,p,r.data))},[d,m,p,s,b,R,l,o,u,f,c,k,K,G,N,t,r,W,j,D,T,S]}class gt extends ke{constructor(e){super(),we(this,e,ht,_t,ye,{namespace:1,conceptName:2,open:0})}}function ge(a){let e,n,t,l;const o=[vt,bt,$t],i=[];function r(s,u){var m,p,f;return(m=s[10])!=null&&m.isLoading?0:(p=s[10])!=null&&p.isError?1:(f=s[10])!=null&&f.isSuccess?2:-1}return~(e=r(a))&&(n=i[e]=o[e](a)),{c(){n&&n.c(),t=re()},l(s){n&&n.l(s),t=re()},m(s,u){~e&&i[e].m(s,u),H(s,t,u),l=!0},p(s,u){let m=e;e=r(s),e===m?~e&&i[e].p(s,u):(n&&(x(),v(i[m],1,1,()=>{i[m]=null}),ee()),~e?(n=i[e],n?n.p(s,u):(n=i[e]=o[e](s),n.c()),$(n,1),n.m(t.parentNode,t)):n=null)},i(s){l||($(n),l=!0)},o(s){v(n),l=!1},d(s){~e&&i[e].d(s),s&&h(t)}}}function $t(a){let e,n;return e=new lt({props:{concept:a[10].data}}),{c(){L(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){U(e,t,l),n=!0},p(t,l){const o={};l&1024&&(o.concept=t[10].data),e.$set(o)},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function bt(a){let e,n=a[10].error+"",t;return{c(){e=w("p"),t=B(n)},l(l){e=y(l,"P",{});var o=E(e);t=M(o,n),o.forEach(h)},m(l,o){H(l,e,o),_(e,t)},p(l,o){o&1024&&n!==(n=l[10].error+"")&&se(t,n)},i:ae,o:ae,d(l){l&&h(e)}}}function vt(a){let e,n;return e=new Pe({}),{c(){L(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){U(e,t,l),n=!0},p:ae,i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function $e(a){let e,n;return e=new st({props:{danger:!0,open:!0,modalHeading:"Delete concept",primaryButtonText:"Delete",primaryButtonIcon:a[9].isLoading?he:void 0,secondaryButtonText:"Cancel",$$slots:{default:[kt]},$$scope:{ctx:a}}}),e.$on("click:button--secondary",a[20]),e.$on("close",a[21]),e.$on("submit",a[22]),{c(){L(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){U(e,t,l),n=!0},p(t,l){const o={};l&512&&(o.primaryButtonIcon=t[9].isLoading?he:void 0),l&16777224&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function kt(a){let e,n,t,l=a[3].namespace+"",o,i,r=a[3].name+"",s,u,m,p,f;return{c(){e=w("p"),n=B("Confirm deleting "),t=w("code"),o=B(l),i=B("/"),s=B(r),u=B(" ?"),m=q(),p=w("p"),f=B("This is a permanent action and cannot be undone."),this.h()},l(c){e=y(c,"P",{class:!0});var d=E(e);n=M(d,"Confirm deleting "),t=y(d,"CODE",{});var b=E(t);o=M(b,l),i=M(b,"/"),s=M(b,r),b.forEach(h),u=M(d," ?"),d.forEach(h),m=F(c),p=y(c,"P",{class:!0});var k=E(p);f=M(k,"This is a permanent action and cannot be undone."),k.forEach(h),this.h()},h(){C(e,"class","!text-lg"),C(p,"class","mt-2")},m(c,d){H(c,e,d),_(e,n),_(e,t),_(t,o),_(t,i),_(t,s),_(e,u),H(c,m,d),H(c,p,d),_(p,f)},p(c,d){d&8&&l!==(l=c[3].namespace+"")&&se(o,l),d&8&&r!==(r=c[3].name+"")&&se(s,r)},d(c){c&&h(e),c&&h(m),c&&h(p)}}}function wt(a){let e,n,t,l,o,i,r,s=a[0]!=null&&a[1]!=null&&ge(a),u=a[3]&&$e(a);function m(f){a[23](f)}let p={namespace:a[0],conceptName:a[1]};return a[4]!==void 0&&(p.open=a[4]),o=new gt({props:p}),Ee.push(()=>Ce(o,"open",m)),{c(){e=w("div"),n=w("div"),s&&s.c(),t=q(),u&&u.c(),l=q(),L(o.$$.fragment),this.h()},l(f){e=y(f,"DIV",{class:!0});var c=E(e);n=y(c,"DIV",{class:!0});var d=E(n);s&&s.l(d),d.forEach(h),c.forEach(h),t=F(f),u&&u.l(f),l=F(f),O(o.$$.fragment,f),this.h()},h(){C(n,"class","lilac-page flex w-full"),C(e,"class","flex h-full w-full overflow-x-hidden overflow-y-scroll")},m(f,c){H(f,e,c),_(e,n),s&&s.m(n,null),H(f,t,c),u&&u.m(f,c),H(f,l,c),U(o,f,c),r=!0},p(f,c){f[0]!=null&&f[1]!=null?s?(s.p(f,c),c&3&&$(s,1)):(s=ge(f),s.c(),$(s,1),s.m(n,null)):s&&(x(),v(s,1,1,()=>{s=null}),ee()),f[3]?u?(u.p(f,c),c&8&&$(u,1)):(u=$e(f),u.c(),$(u,1),u.m(l.parentNode,l)):u&&(x(),v(u,1,1,()=>{u=null}),ee());const d={};c&1&&(d.namespace=f[0]),c&2&&(d.conceptName=f[1]),!i&&c&16&&(i=!0,d.open=f[4],Ie(()=>i=!1)),o.$set(d)},i(f){r||($(s),$(u),$(o.$$.fragment,f),r=!0)},o(f){v(s),v(u),v(o.$$.fragment,f),r=!1},d(f){f&&h(e),s&&s.d(),f&&h(t),u&&u.d(f),f&&h(l),A(o,f)}}}function yt(a){let e,n=_e(a[0],a[1])+"",t,l,o;return{c(){e=w("a"),t=B(n),this.h()},l(i){e=y(i,"A",{class:!0,href:!0});var r=E(e);t=M(r,n),r.forEach(h),this.h()},h(){C(e,"class","font-semibold text-black"),C(e,"href",a[6])},m(i,r){H(i,e,r),_(e,t),l||(o=ie(e,"click",a[19]),l=!0)},p(i,r){r&3&&n!==(n=_e(i[0],i[1])+"")&&se(t,n),r&64&&C(e,"href",i[6])},d(i){i&&h(e),l=!1,o()}}}function Et(a){let e,n,t;return n=new Xe({props:{type:"green",$$slots:{default:[yt]},$$scope:{ctx:a}}}),{c(){e=w("div"),L(n.$$.fragment),this.h()},l(l){e=y(l,"DIV",{slot:!0});var o=E(e);O(n.$$.fragment,o),o.forEach(h),this.h()},h(){C(e,"slot","header-subtext")},m(l,o){H(l,e,o),U(n,e,null),t=!0},p(l,o){const i={};o&16777283&&(i.$$scope={dirty:o,ctx:l}),n.$set(i)},i(l){t||($(n.$$.fragment,l),t=!0)},o(l){v(n.$$.fragment,l),t=!1},d(l){l&&h(e),A(n)}}}function be(a){let e,n,t,l,o,i,r,s=a[5]&&ve();return l=new nt({}),{c(){e=w("div"),s&&s.c(),n=q(),t=w("button"),L(l.$$.fragment),this.h()},l(u){e=y(u,"DIV",{class:!0});var m=E(e);s&&s.l(m),n=F(m),t=y(m,"BUTTON",{class:!0});var p=E(t);O(l.$$.fragment,p),p.forEach(h),m.forEach(h),this.h()},h(){C(t,"class","p-3"),C(e,"class","relative flex flex-row justify-items-center")},m(u,m){H(u,e,m),s&&s.m(e,null),_(e,n),_(e,t),U(l,t,null),o=!0,i||(r=[Te(Be.call(null,t,{text:"Copy the URL"})),ie(t,"click",a[17])],i=!0)},p(u,m){u[5]?s?m&32&&$(s,1):(s=ve(),s.c(),$(s,1),s.m(e,n)):s&&(x(),v(s,1,1,()=>{s=null}),ee())},i(u){o||($(s),$(l.$$.fragment,u),o=!0)},o(u){v(s),v(l.$$.fragment,u),o=!1},d(u){u&&h(e),s&&s.d(),A(l),i=!1,De(r)}}}function ve(a){let e,n,t,l;return{c(){e=w("div"),n=B("Copied!"),this.h()},l(o){e=y(o,"DIV",{class:!0});var i=E(e);n=M(i,"Copied!"),i.forEach(h),this.h()},h(){C(e,"class","absolute right-12 z-50 mt-2 rounded border border-neutral-300 bg-neutral-50 px-4 py-1 text-xs")},m(o,i){H(o,e,i),_(e,n),l=!0},i(o){l||(t&&t.end(1),l=!0)},o(o){t=Oe(e,ot,{}),l=!1},d(o){o&&h(e),o&&t&&t.end()}}}function Ct(a){var f;let e,n,t,l,o,i,r,s,u,m,p=((f=a[2])==null?void 0:f.metadata.is_public)&&be(a);return o=new at({props:{size:16}}),{c(){e=w("div"),p&&p.c(),n=q(),t=w("div"),l=w("button"),L(o.$$.fragment),this.h()},l(c){e=y(c,"DIV",{slot:!0,class:!0});var d=E(e);p&&p.l(d),n=F(d),t=y(d,"DIV",{});var b=E(t);l=y(b,"BUTTON",{title:!0,class:!0});var k=E(l);O(o.$$.fragment,k),k.forEach(h),b.forEach(h),d.forEach(h),this.h()},h(){C(l,"title","Concept settings"),l.disabled=i=!a[7],C(l,"class","p-3"),Z(t,"opacity-40",!a[7]),C(e,"slot","header-right"),C(e,"class","flex flex-row")},m(c,d){H(c,e,d),p&&p.m(e,null),_(e,n),_(e,t),_(t,l),U(o,l,null),s=!0,u||(m=[ie(l,"click",a[18]),Te(r=Be.call(null,t,{text:a[7]?"Edit concept settings":"User does not have access to edit this concept."}))],u=!0)},p(c,d){var b;(b=c[2])!=null&&b.metadata.is_public?p?(p.p(c,d),d&4&&$(p,1)):(p=be(c),p.c(),$(p,1),p.m(e,n)):p&&(x(),v(p,1,1,()=>{p=null}),ee()),(!s||d&128&&i!==(i=!c[7]))&&(l.disabled=i),r&&Me(r.update)&&d&128&&r.update.call(null,{text:c[7]?"Edit concept settings":"User does not have access to edit this concept."}),(!s||d&128)&&Z(t,"opacity-40",!c[7])},i(c){s||($(p),$(o.$$.fragment,c),s=!0)},o(c){v(p),v(o.$$.fragment,c),s=!1},d(c){c&&h(e),p&&p.d(),A(o),u=!1,De(m)}}}function It(a){let e,n;return e=new Ue({props:{$$slots:{"header-right":[Ct],"header-subtext":[Et],default:[wt]},$$scope:{ctx:a}}}),{c(){L(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){U(e,t,l),n=!0},p(t,[l]){const o={};l&16779007&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||($(e.$$.fragment,t),n=!0)},o(t){v(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function Tt(a,e,n){let t,l,o,i,r,s,u,m,p=ae,f=()=>(p(),p=Le(t,P=>n(10,m=P)),t);a.$$.on_destroy.push(()=>p());let c,d;const b=Qe();te(a,b,P=>n(16,u=P));let k=null;const K=Ve();te(a,K,P=>n(15,s=P));const G=Ne();te(a,G,P=>n(9,r=P));function R(){if(k==null)return;const{namespace:P,name:J}=k;r.mutate([P,J],{onSuccess:()=>{n(3,k=null),fe(Se())}})}let N=!1,W=!1;const j=()=>navigator.clipboard.writeText(location.href).then(()=>{n(5,W=!0),setTimeout(()=>n(5,W=!1),2e3)},()=>{throw Error("Error copying link to clipboard.")}),D=()=>n(4,N=!0),T=()=>fe(i),S=()=>n(3,k=null),g=()=>n(3,k=null),V=()=>R();function z(P){N=P,n(4,N)}return a.$$.update=()=>{var P;if(a.$$.dirty&65539&&u.page==="concepts"&&u.identifier!=null){const[J,X]=u.identifier.split("/");(c!=J||d!=X)&&(n(0,c=J),n(1,d=X))}a.$$.dirty&3&&f(n(8,t=c&&d?Ye(c,d):void 0)),a.$$.dirty&32771&&n(2,l=(P=s.data)==null?void 0:P.find(J=>J.namespace===c&&J.name===d)),a.$$.dirty&4&&n(7,o=l==null?void 0:l.acls.write),a.$$.dirty&3&&n(6,i=We(c,d))},[c,d,l,k,N,W,i,o,t,r,m,b,K,G,R,s,u,j,D,T,S,g,V,z]}class At extends ke{constructor(e){super(),we(this,e,Tt,It,ye,{})}}export{At as component};
