diff --git a/about/index.html b/about/index.html
index e0bbc67..8e9bc7f 100644
--- a/about/index.html
+++ b/about/index.html
@@ -5,7 +5,7 @@
ome2024-ngff-challenge
-
+
diff --git a/assets/index-718b7GWF.js b/assets/index-BN10ccra.js
similarity index 54%
rename from assets/index-718b7GWF.js
rename to assets/index-BN10ccra.js
index ae0405c..bee6321 100644
--- a/assets/index-718b7GWF.js
+++ b/assets/index-BN10ccra.js
@@ -13,7 +13,7 @@ License: MIT
`:"\r"}(P,de)),z=!1,f.delimiter)I(f.delimiter)&&(f.delimiter=f.delimiter(P),A.meta.delimiter=f.delimiter);else{var $=function(_e,ce,Pe,be,je){var Ge,ze,se,ve;je=je||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Ye=0;Ye=j)return Me(!0)}else for(le=w,w++;;){if((le=R.indexOf(c,le+1))===-1)return te||ie.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ne.length,index:w}),Se();if(le===A-1)return Se(R.substring(w,le).replace(Ye,c));if(c!==B||R[le+1]!==B){if(c===B||le===0||R[le-1]!==B){se!==-1&&se=j)return Me(!0);break}ie.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ne.length,index:w}),le++}}else le++}return Se();function Qe(Ie){ne.push(Ie),Z=w}function Re(Ie){var nt=0;if(Ie!==-1){var Xe=R.substring(le+1,Ie);Xe&&Xe.trim()===""&&(nt=Xe.length)}return nt}function Se(Ie){return te||(Ie===void 0&&(Ie=R.substring(w)),P.push(Ie),w=A,Qe(P),H&&ct()),Me()}function Le(Ie){w=Ie,Qe(P),P=[],ve=R.indexOf(z,w)}function Me(Ie){return{data:ne,errors:ie,meta:{delimiter:k,linebreak:z,aborted:S,truncated:!!Ie,cursor:Z+(F||0)}}}function ct(){L(Me()),ne=[],ie=[]}},this.abort=function(){S=!0},this.getCharIndex=function(){return w}}function M(f){var c=f.data,k=o[c.workerId],z=!1;if(c.error)k.userError(c.error,c.file);else if(c.results&&c.results.data){var T={abort:function(){z=!0,Y(c.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:G,resume:G};if(I(k.userStep)){for(var L=0;L1&&(r=s,i.data.shift());let o=i.data.map(p=>{let _={...n};for(let E=0;E{var _;return!((_=p.url)!=null&&_.endsWith(".csv"))}),l={};a.forEach(p=>{if(l[p.url]){console.warn("Removing duplicate URL:",p.url);return}l[p.url]=p}),a=Object.values(l);let h=o.filter(p=>{var _;return(_=p.url)==null?void 0:_.includes(".csv")}),u=a.reduce((p,_)=>_.wells?p+1:p,0),g=a.reduce((p,_)=>p+parseInt(_.written||0),0),m=a.length;u>0&&(m=a.reduce((p,_)=>p+parseInt(_.images||1),0)),e.addCsv(t,h,m,u,g),e.addRows(a),h.forEach(p=>{let _=p.url;p.csv=_,dr(_,e,p)})}})}async function _r(t){return await fetch(t).then(e=>e.json())}function ut(t){if(!t)return"";const e=2;return t<1024?t+" B":t<1024*1024?(t/1024).toFixed(e)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(e)+" MB":t<1024*1024*1024*1024?(t/(1024*1024*1024)).toFixed(e)+" GB":t<1024*1024*1024*1024*1024?(t/(1024*1024*1024*1024)).toFixed(e)+" TB":(t/(1024*1024*1024*1024*1024)).toFixed(e)+" PB"}function Xr(t,e){return Array.from({length:e-t},(n,i)=>i+t)}function $r(t,e,n){const i=t[0].shape,r=i[0],s=i[1],o=r*s;e||(e=t.map(gr));let a=performance.now(),l=new Uint8ClampedArray(4*r*s).fill(0),h=0;for(let u=0;u100*s/r),n}function gr(t){const e=t.data;let n=0,i=1/0,r=t.data.length;for(let s=0;sr?s:[]);for(const[r,s]of i.entries())n[s]=_i[r]}return n.map(mr)}function mr(t){t.startsWith("#")&&(t=t.slice(1));const e=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16);return[e,n,i]}class pr{constructor(){this.store=Mn({})}async lookupOntologyTerm(e){let n=e.replace("NCBI:txid","");return(await _r(`https://rest.ensembl.org/taxonomy/id/${n}?content-type=application/json`)).name||e}addTerms(e){let n=Nt(this.store);[...new Set(e)].forEach(r=>{r&&(n[r]||(n[r]="Loading...",setTimeout(()=>{this.lookupOntologyTerm(r).then(s=>{this.addEntry(r,s)})},Math.random()*5e3)))})}addEntry(e,n){this.store.update(i=>(i[e]=n,i))}subscribe(e){return this.store.subscribe(e)}}class os extends pr{constructor(){super()}async lookupOntologyTerm(e){const n=e.replace("obo:","");return(await _r(`https://www.ebi.ac.uk/ols4/api/ontologies/fbbi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252F${n}`)).label||e}}const br=new pr,vr=new os,gi=5;async function jt(t,e){var r;let n=await fetch(`${t}/zarr.json`,{signal:e}).then(s=>{if(s.status===404)throw new Error(`${t}/zarr.json not found`);return s.json()}).catch(s=>[void 0,t]);const i=(r=n==null?void 0:n.attributes)==null?void 0:r.ome;if(!i)return[void 0,t];if(i.multiscales)return[i,t];if(i.plate){let s=i.plate.wells[0],o=`${t}/${s.path}/0`,[a,l]=await jt(o);return[a,l,i.plate]}else if(i["bioformats2raw.layout"]){let s=`${t}/0`;return await jt(s)}}class ls{constructor(e="index",n=!0){this.store=Mn([]),this.selectedRow=Mn(null),this.sortColumn=e,this.sortAscending=n,this.csvFiles=[]}getCsvSourceList(e){let n;if(!e)n=this.csvFiles[0];else for(let r of this.csvFiles){if(r.source===e){n=r;break}for(let s of r.child_csv){if(s.source===e){n=s;break}for(let o of s.child_csv)if(o.source===e){n=o;break}}}return n?n.child_csv.map(r=>{let s=r.image_count||0,o=r.plate_count||0,a=r.bytes||0;for(let l of r.child_csv)s+=l.image_count||0,o+=l.plate_count||0,a+=l.bytes||0;return{...r,image_count:s,plate_count:o,bytes:a}}):[]}addCsv(e,n,i,r,s){n=n.map(a=>({...a,child_csv:[]}));let o;for(let a of this.csvFiles){if(a.url===e){o=a;break}for(let l of a.child_csv){if(l.url===e){o=l;break}for(let h of l.child_csv)if(h.url===e){o=h;break}}}o?(o.image_count=i,o.plate_count=r,o.bytes=s,o.child_csv=n):(o={url:e,image_count:i,plate_count:r,bytes:s,child_csv:n},this.csvFiles.push(o))}addRows(e){e=e.map((r,s)=>{if(r.written&&(r.written=parseFloat(r.written)),r.shape){let o=r.shape.split(",").map(l=>parseInt(l)),a;r.dimension_names?a=r.dimension_names.split(","):o.length==5&&(a=["t","c","z","y","x"]),a&&a.length==o.length&&a.forEach((l,h)=>r["size_"+l]=o[h]),r.dim_count=o.reduce((l,h)=>l+(h>1?1:0),0)}if(r.chunks){let o=r.chunks.split(",").map(a=>parseInt(a));r.chunk_pixels=o.reduce((a,l)=>a*l,1)}if(r.shards){let o=r.shards.split(",").map(a=>parseInt(a));r.shard_pixels=o.reduce((a,l)=>a*l,1)}return r.index=Math.random()*(1+s),r}),console.log("Adding rows",e),this.store.update(r=>(r.push(...e),r.sort((s,o)=>this.compareRows(s,o,!0)),r));let n=e.map(r=>r.organismId);br.addTerms(n);let i=e.map(r=>r.fbbiId);vr.addTerms(i)}populateRow(e,n){this.store.update(i=>(i=i.map(r=>(r.url===e&&(r={...r,...n}),r)),i))}async loadNgffMetadata(e){var m;const[n,i,r]=await jt(e);let s=[],o=0,a=0,l=!1,h=!0,u={multiscales:n},g=i;if(r&&(o=r.wells.length,a=r.field_count||1),n){const p=(m=n[0])==null?void 0:m.datasets[0],_=p==null?void 0:p.path;if(_){const E=await fetch(`${i}/${_}/zarr.json`).then(N=>N.json()).catch(N=>{console.log(`----> Failed to parse ${i}/${_}/zarr.json`,N)});s=E==null?void 0:E.shape}}else console.log("No multiscales found"),l=!0,s=[0];this.populateRow(e,{image_attrs:u,image_url:g,shape:s,well_count:o,field_count:a,load_failed:l,loaded:h})}async loadRocrateJsonAllRows(){let e=Nt(this.store);for(let n=0;nthis.loadRocrateJson(e[r].url));await Promise.all(i)}}compareRows(e,n,i=!1){let r=e[this.sortColumn],s=n[this.sortColumn];if(i)return r===void 0&&(r=0),s===void 0&&(s=0),rs?this.sortAscending?1:-1:0;r===void 0&&(r=""),s===void 0&&(s="");let o=0;return i?o=r-s:o=r.localeCompare(s),this.sortAscending?o:-o}sortTable(e,n=!0){console.log("sortTable",e,n),this.sortColumn=e,this.sortAscending=n;let i=this.isColumnNumeric(e);this.store.update(r=>(r.sort((s,o)=>this.compareRows(s,o,i)),r))}isColumnNumeric(e){let n=Nt(this.store);for(let i of n){let r=i[e];if(r!==void 0&&r!=="")return!isNaN(r)}}emptyTable(){this.store.set([])}subscribe(e){return this.store.subscribe(e)}getRows(){return Nt(this.store)}getRow(e){return Nt(this.store)[e]}subscribeSelectedRow(e){return this.selectedRow.subscribe(e)}setSelectedRow(e){this.selectedRow.set(e)}}const Ae=new ls;function as(t){let e,n,i,r,s,o;return{c(){e=y("button"),n=y("span"),n.textContent="^",i=V(),r=y("span"),r.textContent="^",b(n,"class","acc svelte-17vd65t"),Et(n,"strong",t[1]),b(r,"class","dec svelte-17vd65t"),Et(r,"strong",!t[1]),b(e,"class","svelte-17vd65t")},m(a,l){x(a,e,l),d(e,n),d(e,i),d(e,r),s||(o=we(e,"click",t[2]),s=!0)},p(a,[l]){l&2&&Et(n,"strong",a[1]),l&2&&Et(r,"strong",!a[1])},i:ke,o:ke,d(a){a&&q(e),s=!1,o()}}}function us(t,e,n){let{toggleAscending:i}=e,{sortAscending:r}=e;const s=()=>i();return t.$$set=o=>{"toggleAscending"in o&&n(0,i=o.toggleAscending),"sortAscending"in o&&n(1,r=o.sortAscending)},[i,r,s]}class cs extends Ze{constructor(e){super(),Je(this,e,us,as,Be,{toggleAscending:0,sortAscending:1})}}const cn={AUTO:"auto",START:"start",CENTER:"center",END:"end"},rt={HORIZONTAL:"horizontal",VERTICAL:"vertical"},Ft={OBSERVED:0,REQUESTED:1},fs={[rt.VERTICAL]:"top",[rt.HORIZONTAL]:"left"},mi={[rt.VERTICAL]:"scrollTop",[rt.HORIZONTAL]:"scrollLeft"};class hs{constructor({itemSize:e,itemCount:n,estimatedItemSize:i}){this.itemSize=e,this.itemCount=n,this.estimatedItemSize=i,this.itemSizeAndPositionData={},this.lastMeasuredIndex=-1,this.checkForMismatchItemSizeAndItemCount(),this.justInTime||this.computeTotalSizeAndPositionData()}get justInTime(){return typeof this.itemSize=="function"}updateConfig({itemSize:e,itemCount:n,estimatedItemSize:i}){n!=null&&(this.itemCount=n),i!=null&&(this.estimatedItemSize=i),e!=null&&(this.itemSize=e),this.checkForMismatchItemSizeAndItemCount(),this.justInTime&&this.totalSize!=null?this.totalSize=void 0:this.computeTotalSizeAndPositionData()}checkForMismatchItemSizeAndItemCount(){if(Array.isArray(this.itemSize)&&this.itemSize.length=this.itemCount)throw Error(`Requested index ${e} is outside of range 0..${this.itemCount}`);return this.justInTime?this.getJustInTimeSizeAndPositionForIndex(e):this.itemSizeAndPositionData[e]}getJustInTimeSizeAndPositionForIndex(e){if(e>this.lastMeasuredIndex){const n=this.getSizeAndPositionOfLastMeasuredItem();let i=n.offset+n.size;for(let r=this.lastMeasuredIndex+1;r<=e;r++){const s=this.getSize(r);if(s==null||isNaN(s))throw Error(`Invalid size returned for index ${r} of value ${s}`);this.itemSizeAndPositionData[r]={offset:i,size:s},i+=s}this.lastMeasuredIndex=e}return this.itemSizeAndPositionData[e]}getSizeAndPositionOfLastMeasuredItem(){return this.lastMeasuredIndex>=0?this.itemSizeAndPositionData[this.lastMeasuredIndex]:{offset:0,size:0}}getTotalSize(){if(this.totalSize)return this.totalSize;const e=this.getSizeAndPositionOfLastMeasuredItem();return e.offset+e.size+(this.itemCount-this.lastMeasuredIndex-1)*this.estimatedItemSize}getUpdatedOffsetForIndex({align:e=cn.START,containerSize:n,currentOffset:i,targetIndex:r}){if(n<=0)return 0;const s=this.getSizeAndPositionForIndex(r),o=s.offset,a=o-n+s.size;let l;switch(e){case cn.END:l=a;break;case cn.CENTER:l=o-(n-s.size)/2;break;case cn.START:l=o;break;default:l=Math.max(a,Math.min(o,i))}const h=this.getTotalSize();return Math.max(0,Math.min(h-n,l))}getVisibleRange({containerSize:e=0,offset:n,overscanCount:i}){if(this.getTotalSize()===0)return{};const s=n+e;let o=this.findNearestItem(n);if(o===void 0)throw Error(`Invalid offset ${n} specified`);const a=this.getSizeAndPositionForIndex(o);n=a.offset+a.size;let l=o;for(;n=e?this.binarySearch({high:i,low:0,offset:e}):this.exponentialSearch({index:i,offset:e})}binarySearch({low:e,high:n,offset:i}){let r=0,s=0;for(;e<=n;){if(r=e+Math.floor((n-e)/2),s=this.getSizeAndPositionForIndex(r).offset,s===i)return r;si&&(n=r-1)}return e>0?e-1:0}exponentialSearch({index:e,offset:n}){let i=1;for(;e({}),pi=t=>({});function bi(t,e,n){const i=t.slice();return i[37]=e[n],i}const _s=t=>({style:t[0]&4,index:t[0]&4}),vi=t=>({style:t[37].style,index:t[37].index}),gs=t=>({}),wi=t=>({});function yi(t,e){let n,i;const r=e[21].item,s=Tn(r,e,e[20],vi);return{key:t,first:null,c(){n=bn(),s&&s.c(),this.first=n},m(o,a){x(o,n,a),s&&s.m(o,a),i=!0},p(o,a){e=o,s&&s.p&&(!i||a[0]&1048580)&&On(s,r,e,e[20],i?zn(r,e[20],a,_s):Rn(e[20]),vi)},i(o){i||(re(s,o),i=!0)},o(o){he(s,o),i=!1},d(o){o&&q(n),s&&s.d(o)}}}function ms(t){let e,n,i,r=[],s=new Map,o,a;const l=t[21].header,h=Tn(l,t,t[20],wi);let u=Ne(t[2]);const g=_=>_[0]?_[0](_[37].index):_[37].index;for(let _=0;_{let t=!1;try{const e=Object.defineProperty({},"passive",{get(){return t={passive:!0},!0}});window.addEventListener("testpassive",e,e),window.remove("testpassive",e,e)}catch{}return t})();function bs(t,e,n){let{$$slots:i={},$$scope:r}=e,{height:s}=e,{width:o="100%"}=e,{itemCount:a}=e,{itemSize:l}=e,{estimatedItemSize:h=null}=e,{stickyIndices:u=null}=e,{getKey:g=null}=e,{scrollDirection:m=rt.VERTICAL}=e,{scrollOffset:p=null}=e,{scrollToIndex:_=null}=e,{scrollToAlignment:E=null}=e,{scrollToBehaviour:N="instant"}=e,{overscanCount:O=3}=e;const M=Dr(),Y=new hs({itemCount:a,itemSize:l,estimatedItemSize:te()});let G=!1,X,J=[],I={offset:p||_!=null&&J.length&&S(_)||0,scrollChangeReason:Ft.REQUESTED},f=I,c={scrollToIndex:_,scrollToAlignment:E,scrollOffset:p,itemCount:a,itemSize:l,estimatedItemSize:h},k={},z="",T="";Q(),$t(()=>{n(18,G=!0),X.addEventListener("scroll",R,ps),p!=null?B(p):_!=null&&B(S(_))}),xn(()=>{G&&X.removeEventListener("scroll",R)});function L(){if(!G)return;const v=c.scrollToIndex!==_||c.scrollToAlignment!==E,D=c.itemCount!==a||c.itemSize!==l||c.estimatedItemSize!==h;D&&(Y.updateConfig({itemSize:l,itemCount:a,estimatedItemSize:te()}),w()),c.scrollOffset!==p?n(19,I={offset:p||0,scrollChangeReason:Ft.REQUESTED}):typeof _=="number"&&(v||D)&&n(19,I={offset:S(_,E,a),scrollChangeReason:Ft.REQUESTED}),c={scrollToIndex:_,scrollToAlignment:E,scrollOffset:p,itemCount:a,itemSize:l,estimatedItemSize:h}}function j(){if(!G)return;const{offset:v,scrollChangeReason:D}=I;(f.offset!==v||f.scrollChangeReason!==D)&&Q(),f.offset!==v&&D===Ft.REQUESTED&&B(v),f=I}function Q(){const{offset:v}=I,{start:D,stop:H}=Y.getVisibleRange({containerSize:m===rt.VERTICAL?s:o,offset:v,overscanCount:O});let ne=[];const ie=Y.getTotalSize();m===rt.VERTICAL?(n(3,z=`height:${s}${typeof s=="number"?"px":""};width:${o};`),n(4,T=`flex-direction:column;height:${ie}px;`)):(n(3,z=`height:${s};width:${o}${typeof o=="number"?"px":""}`),n(4,T=`min-height:100%;width:${ie}px;`));const P=u!=null&&u.length!==0;if(P)for(let Z=0;Z=H)&&(v=0),Y.getUpdatedOffsetForIndex({align:D,containerSize:m===rt.VERTICAL?s:o,currentOffset:I.offset||0,targetIndex:v})}function R(v){const D=F();D<0||I.offset===D||v.target!==X||(n(19,I={offset:D,scrollChangeReason:Ft.OBSERVED}),M("afterScroll",{offset:D,event:v}))}function F(){return X[mi[m]]}function te(){return h||typeof l=="number"&&l||50}function A(v,D){if(k[v])return k[v];const{size:H,offset:ne}=Y.getSizeAndPositionForIndex(v);let ie;return m===rt.VERTICAL?(ie=`left:0;width:100%;height:${H}px;`,D?ie+=`position:sticky;flex-grow:0;z-index:1;top:0;margin-top:${ne}px;margin-bottom:${-(ne+H)}px;`:ie+=`position:absolute;top:${ne}px;`):(ie=`top:0;width:${H}px;`,D?ie+=`position:sticky;z-index:1;left:0;margin-left:${ne}px;margin-right:${-(ne+H)}px;`:ie+=`position:absolute;height:100%;left:${ne}px;`),k[v]=ie}function W(v){Tt[v?"unshift":"push"](()=>{X=v,n(1,X)})}return t.$$set=v=>{"height"in v&&n(5,s=v.height),"width"in v&&n(6,o=v.width),"itemCount"in v&&n(7,a=v.itemCount),"itemSize"in v&&n(8,l=v.itemSize),"estimatedItemSize"in v&&n(9,h=v.estimatedItemSize),"stickyIndices"in v&&n(10,u=v.stickyIndices),"getKey"in v&&n(0,g=v.getKey),"scrollDirection"in v&&n(11,m=v.scrollDirection),"scrollOffset"in v&&n(12,p=v.scrollOffset),"scrollToIndex"in v&&n(13,_=v.scrollToIndex),"scrollToAlignment"in v&&n(14,E=v.scrollToAlignment),"scrollToBehaviour"in v&&n(15,N=v.scrollToBehaviour),"overscanCount"in v&&n(16,O=v.overscanCount),"$$scope"in v&&n(20,r=v.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&29568&&L(),t.$$.dirty[0]&524288&&j(),t.$$.dirty[0]&263264&&G&&w(0)},[g,X,J,z,T,s,o,a,l,h,u,m,p,_,E,N,O,w,G,I,r,i,W]}class vs extends Ze{constructor(e){super(),Je(this,e,bs,ms,Be,{height:5,width:6,itemCount:7,itemSize:8,estimatedItemSize:9,stickyIndices:10,getKey:0,scrollDirection:11,scrollOffset:12,scrollToIndex:13,scrollToAlignment:14,scrollToBehaviour:15,overscanCount:16,recomputeSizes:17},null,[-1,-1])}get height(){return this.$$.ctx[5]}set height(e){this.$$set({height:e}),De()}get width(){return this.$$.ctx[6]}set width(e){this.$$set({width:e}),De()}get itemCount(){return this.$$.ctx[7]}set itemCount(e){this.$$set({itemCount:e}),De()}get itemSize(){return this.$$.ctx[8]}set itemSize(e){this.$$set({itemSize:e}),De()}get estimatedItemSize(){return this.$$.ctx[9]}set estimatedItemSize(e){this.$$set({estimatedItemSize:e}),De()}get stickyIndices(){return this.$$.ctx[10]}set stickyIndices(e){this.$$set({stickyIndices:e}),De()}get getKey(){return this.$$.ctx[0]}set getKey(e){this.$$set({getKey:e}),De()}get scrollDirection(){return this.$$.ctx[11]}set scrollDirection(e){this.$$set({scrollDirection:e}),De()}get scrollOffset(){return this.$$.ctx[12]}set scrollOffset(e){this.$$set({scrollOffset:e}),De()}get scrollToIndex(){return this.$$.ctx[13]}set scrollToIndex(e){this.$$set({scrollToIndex:e}),De()}get scrollToAlignment(){return this.$$.ctx[14]}set scrollToAlignment(e){this.$$set({scrollToAlignment:e}),De()}get scrollToBehaviour(){return this.$$.ctx[15]}set scrollToBehaviour(e){this.$$set({scrollToBehaviour:e}),De()}get overscanCount(){return this.$$.ctx[16]}set overscanCount(e){this.$$set({overscanCount:e}),De()}get recomputeSizes(){return this.$$.ctx[17]}}class en extends Error{constructor(e,n={}){super(`Node not found: ${e}`,n),this.name="NodeNotFoundError"}}class Vn extends Error{constructor(e){super(`Missing key: ${e}`),this.name="KeyError"}}const ws="modulepreload",ys=function(t){return"https://ome.github.io/ome2024-ngff-challenge/"+t},ki={},Dt=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.all(n.map(a=>{if(a=ys(a),a in ki)return;ki[a]=!0;const l=a.endsWith(".css"),h=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${h}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":ws,l||(u.as="script"),u.crossOrigin="",u.href=a,o&&u.setAttribute("nonce",o),document.head.appendChild(u),l)return new Promise((g,m)=>{u.addEventListener("load",g),u.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${a}`)))})}))}return r.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};var Ve;class wr{constructor(e,n,i){Te(this,Ve);typeof e=="number"?Ee(this,Ve,new Uint8Array(e)):e instanceof ArrayBuffer?Ee(this,Ve,new Uint8Array(e,n,i)):Ee(this,Ve,new Uint8Array(Array.from(e,r=>r?1:0)))}get BYTES_PER_ELEMENT(){return 1}get byteOffset(){return ee(this,Ve).byteOffset}get byteLength(){return ee(this,Ve).byteLength}get buffer(){return ee(this,Ve).buffer}get length(){return ee(this,Ve).length}get(e){let n=ee(this,Ve)[e];return typeof n=="number"?n!==0:n}set(e,n){ee(this,Ve)[e]=n?1:0}fill(e){ee(this,Ve).fill(e?1:0)}*[Symbol.iterator](){for(let e=0;e=0;i--)n[i]=r,r*=t[i];return n}function Ss(t){const e=t.length,n=globalThis.Array(e);for(let i=0,r=1;i["c",...i].join(n)}if(t==="v2"){const n=(e==null?void 0:e.separator)??".";return i=>i.join(n)||"0"}throw new Error(`Unknown chunk key encoding: ${t}`)}function Fn(t){var n;const e=t.find(i=>i.name==="transpose");return((n=e==null?void 0:e.configuration)==null?void 0:n.order)==="F"?"F":"C"}const Is=/^([<|>])(.*)$/;function Ts(t){if(t==="|O")return{data_type:"v2:object"};let e=t.match(Is);if(!e)throw new Error(`Invalid dtype: ${t}`);let[,n,i]=e,r={b1:"bool",i1:"int8",u1:"uint8",i2:"int16",u2:"uint16",i4:"int32",u4:"uint32",i8:"int64",u8:"uint64",f4:"float32",f8:"float64"}[i]??(i.startsWith("S")||i.startsWith("U")?`v2:${i}`:void 0);if(!r)throw new Error(`Unsupported or unknown dtype: ${t}`);return n==="|"?{data_type:r}:{data_type:r,endian:n==="<"?"little":"big"}}function zs(t,e={}){let n=[],i=Ts(t.dtype);t.order==="F"&&n.push({name:"transpose",configuration:{order:"F"}}),"endian"in i&&i.endian==="big"&&n.push({name:"bytes",configuration:{endian:"big"}});for(let{id:r,...s}of t.filters??[])n.push({name:r,configuration:s});if(t.compressor){let{id:r,...s}=t.compressor;n.push({name:r,configuration:s})}return{zarr_format:3,node_type:"array",shape:t.shape,data_type:i.data_type,chunk_grid:{name:"regular",configuration:{chunk_shape:t.chunks}},chunk_key_encoding:{name:"v2",configuration:{separator:t.dimension_separator??"."}},codecs:n,fill_value:t.fill_value,attributes:e}}function Os(t,e={}){return{zarr_format:3,node_type:"group",attributes:e}}function Rs(t,e){if(e!=="number"&&e!=="bigint"&&e!=="boolean"&&e!=="object"&&e!=="string")return t===e;let n=t==="bool";if(e==="boolean")return n;let i=t.startsWith("v2:U")||t.startsWith("v2:S");if(e==="string")return i;let r=t==="int64"||t==="uint64";if(e==="bigint")return r;let s=t==="v2:object";return e==="object"?s:!i&&!r&&!n&&!s}function Ls(t){return(t==null?void 0:t.name)==="sharding_indexed"}function kr(t){return(t.data_type==="uint64"||t.data_type==="int64")&&t.fill_value!=null?BigInt(t.fill_value):t.fill_value}const Ci=Ms();function Ms(){const t=new Uint32Array([305419896]);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)[0]!==18}function Si(t){return"BYTES_PER_ELEMENT"in t?t.BYTES_PER_ELEMENT:4}var xt,lt,Vt,Wt,It;const Qn=class Qn{constructor(e,n){oe(this,"kind","array_to_bytes");Te(this,xt);Te(this,lt);Te(this,Vt);Te(this,Wt);Te(this,It);Ee(this,It,e==null?void 0:e.endian),Ee(this,lt,yr(n.data_type)),Ee(this,Wt,n.shape),Ee(this,xt,pt(n.shape,Fn(n.codecs)));const i=new(ee(this,lt))(0);Ee(this,Vt,i.BYTES_PER_ELEMENT)}static fromConfig(e,n){return new Qn(e,n)}encode(e){let n=new Uint8Array(e.data.buffer);return Ci&&ee(this,It)==="big"&&Ei(n,Si(ee(this,lt))),n}decode(e){return Ci&&ee(this,It)==="big"&&Ei(e,Si(ee(this,lt))),{data:new(ee(this,lt))(e.buffer,e.byteOffset,e.byteLength/ee(this,Vt)),shape:ee(this,Wt),stride:ee(this,xt)}}};xt=new WeakMap,lt=new WeakMap,Vt=new WeakMap,Wt=new WeakMap,It=new WeakMap;let mn=Qn;class Hn{constructor(){oe(this,"kind","bytes_to_bytes")}static fromConfig(){return new Hn}encode(e){throw new Error("Not implemented")}decode(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength-4)}}function Fs(t,e){if(Number.isNaN(e))throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");if(e===Number.POSITIVE_INFINITY)throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");if(e===Number.NEGATIVE_INFINITY)throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");return e}function Ds(t,e){return e instanceof Object&&!Array.isArray(e)?Object.keys(e).sort().reduce((n,i)=>(n[i]=e[i],n),{}):e}var Ht,Gt;const Xn=class Xn{constructor(e={}){oe(this,"configuration");oe(this,"kind","array_to_bytes");Te(this,Ht);Te(this,Gt);this.configuration=e;const{encoding:n="utf-8",skipkeys:i=!1,ensure_ascii:r=!0,check_circular:s=!0,allow_nan:o=!0,sort_keys:a=!0,indent:l,strict:h=!0}=e;let u=e.separators;u||(l?u=[", ",": "]:u=[",",":"]),Ee(this,Ht,{encoding:n,skipkeys:i,ensure_ascii:r,check_circular:s,allow_nan:o,indent:l,separators:u,sort_keys:a}),Ee(this,Gt,{strict:h})}static fromConfig(e){return new Xn(e)}encode(e){const{indent:n,encoding:i,ensure_ascii:r,check_circular:s,allow_nan:o,sort_keys:a}=ee(this,Ht);if(i!=="utf-8")throw new Error("JsonCodec does not yet support non-utf-8 encoding.");const l=[];if(!s)throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");o||l.push(Fs),a&&l.push(Ds);const h=Array.from(e.data);h.push("|O"),h.push(e.shape);let u;l.length&&(u=(m,p)=>{let _=p;for(let E of l)_=E(m,_);return _});let g=JSON.stringify(h,u,n);return r&&(g=g.replace(/[\u007F-\uFFFF]/g,m=>{const p=`0000${m.charCodeAt(0).toString(16)}`;return`\\u${p.substring(p.length-4)}`})),new TextEncoder().encode(g)}decode(e){const{strict:n}=ee(this,Gt);if(!n)throw new Error("JsonCodec does not yet support non-strict decoding.");const i=tn(e),r=i.pop();if(i.pop(),!r)throw new Error("0D not implemented for JsonCodec.");const s=pt(r,"C");return{data:i,shape:r,stride:s}}};Ht=new WeakMap,Gt=new WeakMap;let Dn=Xn;function Ai(t){return t instanceof wr||t instanceof Wn||t instanceof qt?new Proxy(t,{get(n,i){return n.get(Number(i))},set(n,i,r){return n.set(Number(i),r),!0}}):t}function Ns(t,e){let n;return t.data instanceof Wn||t.data instanceof qt?n=new t.constructor(t.data.length,t.data.chars):n=new t.constructor(t.data.length),{data:n,shape:t.shape,stride:pt(t.shape,e)}}function Ps(t,e){let n=Ns(t,e),i=t.shape.length,r=t.data.length,s=Array(i).fill(0),o=Ai(t.data),a=Ai(n.data);for(let l=0;ln===e[i])?"C":"F"}class Gn{constructor(e){oe(this,"configuration");oe(this,"kind","array_to_array");this.configuration=e}static fromConfig(e){return new Gn(e)}encode(e){var n,i;return Us(e)===((n=this.configuration)==null?void 0:n.order)?e:Ps(e,((i=this.configuration)==null?void 0:i.order)??"C")}decode(e){return e}}var Kt,Jt;const $n=class $n{constructor(e){oe(this,"kind","array_to_bytes");Te(this,Kt);Te(this,Jt);Ee(this,Kt,e),Ee(this,Jt,pt(e,"C"))}static fromConfig(e,n){return new $n(n.shape)}encode(e){throw new Error("Method not implemented.")}decode(e){let n=new TextDecoder,i=new DataView(e.buffer),r=Array(i.getUint32(0,!0)),s=4;for(let o=0;oDt(()=>import("./blosc-E49GQuAK.js"),__vite__mapDeps([0,1])).then(t=>t.default)).set("gzip",()=>Dt(()=>import("./gzip-CF-9a_hd.js"),__vite__mapDeps([2,3])).then(t=>t.default)).set("lz4",()=>Dt(()=>import("./lz4-BIGKWw27.js"),__vite__mapDeps([4,1])).then(t=>t.default)).set("zlib",()=>Dt(()=>import("./zlib-CBiqHlio.js"),__vite__mapDeps([5,3])).then(t=>t.default)).set("zstd",()=>Dt(()=>import("./zstd-IvP746pw.js"),__vite__mapDeps([6,1])).then(t=>t.default)).set("transpose",()=>Gn).set("bytes",()=>mn).set("crc32c",()=>Hn).set("vlen-utf8",()=>Nn).set("json2",()=>Dn)}const js=Bs();function Pn(t){let e;return{async encode(n){e||(e=await Ii(t));for(const r of e.array_to_array)n=await r.encode(n);let i=await e.array_to_bytes.encode(n);for(const r of e.bytes_to_bytes)i=await r.encode(i);return i},async decode(n){e||(e=await Ii(t));for(let r=e.bytes_to_bytes.length-1;r>=0;r--)n=await e.bytes_to_bytes[r].decode(n);let i=await e.array_to_bytes.decode(n);for(let r=e.array_to_array.length-1;r>=0;r--)i=await e.array_to_array[r].decode(i);return i}}}async function Ii(t){let e=t.codecs.map(async s=>{var a;let o=await((a=js.get(s.name))==null?void 0:a());if(!o)throw new Error(`Unknown codec: ${s.name}`);return{Codec:o,meta:s}}),n=[],i,r=[];for await(let{Codec:s,meta:o}of e){let a=s.fromConfig(o.configuration,t);switch(a.kind){case"array_to_array":n.push(a);break;case"array_to_bytes":i=a;break;default:r.push(a)}}if(!i){if(!qs(t))throw new Error(`Cannot encode ${t.data_type} to bytes without a codec`);i=mn.fromConfig({endian:"little"},t)}return{array_to_array:n,array_to_bytes:i,bytes_to_bytes:r}}function qs(t){return t.data_type!=="v2:object"}const Ti=18446744073709551615n;function xs(t,e,n,i){if(t.store.getRange===void 0)throw new Error("Store does not support range requests");let r=t.store.getRange.bind(t.store),s=e.map((l,h)=>l/i.chunk_shape[h]),o=Pn({data_type:"uint64",shape:[...s,2],codecs:i.index_codecs}),a={};return async l=>{let h=l.map((M,Y)=>Math.floor(M/s[Y])),u=t.resolve(n(h)).path,g;if(u in a)g=a[u];else{let M=4,Y=16*s.reduce((X,J)=>X*J,1),G=await r(u,{suffixLength:Y+M});g=a[u]=G?await o.decode(G):null}if(g===null)return;let{data:m,shape:p,stride:_}=g,E=l.map((M,Y)=>M%p[Y]).reduce((M,Y,G)=>M+Y*_[G],0),N=m[E],O=m[E+1];if(!(N===Ti&&O===Ti))return r(u,{offset:Number(N),length:Number(O)})}}class Rt{constructor(e,n="/"){oe(this,"store");oe(this,"path");this.store=e,this.path=n}resolve(e){let n=new URL(`file://${this.path.endsWith("/")?this.path:`${this.path}/`}`);return new Rt(this.store,new URL(e,n).pathname)}}var Zt;class Kn extends Rt{constructor(n,i,r){super(n,i);oe(this,"kind","group");Te(this,Zt);Ee(this,Zt,r)}get attrs(){return ee(this,Zt).attributes}}Zt=new WeakMap;const Pt=Symbol("zarrita.context");function Vs(t){return t[Pt]}function Ws(t,e){let{configuration:n}=e.codecs.find(Ls)??{},i={encode_chunk_key:As(e.chunk_key_encoding),TypedArray:yr(e.data_type),fill_value:e.fill_value};if(n){let s=Fn(n.codecs);return{...i,kind:"sharded",chunk_shape:n.chunk_shape,codec:Pn({data_type:e.data_type,shape:n.chunk_shape,codecs:n.codecs}),get_strides(o,a){return pt(o,a??s)},get_chunk_bytes:xs(t,e.chunk_grid.configuration.chunk_shape,i.encode_chunk_key,n)}}let r=Fn(e.codecs);return{...i,kind:"regular",chunk_shape:e.chunk_grid.configuration.chunk_shape,codec:Pn({data_type:e.data_type,shape:e.chunk_grid.configuration.chunk_shape,codecs:e.codecs}),get_strides(s,o){return pt(s,o??r)},async get_chunk_bytes(s,o){let a=i.encode_chunk_key(s),l=t.resolve(a).path;return t.store.get(l,o)}}}var or,lr,mt,ar;let pn=(ar=class extends(lr=Rt,or=Pt,lr){constructor(n,i,r){super(n,i);oe(this,"kind","array");Te(this,mt);oe(this,or);Ee(this,mt,{...r,fill_value:kr(r)}),this[Pt]=Ws(this,r)}get attrs(){return ee(this,mt).attributes}get shape(){return ee(this,mt).shape}get chunks(){return this[Pt].chunk_shape}get dtype(){return ee(this,mt).data_type}async getChunk(n,i){let r=this[Pt],s=await r.get_chunk_bytes(n,i);if(!s){let o=r.chunk_shape.reduce((l,h)=>l*h,1),a=new r.TypedArray(o);return a.fill(r.fill_value),{data:a,shape:r.chunk_shape,stride:r.get_strides(r.chunk_shape)}}return r.codec.decode(s)}is(n){return Rs(this.dtype,n)}},mt=new WeakMap,ar),vn=Hs();function Hs(){let t=new WeakMap;function e(n){let i=t.get(n)??{v2:0,v3:0};return t.set(n,i),i}return{increment(n,i){e(n)[i]+=1},version_max(n){let i=e(n);return i.v3>i.v2?"v3":"v2"}}}async function Gs(t){let e=await t.store.get(t.resolve(".zattrs").path);return e?tn(e):{}}async function Ks(t,e={}){let n="store"in t?t:new Rt(t),i={};return(e.attrs??!0)&&(i=await Gs(n)),e.kind==="array"?zi(n,i):e.kind==="group"?Oi(n,i):zi(n,i).catch(r=>{if(r instanceof en)return Oi(n,i);throw r})}async function zi(t,e){let{path:n}=t.resolve(".zarray"),i=await t.store.get(n);if(!i)throw new en("v2 array",{cause:new Vn(n)});return vn.increment(t.store,"v2"),new pn(t.store,t.path,zs(tn(i),e))}async function Oi(t,e){let{path:n}=t.resolve(".zgroup"),i=await t.store.get(n);if(!i)throw new en("v2 group",{cause:new Vn(n)});return vn.increment(t.store,"v2"),new Kn(t.store,t.path,Os(tn(i),e))}async function Js(t){let{store:e,path:n}=t.resolve("zarr.json"),i=await t.store.get(n);if(!i)throw new en("v3 array or group",{cause:new Vn(n)});let r=tn(i);return r.node_type==="array"&&(r.fill_value=kr(r)),r.node_type==="array"?new pn(e,t.path,r):new Kn(e,t.path,r)}async function Zs(t,e={}){let n="store"in t?t:new Rt(t),i=await Js(n);if(vn.increment(n.store,"v3"),e.kind===void 0||e.kind==="array"&&i instanceof pn||e.kind==="group"&&i instanceof Kn)return i;let r=i instanceof pn?"array":"group";throw new Error(`Expected node of kind ${e.kind}, found ${r}.`)}async function gt(t,e={}){let n="store"in t?t.store:t,i=vn.version_max(n),r=i==="v2"?gt.v2:gt.v3,s=i==="v2"?gt.v3:gt.v2;return r(t,e).catch(o=>{if(o instanceof en)return s(t,e);throw o})}gt.v2=Ks;gt.v3=Zs;function*Ys(t,e,n=1){e===void 0&&(e=t,t=0);for(let i=t;ii[Symbol.iterator]()),n=e.map(i=>i.next());if(n.some(i=>i.done))throw new Error("Input contains an empty iterator.");for(let i=0;;){if(n[i].done){if(e[i]=t[i][Symbol.iterator](),n[i]=e[i].next(),++i>=e.length)return}else yield n.map(({value:r})=>r),i=0;n[i]=e[i].next()}}function Xs({start:t,stop:e,step:n},i){if(n===0)throw new Error("slice step cannot be zero");n=n??1;const r=n<0,[s,o]=r?[-1,i-1]:[0,i];return t===null?t=r?o:s:t<0?(t+=i,to&&(t=o),e===null?e=r?s:o:e<0?(e+=i,eo&&(e=o),[t,e,n]}function Un(t,e,n=null){return e===void 0&&(e=t,t=null),{start:t,stop:e,step:n}}function $s(){const t=[];return{add:e=>t.push(e()),onIdle:()=>Promise.all(t)}}class Jn extends Error{constructor(e){super(e),this.name="IndexError"}}function eo(t,e){throw new Jn(`too many indicies for array; expected ${e.length}, got ${t.length}`)}function to(t){throw new Jn(`index out of bounds for dimension with length ${t}`)}function no(){throw new Jn("only slices with step >= 1 are supported")}function io(t,e){t.length>e.length&&eo(t,e)}function ro(t,e){return t=Math.trunc(t),t<0&&(t=e+t),(t>=e||t<0)&&to(e),t}class so{constructor({dim_sel:e,dim_len:n,dim_chunk_len:i}){oe(this,"dim_sel");oe(this,"dim_len");oe(this,"dim_chunk_len");oe(this,"nitems");e=ro(e,n),this.dim_sel=e,this.dim_len=n,this.dim_chunk_len=i,this.nitems=1}*[Symbol.iterator](){const e=Math.floor(this.dim_sel/this.dim_chunk_len),n=e*this.dim_chunk_len,i=this.dim_sel-n;yield{dim_chunk_ix:e,dim_chunk_sel:i}}}class Ri{constructor({dim_sel:e,dim_len:n,dim_chunk_len:i}){oe(this,"start");oe(this,"stop");oe(this,"step");oe(this,"dim_len");oe(this,"dim_chunk_len");oe(this,"nitems");oe(this,"nchunks");const[r,s,o]=Xs(e,n);this.start=r,this.stop=s,this.step=o,this.step<1&&no(),this.dim_len=n,this.dim_chunk_len=i,this.nitems=Math.max(0,Math.ceil((this.stop-this.start)/this.step)),this.nchunks=Math.ceil(this.dim_len/this.dim_chunk_len)}*[Symbol.iterator](){const e=Math.floor(this.start/this.dim_chunk_len),n=Math.ceil(this.stop/this.dim_chunk_len);for(const i of Ys(e,n)){const r=i*this.dim_chunk_len,s=Math.min(this.dim_len,(i+1)*this.dim_chunk_len),o=s-r;let a=0,l=0;if(this.starts?o:this.stop-r,u=[l,h,this.step],g=Math.ceil((h-l)/this.step),m=[a,a+g,1];yield{dim_chunk_ix:i,dim_chunk_sel:u,dim_out_sel:m}}}}function oo(t,e){let n=[];return t===null?n=e.map(i=>Un(null)):Array.isArray(t)&&(n=t.map(i=>i??Un(null))),io(n,e),n}class lo{constructor({selection:e,shape:n,chunk_shape:i}){oe(this,"dim_indexers");oe(this,"shape");this.dim_indexers=oo(e,n).map((r,s)=>new(typeof r=="number"?so:Ri)({dim_sel:r,dim_len:n[s],dim_chunk_len:i[s]})),this.shape=this.dim_indexers.filter(r=>r instanceof Ri).map(r=>r.nitems)}*[Symbol.iterator](){for(const e of Qs(...this.dim_indexers)){const n=e.map(r=>r.dim_chunk_ix),i=e.map(r=>"dim_out_sel"in r?{from:r.dim_chunk_sel,to:r.dim_out_sel}:{from:r.dim_chunk_sel,to:null});yield{chunk_coords:n,mapping:i}}}}function ao(t,e){return"get"in t?t.get(e):t[e]}async function uo(t,e,n,i){var l;let r=Vs(t),s=new lo({selection:e,shape:t.shape,chunk_shape:t.chunks}),o=i.prepare(new r.TypedArray(s.shape.reduce((h,u)=>h*u,1)),s.shape,r.get_strides(s.shape,n.order)),a=((l=n.create_queue)==null?void 0:l.call(n))??$s();for(const{chunk_coords:h,mapping:u}of s)a.add(async()=>{let{data:g,shape:m,stride:p}=await t.getChunk(h,n.opts),_=i.prepare(g,m,p);i.set_from_chunk(o,_,u)});return await a.onIdle(),s.shape.length===0?ao(o.data,0):o}function Zn(t,e=0,n){let i=n??t.length-e;return{length:i,subarray(r,s=i){return Zn(t,e+r,s-r)},set(r,s=0){for(let o=0;o1?g=u/o:o<1&&(u=g*o);let m=u,p=g,_=!0;const E=new AbortController;async function N(){var R;let M=r.multiscales[0].datasets.map(F=>F.path),Y=r.multiscales[0].axes.map(F=>F.name),G=M.at(-1);s!=null&&sl*l){console.log("Lowest resolution too large for Thumbnail: ",f,i);return}let c=f.length,k=f[I]||1,z,T;(R=r==null?void 0:r.omero)!=null&&R.channels?(z=r.omero.channels.map(F=>F.active),T=r.omero.channels.map(F=>mr(F.color))):(z=rs(k),T=ss(k,z)),T=T.filter((F,te)=>z[te]);let j=z.reduce((F,te,A)=>(te&&F.push(A),F),[]).map(F=>{let te=f.map((A,W)=>W==I?F:W>=c-2?Un(0,A):Y[W]=="z"||Y[W]=="t"?parseInt(A/2+""):0);return _o(J,te,{opts:{signal:E.signal}})}),Q=await Promise.all(j),B=Q.map(F=>gr(F)),w=$r(Q,B,T);n(1,u=f.at(-1)),n(2,g=f.at(-2));let S=u/a;g>u&&(S=g/a),n(3,m=u/S),n(4,p=g/S),setTimeout(()=>{const F=h.getContext("2d");n(5,_=!1),F.putImageData(new ImageData(w,u,g),0,0)},100)}$t(()=>{N()}),xn(()=>{E.abort()});function O(M){Tt[M?"unshift":"push"](()=>{h=M,n(0,h)})}return t.$$set=M=>{"source"in M&&n(6,i=M.source),"attrs"in M&&n(7,r=M.attrs),"thumbDatasetIndex"in M&&n(8,s=M.thumbDatasetIndex),"thumbAspectRatio"in M&&n(9,o=M.thumbAspectRatio),"cssSize"in M&&n(10,a=M.cssSize),"max_size"in M&&n(11,l=M.max_size)},[h,u,g,m,p,_,i,r,s,o,a,l,O]}class Sr extends Ze{constructor(e){super(),Je(this,e,vo,bo,Be,{source:6,attrs:7,thumbDatasetIndex:8,thumbAspectRatio:9,cssSize:10,max_size:11})}}function Fi(t,e,n){const i=t.slice();return i[12]=e[n],i}function Di(t){let e,n;return e=new Sr({props:{source:t[4],attrs:t[3],max_size:2e3,thumbDatasetIndex:t[5],thumbAspectRatio:t[6]}}),{c(){Ke(e.$$.fragment)},m(i,r){We(e,i,r),n=!0},p(i,r){const s={};r&16&&(s.source=i[4]),r&8&&(s.attrs=i[3]),r&32&&(s.thumbDatasetIndex=i[5]),r&64&&(s.thumbAspectRatio=i[6]),e.$set(s)},i(i){n||(re(e.$$.fragment,i),n=!0)},o(i){he(e.$$.fragment,i),n=!1},d(i){He(e,i)}}}function Ni(t){let e,n,i,r,s,o,a,l=t[0].source+"",h,u,g=t[0].csv&&Pi(t);return{c(){e=y("div"),n=y("span"),n.textContent="Data",i=V(),g&&g.c(),r=V(),s=y("span"),s.textContent="provided by",o=V(),a=y("strong"),h=U(l),u=U("."),b(n,"class","hideOnSmall svelte-afrxqy"),b(s,"class","hideOnSmall svelte-afrxqy"),ae(a,"color","grey")},m(m,p){x(m,e,p),d(e,n),d(e,i),g&&g.m(e,null),d(e,r),d(e,s),d(e,o),d(e,a),d(a,h),d(e,u)},p(m,p){m[0].csv?g?g.p(m,p):(g=Pi(m),g.c(),g.m(e,r)):g&&(g.d(1),g=null),p&1&&l!==(l=m[0].source+"")&&me(h,l)},d(m){m&&q(e),g&&g.d()}}}function Pi(t){var a;let e,n,i,r=((a=t[0].csv)==null?void 0:a.split("/").pop().replace(".csv",""))+"",s,o;return{c(){e=y("span"),e.textContent="from collection",n=V(),i=y("a"),s=U(r),b(e,"class","hideOnSmall svelte-afrxqy"),b(i,"title","Show collection in a new tab"),b(i,"href",o=qi(t[0])),b(i,"target","_blank")},m(l,h){x(l,e,h),x(l,n,h),x(l,i,h),d(i,s)},p(l,h){var u;h&1&&r!==(r=((u=l[0].csv)==null?void 0:u.split("/").pop().replace(".csv",""))+"")&&me(s,r),h&1&&o!==(o=qi(l[0]))&&b(i,"href",o)},d(l){l&&(q(e),q(n),q(i))}}}function Ui(t){let e,n,i,r,s,o;return{c(){e=U("Browse "),n=y("a"),i=U("Original data"),o=U("."),b(n,"title",r="Link to original data: "+t[0].origin),b(n,"href",s=t[0].origin),b(n,"target","_blank")},m(a,l){x(a,e,l),x(a,n,l),d(n,i),x(a,o,l)},p(a,l){l&1&&r!==(r="Link to original data: "+a[0].origin)&&b(n,"title",r),l&1&&s!==(s=a[0].origin)&&b(n,"href",s)},d(a){a&&(q(e),q(n),q(o))}}}function Bi(t){let e=t[12].toUpperCase()+"",n,i,r=t[0][`size_${t[12]}`]+"",s,o;return{c(){n=U(e),i=U(":"),s=U(r),o=U(" ")},m(a,l){x(a,n,l),x(a,i,l),x(a,s,l),x(a,o,l)},p(a,l){l&1&&r!==(r=a[0][`size_${a[12]}`]+"")&&me(s,r)},d(a){a&&(q(n),q(i),q(s),q(o))}}}function ji(t){let e,n=t[0][`size_${t[12]}`]!==void 0&&Bi(t);return{c(){n&&n.c(),e=bn()},m(i,r){n&&n.m(i,r),x(i,e,r)},p(i,r){i[0][`size_${i[12]}`]!==void 0?n?n.p(i,r):(n=Bi(i),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(i){i&&q(e),n&&n.d(i)}}}function wo(t){let e,n,i=ut(t[0].written)+"",r;return{c(){e=y("div"),n=U("Data size: "),r=U(i)},m(s,o){x(s,e,o),d(e,n),d(e,r)},p(s,o){o&1&&i!==(i=ut(s[0].written)+"")&&me(r,i)},d(s){s&&q(e)}}}function yo(t){let e,n,i=t[0].shards+"",r;return{c(){e=y("div"),n=U("Shard shape: "),r=U(i)},m(s,o){x(s,e,o),d(e,n),d(e,r)},p(s,o){o&1&&i!==(i=s[0].shards+"")&&me(r,i)},d(s){s&&q(e)}}}function ko(t){let e,n,i=t[0].chunks+"",r;return{c(){e=y("div"),n=U("Chunk shape: "),r=U(i)},m(s,o){x(s,e,o),d(e,n),d(e,r)},p(s,o){o&1&&i!==(i=s[0].chunks+"")&&me(r,i)},d(s){s&&q(e)}}}function Eo(t){let e,n,i,r,s,o,a=t[9](t[0].url)+"",l,h,u,g=(t[0].name?t[0].name.replaceAll(t[1],`${t[1]}`):"")+"",m,p,_,E=t[7].replaceAll(t[1],`${t[1]}`)+"",N,O,M,Y,G,X,J,I,f,c,k,z,T,L,j,Q,B=t[3]&&Di(t),w=t[0].source&&Ni(t),S=t[0].origin&&Ui(t),R=Ne(["t","c","z","y","x"]),F=[];for(let v=0;v<5;v+=1)F[v]=ji(Fi(t,R,v));function te(v,D){return v[2]=="chunk_pixels"?ko:v[2]=="shard_pixels"?yo:wo}let A=te(t),W=A(t);return{c(){e=y("div"),n=y("div"),B&&B.c(),i=V(),r=y("div"),s=y("div"),o=y("strong"),h=V(),u=y("div"),p=V(),_=y("div"),N=V(),w&&w.c(),O=V(),M=y("div"),Y=U("Open in "),G=y("a"),X=U("OME-Validator."),f=V(),S&&S.c(),c=V(),k=y("div"),z=U(`Image size:
+`);var w=0,S=!1;this.parse=function(R,F,te){if(typeof R!="string")throw new Error("Input must be a string");var A=R.length,W=k.length,v=z.length,D=T.length,H=I(L),ne=[],ie=[],P=[],Z=w=0;if(!R)return Me();if(f.header&&!F){var ue=R.split(z)[0].split(k),de=[],$={},pe=!1;for(var _e in ue){var ce=ue[_e];I(f.transformHeader)&&(ce=f.transformHeader(ce,_e));var Pe=ce,be=$[ce]||0;for(0=j)return Me(!0)}else for(le=w,w++;;){if((le=R.indexOf(c,le+1))===-1)return te||ie.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ne.length,index:w}),Se();if(le===A-1)return Se(R.substring(w,le).replace(Ye,c));if(c!==B||R[le+1]!==B){if(c===B||le===0||R[le-1]!==B){se!==-1&&se=j)return Me(!0);break}ie.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ne.length,index:w}),le++}}else le++}return Se();function Qe(Ie){ne.push(Ie),Z=w}function Re(Ie){var nt=0;if(Ie!==-1){var Xe=R.substring(le+1,Ie);Xe&&Xe.trim()===""&&(nt=Xe.length)}return nt}function Se(Ie){return te||(Ie===void 0&&(Ie=R.substring(w)),P.push(Ie),w=A,Qe(P),H&&ct()),Me()}function Le(Ie){w=Ie,Qe(P),P=[],ve=R.indexOf(z,w)}function Me(Ie){return{data:ne,errors:ie,meta:{delimiter:k,linebreak:z,aborted:S,truncated:!!Ie,cursor:Z+(F||0)}}}function ct(){L(Me()),ne=[],ie=[]}},this.abort=function(){S=!0},this.getCharIndex=function(){return w}}function M(f){var c=f.data,k=o[c.workerId],z=!1;if(c.error)k.userError(c.error,c.file);else if(c.results&&c.results.data){var T={abort:function(){z=!0,Y(c.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:G,resume:G};if(I(k.userStep)){for(var L=0;L1&&(r=s,i.data.shift());let o=i.data.map(p=>{let _={...n};for(let E=0;E{var _;return!((_=p.url)!=null&&_.endsWith(".csv"))}),l={};a.forEach(p=>{if(l[p.url]){console.warn("Removing duplicate URL:",p.url);return}l[p.url]=p}),a=Object.values(l);let h=o.filter(p=>{var _;return(_=p.url)==null?void 0:_.includes(".csv")}),u=a.reduce((p,_)=>_.wells?p+1:p,0),g=a.reduce((p,_)=>p+parseInt(_.written||0),0),m=a.length;u>0&&(m=a.reduce((p,_)=>p+parseInt(_.images||1),0)),e.addCsv(t,h,m,u,g),e.addRows(a),h.forEach(p=>{let _=p.url;p.csv=_,dr(_,e,p)})}})}async function _r(t){return await fetch(t).then(e=>e.json())}function ut(t){if(!t)return"";const e=2;return t<1024?t+" B":t<1024*1024?(t/1024).toFixed(e)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(e)+" MB":t<1024*1024*1024*1024?(t/(1024*1024*1024)).toFixed(e)+" GB":t<1024*1024*1024*1024*1024?(t/(1024*1024*1024*1024)).toFixed(e)+" TB":(t/(1024*1024*1024*1024*1024)).toFixed(e)+" PB"}function Xr(t,e){return Array.from({length:e-t},(n,i)=>i+t)}function $r(t,e,n){const i=t[0].shape,r=i[0],s=i[1],o=r*s;e||(e=t.map(gr));let a=performance.now(),l=new Uint8ClampedArray(4*r*s).fill(0),h=0;for(let u=0;u100*s/r),n}function gr(t){const e=t.data;let n=0,i=1/0,r=t.data.length;for(let s=0;sr?s:[]);for(const[r,s]of i.entries())n[s]=_i[r]}return n.map(mr)}function mr(t){t.startsWith("#")&&(t=t.slice(1));const e=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16);return[e,n,i]}class pr{constructor(){this.store=Mn({})}async lookupOntologyTerm(e){let n=e.replace("NCBI:txid","");return(await _r(`https://rest.ensembl.org/taxonomy/id/${n}?content-type=application/json`)).name||e}addTerms(e){let n=Nt(this.store);[...new Set(e)].forEach(r=>{r&&(n[r]||(n[r]="Loading...",setTimeout(()=>{this.lookupOntologyTerm(r).then(s=>{this.addEntry(r,s)})},Math.random()*5e3)))})}addEntry(e,n){this.store.update(i=>(i[e]=n,i))}subscribe(e){return this.store.subscribe(e)}}class os extends pr{constructor(){super()}async lookupOntologyTerm(e){const n=e.replace("obo:","");return(await _r(`https://www.ebi.ac.uk/ols4/api/ontologies/fbbi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252F${n}`)).label||e}}const br=new pr,vr=new os,gi=5;async function jt(t,e){var r;let n=await fetch(`${t}/zarr.json`,{signal:e}).then(s=>{if(s.status===404)throw new Error(`${t}/zarr.json not found`);return s.json()}).catch(s=>[void 0,t]);const i=(r=n==null?void 0:n.attributes)==null?void 0:r.ome;if(!i)return[void 0,t];if(i.multiscales)return[i,t];if(i.plate){let s=i.plate.wells[0],o=`${t}/${s.path}/0`,[a,l]=await jt(o);return[a,l,i.plate]}else if(i["bioformats2raw.layout"]){let s=`${t}/0`;return await jt(s)}}class ls{constructor(e="index",n=!0){this.store=Mn([]),this.selectedRow=Mn(null),this.sortColumn=e,this.sortAscending=n,this.csvFiles=[]}getCsvSourceList(e){let n;if(!e)n=this.csvFiles[0];else for(let r of this.csvFiles){if(r.source===e){n=r;break}for(let s of r.child_csv){if(s.source===e){n=s;break}for(let o of s.child_csv)if(o.source===e){n=o;break}}}return n?n.child_csv.map(r=>{let s=r.image_count||0,o=r.plate_count||0,a=r.bytes||0;for(let l of r.child_csv)s+=l.image_count||0,o+=l.plate_count||0,a+=l.bytes||0;return{...r,image_count:s,plate_count:o,bytes:a}}):[]}addCsv(e,n,i,r,s){n=n.map(a=>({...a,child_csv:[]}));let o;for(let a of this.csvFiles){if(a.url===e){o=a;break}for(let l of a.child_csv){if(l.url===e){o=l;break}for(let h of l.child_csv)if(h.url===e){o=h;break}}}o?(o.image_count=i,o.plate_count=r,o.bytes=s,o.child_csv=n):(o={url:e,image_count:i,plate_count:r,bytes:s,child_csv:n},this.csvFiles.push(o))}addRows(e){e=e.map((r,s)=>{if(r.written&&(r.written=parseFloat(r.written)),r.shape){let o=r.shape.split(",").map(l=>parseInt(l)),a;r.dimension_names?a=r.dimension_names.split(","):o.length==5&&(a=["t","c","z","y","x"]),a&&a.length==o.length&&a.forEach((l,h)=>r["size_"+l]=o[h]),r.dim_count=o.reduce((l,h)=>l+(h>1?1:0),0)}if(r.chunks){let o=r.chunks.split(",").map(a=>parseInt(a));r.chunk_pixels=o.reduce((a,l)=>a*l,1)}if(r.shards){let o=r.shards.split(",").map(a=>parseInt(a));r.shard_pixels=o.reduce((a,l)=>a*l,1)}return r.index=Math.random()*(1+s),r}),console.log("Adding rows",e),this.store.update(r=>(r.push(...e),r.sort((s,o)=>this.compareRows(s,o,!0)),r));let n=e.map(r=>r.organismId);br.addTerms(n);let i=e.map(r=>r.fbbiId);vr.addTerms(i)}populateRow(e,n){this.store.update(i=>(i=i.map(r=>(r.url===e&&(r={...r,...n}),r)),i))}async loadNgffMetadata(e){var m;const[n,i,r]=await jt(e);let s=[],o=0,a=0,l=!1,h=!0,u={multiscales:n},g=i;if(r&&(o=r.wells.length,a=r.field_count||1),n){const p=(m=n[0])==null?void 0:m.datasets[0],_=p==null?void 0:p.path;if(_){const E=await fetch(`${i}/${_}/zarr.json`).then(N=>N.json()).catch(N=>{console.log(`----> Failed to parse ${i}/${_}/zarr.json`,N)});s=E==null?void 0:E.shape}}else console.log("No multiscales found"),l=!0,s=[0];this.populateRow(e,{image_attrs:u,image_url:g,shape:s,well_count:o,field_count:a,load_failed:l,loaded:h})}async loadRocrateJsonAllRows(){let e=Nt(this.store);for(let n=0;nthis.loadRocrateJson(e[r].url));await Promise.all(i)}}compareRows(e,n,i=!1){let r=e[this.sortColumn],s=n[this.sortColumn];if(i)return r===void 0&&(r=0),s===void 0&&(s=0),rs?this.sortAscending?1:-1:0;r===void 0&&(r=""),s===void 0&&(s="");let o=0;return i?o=r-s:o=r.localeCompare(s),this.sortAscending?o:-o}sortTable(e,n=!0){console.log("sortTable",e,n),this.sortColumn=e,this.sortAscending=n;let i=this.isColumnNumeric(e);this.store.update(r=>(r.sort((s,o)=>this.compareRows(s,o,i)),r))}isColumnNumeric(e){let n=Nt(this.store);for(let i of n){let r=i[e];if(r!==void 0&&r!=="")return!isNaN(r)}}emptyTable(){this.store.set([])}subscribe(e){return this.store.subscribe(e)}getRows(){return Nt(this.store)}getRow(e){return Nt(this.store)[e]}subscribeSelectedRow(e){return this.selectedRow.subscribe(e)}setSelectedRow(e){this.selectedRow.set(e)}}const Ae=new ls;function as(t){let e,n,i,r,s,o;return{c(){e=y("button"),n=y("span"),n.textContent="^",i=V(),r=y("span"),r.textContent="^",b(n,"class","acc svelte-17vd65t"),Et(n,"strong",t[1]),b(r,"class","dec svelte-17vd65t"),Et(r,"strong",!t[1]),b(e,"class","svelte-17vd65t")},m(a,l){x(a,e,l),d(e,n),d(e,i),d(e,r),s||(o=we(e,"click",t[2]),s=!0)},p(a,[l]){l&2&&Et(n,"strong",a[1]),l&2&&Et(r,"strong",!a[1])},i:ke,o:ke,d(a){a&&q(e),s=!1,o()}}}function us(t,e,n){let{toggleAscending:i}=e,{sortAscending:r}=e;const s=()=>i();return t.$$set=o=>{"toggleAscending"in o&&n(0,i=o.toggleAscending),"sortAscending"in o&&n(1,r=o.sortAscending)},[i,r,s]}class cs extends Ze{constructor(e){super(),Je(this,e,us,as,Be,{toggleAscending:0,sortAscending:1})}}const cn={AUTO:"auto",START:"start",CENTER:"center",END:"end"},rt={HORIZONTAL:"horizontal",VERTICAL:"vertical"},Ft={OBSERVED:0,REQUESTED:1},fs={[rt.VERTICAL]:"top",[rt.HORIZONTAL]:"left"},mi={[rt.VERTICAL]:"scrollTop",[rt.HORIZONTAL]:"scrollLeft"};class hs{constructor({itemSize:e,itemCount:n,estimatedItemSize:i}){this.itemSize=e,this.itemCount=n,this.estimatedItemSize=i,this.itemSizeAndPositionData={},this.lastMeasuredIndex=-1,this.checkForMismatchItemSizeAndItemCount(),this.justInTime||this.computeTotalSizeAndPositionData()}get justInTime(){return typeof this.itemSize=="function"}updateConfig({itemSize:e,itemCount:n,estimatedItemSize:i}){n!=null&&(this.itemCount=n),i!=null&&(this.estimatedItemSize=i),e!=null&&(this.itemSize=e),this.checkForMismatchItemSizeAndItemCount(),this.justInTime&&this.totalSize!=null?this.totalSize=void 0:this.computeTotalSizeAndPositionData()}checkForMismatchItemSizeAndItemCount(){if(Array.isArray(this.itemSize)&&this.itemSize.length=this.itemCount)throw Error(`Requested index ${e} is outside of range 0..${this.itemCount}`);return this.justInTime?this.getJustInTimeSizeAndPositionForIndex(e):this.itemSizeAndPositionData[e]}getJustInTimeSizeAndPositionForIndex(e){if(e>this.lastMeasuredIndex){const n=this.getSizeAndPositionOfLastMeasuredItem();let i=n.offset+n.size;for(let r=this.lastMeasuredIndex+1;r<=e;r++){const s=this.getSize(r);if(s==null||isNaN(s))throw Error(`Invalid size returned for index ${r} of value ${s}`);this.itemSizeAndPositionData[r]={offset:i,size:s},i+=s}this.lastMeasuredIndex=e}return this.itemSizeAndPositionData[e]}getSizeAndPositionOfLastMeasuredItem(){return this.lastMeasuredIndex>=0?this.itemSizeAndPositionData[this.lastMeasuredIndex]:{offset:0,size:0}}getTotalSize(){if(this.totalSize)return this.totalSize;const e=this.getSizeAndPositionOfLastMeasuredItem();return e.offset+e.size+(this.itemCount-this.lastMeasuredIndex-1)*this.estimatedItemSize}getUpdatedOffsetForIndex({align:e=cn.START,containerSize:n,currentOffset:i,targetIndex:r}){if(n<=0)return 0;const s=this.getSizeAndPositionForIndex(r),o=s.offset,a=o-n+s.size;let l;switch(e){case cn.END:l=a;break;case cn.CENTER:l=o-(n-s.size)/2;break;case cn.START:l=o;break;default:l=Math.max(a,Math.min(o,i))}const h=this.getTotalSize();return Math.max(0,Math.min(h-n,l))}getVisibleRange({containerSize:e=0,offset:n,overscanCount:i}){if(this.getTotalSize()===0)return{};const s=n+e;let o=this.findNearestItem(n);if(o===void 0)throw Error(`Invalid offset ${n} specified`);const a=this.getSizeAndPositionForIndex(o);n=a.offset+a.size;let l=o;for(;n=e?this.binarySearch({high:i,low:0,offset:e}):this.exponentialSearch({index:i,offset:e})}binarySearch({low:e,high:n,offset:i}){let r=0,s=0;for(;e<=n;){if(r=e+Math.floor((n-e)/2),s=this.getSizeAndPositionForIndex(r).offset,s===i)return r;si&&(n=r-1)}return e>0?e-1:0}exponentialSearch({index:e,offset:n}){let i=1;for(;e({}),pi=t=>({});function bi(t,e,n){const i=t.slice();return i[37]=e[n],i}const _s=t=>({style:t[0]&4,index:t[0]&4}),vi=t=>({style:t[37].style,index:t[37].index}),gs=t=>({}),wi=t=>({});function yi(t,e){let n,i;const r=e[21].item,s=Tn(r,e,e[20],vi);return{key:t,first:null,c(){n=bn(),s&&s.c(),this.first=n},m(o,a){x(o,n,a),s&&s.m(o,a),i=!0},p(o,a){e=o,s&&s.p&&(!i||a[0]&1048580)&&On(s,r,e,e[20],i?zn(r,e[20],a,_s):Rn(e[20]),vi)},i(o){i||(re(s,o),i=!0)},o(o){he(s,o),i=!1},d(o){o&&q(n),s&&s.d(o)}}}function ms(t){let e,n,i,r=[],s=new Map,o,a;const l=t[21].header,h=Tn(l,t,t[20],wi);let u=Ne(t[2]);const g=_=>_[0]?_[0](_[37].index):_[37].index;for(let _=0;_{let t=!1;try{const e=Object.defineProperty({},"passive",{get(){return t={passive:!0},!0}});window.addEventListener("testpassive",e,e),window.remove("testpassive",e,e)}catch{}return t})();function bs(t,e,n){let{$$slots:i={},$$scope:r}=e,{height:s}=e,{width:o="100%"}=e,{itemCount:a}=e,{itemSize:l}=e,{estimatedItemSize:h=null}=e,{stickyIndices:u=null}=e,{getKey:g=null}=e,{scrollDirection:m=rt.VERTICAL}=e,{scrollOffset:p=null}=e,{scrollToIndex:_=null}=e,{scrollToAlignment:E=null}=e,{scrollToBehaviour:N="instant"}=e,{overscanCount:O=3}=e;const M=Dr(),Y=new hs({itemCount:a,itemSize:l,estimatedItemSize:te()});let G=!1,X,J=[],I={offset:p||_!=null&&J.length&&S(_)||0,scrollChangeReason:Ft.REQUESTED},f=I,c={scrollToIndex:_,scrollToAlignment:E,scrollOffset:p,itemCount:a,itemSize:l,estimatedItemSize:h},k={},z="",T="";Q(),$t(()=>{n(18,G=!0),X.addEventListener("scroll",R,ps),p!=null?B(p):_!=null&&B(S(_))}),xn(()=>{G&&X.removeEventListener("scroll",R)});function L(){if(!G)return;const v=c.scrollToIndex!==_||c.scrollToAlignment!==E,D=c.itemCount!==a||c.itemSize!==l||c.estimatedItemSize!==h;D&&(Y.updateConfig({itemSize:l,itemCount:a,estimatedItemSize:te()}),w()),c.scrollOffset!==p?n(19,I={offset:p||0,scrollChangeReason:Ft.REQUESTED}):typeof _=="number"&&(v||D)&&n(19,I={offset:S(_,E,a),scrollChangeReason:Ft.REQUESTED}),c={scrollToIndex:_,scrollToAlignment:E,scrollOffset:p,itemCount:a,itemSize:l,estimatedItemSize:h}}function j(){if(!G)return;const{offset:v,scrollChangeReason:D}=I;(f.offset!==v||f.scrollChangeReason!==D)&&Q(),f.offset!==v&&D===Ft.REQUESTED&&B(v),f=I}function Q(){const{offset:v}=I,{start:D,stop:H}=Y.getVisibleRange({containerSize:m===rt.VERTICAL?s:o,offset:v,overscanCount:O});let ne=[];const ie=Y.getTotalSize();m===rt.VERTICAL?(n(3,z=`height:${s}${typeof s=="number"?"px":""};width:${o};`),n(4,T=`flex-direction:column;height:${ie}px;`)):(n(3,z=`height:${s};width:${o}${typeof o=="number"?"px":""}`),n(4,T=`min-height:100%;width:${ie}px;`));const P=u!=null&&u.length!==0;if(P)for(let Z=0;Z=H)&&(v=0),Y.getUpdatedOffsetForIndex({align:D,containerSize:m===rt.VERTICAL?s:o,currentOffset:I.offset||0,targetIndex:v})}function R(v){const D=F();D<0||I.offset===D||v.target!==X||(n(19,I={offset:D,scrollChangeReason:Ft.OBSERVED}),M("afterScroll",{offset:D,event:v}))}function F(){return X[mi[m]]}function te(){return h||typeof l=="number"&&l||50}function A(v,D){if(k[v])return k[v];const{size:H,offset:ne}=Y.getSizeAndPositionForIndex(v);let ie;return m===rt.VERTICAL?(ie=`left:0;width:100%;height:${H}px;`,D?ie+=`position:sticky;flex-grow:0;z-index:1;top:0;margin-top:${ne}px;margin-bottom:${-(ne+H)}px;`:ie+=`position:absolute;top:${ne}px;`):(ie=`top:0;width:${H}px;`,D?ie+=`position:sticky;z-index:1;left:0;margin-left:${ne}px;margin-right:${-(ne+H)}px;`:ie+=`position:absolute;height:100%;left:${ne}px;`),k[v]=ie}function W(v){Tt[v?"unshift":"push"](()=>{X=v,n(1,X)})}return t.$$set=v=>{"height"in v&&n(5,s=v.height),"width"in v&&n(6,o=v.width),"itemCount"in v&&n(7,a=v.itemCount),"itemSize"in v&&n(8,l=v.itemSize),"estimatedItemSize"in v&&n(9,h=v.estimatedItemSize),"stickyIndices"in v&&n(10,u=v.stickyIndices),"getKey"in v&&n(0,g=v.getKey),"scrollDirection"in v&&n(11,m=v.scrollDirection),"scrollOffset"in v&&n(12,p=v.scrollOffset),"scrollToIndex"in v&&n(13,_=v.scrollToIndex),"scrollToAlignment"in v&&n(14,E=v.scrollToAlignment),"scrollToBehaviour"in v&&n(15,N=v.scrollToBehaviour),"overscanCount"in v&&n(16,O=v.overscanCount),"$$scope"in v&&n(20,r=v.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&29568&&L(),t.$$.dirty[0]&524288&&j(),t.$$.dirty[0]&263264&&G&&w(0)},[g,X,J,z,T,s,o,a,l,h,u,m,p,_,E,N,O,w,G,I,r,i,W]}class vs extends Ze{constructor(e){super(),Je(this,e,bs,ms,Be,{height:5,width:6,itemCount:7,itemSize:8,estimatedItemSize:9,stickyIndices:10,getKey:0,scrollDirection:11,scrollOffset:12,scrollToIndex:13,scrollToAlignment:14,scrollToBehaviour:15,overscanCount:16,recomputeSizes:17},null,[-1,-1])}get height(){return this.$$.ctx[5]}set height(e){this.$$set({height:e}),De()}get width(){return this.$$.ctx[6]}set width(e){this.$$set({width:e}),De()}get itemCount(){return this.$$.ctx[7]}set itemCount(e){this.$$set({itemCount:e}),De()}get itemSize(){return this.$$.ctx[8]}set itemSize(e){this.$$set({itemSize:e}),De()}get estimatedItemSize(){return this.$$.ctx[9]}set estimatedItemSize(e){this.$$set({estimatedItemSize:e}),De()}get stickyIndices(){return this.$$.ctx[10]}set stickyIndices(e){this.$$set({stickyIndices:e}),De()}get getKey(){return this.$$.ctx[0]}set getKey(e){this.$$set({getKey:e}),De()}get scrollDirection(){return this.$$.ctx[11]}set scrollDirection(e){this.$$set({scrollDirection:e}),De()}get scrollOffset(){return this.$$.ctx[12]}set scrollOffset(e){this.$$set({scrollOffset:e}),De()}get scrollToIndex(){return this.$$.ctx[13]}set scrollToIndex(e){this.$$set({scrollToIndex:e}),De()}get scrollToAlignment(){return this.$$.ctx[14]}set scrollToAlignment(e){this.$$set({scrollToAlignment:e}),De()}get scrollToBehaviour(){return this.$$.ctx[15]}set scrollToBehaviour(e){this.$$set({scrollToBehaviour:e}),De()}get overscanCount(){return this.$$.ctx[16]}set overscanCount(e){this.$$set({overscanCount:e}),De()}get recomputeSizes(){return this.$$.ctx[17]}}class en extends Error{constructor(e,n={}){super(`Node not found: ${e}`,n),this.name="NodeNotFoundError"}}class Vn extends Error{constructor(e){super(`Missing key: ${e}`),this.name="KeyError"}}const ws="modulepreload",ys=function(t){return"https://ome.github.io/ome2024-ngff-challenge/"+t},ki={},Dt=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.all(n.map(a=>{if(a=ys(a),a in ki)return;ki[a]=!0;const l=a.endsWith(".css"),h=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${h}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":ws,l||(u.as="script"),u.crossOrigin="",u.href=a,o&&u.setAttribute("nonce",o),document.head.appendChild(u),l)return new Promise((g,m)=>{u.addEventListener("load",g),u.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${a}`)))})}))}return r.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};var Ve;class wr{constructor(e,n,i){Te(this,Ve);typeof e=="number"?Ee(this,Ve,new Uint8Array(e)):e instanceof ArrayBuffer?Ee(this,Ve,new Uint8Array(e,n,i)):Ee(this,Ve,new Uint8Array(Array.from(e,r=>r?1:0)))}get BYTES_PER_ELEMENT(){return 1}get byteOffset(){return ee(this,Ve).byteOffset}get byteLength(){return ee(this,Ve).byteLength}get buffer(){return ee(this,Ve).buffer}get length(){return ee(this,Ve).length}get(e){let n=ee(this,Ve)[e];return typeof n=="number"?n!==0:n}set(e,n){ee(this,Ve)[e]=n?1:0}fill(e){ee(this,Ve).fill(e?1:0)}*[Symbol.iterator](){for(let e=0;e=0;i--)n[i]=r,r*=t[i];return n}function Ss(t){const e=t.length,n=globalThis.Array(e);for(let i=0,r=1;i["c",...i].join(n)}if(t==="v2"){const n=(e==null?void 0:e.separator)??".";return i=>i.join(n)||"0"}throw new Error(`Unknown chunk key encoding: ${t}`)}function Fn(t){var n;const e=t.find(i=>i.name==="transpose");return((n=e==null?void 0:e.configuration)==null?void 0:n.order)==="F"?"F":"C"}const Is=/^([<|>])(.*)$/;function Ts(t){if(t==="|O")return{data_type:"v2:object"};let e=t.match(Is);if(!e)throw new Error(`Invalid dtype: ${t}`);let[,n,i]=e,r={b1:"bool",i1:"int8",u1:"uint8",i2:"int16",u2:"uint16",i4:"int32",u4:"uint32",i8:"int64",u8:"uint64",f4:"float32",f8:"float64"}[i]??(i.startsWith("S")||i.startsWith("U")?`v2:${i}`:void 0);if(!r)throw new Error(`Unsupported or unknown dtype: ${t}`);return n==="|"?{data_type:r}:{data_type:r,endian:n==="<"?"little":"big"}}function zs(t,e={}){let n=[],i=Ts(t.dtype);t.order==="F"&&n.push({name:"transpose",configuration:{order:"F"}}),"endian"in i&&i.endian==="big"&&n.push({name:"bytes",configuration:{endian:"big"}});for(let{id:r,...s}of t.filters??[])n.push({name:r,configuration:s});if(t.compressor){let{id:r,...s}=t.compressor;n.push({name:r,configuration:s})}return{zarr_format:3,node_type:"array",shape:t.shape,data_type:i.data_type,chunk_grid:{name:"regular",configuration:{chunk_shape:t.chunks}},chunk_key_encoding:{name:"v2",configuration:{separator:t.dimension_separator??"."}},codecs:n,fill_value:t.fill_value,attributes:e}}function Os(t,e={}){return{zarr_format:3,node_type:"group",attributes:e}}function Rs(t,e){if(e!=="number"&&e!=="bigint"&&e!=="boolean"&&e!=="object"&&e!=="string")return t===e;let n=t==="bool";if(e==="boolean")return n;let i=t.startsWith("v2:U")||t.startsWith("v2:S");if(e==="string")return i;let r=t==="int64"||t==="uint64";if(e==="bigint")return r;let s=t==="v2:object";return e==="object"?s:!i&&!r&&!n&&!s}function Ls(t){return(t==null?void 0:t.name)==="sharding_indexed"}function kr(t){return(t.data_type==="uint64"||t.data_type==="int64")&&t.fill_value!=null?BigInt(t.fill_value):t.fill_value}const Ci=Ms();function Ms(){const t=new Uint32Array([305419896]);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)[0]!==18}function Si(t){return"BYTES_PER_ELEMENT"in t?t.BYTES_PER_ELEMENT:4}var xt,lt,Vt,Wt,It;const Qn=class Qn{constructor(e,n){oe(this,"kind","array_to_bytes");Te(this,xt);Te(this,lt);Te(this,Vt);Te(this,Wt);Te(this,It);Ee(this,It,e==null?void 0:e.endian),Ee(this,lt,yr(n.data_type)),Ee(this,Wt,n.shape),Ee(this,xt,pt(n.shape,Fn(n.codecs)));const i=new(ee(this,lt))(0);Ee(this,Vt,i.BYTES_PER_ELEMENT)}static fromConfig(e,n){return new Qn(e,n)}encode(e){let n=new Uint8Array(e.data.buffer);return Ci&&ee(this,It)==="big"&&Ei(n,Si(ee(this,lt))),n}decode(e){return Ci&&ee(this,It)==="big"&&Ei(e,Si(ee(this,lt))),{data:new(ee(this,lt))(e.buffer,e.byteOffset,e.byteLength/ee(this,Vt)),shape:ee(this,Wt),stride:ee(this,xt)}}};xt=new WeakMap,lt=new WeakMap,Vt=new WeakMap,Wt=new WeakMap,It=new WeakMap;let mn=Qn;class Hn{constructor(){oe(this,"kind","bytes_to_bytes")}static fromConfig(){return new Hn}encode(e){throw new Error("Not implemented")}decode(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength-4)}}function Fs(t,e){if(Number.isNaN(e))throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");if(e===Number.POSITIVE_INFINITY)throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");if(e===Number.NEGATIVE_INFINITY)throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");return e}function Ds(t,e){return e instanceof Object&&!Array.isArray(e)?Object.keys(e).sort().reduce((n,i)=>(n[i]=e[i],n),{}):e}var Ht,Gt;const Xn=class Xn{constructor(e={}){oe(this,"configuration");oe(this,"kind","array_to_bytes");Te(this,Ht);Te(this,Gt);this.configuration=e;const{encoding:n="utf-8",skipkeys:i=!1,ensure_ascii:r=!0,check_circular:s=!0,allow_nan:o=!0,sort_keys:a=!0,indent:l,strict:h=!0}=e;let u=e.separators;u||(l?u=[", ",": "]:u=[",",":"]),Ee(this,Ht,{encoding:n,skipkeys:i,ensure_ascii:r,check_circular:s,allow_nan:o,indent:l,separators:u,sort_keys:a}),Ee(this,Gt,{strict:h})}static fromConfig(e){return new Xn(e)}encode(e){const{indent:n,encoding:i,ensure_ascii:r,check_circular:s,allow_nan:o,sort_keys:a}=ee(this,Ht);if(i!=="utf-8")throw new Error("JsonCodec does not yet support non-utf-8 encoding.");const l=[];if(!s)throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");o||l.push(Fs),a&&l.push(Ds);const h=Array.from(e.data);h.push("|O"),h.push(e.shape);let u;l.length&&(u=(m,p)=>{let _=p;for(let E of l)_=E(m,_);return _});let g=JSON.stringify(h,u,n);return r&&(g=g.replace(/[\u007F-\uFFFF]/g,m=>{const p=`0000${m.charCodeAt(0).toString(16)}`;return`\\u${p.substring(p.length-4)}`})),new TextEncoder().encode(g)}decode(e){const{strict:n}=ee(this,Gt);if(!n)throw new Error("JsonCodec does not yet support non-strict decoding.");const i=tn(e),r=i.pop();if(i.pop(),!r)throw new Error("0D not implemented for JsonCodec.");const s=pt(r,"C");return{data:i,shape:r,stride:s}}};Ht=new WeakMap,Gt=new WeakMap;let Dn=Xn;function Ai(t){return t instanceof wr||t instanceof Wn||t instanceof qt?new Proxy(t,{get(n,i){return n.get(Number(i))},set(n,i,r){return n.set(Number(i),r),!0}}):t}function Ns(t,e){let n;return t.data instanceof Wn||t.data instanceof qt?n=new t.constructor(t.data.length,t.data.chars):n=new t.constructor(t.data.length),{data:n,shape:t.shape,stride:pt(t.shape,e)}}function Ps(t,e){let n=Ns(t,e),i=t.shape.length,r=t.data.length,s=Array(i).fill(0),o=Ai(t.data),a=Ai(n.data);for(let l=0;ln===e[i])?"C":"F"}class Gn{constructor(e){oe(this,"configuration");oe(this,"kind","array_to_array");this.configuration=e}static fromConfig(e){return new Gn(e)}encode(e){var n,i;return Us(e)===((n=this.configuration)==null?void 0:n.order)?e:Ps(e,((i=this.configuration)==null?void 0:i.order)??"C")}decode(e){return e}}var Kt,Jt;const $n=class $n{constructor(e){oe(this,"kind","array_to_bytes");Te(this,Kt);Te(this,Jt);Ee(this,Kt,e),Ee(this,Jt,pt(e,"C"))}static fromConfig(e,n){return new $n(n.shape)}encode(e){throw new Error("Method not implemented.")}decode(e){let n=new TextDecoder,i=new DataView(e.buffer),r=Array(i.getUint32(0,!0)),s=4;for(let o=0;oDt(()=>import("./blosc-E49GQuAK.js"),__vite__mapDeps([0,1])).then(t=>t.default)).set("gzip",()=>Dt(()=>import("./gzip-CF-9a_hd.js"),__vite__mapDeps([2,3])).then(t=>t.default)).set("lz4",()=>Dt(()=>import("./lz4-BIGKWw27.js"),__vite__mapDeps([4,1])).then(t=>t.default)).set("zlib",()=>Dt(()=>import("./zlib-CBiqHlio.js"),__vite__mapDeps([5,3])).then(t=>t.default)).set("zstd",()=>Dt(()=>import("./zstd-IvP746pw.js"),__vite__mapDeps([6,1])).then(t=>t.default)).set("transpose",()=>Gn).set("bytes",()=>mn).set("crc32c",()=>Hn).set("vlen-utf8",()=>Nn).set("json2",()=>Dn)}const js=Bs();function Pn(t){let e;return{async encode(n){e||(e=await Ii(t));for(const r of e.array_to_array)n=await r.encode(n);let i=await e.array_to_bytes.encode(n);for(const r of e.bytes_to_bytes)i=await r.encode(i);return i},async decode(n){e||(e=await Ii(t));for(let r=e.bytes_to_bytes.length-1;r>=0;r--)n=await e.bytes_to_bytes[r].decode(n);let i=await e.array_to_bytes.decode(n);for(let r=e.array_to_array.length-1;r>=0;r--)i=await e.array_to_array[r].decode(i);return i}}}async function Ii(t){let e=t.codecs.map(async s=>{var a;let o=await((a=js.get(s.name))==null?void 0:a());if(!o)throw new Error(`Unknown codec: ${s.name}`);return{Codec:o,meta:s}}),n=[],i,r=[];for await(let{Codec:s,meta:o}of e){let a=s.fromConfig(o.configuration,t);switch(a.kind){case"array_to_array":n.push(a);break;case"array_to_bytes":i=a;break;default:r.push(a)}}if(!i){if(!qs(t))throw new Error(`Cannot encode ${t.data_type} to bytes without a codec`);i=mn.fromConfig({endian:"little"},t)}return{array_to_array:n,array_to_bytes:i,bytes_to_bytes:r}}function qs(t){return t.data_type!=="v2:object"}const Ti=18446744073709551615n;function xs(t,e,n,i){if(t.store.getRange===void 0)throw new Error("Store does not support range requests");let r=t.store.getRange.bind(t.store),s=e.map((l,h)=>l/i.chunk_shape[h]),o=Pn({data_type:"uint64",shape:[...s,2],codecs:i.index_codecs}),a={};return async l=>{let h=l.map((M,Y)=>Math.floor(M/s[Y])),u=t.resolve(n(h)).path,g;if(u in a)g=a[u];else{let M=4,Y=16*s.reduce((X,J)=>X*J,1),G=await r(u,{suffixLength:Y+M});g=a[u]=G?await o.decode(G):null}if(g===null)return;let{data:m,shape:p,stride:_}=g,E=l.map((M,Y)=>M%p[Y]).reduce((M,Y,G)=>M+Y*_[G],0),N=m[E],O=m[E+1];if(!(N===Ti&&O===Ti))return r(u,{offset:Number(N),length:Number(O)})}}class Rt{constructor(e,n="/"){oe(this,"store");oe(this,"path");this.store=e,this.path=n}resolve(e){let n=new URL(`file://${this.path.endsWith("/")?this.path:`${this.path}/`}`);return new Rt(this.store,new URL(e,n).pathname)}}var Zt;class Kn extends Rt{constructor(n,i,r){super(n,i);oe(this,"kind","group");Te(this,Zt);Ee(this,Zt,r)}get attrs(){return ee(this,Zt).attributes}}Zt=new WeakMap;const Pt=Symbol("zarrita.context");function Vs(t){return t[Pt]}function Ws(t,e){let{configuration:n}=e.codecs.find(Ls)??{},i={encode_chunk_key:As(e.chunk_key_encoding),TypedArray:yr(e.data_type),fill_value:e.fill_value};if(n){let s=Fn(n.codecs);return{...i,kind:"sharded",chunk_shape:n.chunk_shape,codec:Pn({data_type:e.data_type,shape:n.chunk_shape,codecs:n.codecs}),get_strides(o,a){return pt(o,a??s)},get_chunk_bytes:xs(t,e.chunk_grid.configuration.chunk_shape,i.encode_chunk_key,n)}}let r=Fn(e.codecs);return{...i,kind:"regular",chunk_shape:e.chunk_grid.configuration.chunk_shape,codec:Pn({data_type:e.data_type,shape:e.chunk_grid.configuration.chunk_shape,codecs:e.codecs}),get_strides(s,o){return pt(s,o??r)},async get_chunk_bytes(s,o){let a=i.encode_chunk_key(s),l=t.resolve(a).path;return t.store.get(l,o)}}}var or,lr,mt,ar;let pn=(ar=class extends(lr=Rt,or=Pt,lr){constructor(n,i,r){super(n,i);oe(this,"kind","array");Te(this,mt);oe(this,or);Ee(this,mt,{...r,fill_value:kr(r)}),this[Pt]=Ws(this,r)}get attrs(){return ee(this,mt).attributes}get shape(){return ee(this,mt).shape}get chunks(){return this[Pt].chunk_shape}get dtype(){return ee(this,mt).data_type}async getChunk(n,i){let r=this[Pt],s=await r.get_chunk_bytes(n,i);if(!s){let o=r.chunk_shape.reduce((l,h)=>l*h,1),a=new r.TypedArray(o);return a.fill(r.fill_value),{data:a,shape:r.chunk_shape,stride:r.get_strides(r.chunk_shape)}}return r.codec.decode(s)}is(n){return Rs(this.dtype,n)}},mt=new WeakMap,ar),vn=Hs();function Hs(){let t=new WeakMap;function e(n){let i=t.get(n)??{v2:0,v3:0};return t.set(n,i),i}return{increment(n,i){e(n)[i]+=1},version_max(n){let i=e(n);return i.v3>i.v2?"v3":"v2"}}}async function Gs(t){let e=await t.store.get(t.resolve(".zattrs").path);return e?tn(e):{}}async function Ks(t,e={}){let n="store"in t?t:new Rt(t),i={};return(e.attrs??!0)&&(i=await Gs(n)),e.kind==="array"?zi(n,i):e.kind==="group"?Oi(n,i):zi(n,i).catch(r=>{if(r instanceof en)return Oi(n,i);throw r})}async function zi(t,e){let{path:n}=t.resolve(".zarray"),i=await t.store.get(n);if(!i)throw new en("v2 array",{cause:new Vn(n)});return vn.increment(t.store,"v2"),new pn(t.store,t.path,zs(tn(i),e))}async function Oi(t,e){let{path:n}=t.resolve(".zgroup"),i=await t.store.get(n);if(!i)throw new en("v2 group",{cause:new Vn(n)});return vn.increment(t.store,"v2"),new Kn(t.store,t.path,Os(tn(i),e))}async function Js(t){let{store:e,path:n}=t.resolve("zarr.json"),i=await t.store.get(n);if(!i)throw new en("v3 array or group",{cause:new Vn(n)});let r=tn(i);return r.node_type==="array"&&(r.fill_value=kr(r)),r.node_type==="array"?new pn(e,t.path,r):new Kn(e,t.path,r)}async function Zs(t,e={}){let n="store"in t?t:new Rt(t),i=await Js(n);if(vn.increment(n.store,"v3"),e.kind===void 0||e.kind==="array"&&i instanceof pn||e.kind==="group"&&i instanceof Kn)return i;let r=i instanceof pn?"array":"group";throw new Error(`Expected node of kind ${e.kind}, found ${r}.`)}async function gt(t,e={}){let n="store"in t?t.store:t,i=vn.version_max(n),r=i==="v2"?gt.v2:gt.v3,s=i==="v2"?gt.v3:gt.v2;return r(t,e).catch(o=>{if(o instanceof en)return s(t,e);throw o})}gt.v2=Ks;gt.v3=Zs;function*Ys(t,e,n=1){e===void 0&&(e=t,t=0);for(let i=t;ii[Symbol.iterator]()),n=e.map(i=>i.next());if(n.some(i=>i.done))throw new Error("Input contains an empty iterator.");for(let i=0;;){if(n[i].done){if(e[i]=t[i][Symbol.iterator](),n[i]=e[i].next(),++i>=e.length)return}else yield n.map(({value:r})=>r),i=0;n[i]=e[i].next()}}function Xs({start:t,stop:e,step:n},i){if(n===0)throw new Error("slice step cannot be zero");n=n??1;const r=n<0,[s,o]=r?[-1,i-1]:[0,i];return t===null?t=r?o:s:t<0?(t+=i,to&&(t=o),e===null?e=r?s:o:e<0?(e+=i,eo&&(e=o),[t,e,n]}function Un(t,e,n=null){return e===void 0&&(e=t,t=null),{start:t,stop:e,step:n}}function $s(){const t=[];return{add:e=>t.push(e()),onIdle:()=>Promise.all(t)}}class Jn extends Error{constructor(e){super(e),this.name="IndexError"}}function eo(t,e){throw new Jn(`too many indicies for array; expected ${e.length}, got ${t.length}`)}function to(t){throw new Jn(`index out of bounds for dimension with length ${t}`)}function no(){throw new Jn("only slices with step >= 1 are supported")}function io(t,e){t.length>e.length&&eo(t,e)}function ro(t,e){return t=Math.trunc(t),t<0&&(t=e+t),(t>=e||t<0)&&to(e),t}class so{constructor({dim_sel:e,dim_len:n,dim_chunk_len:i}){oe(this,"dim_sel");oe(this,"dim_len");oe(this,"dim_chunk_len");oe(this,"nitems");e=ro(e,n),this.dim_sel=e,this.dim_len=n,this.dim_chunk_len=i,this.nitems=1}*[Symbol.iterator](){const e=Math.floor(this.dim_sel/this.dim_chunk_len),n=e*this.dim_chunk_len,i=this.dim_sel-n;yield{dim_chunk_ix:e,dim_chunk_sel:i}}}class Ri{constructor({dim_sel:e,dim_len:n,dim_chunk_len:i}){oe(this,"start");oe(this,"stop");oe(this,"step");oe(this,"dim_len");oe(this,"dim_chunk_len");oe(this,"nitems");oe(this,"nchunks");const[r,s,o]=Xs(e,n);this.start=r,this.stop=s,this.step=o,this.step<1&&no(),this.dim_len=n,this.dim_chunk_len=i,this.nitems=Math.max(0,Math.ceil((this.stop-this.start)/this.step)),this.nchunks=Math.ceil(this.dim_len/this.dim_chunk_len)}*[Symbol.iterator](){const e=Math.floor(this.start/this.dim_chunk_len),n=Math.ceil(this.stop/this.dim_chunk_len);for(const i of Ys(e,n)){const r=i*this.dim_chunk_len,s=Math.min(this.dim_len,(i+1)*this.dim_chunk_len),o=s-r;let a=0,l=0;if(this.starts?o:this.stop-r,u=[l,h,this.step],g=Math.ceil((h-l)/this.step),m=[a,a+g,1];yield{dim_chunk_ix:i,dim_chunk_sel:u,dim_out_sel:m}}}}function oo(t,e){let n=[];return t===null?n=e.map(i=>Un(null)):Array.isArray(t)&&(n=t.map(i=>i??Un(null))),io(n,e),n}class lo{constructor({selection:e,shape:n,chunk_shape:i}){oe(this,"dim_indexers");oe(this,"shape");this.dim_indexers=oo(e,n).map((r,s)=>new(typeof r=="number"?so:Ri)({dim_sel:r,dim_len:n[s],dim_chunk_len:i[s]})),this.shape=this.dim_indexers.filter(r=>r instanceof Ri).map(r=>r.nitems)}*[Symbol.iterator](){for(const e of Qs(...this.dim_indexers)){const n=e.map(r=>r.dim_chunk_ix),i=e.map(r=>"dim_out_sel"in r?{from:r.dim_chunk_sel,to:r.dim_out_sel}:{from:r.dim_chunk_sel,to:null});yield{chunk_coords:n,mapping:i}}}}function ao(t,e){return"get"in t?t.get(e):t[e]}async function uo(t,e,n,i){var l;let r=Vs(t),s=new lo({selection:e,shape:t.shape,chunk_shape:t.chunks}),o=i.prepare(new r.TypedArray(s.shape.reduce((h,u)=>h*u,1)),s.shape,r.get_strides(s.shape,n.order)),a=((l=n.create_queue)==null?void 0:l.call(n))??$s();for(const{chunk_coords:h,mapping:u}of s)a.add(async()=>{let{data:g,shape:m,stride:p}=await t.getChunk(h,n.opts),_=i.prepare(g,m,p);i.set_from_chunk(o,_,u)});return await a.onIdle(),s.shape.length===0?ao(o.data,0):o}function Zn(t,e=0,n){let i=n??t.length-e;return{length:i,subarray(r,s=i){return Zn(t,e+r,s-r)},set(r,s=0){for(let o=0;o1?g=u/o:o<1&&(u=g*o);let m=u,p=g,_=!0;const E=new AbortController;async function N(){var R;let M=r.multiscales[0].datasets.map(F=>F.path),Y=r.multiscales[0].axes.map(F=>F.name),G=M.at(-1);s!=null&&sl*l){console.log("Lowest resolution too large for Thumbnail: ",f,i);return}let c=f.length,k=f[I]||1,z,T;(R=r==null?void 0:r.omero)!=null&&R.channels?(z=r.omero.channels.map(F=>F.active),T=r.omero.channels.map(F=>mr(F.color))):(z=rs(k),T=ss(k,z)),T=T.filter((F,te)=>z[te]);let j=z.reduce((F,te,A)=>(te&&F.push(A),F),[]).map(F=>{let te=f.map((A,W)=>W==I?F:W>=c-2?Un(0,A):Y[W]=="z"||Y[W]=="t"?parseInt(A/2+""):0);return _o(J,te,{opts:{signal:E.signal}})}),Q=await Promise.all(j),B=Q.map(F=>gr(F)),w=$r(Q,B,T);n(1,u=f.at(-1)),n(2,g=f.at(-2));let S=u/a;g>u&&(S=g/a),n(3,m=u/S),n(4,p=g/S),setTimeout(()=>{const F=h.getContext("2d");n(5,_=!1),F.putImageData(new ImageData(w,u,g),0,0)},100)}$t(()=>{N()}),xn(()=>{E.abort()});function O(M){Tt[M?"unshift":"push"](()=>{h=M,n(0,h)})}return t.$$set=M=>{"source"in M&&n(6,i=M.source),"attrs"in M&&n(7,r=M.attrs),"thumbDatasetIndex"in M&&n(8,s=M.thumbDatasetIndex),"thumbAspectRatio"in M&&n(9,o=M.thumbAspectRatio),"cssSize"in M&&n(10,a=M.cssSize),"max_size"in M&&n(11,l=M.max_size)},[h,u,g,m,p,_,i,r,s,o,a,l,O]}class Sr extends Ze{constructor(e){super(),Je(this,e,vo,bo,Be,{source:6,attrs:7,thumbDatasetIndex:8,thumbAspectRatio:9,cssSize:10,max_size:11})}}function Fi(t,e,n){const i=t.slice();return i[12]=e[n],i}function Di(t){let e,n;return e=new Sr({props:{source:t[4],attrs:t[3],max_size:2e3,thumbDatasetIndex:t[5],thumbAspectRatio:t[6]}}),{c(){Ke(e.$$.fragment)},m(i,r){We(e,i,r),n=!0},p(i,r){const s={};r&16&&(s.source=i[4]),r&8&&(s.attrs=i[3]),r&32&&(s.thumbDatasetIndex=i[5]),r&64&&(s.thumbAspectRatio=i[6]),e.$set(s)},i(i){n||(re(e.$$.fragment,i),n=!0)},o(i){he(e.$$.fragment,i),n=!1},d(i){He(e,i)}}}function Ni(t){let e,n,i,r,s,o,a,l=t[0].source+"",h,u,g=t[0].csv&&Pi(t);return{c(){e=y("div"),n=y("span"),n.textContent="Data",i=V(),g&&g.c(),r=V(),s=y("span"),s.textContent="provided by",o=V(),a=y("strong"),h=U(l),u=U("."),b(n,"class","hideOnSmall svelte-afrxqy"),b(s,"class","hideOnSmall svelte-afrxqy"),ae(a,"color","grey")},m(m,p){x(m,e,p),d(e,n),d(e,i),g&&g.m(e,null),d(e,r),d(e,s),d(e,o),d(e,a),d(a,h),d(e,u)},p(m,p){m[0].csv?g?g.p(m,p):(g=Pi(m),g.c(),g.m(e,r)):g&&(g.d(1),g=null),p&1&&l!==(l=m[0].source+"")&&me(h,l)},d(m){m&&q(e),g&&g.d()}}}function Pi(t){var a;let e,n,i,r=((a=t[0].csv)==null?void 0:a.split("/").pop().replace(".csv",""))+"",s,o;return{c(){e=y("span"),e.textContent="from collection",n=V(),i=y("a"),s=U(r),b(e,"class","hideOnSmall svelte-afrxqy"),b(i,"title","Show collection in a new tab"),b(i,"href",o=qi(t[0])),b(i,"target","_blank")},m(l,h){x(l,e,h),x(l,n,h),x(l,i,h),d(i,s)},p(l,h){var u;h&1&&r!==(r=((u=l[0].csv)==null?void 0:u.split("/").pop().replace(".csv",""))+"")&&me(s,r),h&1&&o!==(o=qi(l[0]))&&b(i,"href",o)},d(l){l&&(q(e),q(n),q(i))}}}function Ui(t){let e,n,i,r,s,o;return{c(){e=U("Browse "),n=y("a"),i=U("Original data"),o=U("."),b(n,"title",r="Link to original data: "+t[0].origin),b(n,"href",s=t[0].origin),b(n,"target","_blank")},m(a,l){x(a,e,l),x(a,n,l),d(n,i),x(a,o,l)},p(a,l){l&1&&r!==(r="Link to original data: "+a[0].origin)&&b(n,"title",r),l&1&&s!==(s=a[0].origin)&&b(n,"href",s)},d(a){a&&(q(e),q(n),q(o))}}}function Bi(t){let e=t[12].toUpperCase()+"",n,i,r=t[0][`size_${t[12]}`]+"",s,o;return{c(){n=U(e),i=U(":"),s=U(r),o=U(" ")},m(a,l){x(a,n,l),x(a,i,l),x(a,s,l),x(a,o,l)},p(a,l){l&1&&r!==(r=a[0][`size_${a[12]}`]+"")&&me(s,r)},d(a){a&&(q(n),q(i),q(s),q(o))}}}function ji(t){let e,n=t[0][`size_${t[12]}`]!==void 0&&Bi(t);return{c(){n&&n.c(),e=bn()},m(i,r){n&&n.m(i,r),x(i,e,r)},p(i,r){i[0][`size_${i[12]}`]!==void 0?n?n.p(i,r):(n=Bi(i),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(i){i&&q(e),n&&n.d(i)}}}function wo(t){let e,n,i=ut(t[0].written)+"",r;return{c(){e=y("div"),n=U("Data size: "),r=U(i)},m(s,o){x(s,e,o),d(e,n),d(e,r)},p(s,o){o&1&&i!==(i=ut(s[0].written)+"")&&me(r,i)},d(s){s&&q(e)}}}function yo(t){let e,n,i=t[0].shards+"",r;return{c(){e=y("div"),n=U("Shard shape: "),r=U(i)},m(s,o){x(s,e,o),d(e,n),d(e,r)},p(s,o){o&1&&i!==(i=s[0].shards+"")&&me(r,i)},d(s){s&&q(e)}}}function ko(t){let e,n,i=t[0].chunks+"",r;return{c(){e=y("div"),n=U("Chunk shape: "),r=U(i)},m(s,o){x(s,e,o),d(e,n),d(e,r)},p(s,o){o&1&&i!==(i=s[0].chunks+"")&&me(r,i)},d(s){s&&q(e)}}}function Eo(t){let e,n,i,r,s,o,a=t[9](t[0].url)+"",l,h,u,g=(t[0].name?t[0].name.replaceAll(t[1],`${t[1]}`):"")+"",m,p,_,E=t[7].replaceAll(t[1],`${t[1]}`)+"",N,O,M,Y,G,X,J,I,f,c,k,z,T,L,j,Q,B=t[3]&&Di(t),w=t[0].source&&Ni(t),S=t[0].origin&&Ui(t),R=Ne(["t","c","z","y","x"]),F=[];for(let v=0;v<5;v+=1)F[v]=ji(Fi(t,R,v));function te(v,D){return v[2]=="chunk_pixels"?ko:v[2]=="shard_pixels"?yo:wo}let A=te(t),W=A(t);return{c(){e=y("div"),n=y("div"),B&&B.c(),i=V(),r=y("div"),s=y("div"),o=y("strong"),h=V(),u=y("div"),p=V(),_=y("div"),N=V(),w&&w.c(),O=V(),M=y("div"),Y=U("Open in "),G=y("a"),X=U("OME-Validator."),f=V(),S&&S.c(),c=V(),k=y("div"),z=U(`Image size:
`);for(let v=0;v<5;v+=1)F[v].c();T=V(),W.c(),b(n,"class","thumbWrapper svelte-afrxqy"),b(s,"title",l=t[0].url),b(u,"class",m=fi(t[1]==""?"hideOnSmall":"")+" svelte-afrxqy"),b(G,"title",J="Open in Validator: "+t[0].url),b(G,"href",I="https://ome.github.io/ome-ngff-validator/?source="+t[0].url),b(G,"target","_blank"),b(e,"class","zarr-list-item svelte-afrxqy")},m(v,D){x(v,e,D),d(e,n),B&&B.m(n,null),d(e,i),d(e,r),d(r,s),d(s,o),o.innerHTML=a,d(r,h),d(r,u),u.innerHTML=g,d(r,p),d(r,_),_.innerHTML=E,d(r,N),w&&w.m(r,null),d(r,O),d(r,M),d(M,Y),d(M,G),d(G,X),d(M,f),S&&S.m(M,null),d(r,c),d(r,k),d(k,z);for(let H=0;H<5;H+=1)F[H]&&F[H].m(k,null);d(r,T),W.m(r,null),L=!0,j||(Q=we(n,"click",t[8]),j=!0)},p(v,[D]){if(v[3]?B?(B.p(v,D),D&8&&re(B,1)):(B=Di(v),B.c(),re(B,1),B.m(n,null)):B&&(zt(),he(B,1,1,()=>{B=null}),Ot()),(!L||D&1)&&a!==(a=v[9](v[0].url)+"")&&(o.innerHTML=a),(!L||D&1&&l!==(l=v[0].url))&&b(s,"title",l),(!L||D&3)&&g!==(g=(v[0].name?v[0].name.replaceAll(v[1],`${v[1]}`):"")+"")&&(u.innerHTML=g),(!L||D&2&&m!==(m=fi(v[1]==""?"hideOnSmall":"")+" svelte-afrxqy"))&&b(u,"class",m),(!L||D&130)&&E!==(E=v[7].replaceAll(v[1],`${v[1]}`)+"")&&(_.innerHTML=E),v[0].source?w?w.p(v,D):(w=Ni(v),w.c(),w.m(r,O)):w&&(w.d(1),w=null),(!L||D&1&&J!==(J="Open in Validator: "+v[0].url))&&b(G,"title",J),(!L||D&1&&I!==(I="https://ome.github.io/ome-ngff-validator/?source="+v[0].url))&&b(G,"href",I),v[0].origin?S?S.p(v,D):(S=Ui(v),S.c(),S.m(M,null)):S&&(S.d(1),S=null),D&1){R=Ne(["t","c","z","y","x"]);let H;for(H=0;H<5;H+=1){const ne=Fi(v,R,H);F[H]?F[H].p(ne,D):(F[H]=ji(ne),F[H].c(),F[H].m(k,null))}for(;H<5;H+=1)F[H].d(1)}A===(A=te(v))&&W?W.p(v,D):(W.d(1),W=A(v),W&&(W.c(),W.m(r,null)))},i(v){L||(re(B),L=!0)},o(v){he(B),L=!1},d(v){v&&q(e),B&&B.d(),w&&w.d(),S&&S.d(),Ct(F,v),W.d(),j=!1,Q()}}}function qi(t){return window.location.origin+window.location.pathname+"?csv="+t.csv}function Co(t,e,n){let i,{rowData:r}=e,{textFilter:s}=e,{sortedBy:o=void 0}=e,a,l,h,u=1;const g=new AbortController;if(r.size_x&&r.size_y){let _=Math.max(r.size_x,r.size_y);for(h=0;_>256;)h+=1,_=_/2;u=r.size_x/r.size_y}function m(){console.log("Clicked on thumbnail"),Ae.setSelectedRow(r)}function p(_){if(s&&_.toLowerCase().includes(s.toLowerCase())){let N=_.toLowerCase(),O=s.toLowerCase(),M=N.indexOf(O),Y=Math.max(0,Math.min(M,_.length-50)),G=_.substring(Y,M);return G+="",G+=_.substring(M,M+O.length),G+="",G+=_.substring(M+O.length),G}return _.split("/").pop()}return $t(async()=>{let _=r.url;r.series0!==void 0&&(_+="/"+r.series0);let E=await jt(_,g.signal);n(3,a=E[0]),n(4,l=E[1]),E[2]}),xn(()=>{g.abort()}),t.$$set=_=>{"rowData"in _&&n(0,r=_.rowData),"textFilter"in _&&n(1,s=_.textFilter),"sortedBy"in _&&n(2,o=_.sortedBy)},t.$$.update=()=>{var _;t.$$.dirty&3&&n(7,i=s!=""&&((_=r.description)!=null&&_.toLowerCase().includes(s.toLowerCase()))?r.description:"")},[r,s,o,a,l,h,u,i,m,p]}class So extends Ze{constructor(e){super(),Je(this,e,Co,Eo,Be,{rowData:0,textFilter:1,sortedBy:2})}}function Ao(t){let e,n,i,r;return n=new So({props:{rowData:t[0][t[13]],textFilter:t[1],sortedBy:t[2]}}),{c(){e=y("div"),Ke(n.$$.fragment),b(e,"slot","item"),b(e,"style",i=t[12]),b(e,"class","row svelte-1xlep2t")},m(s,o){x(s,e,o),We(n,e,null),r=!0},p(s,o){const a={};o&8193&&(a.rowData=s[0][s[13]]),o&2&&(a.textFilter=s[1]),o&4&&(a.sortedBy=s[2]),n.$set(a),(!r||o&4096&&i!==(i=s[12]))&&b(e,"style",i)},i(s){r||(re(n.$$.fragment,s),r=!0)},o(s){he(n.$$.fragment,s),r=!1},d(s){s&&q(e),He(n)}}}function Io(t){let e=!1,n=()=>{e=!1},i,r,s,o=`${t[5]}px`,a,l,h;return st(t[8]),st(t[9]),s=new vs({props:{width:"100%",height:t[5],itemCount:t[0].length,itemSize:160,getKey:t[6],$$slots:{item:[Ao,({style:u,index:g})=>({12:u,13:g}),({style:u,index:g})=>(u?4096:0)|(g?8192:0)]},$$scope:{ctx:t}}}),s.$on("afterScroll",t[7]),{c(){r=y("div"),Ke(s.$$.fragment),b(r,"class","imageListContainer svelte-1xlep2t"),ae(r,"height",o)},m(u,g){x(u,r,g),We(s,r,null),t[10](r),a=!0,l||(h=[we(window,"resize",t[8]),we(window,"scroll",()=>{e=!0,clearTimeout(i),i=setTimeout(n,100),t[9]()})],l=!0)},p(u,[g]){g&16&&!e&&(e=!0,clearTimeout(i),scrollTo(window.pageXOffset,u[4]),i=setTimeout(n,100));const m={};g&32&&(m.height=u[5]),g&1&&(m.itemCount=u[0].length),g&28679&&(m.$$scope={dirty:g,ctx:u}),s.$set(m),g&32&&o!==(o=`${u[5]}px`)&&ae(r,"height",o)},i(u){a||(re(s.$$.fragment,u),a=!0)},o(u){he(s.$$.fragment,u),a=!1},d(u){u&&q(r),He(s),t[10](null),l=!1,et(h)}}}function To(t,e,n){let i,{tableRows:r}=e,{textFilter:s}=e,{sortedBy:o=void 0}=e;function a(E){return r[E].url}let l,h=0,u=0;function g(E){let O=l.offsetTop-20;E.detail.offset-u<0&&h>O&&n(4,h-=1),u=E.detail.offset}function m(){n(5,i=window.innerHeight)}function p(){n(4,h=window.pageYOffset)}function _(E){Tt[E?"unshift":"push"](()=>{l=E,n(3,l)})}return t.$$set=E=>{"tableRows"in E&&n(0,r=E.tableRows),"textFilter"in E&&n(1,s=E.textFilter),"sortedBy"in E&&n(2,o=E.sortedBy)},n(5,i=0),[r,s,o,l,h,i,a,g,m,p,_]}class zo extends Ze{constructor(e){super(),Je(this,e,To,Io,Be,{tableRows:0,textFilter:1,sortedBy:2})}}function xi(t){let e,n;return e=new Sr({props:{source:t[1],attrs:t[0],cssSize:512,max_size:2e3,thumbDatasetIndex:t[2],thumbAspectRatio:t[3]}}),{c(){Ke(e.$$.fragment)},m(i,r){We(e,i,r),n=!0},p(i,r){const s={};r&2&&(s.source=i[1]),r&1&&(s.attrs=i[0]),r&4&&(s.thumbDatasetIndex=i[2]),r&8&&(s.thumbAspectRatio=i[3]),e.$set(s)},i(i){n||(re(e.$$.fragment,i),n=!0)},o(i){he(e.$$.fragment,i),n=!1},d(i){He(e,i)}}}function Oo(t){let e,n,i=t[0]&&xi(t);return{c(){i&&i.c(),e=bn()},m(r,s){i&&i.m(r,s),x(r,e,s),n=!0},p(r,[s]){r[0]?i?(i.p(r,s),s&1&&re(i,1)):(i=xi(r),i.c(),re(i,1),i.m(e.parentNode,e)):i&&(zt(),he(i,1,1,()=>{i=null}),Ot())},i(r){n||(re(i),n=!0)},o(r){he(i),n=!1},d(r){r&&q(e),i&&i.d(r)}}}function Ro(t,e,n){let{rowData:i}=e;console.log("ThumbLoader",i);let r,s,o,a=1;if(i.size_x&&i.size_y){let l=Math.max(i.size_x,i.size_y);for(o=0;l>1024;)o+=1,l=l/2;a=i.size_x/i.size_y}else o=void 0,a=1;return $t(async()=>{let l=await jt(i.url);n(0,r=l[0]),n(1,s=l[1]),l[2]}),t.$$set=l=>{"rowData"in l&&n(4,i=l.rowData)},[r,s,o,a,i]}class Lo extends Ze{constructor(e){super(),Je(this,e,Ro,Oo,Be,{rowData:4})}}function Vi(t,e,n){const i=t.slice();return i[5]=e[n][0],i[6]=e[n][1],i}function Wi(t){let e,n;return e=new Lo({props:{rowData:t[1]}}),{c(){Ke(e.$$.fragment)},m(i,r){We(e,i,r),n=!0},p(i,r){const s={};r&2&&(s.rowData=i[1]),e.$set(s)},i(i){n||(re(e.$$.fragment,i),n=!0)},o(i){he(e.$$.fragment,i),n=!1},d(i){He(e,i)}}}function Hi(t){let e,n,i=t[2]&&Wi(t);return{c(){i&&i.c(),e=bn()},m(r,s){i&&i.m(r,s),x(r,e,s),n=!0},p(r,s){r[2]?i?(i.p(r,s),s&4&&re(i,1)):(i=Wi(r),i.c(),re(i,1),i.m(e.parentNode,e)):i&&(zt(),he(i,1,1,()=>{i=null}),Ot())},i(r){n||(re(i),n=!0)},o(r){he(i),n=!1},d(r){r&&q(e),i&&i.d(r)}}}function Gi(t){let e,n=Ne(Object.entries(t[1])),i=[];for(let r=0;r{console.log("Showing preview for",l),l&&(n(1,r=l),console.log("Showing Thumb preview for",l,r),n(2,s=r.url),i.showPopover())});function o(){i.hidePopover()}$t(()=>{console.log("Mounted popover",i),i&&i.addEventListener("toggle",l=>{l.newState==="open"||(console.log("Popover has been hidden"),Ae.setSelectedRow(null))})});function a(l){Tt[l?"unshift":"push"](()=>{i=l,n(0,i)})}return[i,r,s,o,a]}class Do extends Ze{constructor(e){super(),Je(this,e,Fo,Mo,Be,{})}}const No="https://ome.github.io/ome2024-ngff-challenge/selectCaret.svg",Po="https://ome.github.io/ome2024-ngff-challenge/ome-main-nav.svg",Uo="https://ome.github.io/ome2024-ngff-challenge/github-mark-white.svg";function Bo(t){let e,n,i,r,s,o,a,l,h,u,g,m,p,_,E;return{c(){e=y("base"),n=V(),i=y("nav"),r=y("a"),s=y("img"),a=V(),l=y("a"),h=y("h2"),h.textContent="2024 NGFF Challenge",u=V(),g=y("div"),m=V(),p=y("a"),p.textContent="About",_=V(),E=y("a"),E.innerHTML=``,b(e,"href",t[0]),b(s,"alt","OME Logo"),In(s.src,o=Po)||b(s,"src",o),b(s,"class","svelte-1q2q39w"),b(r,"class","logolink svelte-1q2q39w"),b(r,"href",t[0]),b(h,"class","svelte-1q2q39w"),b(l,"href",t[0]),b(l,"class","svelte-1q2q39w"),ae(g,"flex","1"),b(p,"href","about/"),b(p,"class","svelte-1q2q39w"),b(E,"class","github svelte-1q2q39w"),b(E,"title","Open in GitHub"),b(E,"target","_blank"),b(E,"href","https://github.com/ome/ome2024-ngff-challenge/"),b(i,"class","svelte-1q2q39w")},m(N,O){x(N,e,O),x(N,n,O),x(N,i,O),d(i,r),d(r,s),d(i,a),d(i,l),d(l,h),d(i,u),d(i,g),d(i,m),d(i,p),d(i,_),d(i,E)},p:ke,i:ke,o:ke,d(N){N&&(q(e),q(n),q(i))}}}function jo(t){let e="https://ome.github.io/ome2024-ngff-challenge/";return console.log("Nav base",e),[e]}class qo extends Ze{constructor(e){super(),Je(this,e,jo,Bo,Be,{})}}function Ji(t){let e=t[0].plate_count+"",n,i;return{c(){n=U(e),i=U(" plates")},m(r,s){x(r,n,s),x(r,i,s)},p(r,s){s&1&&e!==(e=r[0].plate_count+"")&&me(n,e)},d(r){r&&(q(n),q(i))}}}function xo(t){let e,n,i,r,s,o,a,l=t[0].source+"",h,u,g,m,p,_,E=ut(t[0].bytes)+"",N,O,M,Y,G,X,J,I,f=t[0].image_count+"",c,k,z,T,L,j,Q,B,w,S=t[0].plate_count&&Ji(t);return{c(){e=y("div"),n=y("label"),i=y("img"),o=V(),a=y("div"),h=U(l),u=V(),g=y("br"),m=V(),p=y("span"),_=U("("),N=U(E),O=U(")"),Y=y("input"),X=V(),J=y("div"),S&&S.c(),I=V(),c=U(f),k=U(" images"),z=V(),T=y("label"),L=y("input"),j=V(),Q=y("span"),Q.textContent="×",b(i,"title",r=t[0].url),b(i,"class","sourceLogo svelte-1iuq3t7"),b(i,"alt","Source logo"),In(i.src,s=di(t[0].source))||b(i,"src",s),b(p,"title",M=t[0].child_csv.length+" collections"),b(Y,"class","source svelte-1iuq3t7"),b(Y,"type","radio"),b(Y,"name","source"),Y.value=G=t[0].source,b(J,"class","tooltip svelte-1iuq3t7"),b(n,"class","svelte-1iuq3t7"),b(L,"type","radio"),b(L,"name","source"),L.value="",b(L,"class","svelte-1iuq3t7"),b(Q,"title","Clear filter"),b(T,"class","clear svelte-1iuq3t7"),b(e,"class","source svelte-1iuq3t7")},m(R,F){x(R,e,F),d(e,n),d(n,i),d(n,o),d(n,a),d(a,h),d(a,u),d(a,g),d(a,m),d(a,p),d(p,_),d(p,N),d(p,O),d(a,Y),d(a,X),d(a,J),S&&S.m(J,null),d(J,I),d(J,c),d(J,k),d(e,z),d(e,T),d(T,L),d(T,j),d(T,Q),B||(w=[we(Y,"change",function(){_n(t[1])&&t[1].apply(this,arguments)}),we(L,"change",function(){_n(t[1])&&t[1].apply(this,arguments)})],B=!0)},p(R,[F]){t=R,F&1&&r!==(r=t[0].url)&&b(i,"title",r),F&1&&!In(i.src,s=di(t[0].source))&&b(i,"src",s),F&1&&l!==(l=t[0].source+"")&&me(h,l),F&1&&E!==(E=ut(t[0].bytes)+"")&&me(N,E),F&1&&M!==(M=t[0].child_csv.length+" collections")&&b(p,"title",M),F&1&&G!==(G=t[0].source)&&(Y.value=G),t[0].plate_count?S?S.p(t,F):(S=Ji(t),S.c(),S.m(J,I)):S&&(S.d(1),S=null),F&1&&f!==(f=t[0].image_count+"")&&me(c,f)},i:ke,o:ke,d(R){R&&q(e),S&&S.d(),B=!1,et(w)}}}function Vo(t,e,n){let{source:i}=e,{handleFilter:r}=e;return t.$$set=s=>{"source"in s&&n(0,i=s.source),"handleFilter"in s&&n(1,r=s.handleFilter)},[i,r]}class Wo extends Ze{constructor(e){super(),Je(this,e,Vo,xo,Be,{source:0,handleFilter:1})}}function Ho(t,e,n){const i=t.slice();return i[31]=e[n],i}function Zi(t,e,n){const i=t.slice();return i[34]=e[n],i}function Yi(t,e,n){const i=t.slice();return i[34]=e[n],i}function Qi(t,e,n){const i=t.slice();return i[39]=e[n],i}function Xi(t,e,n){const i=t.slice();return i[42]=e[n],i}function Go(t){let e,n,i,r=t[1].split("/").pop()+"",s,o,a=t[1]!=gn&&$i(t);return{c(){e=y("div"),n=U(`Showing Collection:
`),i=y("a"),s=U(r),o=V(),a&&a.c(),b(i,"href",t[1]),ae(e,"font-size","90%")},m(l,h){x(l,e,h),d(e,n),d(e,i),d(i,s),d(e,o),a&&a.m(e,null)},p(l,h){h[0]&2&&r!==(r=l[1].split("/").pop()+"")&&me(s,r),h[0]&2&&b(i,"href",l[1]),l[1]!=gn?a?a.p(l,h):(a=$i(l),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(l){l&&q(e),a&&a.d()}}}function Ko(t){let e,n=ut(t[4])+"",i,r;return{c(){e=y("strong"),i=U(n),r=U(`
of public bioimage data in the next major version of OME-Zarr,
diff --git a/index.html b/index.html
index e0bbc67..8e9bc7f 100644
--- a/index.html
+++ b/index.html
@@ -5,7 +5,7 @@
ome2024-ngff-challenge
-
+