import{S as _e,i as ge,s as he,E as ue,k as M,a as j,y as q,l as z,m as D,c as U,z as H,h,I as Ze,H as se,b as C,J as v,A as O,K as Ve,O as Me,g,d as b,B as L,D as we,C as _t,o as fi,F as Ee,q as Y,r as W,n as V,u as fe,e as re,v as X,f as x,P as Je,w as Re,X as gt,Y as pt,G as rt,L as st,M as at,N as ot,a9 as yt,aa as qt,R as ce,T as ui,t as Di,j as Ii,Q as je,ab as ci,_ as be,$ as ve,a0 as $e,a1 as Z,Z as Vi,p as Ue,W as di,a6 as Ae,a8 as Oe,a3 as Be,a5 as Pe,ac as kt,ad as Ti,U as et,V as tt,ae as Ci,a4 as ft,af as ut,x as ct,ag as Et}from"../chunks/index.01827105.js";import{h as Fe,f as De,b as Ot,s as Ie,p as Lt,a as Ni,c as wt,i as Mi,e as Qe,g as vt,j as zi,L as Ke,l as Ai,k as dt,m as Fi,n as mi,o as Bi,U as Ht,C as tl,r as hi,q as Pi,t as jt,u as Ri,v as Ge,w as $t,x as Pt,O as qi,y as bt,z as Oi,A as Li,B as Dt,V as _i,D as Hi,E as ji,F as Ui,P as gi,G as Yi,H as Wi,I as Qi,J as Ji,K as Ki}from"../chunks/Page.635e2ebb.js";import{e as lt,f as Zi,h as qe,t as Xe,a as xe,E as Ut,i as We,j as Yt,k as Gi,b as Xi,S as xi,l as er,m as Nt,n as tr,o as lr,p as nr,q as ir,r as ll,s as Rt,u as rr,v as sr,w as ar,g as or,x as pi,y as fr,I as It,z as Wt,A as ur,B as mt,D as ht,F as bi,M as vi,G as wi,H as ki,J as cr,C as dr,K as mr,L as hr,N as _r,O as gr,P as pr,Q as br,T as vr}from"../chunks/ConceptView.4261977c.js";import{d as nl,w as it}from"../chunks/index.2213faf5.js";import{C as wr,S as Le,n as kr,I as Qt,d as il}from"../chunks/utils.9f56da00.js";import{W as Sr,b as Er,C as yr,S as Jt,a as Mt}from"../chunks/SelectItem.978ba842.js";import{L as $r,a as Dr,b as Ir,c as Vr,C as Tr}from"../chunks/ComboBox.07cc2afb.js";import{B as Ye,a as St}from"../chunks/taskMonitoringStore.f29f8009.js";import{M as Kt,u as Cr}from"../chunks/urlHashStore.ac1cecd5.js";import{q as Zt,S as Nr}from"../chunks/signalQueries.235d6662.js";import{g as Si}from"../chunks/settingsStore.b6b59745.js";import{S as Mr}from"../chunks/Settings.07bf1197.js";import{g as At}from"../chunks/navigation.d2b4b49c.js";function rl(i,e,l){const t=i.slice();return t[39]=e[l],t[41]=l,t}const zr=i=>({item:i[0]&8,index:i[0]&8}),sl=i=>({item:i[39],index:i[41]});function al(i){let e,l;return{c(){e=M("label"),l=Y(i[10]),this.h()},l(t){e=z(t,"LABEL",{for:!0});var n=D(e);l=W(n,i[10]),n.forEach(h),this.h()},h(){V(e,"for",i[19]),se(e,"bx--label",!0),se(e,"bx--label--disabled",i[9]),se(e,"bx--visually-hidden",i[17])},m(t,n){C(t,e,n),v(e,l)},p(t,n){n[0]&1024&&fe(l,t[10]),n[0]&524288&&V(e,"for",t[19]),n[0]&512&&se(e,"bx--label--disabled",t[9]),n[0]&131072&&se(e,"bx--visually-hidden",t[17])},d(t){t&&h(e)}}}function ol(i){let e,l;return e=new Sr({props:{class:"bx--list-box__invalid-icon"}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function fl(i){let e,l;return e=new Er({props:{class:"bx--list-box__invalid-icon bx--list-box__invalid-icon--warning"}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Ar(i){let e;return{c(){e=Y(i[16])},l(l){e=W(l,i[16])},m(l,t){C(l,e,t)},p(l,t){t[0]&65536&&fe(e,l[16])},d(l){l&&h(e)}}}function Fr(i){let e=i[4](i[22])+"",l;return{c(){l=Y(e)},l(t){l=W(t,e)},m(t,n){C(t,l,n)},p(t,n){n[0]&4194320&&e!==(e=t[4](t[22])+"")&&fe(l,e)},d(t){t&&h(l)}}}function ul(i){let e,l;return e=new Ir({props:{"aria-labelledby":i[19],id:i[19],$$slots:{default:[Rr]},$$scope:{ctx:i}}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,n){const o={};n[0]&524288&&(o["aria-labelledby"]=t[19]),n[0]&524288&&(o.id=t[19]),n[0]&2097181|n[1]&64&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Br(i){let e=i[4](i[39])+"",l;return{c(){l=Y(e)},l(t){l=W(t,e)},m(t,n){C(t,l,n)},p(t,n){n[0]&24&&e!==(e=t[4](t[39])+"")&&fe(l,e)},d(t){t&&h(l)}}}function Pr(i){let e,l;const t=i[29].default,n=rt(t,i,i[37],sl),o=n||Br(i);return{c(){o&&o.c(),e=j()},l(r){o&&o.l(r),e=U(r)},m(r,a){o&&o.m(r,a),C(r,e,a),l=!0},p(r,a){n?n.p&&(!l||a[0]&8|a[1]&64)&&st(n,t,r,r[37],l?ot(t,r[37],a,zr):at(r[37]),sl):o&&o.p&&(!l||a[0]&24)&&o.p(r,l?a:[-1,-1])},i(r){l||(g(o,r),l=!0)},o(r){b(o,r),l=!1},d(r){o&&o.d(r),r&&h(e)}}}function cl(i,e){let l,t,n;function o(...a){return e[34](e[39],...a)}function r(){return e[35](e[39],e[41])}return t=new Vr({props:{id:e[39].id,active:e[0]===e[39].id,highlighted:e[21]===e[41],disabled:e[39].disabled,$$slots:{default:[Pr]},$$scope:{ctx:e}}}),t.$on("click",o),t.$on("mouseenter",r),{key:i,first:null,c(){l=re(),q(t.$$.fragment),this.h()},l(a){l=re(),H(t.$$.fragment,a),this.h()},h(){this.first=l},m(a,s){C(a,l,s),O(t,a,s),n=!0},p(a,s){e=a;const f={};s[0]&8&&(f.id=e[39].id),s[0]&9&&(f.active=e[0]===e[39].id),s[0]&2097160&&(f.highlighted=e[21]===e[41]),s[0]&8&&(f.disabled=e[39].disabled),s[0]&24|s[1]&64&&(f.$$scope={dirty:s,ctx:e}),t.$set(f)},i(a){n||(g(t.$$.fragment,a),n=!0)},o(a){b(t.$$.fragment,a),n=!1},d(a){a&&h(l),L(t,a)}}}function Rr(i){let e=[],l=new Map,t,n,o=i[3];const r=a=>a[39].id;for(let a=0;a{c=null}),x()),!S[11]&&S[13]?m?w[0]&10240&&g(m,1):(m=fl(),m.c(),g(m,1),m.m(l.parentNode,l)):m&&(X(),b(m,1,1,()=>{m=null}),x()),p===(p=_(S))&&k?k.p(S,w):(k.d(1),k=p(S),k&&(k.c(),k.m(n,null)));const y={};w[0]&262144&&(y.translateWithId=S[18]),w[0]&2&&(y.open=S[1]),r.$set(y),(!f||w[0]&2)&&V(t,"aria-expanded",S[1]),(!f||w[0]&512)&&(t.disabled=S[9]),(!f||w[0]&262144)&&V(t,"translatewithid",S[18]),(!f||w[0]&524288)&&V(t,"id",S[19]),S[1]?$?($.p(S,w),w[0]&2&&g($,1)):($=ul(S),$.c(),g($,1),$.m(s.parentNode,s)):$&&(X(),b($,1,1,()=>{$=null}),x())},i(S){f||(g(c),g(m),g(r.$$.fragment,S),g($),f=!0)},o(S){b(c),b(m),b(r.$$.fragment,S),b($),f=!1},d(S){c&&c.d(S),S&&h(e),m&&m.d(S),S&&h(l),S&&h(t),k.d(),L(r),i[31](null),S&&h(a),$&&$.d(S),S&&h(s),u=!1,Je(d)}}}function dl(i){let e,l;return{c(){e=M("div"),l=Y(i[15]),this.h()},l(t){e=z(t,"DIV",{});var n=D(e);l=W(n,i[15]),n.forEach(h),this.h()},h(){se(e,"bx--form__helper-text",!0),se(e,"bx--form__helper-text--disabled",i[9])},m(t,n){C(t,e,n),v(e,l)},p(t,n){n[0]&32768&&fe(l,t[15]),n[0]&512&&se(e,"bx--form__helper-text--disabled",t[9])},d(t){t&&h(e)}}}function Or(i){let e,l,t,n,o,r,a,s=i[10]&&al(i);t=new $r({props:{role:void 0,type:i[5],size:i[7],name:i[20],"aria-label":i[28]["aria-label"],class:`bx--dropdown `+(i[6]==="top"&&"bx--list-box--up")+` `+(i[11]&&"bx--dropdown--invalid")+` `+(!i[11]&&i[13]&&"bx--dropdown--warning")+` `+(i[1]&&"bx--dropdown--open")+` `+(i[7]==="sm"&&"bx--dropdown--sm")+` `+(i[7]==="xl"&&"bx--dropdown--xl")+` `+(i[23]&&"bx--dropdown--inline")+` `+(i[9]&&"bx--dropdown--disabled")+` `+(i[8]&&"bx--dropdown--light"),disabled:i[9],open:i[1],invalid:i[11],invalidText:i[12],light:i[8],warn:i[13],warnText:i[14],$$slots:{default:[qr]},$$scope:{ctx:i}}}),t.$on("click",i[36]);let f=!i[23]&&!i[11]&&!i[13]&&i[15]&&dl(i),u=[i[27]],d={};for(let c=0;cQ.text||Q.id}=e,{selectedId:d}=e,{type:c="default"}=e,{direction:m="bottom"}=e,{size:_=void 0}=e,{open:p=!1}=e,{light:k=!1}=e,{disabled:$=!1}=e,{titleText:S=""}=e,{invalid:w=!1}=e,{invalidText:y=""}=e,{warn:N=!1}=e,{warnText:F=""}=e,{helperText:T=""}=e,{label:E=void 0}=e,{hideLabel:P=!1}=e,{translateWithId:I=void 0}=e,{id:A="ccs-"+Math.random().toString(36)}=e,{name:B=void 0}=e,{ref:J=null}=e;const te=_t();let K=-1;function G(Q){let R=K+Q;if(f.length===0)return;R<0?R=f.length-1:R>=f.length&&(R=0);let ne=f[R].disabled;for(;ne;)R=R+Q,R<0?R=f.length-1:R>=f.length&&(R=0),ne=f[R].disabled;l(21,K=R)}const ee=()=>{te("select",{selectedId:d,selectedItem:f.find(Q=>Q.id===d)})},le=({target:Q})=>{p&&J&&!J.contains(Q)&&l(1,p=!1)};fi(()=>(parent&&parent.addEventListener("click",le),()=>{parent&&parent.removeEventListener("click",le)}));const pe=Q=>{Q.stopPropagation(),!$&&l(1,p=!p)};function oe(Q){Re[Q?"unshift":"push"](()=>{J=Q,l(2,J)})}const ae=Q=>{const{key:R}=Q;["Enter","ArrowDown","ArrowUp"].includes(R)&&Q.preventDefault(),R==="Enter"?(l(1,p=!p),K>-1&&f[K].id!==d&&(l(0,d=f[K].id),ee(),l(1,p=!1))):R==="Tab"?(l(1,p=!1),J.blur()):R==="ArrowDown"?(p||l(1,p=!0),G(1)):R==="ArrowUp"?(p||l(1,p=!0),G(-1)):R==="Escape"&&l(1,p=!1)},de=Q=>{const{key:R}=Q;if([" "].includes(R))Q.preventDefault();else return;l(1,p=!p),K>-1&&f[K].id!==d&&(l(0,d=f[K].id),ee(),l(1,p=!1))},ke=(Q,R)=>{if(Q.disabled){R.stopPropagation();return}l(0,d=Q.id),ee(),J.focus()},Se=(Q,R)=>{Q.disabled||l(21,K=R)},ye=({target:Q})=>{$||l(1,p=J.contains(Q)?!p:!1)};return i.$$set=Q=>{l(28,e=ue(ue({},e),Ee(Q))),l(27,r=we(e,o)),"items"in Q&&l(3,f=Q.items),"itemToString"in Q&&l(4,u=Q.itemToString),"selectedId"in Q&&l(0,d=Q.selectedId),"type"in Q&&l(5,c=Q.type),"direction"in Q&&l(6,m=Q.direction),"size"in Q&&l(7,_=Q.size),"open"in Q&&l(1,p=Q.open),"light"in Q&&l(8,k=Q.light),"disabled"in Q&&l(9,$=Q.disabled),"titleText"in Q&&l(10,S=Q.titleText),"invalid"in Q&&l(11,w=Q.invalid),"invalidText"in Q&&l(12,y=Q.invalidText),"warn"in Q&&l(13,N=Q.warn),"warnText"in Q&&l(14,F=Q.warnText),"helperText"in Q&&l(15,T=Q.helperText),"label"in Q&&l(16,E=Q.label),"hideLabel"in Q&&l(17,P=Q.hideLabel),"translateWithId"in Q&&l(18,I=Q.translateWithId),"id"in Q&&l(19,A=Q.id),"name"in Q&&l(20,B=Q.name),"ref"in Q&&l(2,J=Q.ref),"$$scope"in Q&&l(37,s=Q.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&32&&l(23,t=c==="inline"),i.$$.dirty[0]&9&&l(22,n=f.find(Q=>Q.id===d)),i.$$.dirty[0]&2&&(p||l(21,K=-1))},e=Ee(e),[d,p,J,f,u,c,m,_,k,$,S,w,y,N,F,T,E,P,I,A,B,K,n,t,G,ee,le,r,e,a,pe,oe,ae,de,ke,Se,ye,s]}class Hr extends _e{constructor(e){super(),ge(this,e,Lr,Or,he,{items:3,itemToString:4,selectedId:0,type:5,direction:6,size:7,open:1,light:8,disabled:9,titleText:10,invalid:11,invalidText:12,warn:13,warnText:14,helperText:15,label:16,hideLabel:17,translateWithId:18,id:19,name:20,ref:2},null,[-1,-1])}}const jr=Hr,Ur=i=>({}),ml=i=>({});function hl(i){let e=i[3].label+"",l;return{c(){l=Y(e)},l(t){l=W(t,e)},m(t,n){C(t,l,n)},p(t,n){n[0]&8&&e!==(e=t[3].label+"")&&fe(l,e)},d(t){t&&h(l)}}}function Yr(i){let e,l,t,n,o,r,a,s,f,u,d,c,m=i[3]&&hl(i);o=new yr({props:{"aria-hidden":"true",title:i[1]}});const _=i[20].default,p=rt(_,i,i[19],null);let k=[{role:"navigation"},i[10]],$={};for(let y=0;yl(18,f=oe));const y=nl(w,oe=>oe.reduce((ae,de)=>({...ae,[de.id]:de}),{}));ce(i,y,oe=>l(28,u=oe));const N=it(p),F=it(void 0);ce(i,F,oe=>l(16,a=oe));const T=it([]);ce(i,T,oe=>l(17,s=oe));const E=nl(T,oe=>oe.reduce((ae,de)=>({...ae,[de.id]:de}),{})),P=it(void 0);let I=null;ui("Tabs",{tabs:w,contentById:E,selectedTab:F,selectedContent:P,useAutoWidth:N,add:oe=>{w.update(ae=>[...ae,{...oe,index:ae.length}])},addContent:oe=>{T.update(ae=>[...ae,{...oe,index:ae.length}])},update:oe=>{l(14,B=u[oe].index)},change:async oe=>{let ae=B+oe;ae<0?ae=f.length-1:ae>=f.length&&(ae=0);let de=f[ae].disabled;for(;de;)ae=ae+oe,ae<0?ae=f.length-1:ae>=f.length&&(ae=0),de=f[ae].disabled;l(14,B=ae),await Di();const ke=I==null?void 0:I.querySelectorAll("[role='tab']")[B];ke==null||ke.focus()}}),Ii(()=>{l(12,m=B),J>-1&&J!==B&&S("change",B),J=B});let A=!0,B=m,J=-1;function te(oe){je.call(this,i,oe)}function K(oe){je.call(this,i,oe)}const G=()=>{l(5,A=!A)},ee=()=>{l(5,A=!A)},le=()=>{l(5,A=!A)};function pe(oe){Re[oe?"unshift":"push"](()=>{I=oe,l(4,I)})}return i.$$set=oe=>{l(11,e=ue(ue({},e),Ee(oe))),l(10,r=we(e,o)),"selected"in oe&&l(12,m=oe.selected),"type"in oe&&l(0,_=oe.type),"autoWidth"in oe&&l(13,p=oe.autoWidth),"iconDescription"in oe&&l(1,k=oe.iconDescription),"triggerHref"in oe&&l(2,$=oe.triggerHref),"$$scope"in oe&&l(19,c=oe.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&4096&&l(14,B=m),i.$$.dirty[0]&278528&&l(3,t=f[B]||void 0),i.$$.dirty[0]&147456&&l(15,n=s[B]||void 0),i.$$.dirty[0]&32776&&(t&&F.set(t.id),n&&P.set(n.id)),i.$$.dirty[0]&65536&&a&&l(5,A=!0),i.$$.dirty[0]&8192&&N.set(p)},e=Ee(e),[_,k,$,t,I,A,w,y,F,T,r,e,m,p,B,n,a,s,f,c,d,te,K,G,ee,le,pe]}class Qr extends _e{constructor(e){super(),ge(this,e,Wr,Yr,he,{selected:12,type:0,autoWidth:13,iconDescription:1,triggerHref:2},null,[-1,-1])}}const Jr=Qr;function Kr(i){let e;return{c(){e=Y(i[1])},l(l){e=W(l,i[1])},m(l,t){C(l,e,t)},p(l,t){t&2&&fe(e,l[1])},d(l){l&&h(e)}}}function Zr(i){let e,l,t,n,o,r,a;const s=i[15].default,f=rt(s,i,i[14],null),u=f||Kr(i);let d=[{tabindex:"-1"},{role:"presentation"},i[12]],c={};for(let m=0;ml(13,r=B)),ce(i,$,B=>l(7,a=B)),S({id:_,label:u,disabled:c});function N(B){je.call(this,i,B)}function F(B){je.call(this,i,B)}function T(B){je.call(this,i,B)}function E(B){je.call(this,i,B)}function P(B){Re[B?"unshift":"push"](()=>{p=B,l(0,p)})}const I=()=>{c||w(_)},A=({key:B})=>{c||(B==="ArrowRight"?y(1):B==="ArrowLeft"?y(-1):(B===" "||B==="Enter")&&w(_))};return i.$$set=B=>{e=ue(ue({},e),Ee(B)),l(12,o=we(e,n)),"label"in B&&l(1,u=B.label),"href"in B&&l(2,d=B.href),"disabled"in B&&l(3,c=B.disabled),"tabindex"in B&&l(4,m=B.tabindex),"id"in B&&l(5,_=B.id),"ref"in B&&l(0,p=B.ref),"$$scope"in B&&l(14,f=B.$$scope)},i.$$.update=()=>{i.$$.dirty&8224&&l(6,t=r===_)},[p,u,d,c,m,_,t,a,k,$,w,y,o,r,f,s,N,F,T,E,P,I,A]}class Xr extends _e{constructor(e){super(),ge(this,e,Gr,Zr,he,{label:1,href:2,disabled:3,tabindex:4,id:5,ref:0})}}const Ft=Xr;function xr(i){let e,l,t,n;const o=i[12].default,r=rt(o,i,i[11],null);let a=[{role:"tabpanel"},{"aria-labelledby":i[1]},{"aria-hidden":l=!i[2]},{hidden:t=i[2]?void 0:""},{id:i[0]},i[6]],s={};for(let f=0;fl(10,u=S)),ce(i,k,S=>l(8,s=S)),ce(i,$,S=>l(9,f=S)),p({id:m}),i.$$set=S=>{e=ue(ue({},e),Ee(S)),l(6,a=we(e,r)),"id"in S&&l(0,m=S.id),"$$scope"in S&&l(11,c=S.$$scope)},i.$$.update=()=>{i.$$.dirty&1025&&l(2,t=u===m),i.$$.dirty&513&&l(7,n=f[m].index),i.$$.dirty&384&&l(1,o=s[n].id)},[m,o,t,_,k,$,a,n,s,f,u,c,d]}class ts extends _e{constructor(e){super(),ge(this,e,es,xr,he,{id:0})}}const Bt=ts;function _l(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function ls(i){let e,l,t=i[1]&&_l(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class is extends _e{constructor(e){super(),ge(this,e,ns,ls,he,{size:0,title:1})}}function gl(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function rs(i){let e,l,t=i[1]&&gl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class as extends _e{constructor(e){super(),ge(this,e,ss,rs,he,{size:0,title:1})}}function pl(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function os(i){let e,l,t=i[1]&&pl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class us extends _e{constructor(e){super(),ge(this,e,fs,os,he,{size:0,title:1})}}function bl(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function cs(i){let e,l,t=i[1]&&bl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class ms extends _e{constructor(e){super(),ge(this,e,ds,cs,he,{size:0,title:1})}}function vl(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function hs(i){let e,l,t=i[1]&&vl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class gs extends _e{constructor(e){super(),ge(this,e,_s,hs,he,{size:0,title:1})}}function wl(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function ps(i){let e,l,t=i[1]&&wl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class vs extends _e{constructor(e){super(),ge(this,e,bs,ps,he,{size:0,title:1})}}function kl(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function ws(i){let e,l,t,n=i[1]&&kl(i),o=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],r={};for(let a=0;a{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class Vt extends _e{constructor(e){super(),ge(this,e,ks,ws,he,{size:0,title:1})}}function Sl(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function Ss(i){let e,l,t=i[1]&&Sl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class ys extends _e{constructor(e){super(),ge(this,e,Es,Ss,he,{size:0,title:1})}}function El(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function $s(i){let e,l,t=i[1]&&El(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class Is extends _e{constructor(e){super(),ge(this,e,Ds,$s,he,{size:0,title:1})}}function yl(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function Vs(i){let e,l,t=i[1]&&yl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class Tt extends _e{constructor(e){super(),ge(this,e,Ts,Vs,he,{size:0,title:1})}}function $l(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function Cs(i){let e,l,t=i[1]&&$l(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class Ct extends _e{constructor(e){super(),ge(this,e,Ns,Cs,he,{size:0,title:1})}}function Dl(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function Ms(i){let e,l,t=i[1]&&Dl(i),n=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],o={};for(let r=0;r{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class Il extends _e{constructor(e){super(),ge(this,e,zs,Ms,he,{size:0,title:1})}}function Vl(i){let e,l;return{c(){e=be("title"),l=Y(i[1])},l(t){e=ve(t,"title",{});var n=D(e);l=W(n,i[1]),n.forEach(h)},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&2&&fe(l,t[1])},d(t){t&&h(e)}}}function As(i){let e,l,t,n=i[1]&&Vl(i),o=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:i[0]},{height:i[0]},i[2],i[3]],r={};for(let a=0;a{l(5,e=ue(ue({},e),Ee(f))),l(3,r=we(e,o)),"size"in f&&l(0,a=f.size),"title"in f&&l(1,s=f.title)},i.$$.update=()=>{l(4,t=e["aria-label"]||e["aria-labelledby"]||s),l(2,n={"aria-hidden":t?void 0:!0,role:t?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Ee(e),[a,s,n,r,t]}class Bs extends _e{constructor(e){super(),ge(this,e,Fs,As,he,{size:0,title:1})}}function Tl(i){let e;return{c(){e=M("div"),this.h()},l(l){e=z(l,"DIV",{id:!0,style:!0}),D(e).forEach(h),this.h()},h(){V(e,"id","svelte-infinite-scroll"),Ue(e,"width","0")},m(l,t){C(l,e,t),i[11](e)},p:Z,d(l){l&&h(e),i[11](null)}}}function Ps(i){let e,l=!i[1]&&!i[0]&&Tl(i);return{c(){l&&l.c(),e=re()},l(t){l&&l.l(t),e=re()},m(t,n){l&&l.m(t,n),C(t,e,n)},p(t,[n]){!t[1]&&!t[0]?l?l.p(t,n):(l=Tl(t),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Z,o:Z,d(t){l&&l.d(t),t&&h(e)}}}function Rs(i,e,l){let{threshold:t=0}=e,{horizontal:n=!1}=e,{elementScroll:o=null}=e,{hasMore:r=!0}=e,{reverse:a=!1}=e,{window:s=!1}=e;const f=_t();let u=!1,d,c,m,_;const p=S=>{if(!r)return;const w=S.target;k(w,a,n)<=t?(!u&&r&&(f("loadMore"),l(8,c=w.scrollHeight),l(9,m=w.scrollTop)),l(7,u=!0)):l(7,u=!1)},k=(S,w,y)=>{const N=S.documentElement?S.documentElement:S;return w?y?N.scrollLeft:N.scrollTop:y?N.scrollWidth-N.clientWidth-N.scrollLeft:N.scrollHeight-N.clientHeight-N.scrollTop};fi(()=>{s?l(10,_=document):o?l(10,_=o):l(10,_=d.parentNode)}),Vi(()=>{_&&(_.removeEventListener("scroll",p),_.removeEventListener("resize",p))});function $(S){Re[S?"unshift":"push"](()=>{d=S,l(2,d)})}return i.$$set=S=>{"threshold"in S&&l(3,t=S.threshold),"horizontal"in S&&l(4,n=S.horizontal),"elementScroll"in S&&l(0,o=S.elementScroll),"hasMore"in S&&l(5,r=S.hasMore),"reverse"in S&&l(6,a=S.reverse),"window"in S&&l(1,s=S.window)},i.$$.update=()=>{i.$$.dirty&1088&&_&&(a&&l(10,_.scrollTop=_.scrollHeight,_),_.addEventListener("scroll",p),_.addEventListener("resize",p)),i.$$.dirty&1984&&u&&a&&l(10,_.scrollTop=_.scrollHeight-c+m,_)},[o,s,d,t,n,r,a,u,c,m,_,$]}class qs extends _e{constructor(e){super(),ge(this,e,Rs,Ps,he,{threshold:3,horizontal:4,elementScroll:0,hasMore:5,reverse:6,window:1})}}function Os(i){let e,l,t,n,o,r,a,s;t=new Zi({});const f=i[3].default,u=rt(f,i,i[6],null);return{c(){e=M("div"),l=M("button"),q(t.$$.fragment),n=j(),o=M("span"),u&&u.c(),this.h()},l(d){e=z(d,"DIV",{class:!0});var c=D(e);l=z(c,"BUTTON",{class:!0});var m=D(l);H(t.$$.fragment,m),m.forEach(h),n=U(c),o=z(c,"SPAN",{class:!0});var _=D(o);u&&u.l(_),_.forEach(h),c.forEach(h),this.h()},h(){V(l,"class","opacity-50 hover:opacity-100"),V(o,"class","truncate"),V(e,"class","removable-tag flex items-center gap-x-1")},m(d,c){C(d,e,c),v(e,l),O(t,l,null),v(e,n),v(e,o),u&&u.m(o,null),r=!0,a||(s=Ve(l,"click",qt(i[4])),a=!0)},p(d,c){u&&u.p&&(!r||c&64)&&st(u,f,d,d[6],r?ot(f,d[6],c,null):at(d[6]),null)},i(d){r||(g(t.$$.fragment,d),g(u,d),r=!0)},o(d){b(t.$$.fragment,d),b(u,d),r=!1},d(d){d&&h(e),L(t),u&&u.d(d),a=!1,s()}}}function Ls(i){let e,l;const t=[{type:i[0]},i[2]];let n={$$slots:{default:[Os]},$$scope:{ctx:i}};for(let o=0;oa("remove");function u(d){je.call(this,i,d)}return i.$$set=d=>{e=ue(ue({},e),Ee(d)),l(2,n=we(e,t)),"type"in d&&l(0,s=d.type),"$$scope"in d&&l(6,r=d.$$scope)},[s,a,n,o,f,u,r]}class zt extends _e{constructor(e){super(),ge(this,e,Hs,Ls,he,{type:0})}}function js(i){let e=(i[2]?"":i[5])+"",l,t,n=i[0][i[1].op]+"",o,r,a;return{c(){l=Y(e),t=j(),o=Y(n),r=j(),a=Y(i[4])},l(s){l=W(s,e),t=U(s),o=W(s,n),r=U(s),a=W(s,i[4])},m(s,f){C(s,l,f),C(s,t,f),C(s,o,f),C(s,r,f),C(s,a,f)},p(s,f){f&36&&e!==(e=(s[2]?"":s[5])+"")&&fe(l,e),f&2&&n!==(n=s[0][s[1].op]+"")&&fe(o,n),f&16&&fe(a,s[4])},d(s){s&&h(l),s&&h(t),s&&h(o),s&&h(r),s&&h(a)}}}function Us(i){let e,l,t,n,o,r;return l=new zt({props:{interactive:!0,type:"magenta",$$slots:{default:[js]},$$scope:{ctx:i}}}),l.$on("click",i[9]),l.$on("remove",i[10]),{c(){e=M("div"),q(l.$$.fragment),this.h()},l(a){e=z(a,"DIV",{class:!0});var s=D(e);H(l.$$.fragment,s),s.forEach(h),this.h()},h(){V(e,"class","filter-pill items-center")},m(a,s){C(a,e,s),O(l,e,null),n=!0,o||(r=Ae(t=Fe.call(null,e,{text:i[6]})),o=!0)},p(a,[s]){const f={};s&2102&&(f.$$scope={dirty:s,ctx:a}),l.$set(f),t&&Oe(t.update)&&s&64&&t.update.call(null,{text:a[6]})},i(a){n||(g(l.$$.fragment,a),n=!0)},o(a){b(l.$$.fragment,a),n=!1},d(a){a&&h(e),L(l),o=!1,r()}}}function Ys(i,e,l){let t,n,o,r,a;const s={equals:"=",not_equal:"≠",less:"<",less_equal:"≤",greater:">",greater_equal:"≥",in:"in",exists:"exists"};let{filter:f}=e,{hidePath:u=!1}=e;const d=qe();ce(i,d,_=>l(7,a=_));const c=()=>Xe({command:xe.EditFilter,namespace:a.namespace,datasetName:a.datasetName,path:n}),m=()=>d.removeFilter(f);return i.$$set=_=>{"filter"in _&&l(1,f=_.filter),"hidePath"in _&&l(2,u=_.hidePath)},i.$$.update=()=>{i.$$.dirty&2&&l(4,t=De(f.value||"false")),i.$$.dirty&2&&l(3,n=Ot(f.path)),i.$$.dirty&18&&l(6,o=`${Ie(f.path)} ${s[f.op]} ${t}`),i.$$.dirty&8&&l(5,r=n.at(-1))},[s,f,u,n,t,r,o,a,d,c,m]}class Gt extends _e{constructor(e){super(),ge(this,e,Ys,Us,he,{FILTER_SHORTHANDS:0,filter:1,hidePath:2})}get FILTER_SHORTHANDS(){return this.$$.ctx[0]}}function Cl(i){let e,l=i[0].query.concept_namespace+"",t,n,o=i[0].query.concept_name+"",r;return{c(){e=M("div"),t=Y(l),n=Y(" / "),r=Y(o),this.h()},l(a){e=z(a,"DIV",{class:!0});var s=D(e);t=W(s,l),n=W(s," / "),r=W(s,o),s.forEach(h),this.h()},h(){V(e,"class","mb-2 w-full text-center text-xs")},m(a,s){C(a,e,s),v(e,t),v(e,n),v(e,r)},p(a,s){s&1&&l!==(l=a[0].query.concept_namespace+"")&&fe(t,l),s&1&&o!==(o=a[0].query.concept_name+"")&&fe(r,o)},d(a){a&&h(e)}}}function Ws(i){let e=Ie(i[0].path)+"",l,t,n=i[0].query.type+"",o;return{c(){l=Y(e),t=Y(": "),o=Y(n)},l(r){l=W(r,e),t=W(r,": "),o=W(r,n)},m(r,a){C(r,l,a),C(r,t,a),C(r,o,a)},p(r,a){a&1&&e!==(e=Ie(r[0].path)+"")&&fe(l,e),a&1&&n!==(n=r[0].query.type+"")&&fe(o,n)},d(r){r&&h(l),r&&h(t),r&&h(o)}}}function Nl(i){let e,l,t;return l=new Ut({props:{embedding:i[0].query.embedding}}),{c(){e=M("div"),q(l.$$.fragment),this.h()},l(n){e=z(n,"DIV",{class:!0});var o=D(e);H(l.$$.fragment,o),o.forEach(h),this.h()},h(){V(e,"class","ml-2")},m(n,o){C(n,e,o),O(l,e,null),t=!0},p(n,o){const r={};o&1&&(r.embedding=n[0].query.embedding),l.$set(r)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function Ml(i){let e,l;return{c(){e=M("div"),l=Y(i[2]),this.h()},l(t){e=z(t,"DIV",{class:!0});var n=D(e);l=W(n,i[2]),n.forEach(h),this.h()},h(){V(e,"class","mt-2 whitespace-pre-wrap text-left")},m(t,n){C(t,e,n),v(e,l)},p(t,n){n&4&&fe(l,t[2])},d(t){t&&h(e)}}}function Qs(i){let e,l,t,n,o,r,a,s,f=i[0].query.type==="concept"&&Cl(i);n=new lt({props:{type:i[1],$$slots:{default:[Ws]},$$scope:{ctx:i}}});let u=(i[0].query.type==="semantic"||i[0].query.type==="concept")&&Nl(i),d=i[2]&&Ml(i);return{c(){f&&f.c(),e=j(),l=M("div"),t=M("div"),q(n.$$.fragment),o=j(),u&&u.c(),r=j(),d&&d.c(),a=re(),this.h()},l(c){f&&f.l(c),e=U(c),l=z(c,"DIV",{class:!0});var m=D(l);t=z(m,"DIV",{class:!0});var _=D(t);H(n.$$.fragment,_),_.forEach(h),o=U(m),u&&u.l(m),m.forEach(h),r=U(c),d&&d.l(c),a=re(),this.h()},h(){V(t,"class","whitespace-nowrap"),V(l,"class","flex items-center justify-items-center")},m(c,m){f&&f.m(c,m),C(c,e,m),C(c,l,m),v(l,t),O(n,t,null),v(l,o),u&&u.m(l,null),C(c,r,m),d&&d.m(c,m),C(c,a,m),s=!0},p(c,[m]){c[0].query.type==="concept"?f?f.p(c,m):(f=Cl(c),f.c(),f.m(e.parentNode,e)):f&&(f.d(1),f=null);const _={};m&2&&(_.type=c[1]),m&9&&(_.$$scope={dirty:m,ctx:c}),n.$set(_),c[0].query.type==="semantic"||c[0].query.type==="concept"?u?(u.p(c,m),m&1&&g(u,1)):(u=Nl(c),u.c(),g(u,1),u.m(l,null)):u&&(X(),b(u,1,1,()=>{u=null}),x()),c[2]?d?d.p(c,m):(d=Ml(c),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},i(c){s||(g(n.$$.fragment,c),g(u),s=!0)},o(c){b(n.$$.fragment,c),b(u),s=!1},d(c){f&&f.d(c),c&&h(e),c&&h(l),L(n),u&&u.d(),c&&h(r),d&&d.d(c),c&&h(a)}}}function Js(i,e,l){let t,{search:n}=e,{tagType:o="outline"}=e;return i.$$set=r=>{"search"in r&&l(0,n=r.search),"tagType"in r&&l(1,o=r.tagType)},i.$$.update=()=>{i.$$.dirty&1&&l(2,t=n.query.type==="concept"?"":n.query.search)},[n,o,t]}class zl extends _e{constructor(e){super(),ge(this,e,Js,Qs,he,{search:0,tagType:1})}}function Ks(i){let e;return{c(){e=Y(i[2])},l(l){e=W(l,i[2])},m(l,t){C(l,e,t)},p(l,t){t&4&&fe(e,l[2])},d(l){l&&h(e)}}}function Zs(i){let e,l,t,n,o,r;return l=new zt({props:{title:"query",interactive:!0,type:i[1],$$slots:{default:[Ks]},$$scope:{ctx:i}}}),l.$on("remove",i[7]),{c(){e=M("button"),q(l.$$.fragment),this.h()},l(a){e=z(a,"BUTTON",{class:!0});var s=D(e);H(l.$$.fragment,s),s.forEach(h),this.h()},h(){V(e,"class","search-pill items-center text-left")},m(a,s){C(a,e,s),O(l,e,null),n=!0,o||(r=[Ae(t=Fe.call(null,e,{component:zl,props:{search:i[0],tagType:i[1]}})),Ve(e,"click",i[6])],o=!0)},p(a,[s]){const f={};s&2&&(f.type=a[1]),s&516&&(f.$$scope={dirty:s,ctx:a}),l.$set(f),t&&Oe(t.update)&&s&3&&t.update.call(null,{component:zl,props:{search:a[0],tagType:a[1]}})},i(a){n||(g(l.$$.fragment,a),n=!0)},o(a){b(l.$$.fragment,a),n=!1},d(a){a&&h(e),L(l),o=!1,Je(r)}}}function Gs(i,e,l){let t,n,o,{search:r}=e;const a={keyword:"outline",semantic:"teal",concept:"green"},s=qe(),f=We();ce(i,f,c=>l(3,o=c));function u(c){je.call(this,i,c)}const d=()=>{var c;return s.removeSearch(r,((c=o.selectRowsSchema)==null?void 0:c.data)||null)};return i.$$set=c=>{"search"in c&&l(0,r=c.search)},i.$$.update=()=>{i.$$.dirty&1&&l(2,t=r.query.type==="concept"?r.query.concept_name:r.query.search),i.$$.dirty&1&&l(1,n=r.query.type!=null?a[r.query.type]:"outline")},[r,n,t,o,s,f,u,d]}class Ei extends _e{constructor(e){super(),ge(this,e,Gs,Zs,he,{search:0})}}function Al(i,e,l){const t=i.slice();return t[25]=e[l],t}function Fl(i,e,l){const t=i.slice();return t[28]=e[l],t}function Bl(i,e,l){const t=i.slice();return t[31]=e[l],t}function Xs(i){let e,l,t,n=i[13],o=[];for(let s=0;sb(o[s],1,1,()=>{o[s]=null});let a=i[8]!=null&&i[8].length>0&&Ol(i);return{c(){e=M("div");for(let s=0;s0?a?(a.p(s,f),f[0]&256&&g(a,1)):(a=Ol(s),a.c(),g(a,1),a.m(e,null)):a&&(X(),b(a,1,1,()=>{a=null}),x())},i(s){if(!t){for(let f=0;fb(u[c],1,1,()=>{u[c]=null});return{c(){e=M("div"),l=M("div"),n=Y(t),o=j(),r=M("div");for(let c=0;c{t=null}),x())},i(n){l||(g(t),l=!0)},o(n){b(t),l=!1},d(n){t&&t.d(n),n&&h(e)}}}function Ol(i){let e,l,t,n,o,r,a=i[8],s=[];for(let u=0;ub(s[u],1,1,()=>{s[u]=null});return{c(){e=M("div"),l=M("div"),t=Y("Filters"),n=j(),o=M("div");for(let u=0;u{r[u]=null}),x()),~e?(l=r[e],l?l.p(s,f):(l=r[e]=o[e](s),l.c()),g(l,1),l.m(t.parentNode,t)):l=null)},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){~e&&r[e].d(s),s&&h(t)}}}function na(i){var N,F,T;let e,l,t,n,o,r,a,s,f,u,d,c,m,_,p,k,$=i[13].length>0&&Xs(i),S=i[0]&&i[1]&&Hl(i),w=i[6]!=null&&jl(i);u=new jr({props:{size:"sm",titleText:"Sort by",class:"w-36",selectedId:i[5],items:i[7]}}),u.$on("select",i[16]),m=new Ye({props:{class:"top-2",kind:"ghost",expressive:!0,icon:((N=i[4])==null?void 0:N.order)==null?Il:((F=i[4])==null?void 0:F.order)==="ASC"?Tt:Ct,disabled:i[4]==null,tooltipPosition:"bottom",tooltipAlignment:"end",iconDescription:((T=i[4])==null?void 0:T.order)==="ASC"?"Sorted ascending. Toggle to switch to descending.":"Sorted descending. Toggle to switch to ascending."}}),m.$on("click",i[17]);let y=i[2]&&Ul(i);return{c(){e=M("div"),l=M("div"),$&&$.c(),t=j(),n=M("div"),o=M("div"),S&&S.c(),r=j(),a=M("div"),s=M("div"),w&&w.c(),f=j(),q(u.$$.fragment),d=j(),c=M("div"),q(m.$$.fragment),_=j(),y&&y.c(),p=re(),this.h()},l(E){e=z(E,"DIV",{class:!0});var P=D(e);l=z(P,"DIV",{class:!0});var I=D(l);$&&$.l(I),t=U(I),n=z(I,"DIV",{class:!0});var A=D(n);o=z(A,"DIV",{class:!0});var B=D(o);S&&S.l(B),B.forEach(h),r=U(A),a=z(A,"DIV",{class:!0});var J=D(a);s=z(J,"DIV",{class:!0});var te=D(s);w&&w.l(te),te.forEach(h),f=U(J),H(u.$$.fragment,J),d=U(J),c=z(J,"DIV",{class:!0});var K=D(c);H(m.$$.fragment,K),K.forEach(h),J.forEach(h),A.forEach(h),I.forEach(h),P.forEach(h),_=U(E),y&&y.l(E),p=re(),this.h()},h(){V(o,"class","self-end py-1"),V(s,"class","ml-1 w-8"),V(c,"class","ml-1"),V(a,"class","sort-container flex flex-row items-center"),V(n,"class","flex w-full flex-row items-end justify-between"),V(l,"class","flex w-full flex-col"),V(e,"class","mx-5 my-2 flex items-center justify-between")},m(E,P){C(E,e,P),v(e,l),$&&$.m(l,null),v(l,t),v(l,n),v(n,o),S&&S.m(o,null),v(n,r),v(n,a),v(a,s),w&&w.m(s,null),v(a,f),O(u,a,null),v(a,d),v(a,c),O(m,c,null),C(E,_,P),y&&y.m(E,P),C(E,p,P),k=!0},p(E,P){var B,J,te;E[13].length>0&&$.p(E,P),E[0]&&E[1]?S?S.p(E,P):(S=Hl(E),S.c(),S.m(o,null)):S&&(S.d(1),S=null),E[6]!=null?w?(w.p(E,P),P[0]&64&&g(w,1)):(w=jl(E),w.c(),g(w,1),w.m(s,null)):w&&(X(),b(w,1,1,()=>{w=null}),x());const I={};P[0]&32&&(I.selectedId=E[5]),P[0]&128&&(I.items=E[7]),u.$set(I);const A={};P[0]&16&&(A.icon=((B=E[4])==null?void 0:B.order)==null?Il:((J=E[4])==null?void 0:J.order)==="ASC"?Tt:Ct),P[0]&16&&(A.disabled=E[4]==null),P[0]&16&&(A.iconDescription=((te=E[4])==null?void 0:te.order)==="ASC"?"Sorted ascending. Toggle to switch to descending.":"Sorted descending. Toggle to switch to ascending."),m.$set(A),E[2]?y?(y.p(E,P),P[0]&4&&g(y,1)):(y=Ul(E),y.c(),g(y,1),y.m(p.parentNode,p)):y&&(X(),b(y,1,1,()=>{y=null}),x())},i(E){k||(g($),g(w),g(u.$$.fragment,E),g(m.$$.fragment,E),g(y),k=!0)},o(E){b($),b(w),b(u.$$.fragment,E),b(m.$$.fragment,E),b(y),k=!1},d(E){E&&h(e),$&&$.d(),S&&S.d(),w&&w.d(),L(u),L(m),E&&h(_),y&&y.d(E),E&&h(p)}}}function ia(i,e,l){let t,n,o,r,a,s,f,u,d,c,m=Z,_=()=>(m(),m=Pe(t,te=>l(10,c=te)),t);i.$$.on_destroy.push(()=>m());let{totalNumRows:p}=e,{manifest:k}=e,$=qe();ce(i,$,te=>l(21,d=te));let S=We();ce(i,S,te=>l(20,u=te));let w=null;const y=["keyword","semantic","concept"],N={keyword:"Keyword",semantic:"Semantic",concept:"Concepts"};let F={};function T(te){if(te.query.type==="concept"){const K=te.query;l(2,w={namespace:K.concept_namespace,name:K.concept_name})}}let E={};const P=te=>{if(te.detail.selectedId==null){$.setSortBy(null);return}$.setSortBy(Ot(te.detail.selectedId))},I=()=>{r!=null&&$.setSortBy(r.path),$.setSortOrder((r==null?void 0:r.order)==="ASC"?"DESC":"ASC")},A=()=>{$.clearSorts()},B=te=>T(te),J=()=>l(2,w=null);return i.$$set=te=>{"totalNumRows"in te&&l(0,p=te.totalNumRows),"manifest"in te&&l(1,k=te.manifest)},i.$$.update=()=>{var te,K,G,ee;if(i.$$.dirty[0]&4&&_(l(9,t=w?Ni(w.namespace,w.name):void 0)),i.$$.dirty[0]&2097152&&l(19,n=Yt(d)),i.$$.dirty[0]&2097152&&l(8,o=d.queryOptions.filters),i.$$.dirty[0]&524296){l(3,F={});for(const le of n)le.query.type&&(le.query.type in F||l(3,F[le.query.type]=[],F),F[le.query.type].push(le))}if(i.$$.dirty[0]&1048576&&l(4,r=Gi(u)),i.$$.dirty[0]&1048576)for(const le of((K=(te=u.selectRowsSchema)==null?void 0:te.data)==null?void 0:K.search_results)||[])E[Ie(le.result_path)]=le;i.$$.dirty[0]&16&&l(5,a=r!=null&&r.path?Ie(r.path):null),i.$$.dirty[0]&2097152&&l(6,s=d.queryOptions.sort_by),i.$$.dirty[0]&1048672&&l(7,f=((ee=(G=u.selectRowsSchema)==null?void 0:G.data)==null?void 0:ee.schema)!=null?[{id:null,text:"None",disabled:s==null&&a!=null},...Lt(u.selectRowsSchema.data.schema).map(le=>{const pe=Ie(le.path);return{id:pe,text:pe}})]:[])},[p,k,w,F,r,a,s,f,o,t,c,$,S,y,N,T,P,I,A,n,u,d,B,J]}class ra extends _e{constructor(e){super(),ge(this,e,ia,na,he,{totalNumRows:0,manifest:1},null,[-1,-1])}}function Yl(i,e,l){const t=i.slice();t[16]=e[l],t[19]=l;const n=t[2].length>1?`[${t[19]}]`:"";return t[17]=n,t}function Wl(i){let e,l,t,n=i[0].join(".")+i[17]+"",o,r,a,s,f,u;return s=new xi({props:{text:De(i[16]),row:i[1],spanPaths:i[3],valuePaths:i[5],datasetViewStore:i[6],datasetStore:i[4]}}),{c(){e=M("div"),l=M("div"),t=M("div"),o=Y(n),r=j(),a=M("div"),q(s.$$.fragment),f=j(),this.h()},l(d){e=z(d,"DIV",{class:!0});var c=D(e);l=z(c,"DIV",{class:!0});var m=D(l);t=z(m,"DIV",{class:!0});var _=D(t);o=W(_,n),_.forEach(h),r=U(m),a=z(m,"DIV",{class:!0});var p=D(a);H(s.$$.fragment,p),p.forEach(h),m.forEach(h),f=U(c),c.forEach(h),this.h()},h(){V(t,"class","sticky top-0 z-10 w-full self-start border-t border-neutral-200 bg-neutral-100 px-2 py-2 pb-2 font-mono font-medium text-neutral-500"),V(a,"class","font-normal"),V(l,"class","flex w-full flex-col"),V(e,"class","flex flex-row")},m(d,c){C(d,e,c),v(e,l),v(l,t),v(t,o),v(l,r),v(l,a),O(s,a,null),v(e,f),u=!0},p(d,c){(!u||c&5)&&n!==(n=d[0].join(".")+d[17]+"")&&fe(o,n);const m={};c&4&&(m.text=De(d[16])),c&2&&(m.row=d[1]),c&8&&(m.spanPaths=d[3]),c&16&&(m.datasetStore=d[4]),s.$set(m)},i(d){u||(g(s.$$.fragment,d),u=!0)},o(d){b(s.$$.fragment,d),u=!1},d(d){d&&h(e),L(s)}}}function sa(i){let e,l,t=i[2],n=[];for(let r=0;rb(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;rl(4,d=w));const S=d.visibleFields||[];return i.$$set=w=>{"path"in w&&l(0,c=w.path),"row"in w&&l(1,m=w.row),"field"in w&&l(8,_=w.field)},i.$$.update=()=>{if(i.$$.dirty&256&&l(14,t=wt(_)),i.$$.dirty&16384&&l(11,n=t.filter(w=>Mi(w.signal))),i.$$.dirty&16384&&l(10,o=t.filter(w=>{var y;return((y=w.signal)==null?void 0:y.signal_name)==="concept_labels"})),i.$$.dirty&16384&&l(9,r=t.filter(w=>{var y;return((y=w.signal)==null?void 0:y.signal_name)==="semantic_similarity"})),i.$$.dirty&16384&&l(12,a=t.filter(w=>{var y;return((y=w.signal)==null?void 0:y.signal_name)==="substring_search"})),i.$$.dirty&16384&&l(13,s=t.filter(w=>w.dtype==="string_span")),i.$$.dirty&8192&&l(3,f=s.map(w=>w.path)),i.$$.dirty&15872)for(const w of s){const N=wt(w).filter(E=>E.dtype!="string_span").filter(E=>S==null?void 0:S.some(P=>Qe(P.path,E.path))).filter(E=>E.dtype!=null&&E.dtype!="embedding"),F=w.path,T=a.find(E=>vt(w.path,E.path));if(T!=null){const E=T.signal;p.push({path:w.path,spanPath:F,type:"keyword",name:E.query,dtype:w.dtype,signal:E})}for(const E of N){const P=n.find(B=>vt(E.path,B.path)),I=o.find(B=>vt(E.path,B.path)),A=r.find(B=>vt(E.path,B.path));if(P!=null){const B=P.signal;p.push({path:E.path,spanPath:F,type:"concept_score",name:`${B.namespace}/${B.concept_name}`,dtype:E.dtype,signal:B})}else if(I!=null){const B=I.signal;p.push({path:E.path,spanPath:F,type:"label",name:`${B.namespace}/${B.concept_name} label`,dtype:E.dtype,signal:B})}else if(A!=null){const B=A.signal;p.push({path:E.path,spanPath:F,type:"semantic_similarity",name:`similarity: ${B.query}`,dtype:E.dtype,signal:B})}else p.push({path:E.path,spanPath:F,type:"metadata",name:E.path[E.path.length-1],dtype:E.dtype})}}i.$$.dirty&3&&l(2,u=zi(m,c).map(w=>Ke.value(w)).filter(kr))},[c,m,u,f,d,p,k,$,_,r,o,n,a,s,t]}class oa extends _e{constructor(e){super(),ge(this,e,aa,sa,he,{path:0,row:1,field:8})}}function fa(i){let e,l,t,n,o;const r=[i[3],{type:i[0]?"green":"blue"},{icon:i[2]}];let a={};for(let s=0;s{e=ue(ue({},e),Ee(s)),l(3,n=we(e,t)),"isPreview"in s&&l(0,o=s.isPreview)},[o,r,a,n]}class Xt extends _e{constructor(e){super(),ge(this,e,ua,fa,he,{isPreview:0})}}function Ql(i,e,l){const t=i.slice();return t[0]=e[l],t}function Jl(i){let e,l,t=[],n=new Map,o,r=i[1];const a=s=>Ie(s[0].path);for(let s=0;s{N[P]=null}),x()),~u?(d=N[u],d?d.p(e,E):(d=N[u]=y[u](e),d.c()),g(d,1),d.m(f,null)):d=null),(!w||E&2)&&p!==(p=e[0].formattedValue+"")&&fe(k,p),(!w||E&2&&$!==($=`${e[0].value}`))&&V(_,"title",$),(!w||E&2)&&se(_,"italic",e[0].formattedValue===null)},i(T){w||(g(d),w=!0)},o(T){b(d),w=!1},d(T){T&&h(l),~u&&N[u].d()}}}function ma(i){let e,l,t=i[1].length>0&&Jl(i);return{c(){t&&t.c(),e=re()},l(n){t&&t.l(n),e=re()},m(n,o){t&&t.m(n,o),C(n,e,o),l=!0},p(n,[o]){n[1].length>0?t?(t.p(n,o),o&2&&g(t,1)):(t=Jl(n),t.c(),g(t,1),t.m(e.parentNode,e)):t&&(X(),b(t,1,1,()=>{t=null}),x())},i(n){l||(g(t),l=!0)},o(n){b(t),l=!1},d(n){t&&t.d(n),n&&h(e)}}}function ha(i,e,l){let t,n,o,{row:r}=e,{visibleFields:a}=e;const s=We();ce(i,s,d=>l(5,n=d));const f=Zt();ce(i,f,d=>l(6,o=d));function u(d){const c=Ai(d).filter(_=>er(_,a)),m=c.filter(_=>{var p;return((p=Ke.field(_))==null?void 0:p.dtype)==="string_span"}).map(_=>Ke.path(_));return c.filter(_=>!m.some(p=>vt(Ke.path(_),p))).map(_=>{var N,F;const p=Ke.field(_),k=Ke.path(_);let $=Ke.value(_);if(p.dtype==="string_span")return null;const S=((N=o.data)==null?void 0:N.some(T=>{var E;return T.name===((E=p.signal)==null?void 0:E.signal_name)}))||!1,w=dt(p);let y;return S||w&&p.dtype==null||p.dtype==="embedding"||p.repeated_field!=null?y="":$==null?y=null:y=De($),{indentLevel:k.length-1,fieldName:k[k.length-1],field:p,path:k,isSignal:w,isPreviewSignal:Nt(((F=n.selectRowsSchema)==null?void 0:F.data)||null,k),isEmbeddingSignal:S,value:$,formattedValue:y}}).filter(_=>_!=null)}return i.$$set=d=>{"row"in d&&l(0,r=d.row),"visibleFields"in d&&l(4,a=d.visibleFields)},i.$$.update=()=>{i.$$.dirty&1&&l(1,t=u(r))},[r,t,s,f,a]}class _a extends _e{constructor(e){super(),ge(this,e,ha,ma,he,{row:0,visibleFields:4})}}function Zl(i,e,l){const t=i.slice();return t[5]=e[l],t[7]=l,t}function Gl(i){let e,l=[],t=new Map,n,o,r=i[1];const a=s=>Ie(s[5].path);for(let s=0;si[4].call(e))},m(s,f){C(s,e,f);for(let u=0;u0&&Gl(i);return a=new _a({props:{row:i[0],visibleFields:i[2]}}),{c(){e=M("div"),l=M("div"),u&&u.c(),t=j(),n=M("div"),o=M("div"),r=M("div"),q(a.$$.fragment),this.h()},l(d){e=z(d,"DIV",{class:!0});var c=D(e);l=z(c,"DIV",{class:!0});var m=D(l);u&&u.l(m),t=U(m),n=z(m,"DIV",{class:!0});var _=D(n);o=z(_,"DIV",{class:!0});var p=D(o);r=z(p,"DIV",{style:!0,class:!0});var k=D(r);H(a.$$.fragment,k),k.forEach(h),p.forEach(h),_.forEach(h),m.forEach(h),c.forEach(h),this.h()},h(){V(r,"style",s=`max-height: ${Math.max(xl,i[3])}px`),V(r,"class","overflow-y-auto"),V(o,"class","sticky top-0 self-start"),V(n,"class","flex h-full w-1/3 bg-neutral-100"),V(l,"class","flex h-full w-full flex-row"),V(e,"class","mx-5 mb-10 rounded border-x border-b border-neutral-200 shadow-md")},m(d,c){C(d,e,c),v(e,l),u&&u.m(l,null),v(l,t),v(l,n),v(n,o),v(o,r),O(a,r,null),f=!0},p(d,[c]){d[1].length>0?u?(u.p(d,c),c&2&&g(u,1)):(u=Gl(d),u.c(),g(u,1),u.m(l,t)):u&&(X(),b(u,1,1,()=>{u=null}),x());const m={};c&1&&(m.row=d[0]),c&4&&(m.visibleFields=d[2]),a.$set(m),(!f||c&8&&s!==(s=`max-height: ${Math.max(xl,d[3])}px`))&&V(r,"style",s)},i(d){f||(g(u),g(a.$$.fragment,d),f=!0)},o(d){b(u),b(a.$$.fragment,d),f=!1},d(d){d&&h(e),u&&u.d(),L(a)}}}const xl=320;function pa(i,e,l){let{row:t}=e,{mediaFields:n}=e,{visibleFields:o}=e,r=0;function a(){r=this.clientHeight,l(3,r)}return i.$$set=s=>{"row"in s&&l(0,t=s.row),"mediaFields"in s&&l(1,n=s.mediaFields),"visibleFields"in s&&l(2,o=s.visibleFields)},[t,n,o,r,a]}class ba extends _e{constructor(e){super(),ge(this,e,pa,ga,he,{row:0,mediaFields:1,visibleFields:2})}}function en(i,e,l){const t=i.slice();return t[21]=e[l],t}function va(i){let e,l;return{c(){e=M("div"),l=Y("No results."),this.h()},l(t){e=z(t,"DIV",{class:!0});var n=D(e);l=W(n,"No results."),n.forEach(h),this.h()},h(){V(e,"class","mx-4 mt-8 w-full text-gray-600")},m(t,n){C(t,e,n),v(e,l)},p:Z,i:Z,o:Z,d(t){t&&h(e)}}}function wa(i){let e,l;return{c(){e=M("div"),l=Y("Select fields to display"),this.h()},l(t){e=z(t,"DIV",{class:!0});var n=D(e);l=W(n,"Select fields to display"),n.forEach(h),this.h()},h(){V(e,"class","mt-12 w-full text-center text-gray-600")},m(t,n){C(t,e,n),v(e,l)},p:Z,i:Z,o:Z,d(t){t&&h(e)}}}function ka(i){let e,l;return e=new Le({props:{paragraph:!0,lines:3}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Sa(i){var t,n;let e,l;return e=new Qt({props:{lowContrast:!0,title:"Could not fetch schema:",subtitle:((t=i[2].error.body)==null?void 0:t.detail)||((n=i[2])==null?void 0:n.error.message)}}),{c(){q(e.$$.fragment)},l(o){H(e.$$.fragment,o)},m(o,r){O(e,o,r),l=!0},p(o,r){var s,f;const a={};r&4&&(a.subtitle=((s=o[2].error.body)==null?void 0:s.detail)||((f=o[2])==null?void 0:f.error.message)),e.$set(a)},i(o){l||(g(e.$$.fragment,o),l=!0)},o(o){b(e.$$.fragment,o),l=!1},d(o){L(e,o)}}}function Ea(i){var t;let e,l;return e=new Qt({props:{lowContrast:!0,title:"Could not fetch rows:",subtitle:((t=i[3].error.body)==null?void 0:t.detail)||i[3].error.message}}),{c(){q(e.$$.fragment)},l(n){H(e.$$.fragment,n)},m(n,o){O(e,n,o),l=!0},p(n,o){var a;const r={};o&8&&(r.subtitle=((a=n[3].error.body)==null?void 0:a.detail)||n[3].error.message),e.$set(r)},i(n){l||(g(e.$$.fragment,n),l=!0)},o(n){b(e.$$.fragment,n),l=!1},d(n){L(e,n)}}}function tn(i){let e,l=[],t=new Map,n,o,r=i[6];const a=f=>Ke.value(f[21][Ht]);for(let f=0;f0&&nn(i);return{c(){e=M("div");for(let f=0;f0?s?(s.p(f,u),u&64&&g(s,1)):(s=nn(f),s.c(),g(s,1),s.m(e,null)):s&&(X(),b(s,1,1,()=>{s=null}),x())},i(f){if(!o){for(let u=0;u0&&i[4].isSuccess&&i[5]!=null&&tn(i);return{c(){q(e.$$.fragment),l=j(),n&&n.c(),o=j(),d&&d.c(),r=re()},l(c){H(e.$$.fragment,c),l=U(c),n&&n.l(c),o=U(c),d&&d.l(c),r=re()},m(c,m){O(e,c,m),C(c,l,m),~t&&f[t].m(c,m),C(c,o,m),d&&d.m(c,m),C(c,r,m),a=!0},p(c,[m]){const _={};m&128&&(_.totalNumRows=c[7]),m&1024&&(_.manifest=c[10].data),e.$set(_);let p=t;t=u(c),t===p?~t&&f[t].p(c,m):(n&&(X(),b(f[p],1,1,()=>{f[p]=null}),x()),~t?(n=f[t],n?n.p(c,m):(n=f[t]=s[t](c),n.c()),g(n,1),n.m(o.parentNode,o)):n=null),c[6]&&c[1].length>0&&c[4].isSuccess&&c[5]!=null?d?(d.p(c,m),m&114&&g(d,1)):(d=tn(c),d.c(),g(d,1),d.m(r.parentNode,r)):d&&(X(),b(d,1,1,()=>{d=null}),x())},i(c){a||(g(e.$$.fragment,c),g(n),g(d),a=!0)},o(c){b(e.$$.fragment,c),b(n),b(d),a=!1},d(c){L(e,c),c&&h(l),~t&&f[t].d(c),c&&h(o),d&&d.d(c),c&&h(r)}}}function $a(i,e,l){let t,n,o,r,a,s,f,u,d,c,m,_=Z,p=()=>(_(),_=Pe(r,B=>l(3,m=B)),r),k,$,S=Z,w=()=>(S(),S=Pe(t,B=>l(4,$=B)),t),y;i.$$.on_destroy.push(()=>_()),i.$$.on_destroy.push(()=>S());let N=qe();ce(i,N,B=>l(17,k=B));let F=We();ce(i,F,B=>l(16,c=B));const T=Fi(k.namespace,k.datasetName);ce(i,T,B=>l(10,y=B));let E=null;const P=it(E),I=()=>m==null?void 0:m.fetchNextPage();function A(B){Re[B?"unshift":"push"](()=>{E=B,l(0,E)})}return i.$$.update=()=>{var B,J,te,K;i.$$.dirty&131072&&w(l(9,t=mi(k.namespace,k.datasetName))),i.$$.dirty&131088&&l(15,n=$.isSuccess?tr(k):void 0),i.$$.dirty&65536&&l(2,o=c.selectRowsSchema),i.$$.dirty&163844&&p(l(8,r=Bi(k.namespace,k.datasetName,n||{},o!=null&&o.isSuccess?o.data.schema:void 0))),i.$$.dirty&8&&l(7,a=(B=m.data)==null?void 0:B.pages[0].total_num_rows),i.$$.dirty&8&&l(6,s=(J=m.data)==null?void 0:J.pages.flatMap(G=>G.rows)),i.$$.dirty&65536&&l(1,f=(c.visibleFields||[]).sort((G,ee)=>Ie(G.path)>Ie(ee.path)?1:-1)),i.$$.dirty&6&&l(14,u=((te=o==null?void 0:o.data)==null?void 0:te.schema)!=null?lr((K=o==null?void 0:o.data)==null?void 0:K.schema,f):null),i.$$.dirty&81920&&l(5,d=nr(u,c.settings)),i.$$.dirty&1&&P.set(E)},ui(ir,P),[E,f,o,m,$,d,s,a,r,t,y,N,F,T,u,n,c,k,I,A]}class Da extends _e{constructor(e){super(),ge(this,e,$a,ya,he,{})}}function rn(i,e,l){const t=i.slice();return t[43]=e[l],t}function sn(i,e,l){const t=i.slice();return t[46]=e[l],t}function Ia(i){let e,l=i[49].text+"",t;return{c(){e=M("div"),t=Y(l)},l(n){e=z(n,"DIV",{});var o=D(e);t=W(o,l),o.forEach(h)},m(n,o){C(n,e,o),v(e,t)},p(n,o){o[1]&262144&&l!==(l=n[49].text+"")&&fe(t,l)},i:Z,o:Z,d(n){n&&h(e)}}}function Va(i){let e,l,t,n,o,r,a;return l=new lt({props:{$$slots:{default:[Ca]},$$scope:{ctx:i}}}),{c(){e=M("div"),q(l.$$.fragment),t=j(),n=M("div"),o=Y(`Keyword search: `),r=Y(i[0]),this.h()},l(s){e=z(s,"DIV",{class:!0});var f=D(e);H(l.$$.fragment,f),t=U(f),n=z(f,"DIV",{class:!0});var u=D(n);o=W(u,`Keyword search: `),r=W(u,i[0]),u.forEach(h),f.forEach(h),this.h()},h(){V(n,"class","ml-2"),V(e,"class","new-keyword flex flex-row items-center justify-items-center")},m(s,f){C(s,e,f),O(l,e,null),v(e,t),v(e,n),v(n,o),v(n,r),a=!0},p(s,f){const u={};f[1]&524288&&(u.$$scope={dirty:f,ctx:s}),l.$set(u),(!a||f[0]&1)&&fe(r,s[0])},i(s){a||(g(l.$$.fragment,s),a=!0)},o(s){b(l.$$.fragment,s),a=!1},d(s){s&&h(e),L(l)}}}function Ta(i){let e,l,t,n,o,r=i[0]!=""?":":"",a,s,f,u;return l=new lt({props:{$$slots:{default:[Na]},$$scope:{ctx:i}}}),{c(){e=M("div"),q(l.$$.fragment),t=j(),n=M("div"),o=Y("New concept"),a=Y(r),s=j(),f=Y(i[0]),this.h()},l(d){e=z(d,"DIV",{class:!0});var c=D(e);H(l.$$.fragment,c),t=U(c),n=z(c,"DIV",{class:!0});var m=D(n);o=W(m,"New concept"),a=W(m,r),s=U(m),f=W(m,i[0]),m.forEach(h),c.forEach(h),this.h()},h(){V(n,"class","ml-2"),V(e,"class","new-concept flex flex-row items-center justify-items-center")},m(d,c){C(d,e,c),O(l,e,null),v(e,t),v(e,n),v(n,o),v(n,a),v(n,s),v(n,f),u=!0},p(d,c){const m={};c[1]&524288&&(m.$$scope={dirty:c,ctx:d}),l.$set(m),(!u||c[0]&1)&&r!==(r=d[0]!=""?":":"")&&fe(a,r),(!u||c[0]&1)&&fe(f,d[0])},i(d){u||(g(l.$$.fragment,d),u=!0)},o(d){b(l.$$.fragment,d),u=!1},d(d){d&&h(e),L(l)}}}function Ca(i){let e,l;return e=new Is({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Na(i){let e,l;return e=new is({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Ma(i){let e,l,t,n;const o=[Ta,Va,Ia],r=[];function a(s,f){return s[49].id==="new-concept"?0:s[49].id==="keyword-search"?1:2}return e=a(i),l=r[e]=o[e](i),{c(){l.c(),t=re()},l(s){l.l(s),t=re()},m(s,f){r[e].m(s,f),C(s,t,f),n=!0},p(s,f){let u=e;e=a(s),e===u?r[e].p(s,f):(X(),b(r[u],1,1,()=>{r[u]=null}),x(),l=r[e],l?l.p(s,f):(l=r[e]=o[e](s),l.c()),g(l,1),l.m(t.parentNode,t))},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){r[e].d(s),s&&h(t)}}}function an(i){let e,l;return e=new Mt({props:{value:Ie(i[46]),text:Ie(i[46])}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,n){const o={};n[0]&512&&(o.value=Ie(t[46])),n[0]&512&&(o.text=Ie(t[46])),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function za(i){let e,l,t=i[9],n=[];for(let r=0;rb(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;rb(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r({49:P}),({item:P})=>[0,P?262144:0]]},$$scope:{ctx:i}};i[0]!==void 0&&(T.value=i[0]),u=new Tr({props:T}),i[36](u),Re.push(()=>et(u,"value",F)),u.$on("select",i[20]);let E=on(i);return S=new Jt({props:{size:"xl",selected:i[2]||"",name:i[2]||"",$$slots:{default:[Aa]},$$scope:{ctx:i}}}),S.$on("change",i[18]),{c(){e=M("div"),l=M("div"),q(t.$$.fragment),n=j(),o=M("div"),r=M("div"),a=M("div"),s=M("div"),f=M("div"),q(u.$$.fragment),c=j(),m=M("div"),E.c(),p=j(),k=M("div"),$=M("div"),q(S.$$.fragment),this.h()},l(P){e=z(P,"DIV",{class:!0});var I=D(e);l=z(I,"DIV",{class:!0});var A=D(l);H(t.$$.fragment,A),A.forEach(h),n=U(I),o=z(I,"DIV",{class:!0});var B=D(o);r=z(B,"DIV",{class:!0});var J=D(r);a=z(J,"DIV",{class:!0});var te=D(a);s=z(te,"DIV",{class:!0});var K=D(s);f=z(K,"DIV",{class:!0});var G=D(f);H(u.$$.fragment,G),G.forEach(h),K.forEach(h),te.forEach(h),J.forEach(h),B.forEach(h),c=U(I),m=z(I,"DIV",{class:!0});var ee=D(m);E.l(ee),ee.forEach(h),p=U(I),k=z(I,"DIV",{class:!0});var le=D(k);$=z(le,"DIV",{class:!0});var pe=D($);H(S.$$.fragment,pe),pe.forEach(h),le.forEach(h),I.forEach(h),this.h()},h(){V(l,"class","compute-embedding mr-1"),se(l,"compute-embedding-indexing",i[8]),V(f,"class","flex-grow"),V(s,"class","flex w-full flex-row items-start justify-items-start"),V(a,"class","flex flex-row"),V(r,"class","w-full"),V(o,"class","search-container flex w-full flex-grow flex-row"),V(m,"class","mx-1"),V($,"class","w-28"),V(k,"class","embedding-select mr-8 flex flex-row"),V(e,"class","border-1 flex w-full flex-row items-center px-4")},m(P,I){C(P,e,I),v(e,l),O(t,l,null),v(e,n),v(e,o),v(o,r),v(r,a),v(a,s),v(s,f),O(u,f,null),v(e,c),v(e,m),E.m(m,null),v(e,p),v(e,k),v(k,$),O(S,$,null),w=!0,y||(N=[Ae(Fe.call(null,m,{text:"Select the field to search over."})),Ae(Fe.call(null,$,{text:"Select the embedding to use."}))],y=!0)},p(P,I){const A={};I[0]&264&&(A.disabled=P[3]||P[8]),I[0]&264&&(A.icon=P[3]?tl:P[8]?ll:Rt),t.$set(A),(!w||I[0]&256)&&se(l,"compute-embedding-indexing",P[8]);const B={};I[0]&32&&(B.items=P[5]),I[0]&128&&(B.placeholder=P[7]),I[0]&1|I[1]&786432&&(B.$$scope={dirty:I,ctx:P}),!d&&I[0]&1&&(d=!0,B.value=P[0],tt(()=>d=!1)),u.$set(B),I[0]&512&&he(_,_=P[9])?(X(),b(E,1,1,Z),x(),E=on(P),E.c(),g(E,1),E.m(m,null)):E.p(P,I);const J={};I[0]&4&&(J.selected=P[2]||""),I[0]&4&&(J.name=P[2]||""),I[0]&16|I[1]&524288&&(J.$$scope={dirty:I,ctx:P}),S.$set(J)},i(P){w||(g(t.$$.fragment,P),g(u.$$.fragment,P),g(E),g(S.$$.fragment,P),w=!0)},o(P){b(t.$$.fragment,P),b(u.$$.fragment,P),b(E),b(S.$$.fragment,P),w=!1},d(P){P&&h(e),L(t),i[36](null),L(u),E.d(P),L(S),y=!1,Je(N)}}}const Ba=(i,e)=>i.text.toLowerCase().includes(e.toLowerCase())||i.id==="new-concept";function Pa(i,e,l){let t,n,o,r,a,s,f,u,d,c,m,_,p,k,$,S,w,y,N,F,T,E=Z,P=()=>(E(),E=Pe(t,ie=>l(33,T=ie)),t),I;i.$$.on_destroy.push(()=>E());const A=qe();ce(i,A,ie=>l(32,F=ie));const B=We();ce(i,B,ie=>l(31,y=ie));const J=Si();ce(i,J,ie=>l(34,I=ie));const te=hi();ce(i,te,ie=>l(40,$=ie));const K=Zt();ce(i,K,ie=>l(4,N=ie));const G=(ie,Ce)=>`${Ie(ie||"")}_${Ce}`;let ee={};const le=Pi();ce(i,le,ie=>l(30,w=ie));const pe=St();ce(i,pe,ie=>l(29,S=ie));let oe=[],ae="",de;const ke=ie=>{l(2,f=ie.target.value),A.setSearchEmbedding(ie.target.value)},Se=()=>{f!=null&&(l(22,ee[G(r,f)]=!0,ee),$.mutate([n,o,{leaf_path:Ot(r||[]),signal:{signal_name:f}}]))};let ye;const Q=(ie,Ce)=>{r==null||f==null||(A.addSearch({path:[Ie(r)],query:{type:"concept",concept_namespace:ie,concept_name:Ce,embedding:f}}),ye.clear())},R=ie=>{if(!(r==null||f==null)){if(ie.detail.selectedId==="new-concept"){ae===de.id&&l(0,ae="");const Ce=ae.split("/",2);let ze="",He="";Ce.length===2?[ze,He]=Ce:[He]=Ce,Xe({command:xe.CreateConcept,namespace:ze,conceptName:He,onCreate:nt=>Q(nt.detail.namespace,nt.detail.name)}),ye.clear();return}else if(ie.detail.selectedId==="keyword-search"){if(ae=="")return;A.addSearch({path:[Ie(r)],query:{type:"keyword",search:ae}});return}Q(ie.detail.selectedId.namespace,ie.detail.selectedId.name)}},ne=ie=>{A.setSearchPath(ie.target.value)},me=()=>{Se()};function Ne(ie){Re[ie?"unshift":"push"](()=>{ye=ie,l(6,ye)})}function Te(ie){ae=ie,l(0,ae)}return i.$$.update=()=>{var ie,Ce;i.$$.dirty[1]&2&&P(l(10,t=jt(F.namespace,F.datasetName))),i.$$.dirty[1]&2&&(n=F.namespace),i.$$.dirty[1]&2&&(o=F.datasetName),i.$$.dirty[1]&3&&l(1,r=rr(F,y)),i.$$.dirty[0]&2|i.$$.dirty[1]&2&&l(24,a=Yt(F,r)),i.$$.dirty[1]&1&&l(9,s=(y.visibleFields||[]).filter(ze=>ze.dtype==="string").map(ze=>Ie(ze.path))),i.$$.dirty[0]&18|i.$$.dirty[1]&15&&l(2,f=sr(I,T.data,F,y,r,(N.data||[]).map(ze=>ze.name))),i.$$.dirty[0]&2|i.$$.dirty[1]&1&&l(28,u=ar(y,r)),i.$$.dirty[0]&268435460&&l(3,d=u!=null&&!!u.includes(f||"")),i.$$.dirty[0]&4194318&&l(8,c=!d&&ee[G(r,f)]),i.$$.dirty[0]&8&&l(7,m=d?"Search by concept or keyword.":'Search by keyword. Click "compute embedding" to search by concept.'),i.$$.dirty[0]&536870912&&l(27,_=(Ce=(ie=S.data)==null?void 0:ie.user)==null?void 0:Ce.id),i.$$.dirty[0]&1207959552&&l(25,p=or(w.data||[],_)),i.$$.dirty[0]&9&&l(23,de={id:"new-concept",text:ae,disabled:!d}),i.$$.dirty[0]&1&&l(26,k={id:"keyword-search",text:ae}),i.$$.dirty[0]&1736441865&&l(5,oe=w!=null&&w.data?[de,...ae!=""?[k]:[],...p.flatMap(ze=>ze.concepts.map(He=>({id:{namespace:He.namespace,name:He.name},text:pi(He.namespace,He.name,S.data),disabled:!d||a.some(nt=>nt.query.type==="concept"&&nt.query.concept_namespace===He.namespace&&nt.query.concept_name===He.name)})))]:[])},[ae,r,f,d,N,oe,ye,m,c,s,t,A,B,J,te,K,le,pe,ke,Se,R,ne,ee,de,a,p,k,_,u,S,w,y,F,T,I,me,Ne,Te]}class Ra extends _e{constructor(e){super(),ge(this,e,Pa,Fa,he,{},null,[-1,-1])}}function qa(i){let e,l;return e=new Ye({props:{$$slots:{default:[La]},$$scope:{ctx:i}}}),e.$on("click",i[5]),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,n){const o={};n&512&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Oa(i){let e,l;return{c(){e=M("span"),l=Y("Invalid query"),this.h()},l(t){e=z(t,"SPAN",{class:!0});var n=D(e);l=W(n,"Invalid query"),n.forEach(h),this.h()},h(){V(e,"class","text-red-500")},m(t,n){C(t,e,n),v(e,l)},p:Z,i:Z,o:Z,d(t){t&&h(e)}}}function La(i){let e;return{c(){e=Y("Apply")},l(l){e=W(l,"Apply")},m(l,t){C(l,e,t)},d(l){l&&h(e)}}}function Ha(i){let e,l,t,n,o,r,a,s,f,u,d;const c=[Oa,qa],m=[];function _(p,k){return p[0]?p[3]?1:-1:0}return~(r=_(i))&&(a=m[r]=c[r](i)),{c(){e=M("pre"),l=Y(""),t=Y(i[2]),n=Y(` `),o=j(),a&&a.c(),s=re(),this.h()},l(p){e=z(p,"PRE",{class:!0,contenteditable:!0});var k=D(e);l=W(k,""),t=W(k,i[2]),n=W(k,` `),k.forEach(h),o=U(p),a&&a.l(p),s=re(),this.h()},h(){V(e,"class","whitespace-pre bg-gray-50 p-4 font-mono"),V(e,"contenteditable",""),i[1]===void 0&&kt(()=>i[8].call(e)),se(e,"outline-red-500",!i[0])},m(p,k){C(p,e,k),v(e,l),v(e,t),v(e,n),i[1]!==void 0&&(e.innerText=i[1]),C(p,o,k),~r&&m[r].m(p,k),C(p,s,k),f=!0,u||(d=Ve(e,"input",i[8]),u=!0)},p(p,[k]){(!f||k&4)&&Ci(t,p[2]),k&2&&p[1]!==e.innerText&&(e.innerText=p[1]),(!f||k&1)&&se(e,"outline-red-500",!p[0]);let $=r;r=_(p),r===$?~r&&m[r].p(p,k):(a&&(X(),b(m[$],1,1,()=>{m[$]=null}),x()),~r?(a=m[r],a?a.p(p,k):(a=m[r]=c[r](p),a.c()),g(a,1),a.m(s.parentNode,s)):a=null)},i(p){f||(g(a),f=!0)},o(p){b(a),f=!1},d(p){p&&h(e),p&&h(o),~r&&m[r].d(p),p&&h(s),u=!1,d()}}}function ja(i,e,l){let t,n,o,r,a;const s=qe();ce(i,s,c=>l(7,a=c));let f=!0;function u(){ft(s,a.queryOptions=JSON.parse(o),a)}function d(){o=this.innerText,l(1,o),l(2,n),l(6,t),l(7,a)}return i.$$.update=()=>{if(i.$$.dirty&128&&l(6,t=a.queryOptions),i.$$.dirty&64&&l(2,n=t?JSON.stringify(t,null,2):""),i.$$.dirty&4&&l(1,o=n),i.$$.dirty&2)try{JSON.parse(o),l(0,f=!0)}catch{l(0,f=!1)}i.$$.dirty&67&&l(3,r=f&&!fr(JSON.parse(o),t))},[f,o,n,r,s,u,t,a,d]}class Ua extends _e{constructor(e){super(),ge(this,e,ja,Ha,he,{})}}function un(i){let e,l;return e=new qi({props:{light:!0,flipped:!0,$$slots:{default:[Ya]},$$scope:{ctx:i}}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,n){const o={};n&1073742079&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function cn(i){let e,l;return e=new bt({props:{text:"Sort by"}}),e.$on("click",i[20]),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function dn(i){let e,l;return e=new bt({props:{text:"Filter"}}),e.$on("click",i[21]),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function mn(i){let e,l,t,n,o,r;return l=new bt({props:{disabled:!i[7],text:"Compute embedding"}}),l.$on("click",i[22]),{c(){e=M("div"),q(l.$$.fragment),this.h()},l(a){e=z(a,"DIV",{class:!0});var s=D(e);H(l.$$.fragment,s),s.forEach(h),this.h()},h(){V(e,"class","w-full")},m(a,s){C(a,e,s),O(l,e,null),n=!0,o||(r=Ae(t=Fe.call(null,e,{text:i[7]?"":"User does not have access to compute embeddings over this dataset."})),o=!0)},p(a,s){const f={};s&128&&(f.disabled=!a[7]),l.$set(f),t&&Oe(t.update)&&s&128&&t.update.call(null,{text:a[7]?"":"User does not have access to compute embeddings over this dataset."})},i(a){n||(g(l.$$.fragment,a),n=!0)},o(a){b(l.$$.fragment,a),n=!1},d(a){a&&h(e),L(l),o=!1,r()}}}function hn(i){let e,l;return e=new bt({props:{text:"Preview signal"}}),e.$on("click",i[23]),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function _n(i){let e,l,t,n,o,r;return l=new bt({props:{text:"Compute signal",disabled:!i[7]}}),l.$on("click",i[24]),{c(){e=M("div"),q(l.$$.fragment),this.h()},l(a){e=z(a,"DIV",{class:!0});var s=D(e);H(l.$$.fragment,s),s.forEach(h),this.h()},h(){V(e,"class","w-full")},m(a,s){C(a,e,s),O(l,e,null),n=!0,o||(r=Ae(t=Fe.call(null,e,{text:i[7]?"":"User does not have access to compute signals over this dataset."})),o=!0)},p(a,s){const f={};s&128&&(f.disabled=!a[7]),l.$set(f),t&&Oe(t.update)&&s&128&&t.update.call(null,{text:a[7]?"":"User does not have access to compute signals over this dataset."})},i(a){n||(g(l.$$.fragment,a),n=!0)},o(a){b(l.$$.fragment,a),n=!1},d(a){a&&h(e),L(l),o=!1,r()}}}function gn(i){let e,l,t,n,o,r;return l=new bt({props:{disabled:!i[6],text:"Delete signal"}}),l.$on("click",i[25]),{c(){e=M("div"),q(l.$$.fragment),this.h()},l(a){e=z(a,"DIV",{class:!0});var s=D(e);H(l.$$.fragment,s),s.forEach(h),this.h()},h(){V(e,"class","w-full")},m(a,s){C(a,e,s),O(l,e,null),n=!0,o||(r=Ae(t=Fe.call(null,e,{text:i[6]?"":"User does not have access to delete signals for this dataset."})),o=!0)},p(a,s){const f={};s&64&&(f.disabled=!a[6]),l.$set(f),t&&Oe(t.update)&&s&64&&t.update.call(null,{text:a[6]?"":"User does not have access to delete signals for this dataset."})},i(a){n||(g(l.$$.fragment,a),n=!0)},o(a){b(l.$$.fragment,a),n=!1},d(a){a&&h(e),L(l),o=!1,r()}}}function Ya(i){let e=$t(i[0]),l,t=Pt(i[0]),n,o,r,a,s,f,u=e&&cn(i),d=t&&dn(i),c=!i[2]&&mn(i),m=!i[2]&&hn(i),_=!i[2]&&_n(i),p=i[1]&&gn(i);return{c(){u&&u.c(),l=j(),d&&d.c(),n=j(),c&&c.c(),o=j(),m&&m.c(),r=j(),_&&_.c(),a=j(),p&&p.c(),s=re()},l(k){u&&u.l(k),l=U(k),d&&d.l(k),n=U(k),c&&c.l(k),o=U(k),m&&m.l(k),r=U(k),_&&_.l(k),a=U(k),p&&p.l(k),s=re()},m(k,$){u&&u.m(k,$),C(k,l,$),d&&d.m(k,$),C(k,n,$),c&&c.m(k,$),C(k,o,$),m&&m.m(k,$),C(k,r,$),_&&_.m(k,$),C(k,a,$),p&&p.m(k,$),C(k,s,$),f=!0},p(k,$){$&1&&(e=$t(k[0])),e?u?(u.p(k,$),$&1&&g(u,1)):(u=cn(k),u.c(),g(u,1),u.m(l.parentNode,l)):u&&(X(),b(u,1,1,()=>{u=null}),x()),$&1&&(t=Pt(k[0])),t?d?(d.p(k,$),$&1&&g(d,1)):(d=dn(k),d.c(),g(d,1),d.m(n.parentNode,n)):d&&(X(),b(d,1,1,()=>{d=null}),x()),k[2]?c&&(X(),b(c,1,1,()=>{c=null}),x()):c?(c.p(k,$),$&4&&g(c,1)):(c=mn(k),c.c(),g(c,1),c.m(o.parentNode,o)),k[2]?m&&(X(),b(m,1,1,()=>{m=null}),x()):m?(m.p(k,$),$&4&&g(m,1)):(m=hn(k),m.c(),g(m,1),m.m(r.parentNode,r)),k[2]?_&&(X(),b(_,1,1,()=>{_=null}),x()):_?(_.p(k,$),$&4&&g(_,1)):(_=_n(k),_.c(),g(_,1),_.m(a.parentNode,a)),k[1]?p?(p.p(k,$),$&2&&g(p,1)):(p=gn(k),p.c(),g(p,1),p.m(s.parentNode,s)):p&&(X(),b(p,1,1,()=>{p=null}),x())},i(k){f||(g(u),g(d),g(c),g(m),g(_),g(p),f=!0)},o(k){b(u),b(d),b(c),b(m),b(_),b(p),f=!1},d(k){u&&u.d(k),k&&h(l),d&&d.d(k),k&&h(n),c&&c.d(k),k&&h(o),m&&m.d(k),k&&h(r),_&&_.d(k),k&&h(a),p&&p.d(k),k&&h(s)}}}function Wa(i){let e,l,t,n=Ie(i[0].path)+"",o,r,a,s,f;return{c(){e=M("p"),l=Y("Confirm deleting "),t=M("code"),o=Y(n),r=Y(" ?"),a=j(),s=M("p"),f=Y("This is a permanent action and cannot be undone."),this.h()},l(u){e=z(u,"P",{class:!0});var d=D(e);l=W(d,"Confirm deleting "),t=z(d,"CODE",{});var c=D(t);o=W(c,n),c.forEach(h),r=W(d," ?"),d.forEach(h),a=U(u),s=z(u,"P",{class:!0});var m=D(s);f=W(m,"This is a permanent action and cannot be undone."),m.forEach(h),this.h()},h(){V(e,"class","!text-lg"),V(s,"class","mt-2")},m(u,d){C(u,e,d),v(e,l),v(e,t),v(t,o),v(e,r),C(u,a,d),C(u,s,d),v(s,f)},p(u,d){d&1&&n!==(n=Ie(u[0].path)+"")&&fe(o,n)},d(u){u&&h(e),u&&h(a),u&&h(s)}}}function Qa(i){let e,l,t,n,o=i[8]&&un(i);function r(s){i[26](s)}let a={danger:!0,modalHeading:"Delete signal",primaryButtonText:"Delete",primaryButtonIcon:i[9].isLoading?It:void 0,secondaryButtonText:"Cancel",$$slots:{default:[Wa]},$$scope:{ctx:i}};return i[3]!==void 0&&(a.open=i[3]),l=new Kt({props:a}),Re.push(()=>et(l,"open",r)),l.$on("click:button--secondary",i[27]),l.$on("open",i[28]),l.$on("close",i[29]),l.$on("submit",i[14]),{c(){o&&o.c(),e=j(),q(l.$$.fragment)},l(s){o&&o.l(s),e=U(s),H(l.$$.fragment,s)},m(s,f){o&&o.m(s,f),C(s,e,f),O(l,s,f),n=!0},p(s,[f]){s[8]?o?(o.p(s,f),f&256&&g(o,1)):(o=un(s),o.c(),g(o,1),o.m(e.parentNode,e)):o&&(X(),b(o,1,1,()=>{o=null}),x());const u={};f&512&&(u.primaryButtonIcon=s[9].isLoading?It:void 0),f&1073741825&&(u.$$scope={dirty:f,ctx:s}),!t&&f&8&&(t=!0,u.open=s[3],tt(()=>t=!1)),l.$set(u)},i(s){n||(g(o),g(l.$$.fragment,s),n=!0)},o(s){b(o),b(l.$$.fragment,s),n=!1},d(s){o&&o.d(s),s&&h(e),L(l,s)}}}function Ja(i,e,l){let t,n,o,r,a,s,f,u,d,c,m,_,{field:p}=e,{schema:k}=e,$=!1;const S=qe();ce(i,S,ee=>l(19,_=ee));const w=We();ce(i,w,ee=>l(18,m=ee));const y=Ri();ce(i,y,ee=>l(9,d=ee));const N=St();ce(i,N,ee=>l(17,c=ee));function F(){d.mutate([t,n,{signal_path:p.path}],{onSuccess:()=>{l(3,$=!1),S.deleteSignal(p.path)}})}const T=()=>S.addSortBy(p.path),E=()=>Xe({command:xe.EditFilter,namespace:t,datasetName:n,path:p.path}),P=()=>Xe({command:xe.ComputeEmbedding,namespace:t,datasetName:n,path:p==null?void 0:p.path}),I=()=>Xe({command:xe.PreviewConcept,namespace:t,datasetName:n,path:p==null?void 0:p.path}),A=()=>Xe({command:xe.ComputeSignal,namespace:t,datasetName:n,path:p==null?void 0:p.path}),B=()=>l(3,$=!0);function J(ee){$=ee,l(3,$)}const te=()=>l(3,$=!1);function K(ee){je.call(this,i,ee)}function G(ee){je.call(this,i,ee)}return i.$$set=ee=>{"field"in ee&&l(0,p=ee.field),"schema"in ee&&l(15,k=ee.schema)},i.$$.update=()=>{var ee,le,pe;i.$$.dirty&524288&&l(5,t=_.namespace),i.$$.dirty&524288&&l(4,n=_.datasetName),i.$$.dirty&32769&&l(2,o=Ge(p,k)),i.$$.dirty&1&&l(1,r=dt(p)),i.$$.dirty&262145&&l(16,a=Nt(((ee=m.selectRowsSchema)==null?void 0:ee.data)||null,p.path)),i.$$.dirty&65543&&l(8,s=($t(p)||Pt(p)||!o||r)&&!a),i.$$.dirty&131072&&l(7,f=(le=c.data)==null?void 0:le.access.dataset.compute_signals),i.$$.dirty&131072&&l(6,u=(pe=c.data)==null?void 0:pe.access.dataset.delete_signals)},[p,r,o,$,n,t,u,f,s,d,S,w,y,N,F,k,a,c,m,_,T,E,P,I,A,B,J,te,K,G]}class yi extends _e{constructor(e){super(),ge(this,e,Ja,Qa,he,{field:0,schema:15})}}function pn(i,e,l){const t=i.slice();t[7]=e[l][0],t[8]=e[l][1];const n=t[2](t[7]);t[9]=n;const o=`${t[8]/t[1]*100}%`;t[10]=o;const r=De(t[8]);return t[11]=r,t}function bn(i){let e,l,t=i[9]+"",n,o,r,a,s,f=i[11]+"",u,d,c,m,_;function p(){return i[6](i[7])}return{c(){e=M("button"),l=M("div"),n=Y(t),r=j(),a=M("div"),s=M("div"),u=Y(f),c=j(),this.h()},l(k){e=z(k,"BUTTON",{class:!0});var $=D(e);l=z($,"DIV",{title:!0,class:!0});var S=D(l);n=W(S,t),S.forEach(h),r=U($),a=z($,"DIV",{class:!0});var w=D(a);s=z(w,"DIV",{title:!0,class:!0});var y=D(s);u=W(y,f),y.forEach(h),w.forEach(h),c=U($),$.forEach(h),this.h()},h(){V(l,"title",o=i[9]),V(l,"class","w-48 flex-none truncate px-2"),V(s,"title",d=i[11]),V(s,"class","histogram-bar my-px bg-indigo-200 pl-2 text-xs leading-5"),Ue(s,"width",i[10]),V(a,"class","w-36 border-l border-gray-300 pl-2"),V(e,"class","flex items-center text-left text-xs text-black hover:bg-gray-200")},m(k,$){C(k,e,$),v(e,l),v(l,n),v(e,r),v(e,a),v(a,s),v(s,u),v(e,c),m||(_=Ve(e,"click",p),m=!0)},p(k,$){i=k,$&1&&t!==(t=i[9]+"")&&fe(n,t),$&1&&o!==(o=i[9])&&V(l,"title",o),$&1&&f!==(f=i[11]+"")&&fe(u,f),$&1&&d!==(d=i[11])&&V(s,"title",d),$&3&&Ue(s,"width",i[10])},d(k){k&&h(e),m=!1,_()}}}function Ka(i){let e,l=i[0],t=[];for(let n=0;ns("row-click",{value:u});return i.$$set=u=>{"field"in u&&l(4,n=u.field),"counts"in u&&l(0,o=u.counts),"bins"in u&&l(5,r=u.bins)},i.$$.update=()=>{i.$$.dirty&1&&l(1,t=Math.max(...o.map(([u,d])=>d)))},[o,t,a,s,n,r,f]}class Ga extends _e{constructor(e){super(),ge(this,e,Za,Ka,he,{field:4,counts:0,bins:5})}}function Xa(i){let e,l,t,n,o,r,a,s,f,u,d,c=De(i[4].total_count)+"",m,_,p,k,$,S,w,y,N,F,T,E,P=De(i[4].approx_count_distinct)+"",I,A,B,J,te,K;r=new Vt({props:{class:"inline"}}),S=new Vt({props:{class:"inline"}});let G=i[4].avg_text_length&&vn(i),ee=i[4].min_val&&i[4].max_val&&wn(i);return{c(){e=M("table"),l=M("tbody"),t=M("tr"),n=M("td"),o=M("span"),q(r.$$.fragment),a=j(),s=M("span"),f=Y("Total count"),u=j(),d=M("td"),m=Y(c),_=j(),p=M("tr"),k=M("td"),$=M("span"),q(S.$$.fragment),w=j(),y=M("span"),N=Y("Unique values"),F=j(),T=M("td"),E=Y("~"),I=Y(P),A=j(),G&&G.c(),B=j(),ee&&ee.c(),this.h()},l(le){e=z(le,"TABLE",{class:!0});var pe=D(e);l=z(pe,"TBODY",{});var oe=D(l);t=z(oe,"TR",{});var ae=D(t);n=z(ae,"TD",{class:!0});var de=D(n);o=z(de,"SPAN",{});var ke=D(o);H(r.$$.fragment,ke),ke.forEach(h),a=U(de),s=z(de,"SPAN",{});var Se=D(s);f=W(Se,"Total count"),Se.forEach(h),de.forEach(h),u=U(ae),d=z(ae,"TD",{class:!0});var ye=D(d);m=W(ye,c),ye.forEach(h),ae.forEach(h),_=U(oe),p=z(oe,"TR",{});var Q=D(p);k=z(Q,"TD",{class:!0});var R=D(k);$=z(R,"SPAN",{});var ne=D($);H(S.$$.fragment,ne),ne.forEach(h),w=U(R),y=z(R,"SPAN",{});var me=D(y);N=W(me,"Unique values"),me.forEach(h),R.forEach(h),F=U(Q),T=z(Q,"TD",{class:!0});var Ne=D(T);E=W(Ne,"~"),I=W(Ne,P),Ne.forEach(h),Q.forEach(h),A=U(oe),G&&G.l(oe),B=U(oe),ee&&ee.l(oe),oe.forEach(h),pe.forEach(h),this.h()},h(){V(n,"class","svelte-1tctrjz"),V(d,"class","svelte-1tctrjz"),V(k,"class","svelte-1tctrjz"),V(T,"class","svelte-1tctrjz"),V(e,"class","stats-table w-full svelte-1tctrjz")},m(le,pe){C(le,e,pe),v(e,l),v(l,t),v(t,n),v(n,o),O(r,o,null),v(n,a),v(n,s),v(s,f),v(t,u),v(t,d),v(d,m),v(l,_),v(l,p),v(p,k),v(k,$),O(S,$,null),v(k,w),v(k,y),v(y,N),v(p,F),v(p,T),v(T,E),v(T,I),v(l,A),G&&G.m(l,null),v(l,B),ee&&ee.m(l,null),J=!0,te||(K=[Ae(Fe.call(null,o,{text:"Total number of rows where the value is defined."})),Ae(Fe.call(null,$,{text:"An approximation of the total number of unique values."}))],te=!0)},p(le,pe){(!J||pe&16)&&c!==(c=De(le[4].total_count)+"")&&fe(m,c),(!J||pe&16)&&P!==(P=De(le[4].approx_count_distinct)+"")&&fe(I,P),le[4].avg_text_length?G?(G.p(le,pe),pe&16&&g(G,1)):(G=vn(le),G.c(),g(G,1),G.m(l,B)):G&&(X(),b(G,1,1,()=>{G=null}),x()),le[4].min_val&&le[4].max_val?ee?(ee.p(le,pe),pe&16&&g(ee,1)):(ee=wn(le),ee.c(),g(ee,1),ee.m(l,null)):ee&&(X(),b(ee,1,1,()=>{ee=null}),x())},i(le){J||(g(r.$$.fragment,le),g(S.$$.fragment,le),g(G),g(ee),J=!0)},o(le){b(r.$$.fragment,le),b(S.$$.fragment,le),b(G),b(ee),J=!1},d(le){le&&h(e),L(r),L(S),G&&G.d(),ee&&ee.d(),te=!1,Je(K)}}}function xa(i){let e,l;return e=new Le({props:{paragraph:!0,width:"50%"}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function eo(i){let e,l,t=i[2].error.message+"",n;return{c(){e=M("p"),l=Y("Error: "),n=Y(t)},l(o){e=z(o,"P",{});var r=D(e);l=W(r,"Error: "),n=W(r,t),r.forEach(h)},m(o,r){C(o,e,r),v(e,l),v(e,n)},p(o,r){r&4&&t!==(t=o[2].error.message+"")&&fe(n,t)},i:Z,o:Z,d(o){o&&h(e)}}}function vn(i){let e,l,t,n,o,r,a,s,f,u=De(i[4].avg_text_length)+"",d,c,m,_;return n=new Vt({props:{class:"inline"}}),{c(){e=M("tr"),l=M("td"),t=M("span"),q(n.$$.fragment),o=j(),r=M("span"),a=Y("Average text length"),s=j(),f=M("td"),d=Y(u),this.h()},l(p){e=z(p,"TR",{});var k=D(e);l=z(k,"TD",{class:!0});var $=D(l);t=z($,"SPAN",{});var S=D(t);H(n.$$.fragment,S),S.forEach(h),o=U($),r=z($,"SPAN",{});var w=D(r);a=W(w,"Average text length"),w.forEach(h),$.forEach(h),s=U(k),f=z(k,"TD",{class:!0});var y=D(f);d=W(y,u),y.forEach(h),k.forEach(h),this.h()},h(){V(l,"class","svelte-1tctrjz"),V(f,"class","svelte-1tctrjz")},m(p,k){C(p,e,k),v(e,l),v(l,t),O(n,t,null),v(l,o),v(l,r),v(r,a),v(e,s),v(e,f),v(f,d),c=!0,m||(_=Ae(Fe.call(null,t,{text:"The average length of the text in characters."})),m=!0)},p(p,k){(!c||k&16)&&u!==(u=De(p[4].avg_text_length)+"")&&fe(d,u)},i(p){c||(g(n.$$.fragment,p),c=!0)},o(p){b(n.$$.fragment,p),c=!1},d(p){p&&h(e),L(n),m=!1,_()}}}function wn(i){let e,l,t,n,o,r,a,s,f,u=De(i[4].min_val)+"",d,c,m=De(i[4].max_val)+"",_,p,k,$;return n=new Vt({props:{class:"inline"}}),{c(){e=M("tr"),l=M("td"),t=M("span"),q(n.$$.fragment),o=j(),r=M("span"),a=Y("Range"),s=j(),f=M("td"),d=Y(u),c=Y(" .. "),_=Y(m),this.h()},l(S){e=z(S,"TR",{});var w=D(e);l=z(w,"TD",{class:!0});var y=D(l);t=z(y,"SPAN",{});var N=D(t);H(n.$$.fragment,N),N.forEach(h),o=U(y),r=z(y,"SPAN",{});var F=D(r);a=W(F,"Range"),F.forEach(h),y.forEach(h),s=U(w),f=z(w,"TD",{class:!0});var T=D(f);d=W(T,u),c=W(T," .. "),_=W(T,m),T.forEach(h),w.forEach(h),this.h()},h(){V(l,"class","svelte-1tctrjz"),V(f,"class","svelte-1tctrjz")},m(S,w){C(S,e,w),v(e,l),v(l,t),O(n,t,null),v(l,o),v(l,r),v(r,a),v(e,s),v(e,f),v(f,d),v(f,c),v(f,_),p=!0,k||($=Ae(Fe.call(null,t,{text:"The minimum and maximum value across the dataset"})),k=!0)},p(S,w){(!p||w&16)&&u!==(u=De(S[4].min_val)+"")&&fe(d,u),(!p||w&16)&&m!==(m=De(S[4].max_val)+"")&&fe(_,m)},i(S){p||(g(n.$$.fragment,S),p=!0)},o(S){b(n.$$.fragment,S),p=!1},d(S){S&&h(e),L(n),k=!1,$()}}}function to(i){let e,l,t;return l=new Ga({props:{counts:i[5],bins:i[3],field:i[0]}}),l.$on("row-click",i[11]),{c(){e=M("div"),q(l.$$.fragment),this.h()},l(n){e=z(n,"DIV",{class:!0});var o=D(e);H(l.$$.fragment,o),o.forEach(h),this.h()},h(){V(e,"class","mt-4")},m(n,o){C(n,e,o),O(l,e,null),t=!0},p(n,o){const r={};o&32&&(r.counts=n[5]),o&8&&(r.bins=n[3]),o&1&&(r.field=n[0]),l.$set(r)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function lo(i){let e,l;return e=new Le({props:{paragraph:!0,width:"50%"}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function no(i){let e,l,t=i[1].error.message+"",n;return{c(){e=M("p"),l=Y("Error: "),n=Y(t)},l(o){e=z(o,"P",{});var r=D(e);l=W(r,"Error: "),n=W(r,t),r.forEach(h)},m(o,r){C(o,e,r),v(e,l),v(e,n)},p(o,r){r&2&&t!==(t=o[1].error.message+"")&&fe(n,t)},i:Z,o:Z,d(o){o&&h(e)}}}function io(i){let e,l,t,n,o,r,a;const s=[eo,xa,Xa],f=[];function u(_,p){return _[2].error?0:_[4]==null?1:2}l=u(i),t=f[l]=s[l](i);const d=[no,lo,to],c=[];function m(_,p){return _[1].error?0:_[5]==null?1:_[5].length>0?2:-1}return~(o=m(i))&&(r=c[o]=d[o](i)),{c(){e=M("div"),t.c(),n=j(),r&&r.c(),this.h()},l(_){e=z(_,"DIV",{class:!0});var p=D(e);t.l(p),n=U(p),r&&r.l(p),p.forEach(h),this.h()},h(){V(e,"class","p-4")},m(_,p){C(_,e,p),f[l].m(e,null),v(e,n),~o&&c[o].m(e,null),a=!0},p(_,[p]){let k=l;l=u(_),l===k?f[l].p(_,p):(X(),b(f[k],1,1,()=>{f[k]=null}),x(),t=f[l],t?t.p(_,p):(t=f[l]=s[l](_),t.c()),g(t,1),t.m(e,n));let $=o;o=m(_),o===$?~o&&c[o].p(_,p):(r&&(X(),b(c[$],1,1,()=>{c[$]=null}),x()),~o?(r=c[o],r?r.p(_,p):(r=c[o]=d[o](_),r.c()),g(r,1),r.m(e,null)):r=null)},i(_){a||(g(t),g(r),a=!0)},o(_){b(t),b(r),a=!1},d(_){_&&h(e),f[l].d(),~o&&c[o].d()}}}function ro(i,e,l){let t,n,o,r,a,s=Z,f=()=>(s(),s=Pe(n,w=>l(1,a=w)),n),u,d=Z,c=()=>(d(),d=Pe(t,w=>l(2,u=w)),t),m;i.$$.on_destroy.push(()=>s()),i.$$.on_destroy.push(()=>d());let{field:_}=e;const p=qe();ce(i,p,w=>l(10,m=w));let k=null;function $(w){if(w==null)return;if(k!=null){const[N,F]=k[w.toString()];if(N!=null){const T={path:_.path,op:"greater_equal",value:N};p.addFilter(T)}if(F!=null){const T={path:_.path,op:"less",value:F};p.addFilter(T)}return}const y={path:_.path,op:"equals",value:w};p.addFilter(y)}const S=w=>$(w.detail.value);return i.$$set=w=>{"field"in w&&l(0,_=w.field)},i.$$.update=()=>{var w;if(i.$$.dirty&1025&&c(l(7,t=Oi(m.namespace,m.datasetName,{leaf_path:_.path}))),i.$$.dirty&1025&&f(l(6,n=Li(m.namespace,m.datasetName,{leaf_path:_.path,filters:m.queryOptions.filters}))),i.$$.dirty&2&&l(5,o=a.data!=null?a.data.counts:null),i.$$.dirty&4&&l(4,r=u.data!=null?u.data:null),i.$$.dirty&2)if(((w=a.data)==null?void 0:w.bins)!=null){l(3,k={});for(const[y,N,F]of Object.values(a.data.bins))l(3,k[y]=[N,F],k)}else l(3,k=null)},[_,a,u,k,r,o,n,t,p,$,m,S]}class so extends _e{constructor(e){super(),ge(this,e,ro,io,he,{field:0})}}function kn(i,e,l){const t=i.slice();return t[40]=e[l],t}function Sn(i,e,l){const t=i.slice();return t[43]=e[l],t}function En(i,e,l){const t=i.slice();return t[46]=e[l],t}function yn(i,e,l){const t=i.slice();return t[49]=e[l],t}function ao(i){let e,l="{}",t;return{c(){e=M("span"),t=Y(l),this.h()},l(n){e=z(n,"SPAN",{class:!0});var o=D(e);t=W(o,l),o.forEach(h),this.h()},h(){V(e,"class","font-mono")},m(n,o){C(n,e,o),v(e,t)},p:Z,i:Z,o:Z,d(n){n&&h(e)}}}function oo(i){let e,l,t,n;var o=ht[i[1].repeated_field.dtype];function r(a){return{props:{title:a[1].dtype}}}return o&&(l=ct(o,r(i))),{c(){e=M("div"),l&&q(l.$$.fragment),t=Y("[]"),this.h()},l(a){e=z(a,"DIV",{class:!0});var s=D(e);l&&H(l.$$.fragment,s),t=W(s,"[]"),s.forEach(h),this.h()},h(){V(e,"class","flex")},m(a,s){C(a,e,s),l&&O(l,e,null),v(e,t),n=!0},p(a,s){const f={};if(s[0]&2&&(f.title=a[1].dtype),s[0]&2&&o!==(o=ht[a[1].repeated_field.dtype])){if(l){X();const u=l;b(u.$$.fragment,1,0,()=>{L(u,1)}),x()}o?(l=ct(o,r(a)),q(l.$$.fragment),g(l.$$.fragment,1),O(l,e,t)):l=null}else o&&l.$set(f)},i(a){n||(l&&g(l.$$.fragment,a),n=!0)},o(a){l&&b(l.$$.fragment,a),n=!1},d(a){a&&h(e),l&&L(l)}}}function fo(i){let e,l,t;var n=ht[i[1].dtype];function o(r){return{props:{title:r[1].dtype}}}return n&&(e=ct(n,o(i))),{c(){e&&q(e.$$.fragment),l=re()},l(r){e&&H(e.$$.fragment,r),l=re()},m(r,a){e&&O(e,r,a),C(r,l,a),t=!0},p(r,a){const s={};if(a[0]&2&&(s.title=r[1].dtype),a[0]&2&&n!==(n=ht[r[1].dtype])){if(e){X();const f=e;b(f.$$.fragment,1,0,()=>{L(f,1)}),x()}n?(e=ct(n,o(r)),q(e.$$.fragment),g(e.$$.fragment,1),O(e,l.parentNode,l)):e=null}else n&&e.$set(s)},i(r){t||(e&&g(e.$$.fragment,r),t=!0)},o(r){e&&b(e.$$.fragment,r),t=!1},d(r){r&&h(l),e&&L(e,r)}}}function $n(i){let e,l;return e=new zt({props:{interactive:!0,type:"green",$$slots:{default:[mo]},$$scope:{ctx:i}}}),e.$on("click",i[34]),e.$on("remove",i[35]),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,n){const o={};n[0]&32768|n[1]&2097152&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function uo(i){let e,l;return e=new Ct({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function co(i){let e,l;return e=new Tt({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function mo(i){let e,l,t,n,o,r,a,s;const f=[co,uo],u=[];function d(c,m){return c[15]=="ASC"?0:1}return r=d(i),a=u[r]=f[r](i),{c(){e=M("div"),l=M("div"),t=Y("Sorted"),n=j(),o=M("span"),a.c(),this.h()},l(c){e=z(c,"DIV",{class:!0});var m=D(e);l=z(m,"DIV",{class:!0});var _=D(l);t=W(_,"Sorted"),_.forEach(h),n=U(m),o=z(m,"SPAN",{});var p=D(o);a.l(p),p.forEach(h),m.forEach(h),this.h()},h(){V(l,"class","mr-1"),V(e,"class","flex flex-row")},m(c,m){C(c,e,m),v(e,l),v(l,t),v(e,n),v(e,o),u[r].m(o,null),s=!0},p(c,m){let _=r;r=d(c),r!==_&&(X(),b(u[_],1,1,()=>{u[_]=null}),x(),a=u[r],a||(a=u[r]=f[r](c),a.c()),g(a,1),a.m(o,null))},i(c){s||(g(a),s=!0)},o(c){b(a),s=!1},d(c){c&&h(e),u[r].d()}}}function Dn(i){let e,l,t=i[7],n=[];for(let r=0;rb(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r{n&&(t||(t=ut(e,mt,{},!0)),t.run(1))}),n=!0)},o(o){b(l.$$.fragment,o),o&&(t||(t=ut(e,mt,{},!1)),t.run(0)),n=!1},d(o){o&&h(e),L(l),o&&t&&t.end()}}}function zn(i){let e,l,t=i[19],n=[];for(let r=0;rb(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;rb(le[R],1,1,()=>{le[R]=null});let oe=i[17],ae=[];for(let R=0;Rb(ae[R],1,1,()=>{ae[R]=null});let ke=i[4]&&i[21]&&Cn(i),Se=i[11]&&Nn(i);y=new yi({props:{field:i[1],schema:i[0]}});let ye=i[20]&&Mn(i),Q=i[19].length&&zn(i);return{c(){e=M("div"),l=M("div"),t=M("div"),q(n.$$.fragment),o=j(),r=M("div"),s.c(),u=j(),d=M("button"),c=Y(i[9]),m=j(),K&&K.c(),_=j(),G&&G.c(),p=j();for(let R=0;R{J[Ne]=null}),x(),s=J[a],s?s.p(R,ne):(s=J[a]=B[a](R),s.c()),g(s,1),s.m(r,null)),f&&Oe(f.update)&&ne[0]&4096&&f.update.call(null,{text:R[12]}),(!P||ne[0]&32)&&se(r,"bg-blue-200",R[5]),(!P||ne[0]&512)&&fe(c,R[9]),(!P||ne[0]&2048)&&se(d,"cursor-default",!R[11]),R[16]?K?(K.p(R,ne),ne[0]&65536&&g(K,1)):(K=$n(R),K.c(),g(K,1),K.m(l,_)):K&&(X(),b(K,1,1,()=>{K=null}),x()),R[14]?G?(G.p(R,ne),ne[0]&16384&&g(G,1)):(G=Dn(R),G.c(),g(G,1),G.m(l,p)):G&&(X(),b(G,1,1,()=>{G=null}),x()),ne[0]&8192){ee=R[13];let ie;for(ie=0;ie{ke=null}),x()),R[11]?Se?(Se.p(R,ne),ne[0]&2048&&g(Se,1)):(Se=Nn(R),Se.c(),g(Se,1),Se.m(l,w)):Se&&(X(),b(Se,1,1,()=>{Se=null}),x());const Te={};ne[0]&2&&(Te.field=R[1]),ne[0]&1&&(Te.schema=R[0]),y.$set(Te),(!P||ne[0]&32)&&se(l,"bg-blue-50",R[5]),(!P||ne[0]&16)&&se(l,"bg-emerald-100",R[4]),(!P||ne[0]&32)&&se(l,"hover:bg-blue-100",R[5]),R[20]?ye?(ye.p(R,ne),ne[0]&1048576&&g(ye,1)):(ye=Mn(R),ye.c(),g(ye,1),ye.m(e,F)):ye&&(X(),b(ye,1,1,()=>{ye=null}),x()),R[19].length?Q?(Q.p(R,ne),ne[0]&524288&&g(Q,1)):(Q=zn(R),Q.c(),g(Q,1),Q.m(T,null)):Q&&(X(),b(Q,1,1,()=>{Q=null}),x()),(!P||ne[0]&32)&&se(e,"border-b",!R[5])},i(R){if(!P){g(n.$$.fragment,R),g(s),g(K),g(G);for(let ne=0;ne{P&&(E||(E=ut(T,mt,{},!0)),E.run(1))}),P=!0}},o(R){b(n.$$.fragment,R),b(s),b(K),b(G),le=le.filter(Boolean);for(let ne=0;nel(22,I=R));const G=qe();ce(i,G,R=>l(10,T=R));const ee=We();ce(i,ee,R=>l(30,E=R));const le=St();ce(i,le,R=>l(31,P=R));function pe(R){return R!=null&&R.repeated_field?pe(R.repeated_field):R!=null&&R.fields?[...Object.values(R.fields).filter(ne=>ne.path.at(-1)!==_i)].flatMap(ne=>{const me=pe(ne);return me.some(Ne=>dt(Ne))?me:[ne]}).filter(ne=>{var me,Ne,Te,ie;return!(ne.dtype==="embedding"||ne.signal!=null&&wt(ne).some(Ce=>Ce.dtype==="embedding")||((me=ne.signal)==null?void 0:me.signal_name)==="sentences"||((Ne=ne.signal)==null?void 0:Ne.signal_name)==="substring_search"||((Te=ne.signal)==null?void 0:Te.signal_name)==="semantic_similarity"||((ie=ne.signal)==null?void 0:ie.signal_name)==="concept_labels")}):[]}const oe=()=>{d?G.removeSelectedColumn(r):G.addSelectedColumn(r)},ae=()=>{F&&(a?G.removeExpandedColumn(r):G.addExpandedColumn(r))},de=()=>_==="ASC"?ft(G,T.queryOptions.sort_order="DESC",T):ft(G,T.queryOptions.sort_order="ASC",T),ke=()=>G.removeSortBy(r),Se=()=>B.signal&&$&&J&&I.mutate([T.namespace,T.datasetName,{leaf_path:J.path,signal:B.signal}]),ye=()=>{var R;return B.signal&&$&&Xe({command:xe.EditPreviewConcept,namespace:T.namespace,datasetName:T.datasetName,path:J==null?void 0:J.path,signalName:(R=B.signal)==null?void 0:R.signal_name,value:B.signal})},Q=()=>{a?G.removeExpandedColumn(r):G.addExpandedColumn(r)};return i.$$set=R=>{"schema"in R&&l(0,A=R.schema),"field"in R&&l(1,B=R.field),"sourceField"in R&&l(2,J=R.sourceField),"indent"in R&&l(3,te=R.indent)},i.$$.update=()=>{var R,ne,me,Ne;if(i.$$.dirty[0]&3&&l(5,t=Ge(B,A)),i.$$.dirty[0]&2&&l(21,n=dt(B)),i.$$.dirty[0]&32&&l(8,o=!t),i.$$.dirty[0]&2&&l(6,r=B.path),i.$$.dirty[0]&1088&&l(20,a=T.expandedColumns[Ie(r)]||!1),i.$$.dirty[0]&64&&l(29,s=r.at(-1)===Dt),i.$$.dirty[0]&536870976&&l(9,f=s?r.at(-2):r.at(-1)),i.$$.dirty[0]&1073741888&&l(4,$=Nt(((R=E.selectRowsSchema)==null?void 0:R.data)||null,r)),i.$$.dirty[0]&528|i.$$.dirty[1]&1&&$&&f!=null){const[Te,ie]=f.split("/",2);l(9,f=pi(Te,ie,P.data))}i.$$.dirty[0]&2&&l(19,u=pe(B)),i.$$.dirty[0]&1073741888&&l(18,d=(ne=E.visibleFields)==null?void 0:ne.some(Te=>Qe(Te.path,r))),i.$$.dirty[0]&258&&l(17,c=o?wt(B).filter(Te=>Te.signal!=null&&wt(Te).some(ie=>ie.dtype==="embedding")):[]),i.$$.dirty[0]&1088&&l(16,m=(me=T.queryOptions.sort_by)==null?void 0:me.some(Te=>Qe(Te,r))),i.$$.dirty[0]&1024&&l(15,_=T.queryOptions.sort_order),i.$$.dirty[0]&1088&&l(7,p=((Ne=T.queryOptions.filters)==null?void 0:Ne.filter(Te=>Qe(Te.path,r)))||[]),i.$$.dirty[0]&128&&l(14,k=p.length>0),i.$$.dirty[0]&1088&&l(13,S=Yt(T,r)),i.$$.dirty[0]&32&&l(27,w=t?". This field was generated by a signal":""),i.$$.dirty[0]&2&&l(28,y=B.dtype??(B.repeated_field&&B.repeated_field.dtype?`${B.repeated_field.dtype}[]`:"object")),i.$$.dirty[0]&402653184&&l(12,N=`Data type: ${y}${w}`),i.$$.dirty[0]&18&&l(11,F=$t(B)&&!$)},[A,B,J,te,$,t,r,p,o,f,T,F,N,S,k,_,m,c,d,u,a,n,I,K,G,ee,le,w,y,s,E,P,oe,ae,de,ke,Se,ye,Q]}class $i extends _e{constructor(e){super(),ge(this,e,_o,ho,he,{schema:0,field:1,sourceField:2,indent:3},null,[-1,-1])}}function Fn(i,e,l){const t=i.slice();return t[28]=e[l],t}function Bn(i,e,l){const t=i.slice();return t[31]=e[l],t}function go(i){var P;let e,l,t,n,o,r,a,s,f,u,d,c,m,_,p,k,$,S;t=new Wt({props:{labelText:"Show",hideLabel:!0,checked:i[14],disabled:i[10]}}),t.$on("change",i[23]);let w=i[15]&&Pn(i),y=i[13]&&Rn(i),N=i[11]&&qn(i),F=i[17]&&Ln(i),T=((P=i[1])==null?void 0:P.dtype)&&Hn(i);p=new yi({props:{field:i[1],schema:i[0]}});let E=i[8]&&jn(i);return{c(){e=M("div"),l=M("div"),q(t.$$.fragment),n=j(),o=M("div"),w&&w.c(),r=j(),a=M("div"),s=Y(i[16]),f=j(),y&&y.c(),u=j(),N&&N.c(),d=j(),F&&F.c(),c=j(),T&&T.c(),m=j(),_=M("div"),q(p.$$.fragment),k=j(),E&&E.c(),$=re(),this.h()},l(I){e=z(I,"DIV",{class:!0});var A=D(e);l=z(A,"DIV",{class:!0});var B=D(l);H(t.$$.fragment,B),B.forEach(h),n=U(A),o=z(A,"DIV",{class:!0});var J=D(o);w&&w.l(J),J.forEach(h),r=U(A),a=z(A,"DIV",{class:!0,title:!0});var te=D(a);s=W(te,i[16]),te.forEach(h),f=U(A),y&&y.l(A),u=U(A),N&&N.l(A),d=U(A),F&&F.l(A),c=U(A),T&&T.l(A),m=U(A),_=z(A,"DIV",{});var K=D(_);H(p.$$.fragment,K),K.forEach(h),A.forEach(h),k=U(I),E&&E.l(I),$=re(),this.h()},h(){V(l,"class","w-6"),V(o,"class","w-6"),Ue(o,"margin-left",i[2]*24+"px"),V(a,"class","grow truncate whitespace-nowrap pr-2 text-gray-900"),V(a,"title",i[16]),V(e,"class","flex w-full flex-row items-center border-b border-gray-200 px-4 py-2 hover:bg-gray-100"),se(e,"bg-blue-50",i[18]),se(e,"hover:bg-blue-100",i[18])},m(I,A){C(I,e,A),v(e,l),O(t,l,null),v(e,n),v(e,o),w&&w.m(o,null),v(e,r),v(e,a),v(a,s),v(e,f),y&&y.m(e,null),v(e,u),N&&N.m(e,null),v(e,d),F&&F.m(e,null),v(e,c),T&&T.m(e,null),v(e,m),v(e,_),O(p,_,null),C(I,k,A),E&&E.m(I,A),C(I,$,A),S=!0},p(I,A){var te;const B={};A[0]&16384&&(B.checked=I[14]),A[0]&1024&&(B.disabled=I[10]),t.$set(B),I[15]?w?(w.p(I,A),A[0]&32768&&g(w,1)):(w=Pn(I),w.c(),g(w,1),w.m(o,null)):w&&(X(),b(w,1,1,()=>{w=null}),x()),A[0]&4&&Ue(o,"margin-left",I[2]*24+"px"),(!S||A[0]&65536)&&fe(s,I[16]),(!S||A[0]&65536)&&V(a,"title",I[16]),I[13]?y?(y.p(I,A),A[0]&8192&&g(y,1)):(y=Rn(I),y.c(),g(y,1),y.m(e,u)):y&&(X(),b(y,1,1,()=>{y=null}),x()),I[11]?N?(N.p(I,A),A[0]&2048&&g(N,1)):(N=qn(I),N.c(),g(N,1),N.m(e,d)):N&&(X(),b(N,1,1,()=>{N=null}),x()),I[17]?F?(F.p(I,A),A[0]&131072&&g(F,1)):(F=Ln(I),F.c(),g(F,1),F.m(e,c)):F&&(X(),b(F,1,1,()=>{F=null}),x()),(te=I[1])!=null&&te.dtype?T?T.p(I,A):(T=Hn(I),T.c(),T.m(e,m)):T&&(T.d(1),T=null);const J={};A[0]&2&&(J.field=I[1]),A[0]&1&&(J.schema=I[0]),p.$set(J),(!S||A[0]&262144)&&se(e,"bg-blue-50",I[18]),(!S||A[0]&262144)&&se(e,"hover:bg-blue-100",I[18]),I[8]?E?(E.p(I,A),A[0]&256&&g(E,1)):(E=jn(I),E.c(),g(E,1),E.m($.parentNode,$)):E&&(X(),b(E,1,1,()=>{E=null}),x())},i(I){S||(g(t.$$.fragment,I),g(w),g(y),g(N),g(F),g(p.$$.fragment,I),g(E),S=!0)},o(I){b(t.$$.fragment,I),b(w),b(y),b(N),b(F),b(p.$$.fragment,I),b(E),S=!1},d(I){I&&h(e),L(t),w&&w.d(),y&&y.d(),N&&N.d(),F&&F.d(),T&&T.d(),L(p),I&&h(k),E&&E.d(I),I&&h($)}}}function po(i){let e,l;return e=new xt({props:{field:i[1].repeated_field,indent:i[2],schema:i[0]}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,n){const o={};n[0]&2&&(o.field=t[1].repeated_field),n[0]&4&&(o.indent=t[2]),n[0]&1&&(o.schema=t[0]),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Pn(i){let e,l,t,n,o;return l=new as({props:{class:"w-3"}}),{c(){e=M("button"),q(l.$$.fragment),this.h()},l(r){e=z(r,"BUTTON",{class:!0});var a=D(e);H(l.$$.fragment,a),a.forEach(h),this.h()},h(){V(e,"class","p-2 transition hover:opacity-60"),se(e,"rotate-180",!i[8])},m(r,a){C(r,e,a),O(l,e,null),t=!0,n||(o=Ve(e,"click",i[24]),n=!0)},p(r,a){(!t||a[0]&256)&&se(e,"rotate-180",!r[8])},i(r){t||(g(l.$$.fragment,r),t=!0)},o(r){b(l.$$.fragment,r),t=!1},d(r){r&&h(e),L(l),n=!1,o()}}}function Rn(i){let e,l;return e=new zt({props:{interactive:!0,type:"green",$$slots:{default:[wo]},$$scope:{ctx:i}}}),e.$on("click",i[25]),e.$on("remove",i[26]),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,n){const o={};n[0]&4096|n[1]&8&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function bo(i){let e,l;return e=new Ct({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function vo(i){let e,l;return e=new Tt({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function wo(i){let e,l,t,n,o;const r=[vo,bo],a=[];function s(f,u){return f[12]=="ASC"?0:1}return l=s(i),t=a[l]=r[l](i),{c(){e=Y(`Sorted `),t.c(),n=re()},l(f){e=W(f,`Sorted `),t.l(f),n=re()},m(f,u){C(f,e,u),a[l].m(f,u),C(f,n,u),o=!0},p(f,u){let d=l;l=s(f),l!==d&&(X(),b(a[d],1,1,()=>{a[d]=null}),x(),t=a[l],t||(t=a[l]=r[l](f),t.c()),g(t,1),t.m(n.parentNode,n))},i(f){o||(g(t),o=!0)},o(f){b(t),o=!1},d(f){f&&h(e),a[l].d(f),f&&h(n)}}}function qn(i){let e,l,t=i[4],n=[];for(let r=0;rb(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r{n=null}),x())},i(o){t||(g(n),o&&kt(()=>{t&&(l||(l=ut(e,mt,{},!0)),l.run(1))}),t=!0)},o(o){b(n),o&&(l||(l=ut(e,mt,{},!1)),l.run(0)),t=!1},d(o){o&&h(e),n&&n.d(),o&&l&&l.end()}}}function Un(i){let e,l,t=i[5],n=[];for(let r=0;rb(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r{r[u]=null}),x(),l=r[e],l?l.p(s,f):(l=r[e]=o[e](s),l.c()),g(l,1),l.m(t.parentNode,t))},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){r[e].d(s),s&&h(t)}}}function So(i,e,l){let t,n,o,r,a,s,f,u,d,c,m,_,p,k,$,S,w,{schema:y}=e,{field:N}=e,{indent:F=0}=e;const T=qe();ce(i,T,K=>l(7,w=K));const E=We();ce(i,E,K=>l(22,S=K));let P=!0;function I(K){return K!=null&&K.fields?Object.values(K.fields).filter(G=>G.path.at(-1)!==_i):[]}const A=()=>{d?T.removeSelectedColumn(t):T.addSelectedColumn(t)},B=()=>l(8,P=!P),J=()=>m==="ASC"?ft(T,w.queryOptions.sort_order="DESC",w):ft(T,w.queryOptions.sort_order="ASC",w),te=()=>T.removeSortBy(t);return i.$$set=K=>{"schema"in K&&l(0,y=K.schema),"field"in K&&l(1,N=K.field),"indent"in K&&l(2,F=K.indent)},i.$$.update=()=>{var K,G,ee,le;i.$$.dirty[0]&2&&l(3,t=N.path),i.$$.dirty[0]&3&&l(21,n=Hi(y,N.path.slice(0,-1))),i.$$.dirty[0]&3&&l(18,o=Ge(N,y)),i.$$.dirty[0]&2&&l(6,a=N.path.at(-1)===Dt),i.$$.dirty[0]&2097218&&l(17,r=a&&n?dt(n):dt(N)),i.$$.dirty[0]&66&&l(16,s=a?N.path.at(-2):N.path.at(-1)),i.$$.dirty[0]&2&&l(5,f=I(N)),i.$$.dirty[0]&32&&l(15,u=f.length>0),i.$$.dirty[0]&4194312&&l(14,d=(K=S.visibleFields)==null?void 0:K.some(pe=>Qe(pe.path,t))),i.$$.dirty[0]&136&&l(13,c=(G=w.queryOptions.sort_by)==null?void 0:G.some(pe=>Qe(pe,t))),i.$$.dirty[0]&128&&l(12,m=w.queryOptions.sort_order),i.$$.dirty[0]&136&&l(4,_=((ee=w.queryOptions.filters)==null?void 0:ee.filter(pe=>Qe(pe.path,t)))||[]),i.$$.dirty[0]&16&&l(11,p=_.length>0),i.$$.dirty[0]&2&&l(10,k=!N.dtype||N.dtype==="embedding"),i.$$.dirty[0]&4194312&&l(9,$=Nt(((le=S.selectRowsSchema)==null?void 0:le.data)||null,t))},[y,N,F,t,_,f,a,w,P,$,k,p,m,c,d,u,s,r,o,T,E,n,S,A,B,J,te]}class xt extends _e{constructor(e){super(),ge(this,e,So,ko,he,{schema:0,field:1,indent:2},null,[-1,-1])}}function Wn(i,e,l){const t=i.slice();return t[3]=e[l],t}function Qn(i,e,l){const t=i.slice();return t[3]=e[l],t}function Eo(i){let e,l,t,n,o,r;return e=new Ft({props:{label:"Schema",class:"w-1/3"}}),t=new Ft({props:{label:"Tree View",class:"w-1/3"}}),o=new Ft({props:{label:"Raw Query",class:"w-1/3"}}),{c(){q(e.$$.fragment),l=j(),q(t.$$.fragment),n=j(),q(o.$$.fragment)},l(a){H(e.$$.fragment,a),l=U(a),H(t.$$.fragment,a),n=U(a),H(o.$$.fragment,a)},m(a,s){O(e,a,s),C(a,l,s),O(t,a,s),C(a,n,s),O(o,a,s),r=!0},p:Z,i(a){r||(g(e.$$.fragment,a),g(t.$$.fragment,a),g(o.$$.fragment,a),r=!0)},o(a){b(e.$$.fragment,a),b(t.$$.fragment,a),b(o.$$.fragment,a),r=!1},d(a){L(e,a),a&&h(l),L(t,a),a&&h(n),L(o,a)}}}function yo(i){let e=[],l=new Map,t,n,o=Object.keys(i[0].data.schema.fields);const r=a=>a[3];for(let a=0;a{r[u]=null}),x()),~e?(l=r[e],l?l.p(s,f):(l=r[e]=o[e](s),l.c()),g(l,1),l.m(t.parentNode,t)):l=null)},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){~e&&r[e].d(s),s&&h(t)}}}function Io(i){let e=[],l=new Map,t,n,o=Object.keys(i[0].data.schema.fields);const r=a=>a[3];for(let a=0;a{r[u]=null}),x()),~e?(l=r[e],l?l.p(s,f):(l=r[e]=o[e](s),l.c()),g(l,1),l.m(t.parentNode,t)):l=null)},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){~e&&r[e].d(s),s&&h(t)}}}function Co(i){let e,l;return e=new Ua({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function No(i){let e,l,t,n,o,r,a;return l=new Bt({props:{$$slots:{default:[Do]},$$scope:{ctx:i}}}),n=new Bt({props:{$$slots:{default:[To]},$$scope:{ctx:i}}}),r=new Bt({props:{$$slots:{default:[Co]},$$scope:{ctx:i}}}),{c(){e=M("div"),q(l.$$.fragment),t=j(),q(n.$$.fragment),o=j(),q(r.$$.fragment),this.h()},l(s){e=z(s,"DIV",{class:!0,slot:!0});var f=D(e);H(l.$$.fragment,f),t=U(f),H(n.$$.fragment,f),o=U(f),H(r.$$.fragment,f),f.forEach(h),this.h()},h(){V(e,"class","h-full overflow-y-auto"),V(e,"slot","content")},m(s,f){C(s,e,f),O(l,e,null),v(e,t),O(n,e,null),v(e,o),O(r,e,null),a=!0},p(s,f){const u={};f&257&&(u.$$scope={dirty:f,ctx:s}),l.$set(u);const d={};f&257&&(d.$$scope={dirty:f,ctx:s}),n.$set(d);const c={};f&256&&(c.$$scope={dirty:f,ctx:s}),r.$set(c)},i(s){a||(g(l.$$.fragment,s),g(n.$$.fragment,s),g(r.$$.fragment,s),a=!0)},o(s){b(l.$$.fragment,s),b(n.$$.fragment,s),b(r.$$.fragment,s),a=!1},d(s){s&&h(e),L(l),L(n),L(r)}}}function Mo(i){let e,l,t;return l=new Jr({props:{class:"overflow-hidden border-b border-gray-200",$$slots:{content:[No],default:[Eo]},$$scope:{ctx:i}}}),{c(){e=M("div"),q(l.$$.fragment),this.h()},l(n){e=z(n,"DIV",{class:!0});var o=D(e);H(l.$$.fragment,o),o.forEach(h),this.h()},h(){V(e,"class","flex h-full flex-col pt-4")},m(n,o){C(n,e,o),O(l,e,null),t=!0},p(n,[o]){const r={};o&257&&(r.$$scope={dirty:o,ctx:n}),l.$set(r)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function zo(i,e,l){let t,n;const o=We();return ce(i,o,r=>l(2,n=r)),i.$$.update=()=>{i.$$.dirty&4&&l(0,t=n.selectRowsSchema)},[t,o,n]}class Ao extends _e{constructor(e){super(),ge(this,e,zo,Mo,he,{})}}function Zn(i,e,l){const t=i.slice();return t[4]=e[l],t}function Fo(i){let e,l="{}",t;return{c(){e=M("span"),t=Y(l),this.h()},l(n){e=z(n,"SPAN",{class:!0});var o=D(e);t=W(o,l),o.forEach(h),this.h()},h(){V(e,"class","font-mono")},m(n,o){C(n,e,o),v(e,t)},p:Z,i:Z,o:Z,d(n){n&&h(e)}}}function Bo(i){let e,l,t;var n=ht[i[4].dtype];function o(r){return{props:{title:r[4].dtype}}}return n&&(e=ct(n,o(i))),{c(){e&&q(e.$$.fragment),l=re()},l(r){e&&H(e.$$.fragment,r),l=re()},m(r,a){e&&O(e,r,a),C(r,l,a),t=!0},p(r,a){const s={};if(a&2&&(s.title=r[4].dtype),a&2&&n!==(n=ht[r[4].dtype])){if(e){X();const f=e;b(f.$$.fragment,1,0,()=>{L(f,1)}),x()}n?(e=ct(n,o(r)),q(e.$$.fragment),g(e.$$.fragment,1),O(e,l.parentNode,l)):e=null}else n&&e.$set(s)},i(r){t||(e&&g(e.$$.fragment,r),t=!0)},o(r){e&&b(e.$$.fragment,r),t=!1},d(r){r&&h(l),e&&L(e,r)}}}function Gn(i){let e;return{c(){e=Y("[]")},l(l){e=W(l,"[]")},m(l,t){C(l,e,t)},d(l){l&&h(e)}}}function Xn(i){let e,l,t,n,o,r,a,s,f,u=i[4].path.indexOf(Dt)>=0,d,c,m=Ie(i[4].path)+"",_,p,k;function $(...F){return i[3](i[4],...F)}t=new Wt({props:{labelText:"Download",hideLabel:!0,checked:i[0].indexOf(i[4])>=0}}),t.$on("change",$);const S=[Bo,Fo],w=[];function y(F,T){return F[4].dtype?0:1}a=y(i),s=w[a]=S[a](i);let N=u&&Gn();return{c(){e=M("div"),l=M("div"),q(t.$$.fragment),n=j(),o=M("div"),r=M("div"),s.c(),f=j(),N&&N.c(),d=j(),c=M("div"),_=Y(m),p=j(),this.h()},l(F){e=z(F,"DIV",{class:!0});var T=D(e);l=z(T,"DIV",{class:!0});var E=D(l);H(t.$$.fragment,E),E.forEach(h),n=U(T),o=z(T,"DIV",{class:!0});var P=D(o);r=z(P,"DIV",{class:!0});var I=D(r);s.l(I),f=U(I),N&&N.l(I),I.forEach(h),P.forEach(h),d=U(T),c=z(T,"DIV",{class:!0});var A=D(c);_=W(A,m),A.forEach(h),p=U(T),T.forEach(h),this.h()},h(){V(l,"class","mr-2"),V(r,"class","inline-flex items-center rounded-md bg-blue-200 p-0.5"),V(o,"class","flex w-10"),V(c,"class","flex-grow"),V(e,"class","flex items-center")},m(F,T){C(F,e,T),v(e,l),O(t,l,null),v(e,n),v(e,o),v(o,r),w[a].m(r,null),v(r,f),N&&N.m(r,null),v(e,d),v(e,c),v(c,_),v(e,p),k=!0},p(F,T){i=F;const E={};T&3&&(E.checked=i[0].indexOf(i[4])>=0),t.$set(E);let P=a;a=y(i),a===P?w[a].p(i,T):(X(),b(w[P],1,1,()=>{w[P]=null}),x(),s=w[a],s?s.p(i,T):(s=w[a]=S[a](i),s.c()),g(s,1),s.m(r,f)),T&2&&(u=i[4].path.indexOf(Dt)>=0),u?N||(N=Gn(),N.c(),N.m(r,null)):N&&(N.d(1),N=null),(!k||T&2)&&m!==(m=Ie(i[4].path)+"")&&fe(_,m)},i(F){k||(g(t.$$.fragment,F),g(s),k=!0)},o(F){b(t.$$.fragment,F),b(s),k=!1},d(F){F&&h(e),L(t),w[a].d(),N&&N.d()}}}function Po(i){let e,l,t=i[1],n=[];for(let r=0;rb(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;ru!==a))}const r=(a,s)=>o(a,s);return i.$$set=a=>{"fields"in a&&l(1,t=a.fields),"checkedFields"in a&&l(0,n=a.checkedFields)},[n,t,o,r]}class el extends _e{constructor(e){super(),ge(this,e,Ro,Po,he,{fields:1,checkedFields:0})}}function xn(i,e,l){const t=i.slice();return t[19]=e[l],t}function qo(i){let e,l,t,n,o,r,a,s,f,u,d,c,m,_,p,k,$,S,w,y,N=i[1]!=null&&ei(i);const F=[Ho,Lo],T=[];function E(P,I){return P[5].isFetching?0:1}return S=E(i),w=T[S]=F[S](i),{c(){e=M("div"),l=M("section"),t=M("div"),n=Y("Media fields"),o=j(),r=M("div"),a=Y("These fields will be presented differently from the rest of the metadata fields."),s=j(),N&&N.c(),f=j(),u=M("section"),d=M("div"),c=Y("Preferred embedding"),m=j(),_=M("div"),p=Y("This embedding will be used by default when indexing and querying the data."),k=j(),$=M("div"),w.c(),this.h()},l(P){e=z(P,"DIV",{class:!0});var I=D(e);l=z(I,"SECTION",{class:!0});var A=D(l);t=z(A,"DIV",{class:!0});var B=D(t);n=W(B,"Media fields"),B.forEach(h),o=U(A),r=z(A,"DIV",{class:!0});var J=D(r);a=W(J,"These fields will be presented differently from the rest of the metadata fields."),J.forEach(h),s=U(A),N&&N.l(A),A.forEach(h),f=U(I),u=z(I,"SECTION",{class:!0});var te=D(u);d=z(te,"DIV",{class:!0});var K=D(d);c=W(K,"Preferred embedding"),K.forEach(h),m=U(te),_=z(te,"DIV",{class:!0});var G=D(_);p=W(G,"This embedding will be used by default when indexing and querying the data."),G.forEach(h),k=U(te),$=z(te,"DIV",{class:!0});var ee=D($);w.l(ee),ee.forEach(h),te.forEach(h),I.forEach(h),this.h()},h(){V(t,"class","text-lg text-gray-700"),V(r,"class","text-sm text-gray-500"),V(l,"class","flex flex-col gap-y-1"),V(d,"class","text-lg text-gray-700"),V(_,"class","text-sm text-gray-500"),V($,"class","w-60"),V(u,"class","flex flex-col gap-y-1"),V(e,"class","flex flex-col gap-y-6")},m(P,I){C(P,e,I),v(e,l),v(l,t),v(t,n),v(l,o),v(l,r),v(r,a),v(l,s),N&&N.m(l,null),v(e,f),v(e,u),v(u,d),v(d,c),v(u,m),v(u,_),v(_,p),v(u,k),v(u,$),T[S].m($,null),y=!0},p(P,I){P[1]!=null?N?(N.p(P,I),I&2&&g(N,1)):(N=ei(P),N.c(),g(N,1),N.m(l,null)):N&&(X(),b(N,1,1,()=>{N=null}),x());let A=S;S=E(P),S===A?T[S].p(P,I):(X(),b(T[A],1,1,()=>{T[A]=null}),x(),w=T[S],w?w.p(P,I):(w=T[S]=F[S](P),w.c()),g(w,1),w.m($,null))},i(P){y||(g(N),g(w),y=!0)},o(P){b(N),b(w),y=!1},d(P){P&&h(e),N&&N.d(),T[S].d()}}}function Oo(i){let e,l;return e=new Le({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ei(i){let e,l,t;function n(r){i[14](r)}let o={fields:i[2]};return i[1]!==void 0&&(o.checkedFields=i[1]),e=new el({props:o}),Re.push(()=>et(e,"checkedFields",n)),{c(){q(e.$$.fragment)},l(r){H(e.$$.fragment,r)},m(r,a){O(e,r,a),t=!0},p(r,a){const s={};a&4&&(s.fields=r[2]),!l&&a&2&&(l=!0,s.checkedFields=r[1],tt(()=>l=!1)),e.$set(s)},i(r){t||(g(e.$$.fragment,r),t=!0)},o(r){b(e.$$.fragment,r),t=!1},d(r){L(e,r)}}}function Lo(i){var t;let e,l;return e=new Jt({props:{selected:(t=i[3].data)==null?void 0:t.preferred_embedding,$$slots:{default:[jo]},$$scope:{ctx:i}}}),e.$on("change",i[10]),{c(){q(e.$$.fragment)},l(n){H(e.$$.fragment,n)},m(n,o){O(e,n,o),l=!0},p(n,o){var a;const r={};o&8&&(r.selected=(a=n[3].data)==null?void 0:a.preferred_embedding),o&4194336&&(r.$$scope={dirty:o,ctx:n}),e.$set(r)},i(n){l||(g(e.$$.fragment,n),l=!0)},o(n){b(e.$$.fragment,n),l=!1},d(n){L(e,n)}}}function Ho(i){let e,l;return e=new Nr({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ti(i){let e,l;return e=new Mt({props:{value:i[19].name}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,n){const o={};n&32&&(o.value=t[19].name),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function jo(i){let e,l,t,n;e=new Mt({props:{value:void 0,text:"None"}});let o=i[5].data||[],r=[];for(let s=0;sb(r[s],1,1,()=>{r[s]=null});return{c(){q(e.$$.fragment),l=j();for(let s=0;s{r[u]=null}),x(),l=r[e],l?l.p(s,f):(l=r[e]=o[e](s),l.c()),g(l,1),l.m(t.parentNode,t))},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){r[e].d(s),s&&h(t)}}}function Yo(i){let e,l,t,n,o,r;return e=new vi({props:{label:"Changes",title:"Dataset settings"}}),t=new wi({props:{hasForm:!0,$$slots:{default:[Uo]},$$scope:{ctx:i}}}),o=new ki({props:{primaryButtonText:"Save"}}),{c(){q(e.$$.fragment),l=j(),q(t.$$.fragment),n=j(),q(o.$$.fragment)},l(a){H(e.$$.fragment,a),l=U(a),H(t.$$.fragment,a),n=U(a),H(o.$$.fragment,a)},m(a,s){O(e,a,s),C(a,l,s),O(t,a,s),C(a,n,s),O(o,a,s),r=!0},p(a,s){const f={};s&4194350&&(f.$$scope={dirty:s,ctx:a}),t.$set(f)},i(a){r||(g(e.$$.fragment,a),g(t.$$.fragment,a),g(o.$$.fragment,a),r=!0)},o(a){b(e.$$.fragment,a),b(t.$$.fragment,a),b(o.$$.fragment,a),r=!1},d(a){L(e,a),a&&h(l),L(t,a),a&&h(n),L(o,a)}}}function Wo(i){let e,l;return e=new bi({props:{open:i[0],$$slots:{default:[Yo]},$$scope:{ctx:i}}}),e.$on("submit",i[11]),e.$on("close",i[15]),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,[n]){const o={};n&1&&(o.open=t[0]),n&4194350&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Qo(i,e,l){let t,n,o,r,a,s=Z,f=()=>(s(),s=Pe(t,E=>l(3,a=E)),t),u,d;i.$$.on_destroy.push(()=>s());let{open:c=!1}=e,{schema:m}=e;const _=qe();ce(i,_,E=>l(13,o=E));const p=Si();ce(i,p,E=>l(18,u=E));const k=Zt();ce(i,k,E=>l(5,d=E));const $=ji();ce(i,$,E=>l(17,r=E));let S=null,w=u.embedding;function y(E){w=E.target.value,w===""&&(w=void 0)}function N(){if(S==null)return;const E={ui:{media_paths:S.map(P=>P.path)},preferred_embedding:w};r.mutate([o.namespace,o.datasetName,E],{onSuccess:()=>{l(0,c=!1)}})}function F(E){S=E,l(1,S),l(3,a),l(2,n),l(12,m)}const T=()=>l(0,c=!1);return i.$$set=E=>{"open"in E&&l(0,c=E.open),"schema"in E&&l(12,m=E.schema)},i.$$.update=()=>{var E,P;if(i.$$.dirty&8192&&f(l(4,t=jt(o.namespace,o.datasetName))),i.$$.dirty&4096&&l(2,n=Lt(m).filter(I=>I.dtype==="string"&&!Qe(I.path,[Ht])&&!Ge(I,m))),i.$$.dirty&14&&S==null){const I=((P=(E=a.data)==null?void 0:E.ui)==null?void 0:P.media_paths)||[];l(1,S=n.filter(A=>I.some(B=>Qe(A.path,B))))}},[c,S,n,a,t,d,_,p,k,$,y,N,m,o,F,T]}class Jo extends _e{constructor(e){super(),ge(this,e,Qo,Wo,he,{open:0,schema:12})}}function Ko(i){let e,l,t;function n(r){i[13](r)}let o={fields:i[6]};return i[1]!==void 0&&(o.checkedFields=i[1]),e=new el({props:o}),Re.push(()=>et(e,"checkedFields",n)),{c(){q(e.$$.fragment)},l(r){H(e.$$.fragment,r)},m(r,a){O(e,r,a),t=!0},p(r,a){const s={};a&64&&(s.fields=r[6]),!l&&a&2&&(l=!0,s.checkedFields=r[1],tt(()=>l=!1)),e.$set(s)},i(r){t||(g(e.$$.fragment,r),t=!0)},o(r){b(e.$$.fragment,r),t=!1},d(r){L(e,r)}}}function Zo(i){let e,l;return e=new Le({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function li(i){let e,l,t,n,o,r,a;const s=[Xo,Go],f=[];function u(d,c){return d[5]==null?0:1}return o=u(i),r=f[o]=s[o](i),{c(){e=M("section"),l=M("h4"),t=Y("Select enriched fields"),n=j(),r.c(),this.h()},l(d){e=z(d,"SECTION",{});var c=D(e);l=z(c,"H4",{class:!0});var m=D(l);t=W(m,"Select enriched fields"),m.forEach(h),n=U(c),r.l(c),c.forEach(h),this.h()},h(){V(l,"class","svelte-1ge817j")},m(d,c){C(d,e,c),v(e,l),v(l,t),v(e,n),f[o].m(e,null),a=!0},p(d,c){let m=o;o=u(d),o===m?f[o].p(d,c):(X(),b(f[m],1,1,()=>{f[m]=null}),x(),r=f[o],r?r.p(d,c):(r=f[o]=s[o](d),r.c()),g(r,1),r.m(e,null))},i(d){a||(g(r),a=!0)},o(d){b(r),a=!1},d(d){d&&h(e),f[o].d()}}}function Go(i){let e,l,t;function n(r){i[14](r)}let o={fields:i[5]};return i[2]!==void 0&&(o.checkedFields=i[2]),e=new el({props:o}),Re.push(()=>et(e,"checkedFields",n)),{c(){q(e.$$.fragment)},l(r){H(e.$$.fragment,r)},m(r,a){O(e,r,a),t=!0},p(r,a){const s={};a&32&&(s.fields=r[5]),!l&&a&4&&(l=!0,s.checkedFields=r[2],tt(()=>l=!1)),e.$set(s)},i(r){t||(g(e.$$.fragment,r),t=!0)},o(r){b(e.$$.fragment,r),t=!1},d(r){L(e,r)}}}function Xo(i){let e,l;return e=new Le({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ni(i){let e,l;return{c(){e=M("p"),l=Y("No fields selected. Please select at least one field to download."),this.h()},l(t){e=z(t,"P",{class:!0});var n=D(e);l=W(n,"No fields selected. Please select at least one field to download."),n.forEach(h),this.h()},h(){V(e,"class","text-gray-600")},m(t,n){C(t,e,n),v(e,l)},d(t){t&&h(e)}}}function xo(i){let e,l;return e=new cr({props:{value:JSON.stringify(i[7].data,null,2),readonly:!0,rows:30,placeholder:"3 rows of data for previewing the response",class:"mb-2 font-mono"}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,n){const o={};n&128&&(o.value=JSON.stringify(t[7].data,null,2)),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ef(i){let e,l;return e=new Le({props:{paragraph:!0}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function tf(i){let e,l,t,n,o,r,a,s,f,u,d,c,m,_,p,k,$;const S=[Zo,Ko],w=[];function y(I,A){return I[6]==null?0:1}o=y(i),r=w[o]=S[o](i);let N=(i[5]==null||i[5].length>0)&&li(i),F=i[3].length===0&&ni();const T=[ef,xo],E=[];function P(I,A){return I[7]&&I[7].isFetching?0:I[4]&&I[7]?1:-1}return~(p=P(i))&&(k=E[p]=T[p](i)),{c(){e=M("section"),l=M("h4"),t=Y("Select source fields"),n=j(),r.c(),a=j(),N&&N.c(),s=j(),f=M("section"),u=M("h4"),d=Y("Download preview"),c=j(),F&&F.c(),m=j(),_=M("div"),k&&k.c(),this.h()},l(I){e=z(I,"SECTION",{});var A=D(e);l=z(A,"H4",{class:!0});var B=D(l);t=W(B,"Select source fields"),B.forEach(h),n=U(A),r.l(A),A.forEach(h),a=U(I),N&&N.l(I),s=U(I),f=z(I,"SECTION",{});var J=D(f);u=z(J,"H4",{class:!0});var te=D(u);d=W(te,"Download preview"),te.forEach(h),c=U(J),F&&F.l(J),m=U(J),_=z(J,"DIV",{class:!0});var K=D(_);k&&k.l(K),K.forEach(h),J.forEach(h),this.h()},h(){V(l,"class","svelte-1ge817j"),V(u,"class","svelte-1ge817j"),V(_,"class","preview svelte-1ge817j")},m(I,A){C(I,e,A),v(e,l),v(l,t),v(e,n),w[o].m(e,null),C(I,a,A),N&&N.m(I,A),C(I,s,A),C(I,f,A),v(f,u),v(u,d),v(f,c),F&&F.m(f,null),v(f,m),v(f,_),~p&&E[p].m(_,null),$=!0},p(I,A){let B=o;o=y(I),o===B?w[o].p(I,A):(X(),b(w[B],1,1,()=>{w[B]=null}),x(),r=w[o],r?r.p(I,A):(r=w[o]=S[o](I),r.c()),g(r,1),r.m(e,null)),I[5]==null||I[5].length>0?N?(N.p(I,A),A&32&&g(N,1)):(N=li(I),N.c(),g(N,1),N.m(s.parentNode,s)):N&&(X(),b(N,1,1,()=>{N=null}),x()),I[3].length===0?F||(F=ni(),F.c(),F.m(f,m)):F&&(F.d(1),F=null);let J=p;p=P(I),p===J?~p&&E[p].p(I,A):(k&&(X(),b(E[J],1,1,()=>{E[J]=null}),x()),~p?(k=E[p],k?k.p(I,A):(k=E[p]=T[p](I),k.c()),g(k,1),k.m(_,null)):k=null)},i(I){$||(g(r),g(N),g(k),$=!0)},o(I){b(r),b(N),b(k),$=!1},d(I){I&&h(e),w[o].d(),I&&h(a),N&&N.d(I),I&&h(s),I&&h(f),F&&F.d(),~p&&E[p].d()}}}function lf(i){let e,l,t,n,o,r;return e=new vi({props:{title:"Download data"}}),t=new wi({props:{hasForm:!0,$$slots:{default:[tf]},$$scope:{ctx:i}}}),o=new ki({props:{primaryButtonText:"Download",primaryButtonDisabled:i[3].length===0,secondaryButtonText:"Cancel"}}),o.$on("click:button--secondary",i[10]),{c(){q(e.$$.fragment),l=j(),q(t.$$.fragment),n=j(),q(o.$$.fragment)},l(a){H(e.$$.fragment,a),l=U(a),H(t.$$.fragment,a),n=U(a),H(o.$$.fragment,a)},m(a,s){O(e,a,s),C(a,l,s),O(t,a,s),C(a,n,s),O(o,a,s),r=!0},p(a,s){const f={};s&262398&&(f.$$scope={dirty:s,ctx:a}),t.$set(f);const u={};s&8&&(u.primaryButtonDisabled=a[3].length===0),o.$set(u)},i(a){r||(g(e.$$.fragment,a),g(t.$$.fragment,a),g(o.$$.fragment,a),r=!0)},o(a){b(e.$$.fragment,a),b(t.$$.fragment,a),b(o.$$.fragment,a),r=!1},d(a){L(e,a),a&&h(l),L(t,a),a&&h(n),L(o,a)}}}function nf(i){let e,l;return e=new bi({props:{size:"lg",open:i[0],$$slots:{default:[lf]},$$scope:{ctx:i}}}),e.$on("submit",i[9]),e.$on("close",i[15]),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,[n]){const o={};n&1&&(o.open=t[0]),n&262398&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function rf(i,e,l){let t,n,o,r,a,s,f=Z,u=()=>(f(),f=Pe(r,T=>l(7,s=T)),r);i.$$.on_destroy.push(()=>f());let{open:d=!1}=e,{schema:c}=e;const m=_t(),_=qe();ce(i,_,T=>l(12,a=T));let p=[],k=[];function $(T){if(T==null)return{sourceFields:null,enrichedFields:null};const E=Lt(T).filter(A=>["string_span","embedding"].indexOf(A.dtype)===-1),P=E.filter(A=>!Ge(A,T)&&A.path.at(-1)!==Ht),I=E.filter(A=>Ge(A,T));return{sourceFields:P,enrichedFields:I}}async function S(){const T=a.namespace,E=a.datasetName,P={combine_columns:!1,columns:o.map(B=>B.path)},I=`/api/v1/datasets/${T}/${E}/select_rows_download?url_safe_options=${encodeURIComponent(JSON.stringify(P))}`,A=document.createElement("a");A.download=`${T}_${E}.json`,A.href=I,document.body.appendChild(A),A.click(),A.remove()}function w(){l(0,d=!1),m("close")}function y(T){p=T,l(1,p)}function N(T){k=T,l(2,k)}const F=()=>l(0,d=!1);return i.$$set=T=>{"open"in T&&l(0,d=T.open),"schema"in T&&l(11,c=T.schema)},i.$$.update=()=>{i.$$.dirty&2048&&l(6,{sourceFields:t,enrichedFields:n}=$(c),t,(l(5,n),l(11,c))),i.$$.dirty&6&&l(3,o=[...p,...k]),i.$$.dirty&4104&&u(l(4,r=o.length>0?Ui(a.namespace,a.datasetName,{columns:o.map(T=>T.path),limit:3,combine_columns:!1}):null))},[d,p,k,o,r,n,t,s,_,S,w,c,a,y,N,F]}class sf extends _e{constructor(e){super(),ge(this,e,rf,nf,he,{open:0,schema:11})}}function af(i){let e,l;return e=new ms({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function of(i){let e,l;return e=new us({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function ii(i){let e,l,t,n,o,r;function a(d){i[22](d)}let s={schema:i[2].data};i[3]!==void 0&&(s.open=i[3]),e=new Jo({props:s}),Re.push(()=>et(e,"open",a));function f(d){i[23](d)}let u={schema:i[2].data};return i[4]!==void 0&&(u.open=i[4]),n=new sf({props:u}),Re.push(()=>et(n,"open",f)),{c(){q(e.$$.fragment),t=j(),q(n.$$.fragment)},l(d){H(e.$$.fragment,d),t=U(d),H(n.$$.fragment,d)},m(d,c){O(e,d,c),C(d,t,c),O(n,d,c),r=!0},p(d,c){const m={};c&4&&(m.schema=d[2].data),!l&&c&8&&(l=!0,m.open=d[3],tt(()=>l=!1)),e.$set(m);const _={};c&4&&(_.schema=d[2].data),!o&&c&16&&(o=!0,_.open=d[4],tt(()=>o=!1)),n.$set(_)},i(d){r||(g(e.$$.fragment,d),g(n.$$.fragment,d),r=!0)},o(d){b(e.$$.fragment,d),b(n.$$.fragment,d),r=!1},d(d){L(e,d),d&&h(t),L(n,d)}}}function ff(i){let e,l,t,n,o,r,a,s,f,u,d,c,m,_,p,k,$,S;t=new Ao({});const w=[of,af],y=[];function N(T,E){return T[10]?1:0}r=N(i),a=y[r]=w[r](i),m=new Da({});let F=i[2].data&&ii(i);return{c(){e=M("div"),l=M("div"),q(t.$$.fragment),n=j(),o=M("div"),a.c(),d=j(),c=M("div"),q(m.$$.fragment),_=j(),F&&F.c(),p=re(),this.h()},l(T){e=z(T,"DIV",{class:!0});var E=D(e);l=z(E,"DIV",{class:!0});var P=D(l);H(t.$$.fragment,P),n=U(P),o=z(P,"DIV",{class:!0});var I=D(o);a.l(I),I.forEach(h),P.forEach(h),d=U(E),c=z(E,"DIV",{class:!0});var A=D(c);H(m.$$.fragment,A),A.forEach(h),E.forEach(h),_=U(T),F&&F.l(T),p=re(),this.h()},h(){V(o,"class",s=Et(`absolute right-0 top-1/2 flex h-8 w-4 cursor-pointer items-center justify-center rounded border border-neutral-200 bg-neutral-100 opacity-60 hover:bg-neutral-200 hover:opacity-100 ${i[10]?" translate-x-full":" translate-x-1/2"}`)+" svelte-1nu5kbu"),V(l,"class",u=Et(`schema-container relative h-full ${i[10]?"w-0":"w-1/3"} border-r border-gray-200`)+" svelte-1nu5kbu"),V(c,"class","h-full w-2/3 flex-grow"),V(e,"class","flex h-full w-full")},m(T,E){C(T,e,E),v(e,l),O(t,l,null),v(l,n),v(l,o),y[r].m(o,null),v(e,d),v(e,c),O(m,c,null),C(T,_,E),F&&F.m(T,E),C(T,p,E),k=!0,$||(S=[Ae(f=Fe.call(null,o,{text:i[10]?"Show Schema":"Hide Schema"})),Ve(o,"click",i[11]),Ve(o,"keypress",i[11])],$=!0)},p(T,E){let P=r;r=N(T),r!==P&&(X(),b(y[P],1,1,()=>{y[P]=null}),x(),a=y[r],a||(a=y[r]=w[r](T),a.c()),g(a,1),a.m(o,null)),(!k||E&1024&&s!==(s=Et(`absolute right-0 top-1/2 flex h-8 w-4 cursor-pointer items-center justify-center rounded border border-neutral-200 bg-neutral-100 opacity-60 hover:bg-neutral-200 hover:opacity-100 ${T[10]?" translate-x-full":" translate-x-1/2"}`)+" svelte-1nu5kbu"))&&V(o,"class",s),f&&Oe(f.update)&&E&1024&&f.update.call(null,{text:T[10]?"Show Schema":"Hide Schema"}),(!k||E&1024&&u!==(u=Et(`schema-container relative h-full ${T[10]?"w-0":"w-1/3"} border-r border-gray-200`)+" svelte-1nu5kbu"))&&V(l,"class",u),T[2].data?F?(F.p(T,E),E&4&&g(F,1)):(F=ii(T),F.c(),g(F,1),F.m(p.parentNode,p)):F&&(X(),b(F,1,1,()=>{F=null}),x())},i(T){k||(g(t.$$.fragment,T),g(a),g(m.$$.fragment,T),g(F),k=!0)},o(T){b(t.$$.fragment,T),b(a),b(m.$$.fragment,T),b(F),k=!1},d(T){T&&h(e),L(t),y[r].d(),L(m),T&&h(_),F&&F.d(T),T&&h(p),$=!1,Je(S)}}}function uf(i){let e=i[1].datasetName+"",l;return{c(){l=Y(e)},l(t){l=W(t,e)},m(t,n){C(t,l,n)},p(t,n){n&2&&e!==(e=t[1].datasetName+"")&&fe(l,e)},d(t){t&&h(l)}}}function cf(i){let e,l,t,n,o,r,a;return t=new lt({props:{type:"outline",$$slots:{default:[uf]},$$scope:{ctx:i}}}),{c(){e=M("div"),l=M("div"),q(t.$$.fragment),this.h()},l(s){e=z(s,"DIV",{slot:!0});var f=D(e);l=z(f,"DIV",{});var u=D(l);H(t.$$.fragment,u),u.forEach(h),f.forEach(h),this.h()},h(){V(e,"slot","header-subtext")},m(s,f){C(s,e,f),v(e,l),O(t,l,null),o=!0,r||(a=Ae(n=Fe.call(null,l,{text:`${i[1].namespace}/${i[1].datasetName}`})),r=!0)},p(s,f){const u={};f&33554434&&(u.$$scope={dirty:f,ctx:s}),t.$set(u),n&&Oe(n.update)&&f&2&&n.update.call(null,{text:`${s[1].namespace}/${s[1].datasetName}`})},i(s){o||(g(t.$$.fragment,s),o=!0)},o(s){b(t.$$.fragment,s),o=!1},d(s){s&&h(e),L(t),r=!1,a()}}}function df(i){let e,l,t;return l=new Ra({}),{c(){e=M("div"),q(l.$$.fragment),this.h()},l(n){e=z(n,"DIV",{slot:!0,class:!0});var o=D(e);H(l.$$.fragment,o),o.forEach(h),this.h()},h(){V(e,"slot","header-center"),V(e,"class","flex w-full items-center")},m(n,o){C(n,e,o),O(l,e,null),t=!0},p:Z,i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function mf(i){let e,l,t,n,o,r,a,s,f,u,d,c,m;return n=new Ye({props:{size:"field",kind:"ghost",icon:ys,iconDescription:"Reset View"}}),n.$on("click",function(){Oe(i[0].reset)&&i[0].reset.apply(this,arguments)}),r=new Ye({props:{size:"field",kind:"ghost",icon:gs,iconDescription:"Download data"}}),r.$on("click",i[20]),f=new Ye({props:{disabled:!i[5],size:"field",kind:"ghost",icon:Mr,iconDescription:"Dataset settings"}}),f.$on("click",i[21]),{c(){e=M("div"),l=M("div"),t=M("div"),q(n.$$.fragment),o=j(),q(r.$$.fragment),a=j(),s=M("div"),q(f.$$.fragment),this.h()},l(_){e=z(_,"DIV",{slot:!0});var p=D(e);l=z(p,"DIV",{class:!0});var k=D(l);t=z(k,"DIV",{class:!0});var $=D(t);H(n.$$.fragment,$),o=U($),H(r.$$.fragment,$),a=U($),s=z($,"DIV",{});var S=D(s);H(f.$$.fragment,S),S.forEach(h),$.forEach(h),k.forEach(h),p.forEach(h),this.h()},h(){se(s,"opacity-40",!i[5]),V(t,"class","flex"),V(l,"class","flex h-full flex-col"),V(e,"slot","header-right")},m(_,p){C(_,e,p),v(e,l),v(l,t),O(n,t,null),v(t,o),O(r,t,null),v(t,a),v(t,s),O(f,s,null),d=!0,c||(m=Ae(u=Fe.call(null,s,{text:i[5]?"":"User does not have access to update settings of this dataset."})),c=!0)},p(_,p){i=_;const k={};p&32&&(k.disabled=!i[5]),f.$set(k),u&&Oe(u.update)&&p&32&&u.update.call(null,{text:i[5]?"":"User does not have access to update settings of this dataset."}),(!d||p&32)&&se(s,"opacity-40",!i[5])},i(_){d||(g(n.$$.fragment,_),g(r.$$.fragment,_),g(f.$$.fragment,_),d=!0)},o(_){b(n.$$.fragment,_),b(r.$$.fragment,_),b(f.$$.fragment,_),d=!1},d(_){_&&h(e),L(n),L(r),L(f),c=!1,m()}}}function hf(i){let e,l,t,n;return e=new gi({props:{title:"Datasets",$$slots:{"header-right":[mf],"header-center":[df],"header-subtext":[cf],default:[ff]},$$scope:{ctx:i}}}),t=new dr({}),{c(){q(e.$$.fragment),l=j(),q(t.$$.fragment)},l(o){H(e.$$.fragment,o),l=U(o),H(t.$$.fragment,o)},m(o,r){O(e,o,r),C(o,l,r),O(t,o,r),n=!0},p(o,[r]){const a={};r&33555519&&(a.$$scope={dirty:r,ctx:o}),e.$set(a)},i(o){n||(g(e.$$.fragment,o),g(t.$$.fragment,o),n=!0)},o(o){b(e.$$.fragment,o),b(t.$$.fragment,o),n=!1},d(o){L(e,o),o&&h(l),L(t,o)}}}function _f(i,e,l){let t,n,o,r,a,s,f,u,d,c,m=Z,_=()=>(m(),m=Pe(f,de=>l(17,c=de)),f),p,k=Z,$=()=>(k(),k=Pe(s,de=>l(18,p=de)),s),S,w=Z,y=()=>(w(),w=Pe(t,de=>l(1,S=de)),t),N,F=Z,T=()=>(F(),F=Pe(o,de=>l(2,N=de)),o),E,P=Z,I=()=>(P(),P=Pe(a,de=>l(19,E=de)),a);i.$$.on_destroy.push(()=>m()),i.$$.on_destroy.push(()=>k()),i.$$.on_destroy.push(()=>w()),i.$$.on_destroy.push(()=>F()),i.$$.on_destroy.push(()=>P());let{namespace:A}=e,{datasetName:B}=e;function J(){ft(t,S.schemaCollapsed=!S.schemaCollapsed,S)}const te=mr(A,B);hr(te);let K=!1,G=!1;const ee=St();ce(i,ee,de=>l(16,d=de));const le=()=>l(4,G=!0),pe=()=>l(3,K=!0);function oe(de){K=de,l(3,K)}function ae(de){G=de,l(4,G)}return i.$$set=de=>{"namespace"in de&&l(13,A=de.namespace),"datasetName"in de&&l(14,B=de.datasetName)},i.$$.update=()=>{var de,ke;if(i.$$.dirty&24576&&y(l(0,t=_r(A,B))),i.$$.dirty&1&&gr(t),i.$$.dirty&2&&l(10,n=S.schemaCollapsed),i.$$.dirty&2&&T(l(9,o=mi(S.namespace,S.datasetName))),i.$$.dirty&4&&l(15,r=Yi("string",N.data)),i.$$.dirty&32770&&I(l(8,a=Wi(S.namespace,S.datasetName,r.map(Se=>Se.path)))),i.$$.dirty&2&&$(l(7,s=Qi(S.namespace,S.datasetName,pr(S)))),i.$$.dirty&2&&_(l(6,f=jt(S.namespace,S.datasetName))),i.$$.dirty&524292&&N.data!=null&&E.data&&!E.isFetching&&te.setStats(E.data),i.$$.dirty&4&&N.data!=null&&te.setSchema(N.data),i.$$.dirty&262144&&p!=null&&te.setSelectRowsSchema(p),i.$$.dirty&262146){const Se=br(S.selectedColumns,((de=p==null?void 0:p.data)==null?void 0:de.schema)||null);te.setVisibleFields(Se)}i.$$.dirty&131072&&c.data!=null&&te.setSettings(c.data),i.$$.dirty&65536&&l(5,u=(ke=d.data)==null?void 0:ke.access.dataset.update_settings)},[t,S,N,K,G,u,f,s,a,o,n,J,ee,A,B,r,d,c,p,E,le,pe,oe,ae]}class gf extends _e{constructor(e){super(),ge(this,e,_f,hf,he,{namespace:13,datasetName:14})}}function ri(i,e,l){const t=i.slice();return t[17]=e[l],t}function pf(i){let e,l,t=i[4].data,n=[];for(let r=0;rb(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r{f[_]=null}),x()),~t?(n=f[t],n?n.p(c,m):(n=f[t]=s[t](c),n.c()),g(n,1),n.m(l,null)):n=null),c[0]?d?(d.p(c,m),m&1&&g(d,1)):(d=oi(c),d.c(),g(d,1),d.m(r.parentNode,r)):d&&(X(),b(d,1,1,()=>{d=null}),x())},i(c){a||(g(n),g(d),a=!0)},o(c){b(n),b(d),a=!1},d(c){c&&h(e),~t&&f[t].d(),c&&h(o),d&&d.d(c),c&&h(r)}}}function Ef(i){let e;return{c(){e=Y("+ Add Dataset")},l(l){e=W(l,"+ Add Dataset")},m(l,t){C(l,e,t)},d(l){l&&h(e)}}}function yf(i){let e,l,t;return l=new Ye({props:{size:"small",disabled:!i[1],$$slots:{default:[Ef]},$$scope:{ctx:i}}}),l.$on("click",i[10]),{c(){e=M("div"),q(l.$$.fragment),this.h()},l(n){e=z(n,"DIV",{slot:!0});var o=D(e);H(l.$$.fragment,o),o.forEach(h),this.h()},h(){V(e,"slot","header-right")},m(n,o){C(n,e,o),O(l,e,null),t=!0},p(n,o){const r={};o&2&&(r.disabled=!n[1]),o&1048576&&(r.$$scope={dirty:o,ctx:n}),l.$set(r)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){b(l.$$.fragment,n),t=!1},d(n){n&&h(e),L(l)}}}function $f(i){let e,l;return e=new gi({props:{title:"Datasets",$$slots:{"header-right":[yf],default:[Sf]},$$scope:{ctx:i}}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,[n]){const o={};n&1048607&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Df(i,e,l){let t,n,o,r,a;const s=Ji();ce(i,s,y=>l(4,a=y));const f=Ki();ce(i,f,y=>l(3,o=y));const u=St();ce(i,u,y=>l(9,r=y));let d=null;function c(){if(d==null)return;const{namespace:y,name:N}=d;o.mutate([y,N],{onSuccess:()=>l(0,d=null)})}const m=()=>At("/datasets/new"),_=y=>At(il(y.namespace,y.dataset_name)),p=y=>l(0,d={namespace:y.namespace,name:y.dataset_name}),k=y=>At(il(y.namespace,y.dataset_name)),$=()=>l(0,d=null),S=()=>l(0,d=null),w=()=>c();return i.$$.update=()=>{var y,N;i.$$.dirty&512&&l(2,t=(y=r.data)==null?void 0:y.access.dataset.delete_dataset),i.$$.dirty&512&&l(1,n=(N=r.data)==null?void 0:N.access.create_dataset)},[d,n,t,o,a,s,f,u,c,r,m,_,p,k,$,S,w]}class If extends _e{constructor(e){super(),ge(this,e,Df,$f,he,{})}}function Vf(i){let e,l;return e=new If({}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p:Z,i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Tf(i){let e,l;return e=new gf({props:{namespace:i[0],datasetName:i[1]}}),{c(){q(e.$$.fragment)},l(t){H(e.$$.fragment,t)},m(t,n){O(e,t,n),l=!0},p(t,n){const o={};n&1&&(o.namespace=t[0]),n&2&&(o.datasetName=t[1]),e.$set(o)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){b(e.$$.fragment,t),l=!1},d(t){L(e,t)}}}function Cf(i){let e,l,t,n;const o=[Tf,Vf],r=[];function a(s,f){return s[0]&&s[1]?0:1}return e=a(i),l=r[e]=o[e](i),{c(){l.c(),t=re()},l(s){l.l(s),t=re()},m(s,f){r[e].m(s,f),C(s,t,f),n=!0},p(s,[f]){let u=e;e=a(s),e===u?r[e].p(s,f):(X(),b(r[u],1,1,()=>{r[u]=null}),x(),l=r[e],l?l.p(s,f):(l=r[e]=o[e](s),l.c()),g(l,1),l.m(t.parentNode,t))},i(s){n||(g(l),n=!0)},o(s){b(l),n=!1},d(s){r[e].d(s),s&&h(t)}}}function Nf(i,e,l){let t;ce(i,Cr,r=>l(2,t=r));let n,o;return i.$$.update=()=>{i.$$.dirty&4&&t.onHashChange("",()=>{l(0,n=void 0),l(1,o=void 0)}),i.$$.dirty&4&&t.onHashChange("/(?.+)/(?.+)",r=>{l(0,n=r.namespace),l(1,o=r.datasetName)})},[n,o,t]}class Yf extends _e{constructor(e){super(),ge(this,e,Nf,Cf,he,{})}}export{Yf as component};