Spacelab 0.28.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spacelab/__init__.py +6 -0
- spacelab/__main__.py +3 -0
- spacelab/cli.py +97 -0
- spacelab/hlod/__init__.py +8 -0
- spacelab/hlod/__main__.py +5 -0
- spacelab/hlod/build.py +349 -0
- spacelab/hlod/cells.py +82 -0
- spacelab/hlod/cli.py +90 -0
- spacelab/hlod/hashing.py +38 -0
- spacelab/hlod/hilbert.py +91 -0
- spacelab/hlod/read.py +150 -0
- spacelab/hlod/verify.py +142 -0
- spacelab/prep_spatialdata.py +700 -0
- spacelab/server.py +130 -0
- spacelab/static/AI_lens_black.png +0 -0
- spacelab/static/ai-new-logo.png +0 -0
- spacelab/static/aifi_logo.png +0 -0
- spacelab/static/assets/AllenInstitutePlusText-Bold-DxLtQ4oE.woff2 +0 -0
- spacelab/static/assets/AllenInstitutePlusText-BoldItalic-mxzHQhQO.woff2 +0 -0
- spacelab/static/assets/AllenInstitutePlusText-Italic-CaKmxpsW.woff2 +0 -0
- spacelab/static/assets/AllenInstitutePlusText-Light-DUThXl1m.woff2 +0 -0
- spacelab/static/assets/AllenInstitutePlusText-LightItalic-CxfKknzG.woff2 +0 -0
- spacelab/static/assets/AllenInstitutePlusText-Regular-B0ryviHQ.woff2 +0 -0
- spacelab/static/assets/AllenInstitutePlusText-Semibold-3PoiDF1d.woff2 +0 -0
- spacelab/static/assets/AllenInstitutePlusText-SemiboldItalic-uXaVqnFo.woff2 +0 -0
- spacelab/static/assets/blosc-BKQbfHyB.js +18 -0
- spacelab/static/assets/blosc-j6ygecpn.js +18 -0
- spacelab/static/assets/chunk-INHXZS53-D3tQiqtZ.js +2 -0
- spacelab/static/assets/chunk-INHXZS53-QjxmivJp.js +2 -0
- spacelab/static/assets/deflate-BRVR_fNk.js +2 -0
- spacelab/static/assets/hlodTranscripts.worker-CjhNLk56.js +2 -0
- spacelab/static/assets/index-BT-mDgg2.js +5025 -0
- spacelab/static/assets/index-CNIqsj6m.css +1 -0
- spacelab/static/assets/jpeg-JUDfHHDo.js +2 -0
- spacelab/static/assets/lerc-CXQdKTps.js +2 -0
- spacelab/static/assets/lz4-C2MQfzIA.js +16 -0
- spacelab/static/assets/lz4-rzy_Siro.js +16 -0
- spacelab/static/assets/lzw-DBCCrYEo.js +2 -0
- spacelab/static/assets/packbits-LrtZ2mhj.js +2 -0
- spacelab/static/assets/pako.esm-C69tvH9t.js +2 -0
- spacelab/static/assets/polygons.worker-ClOPdWlW.js +2 -0
- spacelab/static/assets/raw-lPmjnySZ.js +2 -0
- spacelab/static/assets/spatialdataExpression.worker-D4W_OHS3.js +4 -0
- spacelab/static/assets/spatialdataShapes.worker-DQV1zeTt.js +974 -0
- spacelab/static/assets/spatialdataTranscripts.worker-DH9L-MwZ.js +974 -0
- spacelab/static/assets/transcripts.worker-CtxyO4n3.js +2 -0
- spacelab/static/assets/umap.worker-BPHuoLPV.js +2 -0
- spacelab/static/assets/webimage-xg0Pp5Jv.js +2 -0
- spacelab/static/assets/zstd-Cp7BEDDH.js +16 -0
- spacelab/static/assets/zstd-WlDjm0Vu.js +16 -0
- spacelab/static/blurred-bg.jpg +0 -0
- spacelab/static/favicon.ico +0 -0
- spacelab/static/index.html +22 -0
- spacelab/static/logo192.png +0 -0
- spacelab/static/logo512.png +0 -0
- spacelab/static/manifest.json +15 -0
- spacelab/static/robots.txt +3 -0
- spacelab-0.28.0.dist-info/METADATA +30 -0
- spacelab-0.28.0.dist-info/RECORD +62 -0
- spacelab-0.28.0.dist-info/WHEEL +4 -0
- spacelab-0.28.0.dist-info/entry_points.txt +2 -0
- spacelab-0.28.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
function Jt(e,t){return{...e,...t,headers:{...e.headers,...t.headers}}}function Ge(e,t){const n=typeof e=="string"?new URL(e):e;n.pathname.endsWith("/")||(n.pathname+="/");const r=new URL(t.slice(1),n);return r.search=n.search,r}async function Je(e){if(e.status!==404){if(e.status===200||e.status===206)return new Uint8Array(await e.arrayBuffer());throw new Error(`Unexpected response status ${e.status} ${e.statusText}`)}}class Vt{url;#e;#t;#n;constructor(t,n={}){this.url=t,this.#e=n.fetch??(r=>fetch(r)),this.#t=n.overrides??{},this.#n=n.useSuffixRequest??!1}#r(t,n){return new Request(t,Jt(this.#t,n))}async get(t,n={}){let r=Ge(this.url,t).href,i=this.#r(r,n),s=await this.#e(i);return Je(s)}async getRange(t,n,r={}){let i=Ge(this.url,t),s;if("suffixLength"in n)s=await this.#i(i,n.suffixLength,r);else{let o={...r,headers:{...r.headers,Range:`bytes=${n.offset}-${n.offset+n.length-1}`}},a=this.#r(i,o);s=await this.#e(a)}return Je(s)}async#i(t,n,r){if(this.#n){let A={...r,headers:{...r.headers,Range:`bytes=-${n}`}};return this.#e(this.#r(t,A))}let i=this.#r(t,{...r,method:"HEAD"}),s=await this.#e(i);if(!s.ok)return s;let o=s.headers.get("Content-Length"),a=Number(o),c=a-n,l={...r,headers:{...r.headers,Range:`bytes=${c}-${a-1}`}};return this.#e(this.#r(t,l))}}class O extends Error{}class $ extends O{_tag="NotFoundError";name="NotFoundError";path;found;constructor(t,n={}){super(`Not found: ${t}`,{cause:n.cause}),this.path=n.path,this.found=n.found}}class m extends O{_tag="InvalidMetadataError";name="InvalidMetadataError";path;constructor(t,n={}){super(t,{cause:n.cause}),this.path=n.path}}class jt extends O{_tag="UnknownCodecError";name="UnknownCodecError";codec;constructor(t){super(`Unknown codec: ${t}`),this.codec=t}}class Ht extends O{_tag="CodecPipelineError";name="CodecPipelineError";direction;codec;chunkPath;constructor(t){const n=[`Failed to ${t.direction} chunk`,t.codec&&`via codec "${t.codec}"`,t.chunkPath&&`at ${t.chunkPath}`].filter(Boolean);super(n.join(" "),{cause:t.cause}),this.direction=t.direction,this.codec=t.codec,this.chunkPath=t.chunkPath}}class j extends O{_tag="InvalidSelectionError";name="InvalidSelectionError"}class Te extends O{_tag="UnsupportedError";name="UnsupportedError";feature;constructor(t){super(`Unsupported: ${t}`),this.feature=t}}function M(e){return()=>{throw new Te(`${e} encode`)}}class te{kind="array_to_array";constructor(t,n){if(t.keepbits<0)throw new m("keepbits must be zero or positive")}static fromConfig(t,n){return new te(t,n)}encode=M("bitround");decode(t){return t}}function ke(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer}class Qt{#e;constructor(t,n,r){typeof t=="number"?this.#e=new Uint8Array(t):ke(t)?this.#e=new Uint8Array(t,n,r):this.#e=new Uint8Array(Array.from(t,i=>i?1:0))}get BYTES_PER_ELEMENT(){return 1}get byteOffset(){return this.#e.byteOffset}get byteLength(){return this.#e.byteLength}get buffer(){return this.#e.buffer}get length(){return this.#e.length}get(t){let n=this.#e[t];return typeof n=="number"?n!==0:n}set(t,n){this.#e[t]=n?1:0}fill(t){this.#e.fill(t?1:0)}*[Symbol.iterator](){for(let t=0;t<this.length;t++)yield this.get(t)}}class Le{_data;chars;#e;constructor(t,n,r,i){if(this.chars=t,this.#e=new TextEncoder,typeof n=="number")this._data=new Uint8Array(n*t);else if(ke(n))i&&(i=i*t),this._data=new Uint8Array(n,r,i);else{let s=Array.from(n);this._data=new Uint8Array(s.length*t);for(let o=0;o<s.length;o++)this.set(o,s[o])}}get BYTES_PER_ELEMENT(){return this.chars}get byteOffset(){return this._data.byteOffset}get byteLength(){return this._data.byteLength}get buffer(){return this._data.buffer}get length(){return this.byteLength/this.BYTES_PER_ELEMENT}get(t){const n=new Uint8Array(this.buffer,this.byteOffset+this.chars*t,this.chars);return new TextDecoder().decode(n).replace(/\x00/g,"")}set(t,n){const r=new Uint8Array(this.buffer,this.byteOffset+this.chars*t,this.chars);r.fill(0),r.set(this.#e.encode(n))}fill(t){const n=this.#e.encode(t);for(let r=0;r<this.length;r++)this._data.set(n,r*this.chars)}*[Symbol.iterator](){for(let t=0;t<this.length;t++)yield this.get(t)}}class H{#e;chars;constructor(t,n,r,i){if(this.chars=t,typeof n=="number")this.#e=new Int32Array(n*t);else if(ke(n))i&&(i*=t),this.#e=new Int32Array(n,r,i);else{const s=n,o=new H(t,1);this.#e=new Int32Array(function*(){for(let a of s)o.set(0,a),yield*o.#e}())}}get BYTES_PER_ELEMENT(){return this.#e.BYTES_PER_ELEMENT*this.chars}get byteLength(){return this.#e.byteLength}get byteOffset(){return this.#e.byteOffset}get buffer(){return this.#e.buffer}get length(){return this.#e.length/this.chars}get(t){const n=this.chars*t;let r="";for(let i=0;i<this.chars;i++)r+=String.fromCodePoint(this.#e[n+i]);return r.replace(/\u0000/g,"")}set(t,n){const r=this.chars*t,i=this.#e.subarray(r,r+this.chars);i.fill(0);for(let s=0;s<this.chars;s++)i[s]=n.codePointAt(s)??0}fill(t){this.set(0,t);let n=this.#e.subarray(0,this.chars);for(let r=1;r<this.length;r++)this.#e.set(n,r*this.chars)}*[Symbol.iterator](){for(let t=0;t<this.length;t++)yield this.get(t)}}function Tt(){if(typeof SharedArrayBuffer>"u")throw new Error("SharedArrayBuffer is not available. In browsers, this requires Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers to be set.")}function kt(e,t){return new SharedArrayBuffer(e)}function q(e){const t=new TextDecoder().decode(e);try{return JSON.parse(t)}catch(n){throw new m("Failed to decode JSON",{cause:n})}}function Ve(e,t){const n=t/2,r=t-1;let i=0;for(let s=0;s<e.length;s+=t)for(let o=0;o<n;o+=1)i=e[s+o],e[s+o]=e[s+r-o],e[s+r-o]=i}function v(e){if(e==="v2:object")return globalThis.Array;let t=e.match(/v2:([US])(\d+)/);if(t){let[,r,i]=t;return(r==="U"?H:Le).bind(null,Number(i))}if(e==="string")return globalThis.Array;let n={int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:globalThis.BigInt64Array,uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:globalThis.BigUint64Array,float16:globalThis.Float16Array,float32:Float32Array,float64:Float64Array,bool:Qt}[e];if(!n)throw new m(`Unknown or unsupported dataType: ${e}`);return n}function Y(e,t){const n=e.length;typeof t=="string"&&(t=t==="C"?Array.from({length:n},(s,o)=>o):Array.from({length:n},(s,o)=>n-1-o)),b(n===t.length,"Order length must match the number of dimensions.");let r=1,i=new Array(n);for(let s=t.length-1;s>=0;s--)i[t[s]]=r,r*=e[t[s]];return i}function qt({name:e,configuration:t}){if(e==="default"){const n=t?.separator??"/";return r=>["c",...r].join(n)}if(e==="v2"){const n=t?.separator??".";return r=>r.join(n)||"0"}throw new m(`Unknown chunk key encoding: ${e}`)}function je(e){if(e==="|O")return{dataType:"v2:object"};let t=e.match(/^([<|>])(.*)$/);if(!t)throw new m(`Invalid dtype: ${e}`);let[,n,r]=t,i={b1:"bool",i1:"int8",u1:"uint8",i2:"int16",u2:"uint16",i4:"int32",u4:"uint32",i8:"int64",u8:"uint64",f2:"float16",f4:"float32",f8:"float64"}[r]??(r.startsWith("S")||r.startsWith("U")?`v2:${r}`:void 0);if(!i)throw new m(`Unsupported or unknown dtype: ${e}`);return n==="|"?{dataType:i}:{dataType:i,endian:n==="<"?"little":"big"}}function Kt(e){return(e.id==="fixedscaleoffset"||e.id==="numcodecs.fixedscaleoffset")&&typeof e.scale=="number"&&typeof e.offset=="number"&&(e.astype===void 0||typeof e.astype=="string")&&(e.dtype===void 0||typeof e.dtype=="string")}function Xt(e,t={}){let n=[],r=je(e.dtype);e.order==="F"&&n.push({name:"transpose",configuration:{order:"F"}});for(let s of e.filters??[]){if(s.id==="fixedscaleoffset"||s.id==="numcodecs.fixedscaleoffset"){if(!Kt(s))throw new m(`Invalid fixedscaleoffset filter: ${JSON.stringify(s)}`);n.push({name:"scale_offset",configuration:{scale:s.scale,offset:s.offset}});let c=s.astype??s.dtype;if(c!==void 0&&c!==e.dtype){let l=je(c).dataType;if(!pe(l,"number")&&!pe(l,"bigint"))throw new m(`fixedscaleoffset astype must be a numeric data type, got ${c}`);n.push({name:"cast_value",configuration:{data_type:l,rounding:"nearest-even",out_of_range:"wrap"}})}continue}let{id:o,...a}=s;n.push({name:`numcodecs.${o}`,configuration:a})}if("endian"in r&&r.endian==="big"&&n.push({name:"bytes",configuration:{endian:"big"}}),e.compressor){let{id:s,...o}=e.compressor;n.push({name:`numcodecs.${s}`,configuration:o})}let i;return globalThis.Array.isArray(t._ARRAY_DIMENSIONS)&&(i=t._ARRAY_DIMENSIONS),{zarr_format:3,node_type:"array",shape:e.shape,data_type:r.dataType,chunk_grid:{name:"regular",configuration:{chunk_shape:e.chunks}},chunk_key_encoding:{name:"v2",configuration:{separator:e.dimension_separator??"."}},codecs:n,fill_value:e.fill_value,dimension_names:i,attributes:t}}function Wt(e,t={}){return{zarr_format:3,node_type:"group",attributes:t}}function pe(e,t){if(t!=="number"&&t!=="bigint"&&t!=="boolean"&&t!=="object"&&t!=="string")return e===t;let n=e==="bool";if(t==="boolean")return n;let r=e.startsWith("v2:U")||e.startsWith("v2:S")||e==="string";if(t==="string")return r;let i=e==="int64"||e==="uint64";if(t==="bigint")return i;let s=e==="v2:object";return t==="object"?s:!r&&!i&&!n&&!s}function Zt(e){return e?.name==="sharding_indexed"}function Lt(e){if((e.data_type==="uint64"||e.data_type==="int64")&&e.fill_value!=null)return BigInt(e.fill_value);let t=e.data_type==="float16"||e.data_type==="float32"||e.data_type==="float64";if(typeof e.fill_value=="string"&&t){let n={NaN:NaN,Infinity:1/0,"-Infinity":-1/0};if(e.fill_value in n)return n[e.fill_value]}return e.fill_value}function en(e){let t=e.signal,n=e.opts?.signal;return t&&n?AbortSignal.any([t,n]):t??n}function Mt(e,...t){if(!t.some(n=>e instanceof n))throw e}function b(e,t=""){if(!e)throw new Error(t)}async function Dt(e,{format:t,signal:n}){let r;if(e instanceof ArrayBuffer)r=new Response(e);else{let i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);r=new Response(i.slice().buffer)}b(r.body,"Response does not contain body.");try{return await new Response(r.body.pipeThrough(new DecompressionStream(t),{signal:n})).arrayBuffer()}catch{throw n?.throwIfAborted(),new Error(`Failed to decode ${t}`)}}const He=tn();function tn(){const e=new Uint32Array([305419896]);return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)[0]!==18}function qe(e){return"BYTES_PER_ELEMENT"in e?e.BYTES_PER_ELEMENT:4}class ae{kind="array_to_bytes";#e;#t;#n;#r;#i;constructor(t,n){this.#i=t?.endian,this.#t=v(n.dataType),this.#r=n.shape,this.#e=Y(n.shape,"C");const r=new this.#t(0);this.#n=r.BYTES_PER_ELEMENT}static fromConfig(t,n){return new ae(t,n)}encode(t){let n=new Uint8Array(t.data.buffer);return He&&this.#i==="big"&&(n=n.slice(),Ve(n,qe(this.#t))),n}computeEncodedSize(t){return t}decode(t){return He&&this.#i==="big"&&(t=t.slice(),Ve(t,qe(this.#t))),{data:new this.#t(t.buffer,t.byteOffset,t.byteLength/this.#n),shape:this.#r,stride:this.#e}}}const Ke={NaN:NaN,Infinity:1/0,"-Infinity":-1/0},Ft={float16:2,float32:4,float64:8};function ne(e){return e in Ft}function _e(e){return e==="int64"||e==="uint64"}function nn(e,t){const n=BigInt(e),r=new ArrayBuffer(t),i=new DataView(r);if(t===2){if(typeof i.getFloat16!="function")throw new Te("float16 hex-encoded scalar decoding (requires DataView.prototype.getFloat16)");return i.setUint16(0,Number(n)),i.getFloat16(0)}return t===4?(i.setUint32(0,Number(n)),i.getFloat32(0)):(i.setBigUint64(0,n),i.getFloat64(0))}function re(e,t){if(_e(e)){if(typeof t!="number"||!Number.isInteger(t))throw new m(`Expected an integer value for data type "${e}", got ${JSON.stringify(t)}`);return BigInt(t)}if(typeof t=="number"){if(!ne(e)&&!Number.isInteger(t))throw new m(`Expected an integer value for data type "${e}", got ${t}`);return t}if(!ne(e))throw new m(`String-encoded scalar "${t}" is not valid for non-float data type "${e}"`);return t in Ke?Ke[t]:nn(t,Ft[e])}const Xe=new Set(["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float16","float32","float64"]),le={int8:[-128,2**7-1],uint8:[0,2**8-1],int16:[-32768,2**15-1],uint16:[0,2**16-1],int32:[-2147483648,2**31-1],uint32:[0,2**32-1]},ue={int64:[-(2n**63n),2n**63n-1n],uint64:[0n,2n**64n-1n]};function We(e,t,n){return e.map(([r,i])=>({src:re(t,r),tgt:re(n,i)}))}function rn(e,t){for(const n of t)if(typeof n.src=="number"&&Number.isNaN(n.src)){if(typeof e=="number"&&Number.isNaN(e))return n.tgt}else if(e===n.src)return n.tgt}function sn(e){if(!Number.isFinite(e))return e;if(Math.abs(e-Math.trunc(e))===.5){const t=Math.floor(e),n=Math.ceil(e);return t%2===0?t:n}return Math.round(e)}function on(e){return Math.sign(e)*Math.floor(Math.abs(e)+.5)}function Ze(e){switch(e){case"nearest-even":return sn;case"towards-zero":return Math.trunc;case"towards-positive":return Math.ceil;case"towards-negative":return Math.floor;case"nearest-away":return on}}function Ae(e,t,n){const r=t-e+1;switch(n){case"clamp":return i=>i<e?e:i>t?t:i;case"wrap":return i=>i>=e&&i<=t?i:((i-e)%r+r)%r+e;default:return i=>{if(i>=e&&i<=t)return i;throw new Error(`Value ${i} out of range [${e}, ${t}]. Set out_of_range='clamp' or out_of_range='wrap' to handle this.`)}}}function de(e,t,n){const r=t-e+1n;switch(n){case"clamp":return i=>i<e?e:i>t?t:i;case"wrap":return i=>i>=e&&i<=t?i:((i-e)%r+r)%r+e;default:return i=>{if(i>=e&&i<=t)return i;throw new Error(`Value ${i} out of range [${e}, ${t}]. Set out_of_range='clamp' or out_of_range='wrap' to handle this.`)}}}class Me{kind="array_to_array";#e;#t;#n;#r;constructor(t,n,r,i,s,o){this.#e=n,this.#t=v(t),this.#n=et(n,t,r,i,s),this.#r=et(t,n,r,i,o)}getEncodedMeta(t){let n=t.fillValue;return n!=null&&(n=this.#r(n)),{...t,dataType:this.#e,fillValue:n}}static fromConfig(t,n){const r=n.dataType,i=t.data_type;if(!Xe.has(r))throw new m(`cast_value codec does not support array data type: ${r}`);if(!Xe.has(i))throw new m(`cast_value codec does not support encoded data type: ${i}`);const s=t.rounding??"nearest-even",o=t.scalar_map?.decode?We(t.scalar_map.decode,i,r):[],a=t.scalar_map?.encode?We(t.scalar_map.encode,r,i):[];return new Me(r,i,s,t.out_of_range,o,a)}encode=M("cast_value");decode(t){const n=t.data,r=new this.#t(n.length);for(let i=0;i<n.length;i++)r[i]=this.#n(n[i]);return{data:r,shape:t.shape,stride:t.stride}}}function et(e,t,n,r,i){const s=ne(e),o=_e(e),a=ne(t),c=_e(t);let l;if(s&&a){if(n!=="nearest-even")throw new m(`cast_value float -> float only supports "nearest-even" rounding, got "${n}"`);l=u=>u}else if(s&&!a&&!c){const u=Ze(n),h=Ae(...le[t],r);l=w=>{if(!Number.isFinite(w))throw new Error(`Cannot cast ${w} to integer type without scalar_map`);return h(u(w))}}else if(s&&c){const u=Ze(n),h=de(...ue[t],r);l=w=>{if(!Number.isFinite(w))throw new Error(`Cannot cast ${w} to integer type without scalar_map`);return h(BigInt(u(w)))}}else if(!s&&!o&&a)l=u=>u;else if(o&&a)l=u=>Number(u);else if(!s&&!o&&!a&&!c)l=Ae(...le[t],r);else if(!s&&!o&&c){const u=de(...ue[t],r);l=h=>u(BigInt(h))}else if(o&&!a&&!c){const u=Ae(...le[t],r);l=h=>u(Number(h))}else if(o&&c)l=de(...ue[t],r);else throw new Error(`Unhandled type combination: ${e} -> ${t}`);return i.length===0?l:u=>{const h=rn(u,i);return h!==void 0?h:l(u)}}class De{kind="bytes_to_bytes";static fromConfig(){return new De}encode=M("crc32c");decode(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength-4)}computeEncodedSize(t){return t+4}}const an=new Set(["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float16","float32","float64"]);function tt(e,t){const n=e.length;let r=n===0||t[n-1]===1;for(let s=n-2;s>=0&&r;s--)r=t[s]===t[s+1]*e[s+1];if(r)return;let i=n===0||t[0]===1;for(let s=1;s<n&&i;s++)i=t[s]===t[s-1]*e[s-1];if(!i)throw new Error(`DeltaCodec requires C- or Fortran-contiguous strides, got shape=${JSON.stringify(e)} stride=${JSON.stringify(t)}`)}class Fe{kind="array_to_array";#e;constructor(t){this.#e=t}static fromConfig(t,n){if(!an.has(n.dataType))throw new m(`Delta codec does not support data type: ${n.dataType}`);return new Fe(v(n.dataType))}encode(t){tt(t.shape,t.stride);const n=t.data,r=new this.#e(n.length);r[0]=n[0];for(let i=1;i<n.length;i++)r[i]=n[i]-n[i-1];return{data:r,shape:t.shape,stride:t.stride}}decode(t){tt(t.shape,t.stride);const n=t.data,r=new this.#e(n.length);r[0]=n[0];for(let i=1;i<n.length;i++)r[i]=r[i-1]+n[i];return{data:r,shape:t.shape,stride:t.stride}}}class xe{kind="bytes_to_bytes";static fromConfig(t){return new xe}encode=M("gzip");async decode(t){const n=await Dt(t,{format:"gzip"});return new Uint8Array(n)}}function cn(e,t){return b(!Number.isNaN(t),"JsonCodec allow_nan is false but NaN was encountered during encoding."),b(t!==Number.POSITIVE_INFINITY,"JsonCodec allow_nan is false but Infinity was encountered during encoding."),b(t!==Number.NEGATIVE_INFINITY,"JsonCodec allow_nan is false but -Infinity was encountered during encoding."),t}function fn(e,t){return t instanceof Object&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,r)=>(n[r]=t[r],n),{}):t}class ie{configuration;kind="array_to_bytes";#e;#t;constructor(t={}){this.configuration=t;const{encoding:n="utf-8",skipkeys:r=!1,ensure_ascii:i=!0,check_circular:s=!0,allow_nan:o=!0,sort_keys:a=!0,indent:c,strict:l=!0}=t;let A=t.separators;A||(c?A=[", ",": "]:A=[",",":"]),this.#e={encoding:n,skipkeys:r,ensure_ascii:i,check_circular:s,allow_nan:o,indent:c,separators:A,sort_keys:a},this.#t={strict:l}}static fromConfig(t){return new ie(t)}encode(t){const{indent:n,encoding:r,ensure_ascii:i,check_circular:s,allow_nan:o,sort_keys:a}=this.#e;b(r==="utf-8","JsonCodec does not yet support non-utf-8 encoding.");const c=[];b(s,"JsonCodec does not yet support skipping the check for circular references during encoding."),o||c.push(cn),a&&c.push(fn);const l=Array.from(t.data);l.push("|O"),l.push(t.shape);let A;c.length&&(A=(h,w)=>{let p=w;for(let C of c)p=C(h,p);return p});let u=JSON.stringify(l,A,n);return i&&(u=u.replace(/[\u007F-\uFFFF]/g,h=>{const w=`0000${h.charCodeAt(0).toString(16)}`;return`\\u${w.substring(w.length-4)}`})),new TextEncoder().encode(u)}decode(t){const{strict:n}=this.#t;b(n,"JsonCodec does not yet support non-strict decoding.");const r=q(t),i=r.pop();r.pop(),b(i,"0D not implemented for JsonCodec.");const s=Y(i,"C");return{data:r,shape:i,stride:s}}}const ln=new Set(["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float16","float32","float64"]);class Ue{kind="array_to_array";#e;#t;#n;constructor(t,n,r){this.#t=t,this.#n=n,this.#e=r}static fromConfig(t,n){if(!ln.has(n.dataType))throw new m(`scale_offset codec does not support data type: ${n.dataType}`);return new Ue(re(n.dataType,t.scale??1),re(n.dataType,t.offset??0),v(n.dataType))}encode=M("scale_offset");decode(t){const n=t.data,r=new this.#e(n.length);for(let i=0;i<n.length;i++)r[i]=n[i]/this.#t+this.#n;return{data:r,shape:t.shape,stride:t.stride}}}class Re{kind="bytes_to_bytes";#e;constructor(t,n){if(n){let r=new(v(n.dataType))(0);b("BYTES_PER_ELEMENT"in r,`Shuffle codec requires a fixed-size dtype, got "${n.dataType}"`),this.#e=r.BYTES_PER_ELEMENT}else this.#e=t.elementsize??4}static fromConfig(t,n){return new Re(t,n)}encode(t){return un(t,this.#e)}decode(t){return An(t,this.#e)}}function un(e,t){let n=e.length,r=Math.floor(n/t),i=new Uint8Array(n);for(let s=0;s<t;s++)for(let o=0;o<r;o++)i[s*r+o]=e[o*t+s];return i}function An(e,t){let n=e.length,r=Math.floor(n/t),i=new Uint8Array(n);for(let s=0;s<t;s++)for(let o=0;o<r;o++)i[o*t+s]=e[s*r+o];return i}function nt(e){return e instanceof Qt||e instanceof Le||e instanceof H?new Proxy(e,{get(n,r){return n.get(Number(r))},set(n,r,i){return n.set(Number(r),i),!0}}):e}function dn(e,t){let n;return e.data instanceof Le||e.data instanceof H?n=new e.data.constructor(e.data.chars,e.data.length):n=new e.data.constructor(e.data.length),{data:n,shape:e.shape,stride:Y(e.shape,t)}}function hn(e,t){let n=dn(e,t),r=e.shape.length,i=e.shape.reduce((c,l)=>c*l,1),s=Array(r).fill(0),o=nt(e.data),a=nt(n.data);for(let c=0;c<i;c++){let l=0,A=0;for(let u=0;u<r;u++)l+=s[u]*e.stride[u],A+=s[u]*n.stride[u];a[A]=o[l],s[0]+=1;for(let u=0;u<r;u++)if(s[u]===e.shape[u]){if(u+1===r)break;s[u]=0,s[u+1]+=1}}return n}function gn(e){let t=e.shape.length;return b(t===e.stride.length,"Shape and stride must have the same length."),e.stride.map((n,r)=>({stride:n,index:r})).sort((n,r)=>r.stride-n.stride).map(n=>n.index)}function wn(e,t){let n=gn(e);return b(n.length===t.length,"Orders must match"),n.every((r,i)=>r===t[i])}class Oe{kind="array_to_array";#e;constructor(t,n){let r=t.order??"C",i=n.shape.length,s=new Array(i);if(r==="C")for(let o=0;o<i;++o)s[o]=o;else if(r==="F")for(let o=0;o<i;++o)s[o]=i-o-1;else{s=r;let o=new Array(i);s.forEach(a=>{b(!o[a],`Invalid permutation: ${JSON.stringify(r)}`),o[a]=!0})}this.#e=s}static fromConfig(t,n){return new Oe(t,n)}encode(t){return wn(t,this.#e)?t:hn(t,this.#e)}decode(t){return{data:t.data,shape:t.shape,stride:Y(t.shape,this.#e)}}}class se{kind="array_to_bytes";#e;#t;constructor(t){this.#e=t,this.#t=Y(t,"C")}static fromConfig(t,n){return new se(n.shape)}encode=M("vlen-utf8");decode(t){let n=new TextDecoder,r=new DataView(t.buffer),i=Array(r.getUint32(0,!0)),s=4;for(let o=0;o<i.length;o++){let a=r.getUint32(s,!0);s+=4,i[o]=n.decode(t.buffer.slice(s,s+a)),s+=a}return{data:i,shape:this.#e,stride:this.#t}}}class $e{kind="bytes_to_bytes";static fromConfig(t){return new $e}encode=M("zlib");async decode(t){const n=await Dt(t,{format:"deflate"});return new Uint8Array(n)}}function yn(){let e=()=>import("./blosc-j6ygecpn.js").then(s=>s.default),t=()=>import("./lz4-rzy_Siro.js").then(s=>s.default),n=()=>import("./zstd-Cp7BEDDH.js").then(s=>s.default),r=()=>xe,i=()=>$e;return new Map().set("blosc",e).set("lz4",t).set("zstd",n).set("gzip",r).set("zlib",i).set("transpose",()=>Oe).set("bytes",()=>ae).set("crc32c",()=>De).set("vlen-utf8",()=>se).set("json2",()=>ie).set("bitround",()=>te).set("cast_value",()=>Me).set("scale_offset",()=>Ue).set("numcodecs.blosc",e).set("numcodecs.lz4",t).set("numcodecs.zstd",n).set("numcodecs.gzip",r).set("numcodecs.zlib",i).set("numcodecs.vlen-utf8",()=>se).set("numcodecs.shuffle",()=>Re).set("numcodecs.delta",()=>Fe).set("numcodecs.bitround",()=>te).set("numcodecs.json2",()=>ie)}const pn=yn();function Ie(e){let t;function n(){return t||(t=_n(e)),t}async function r(i,s,o){try{return await o()}catch(a){throw new Ht({direction:i,codec:s,cause:a})}}return{async encode(i){let s=await n();for(const{name:a,codec:c}of s.arrayToArray)i=await r("encode",a,()=>c.encode(i));let o=await r("encode",s.arrayToBytes.name,()=>s.arrayToBytes.codec.encode(i));for(const{name:a,codec:c}of s.bytesToBytes)o=await r("encode",a,()=>c.encode(o));return o},async decode(i){let s=await n();for(let a=s.bytesToBytes.length-1;a>=0;a--){const{name:c,codec:l}=s.bytesToBytes[a];i=await r("decode",c,()=>l.decode(i))}let o=await r("decode",s.arrayToBytes.name,()=>s.arrayToBytes.codec.decode(i));for(let a=s.arrayToArray.length-1;a>=0;a--){const{name:c,codec:l}=s.arrayToArray[a];o=await r("decode",c,()=>l.decode(o))}return o},async computeEncodedSize(i){let s=await n(),o=rt(s.arrayToBytes.name,s.arrayToBytes.codec,i);for(const{name:a,codec:c}of s.bytesToBytes)o=rt(a,c,o);return o}}}function rt(e,t,n){if(!t.computeEncodedSize)throw new m(`Codec "${e}" cannot compute its encoded size; it is not a fixed-size codec and cannot be used in a sharding index pipeline`);return t.computeEncodedSize(n)}async function _n(e){let t=e.codecs.map(async o=>{let a=await pn.get(o.name)?.();if(!a)throw new jt(o.name);return{Codec:a,meta:o}}),n=[],r,i=[],s={...e};for await(let{Codec:o,meta:a}of t){let c=o.fromConfig(a.configuration,s);switch(c.kind){case"array_to_array":n.push({name:a.name,codec:c}),c.getEncodedMeta&&(s=c.getEncodedMeta(s));break;case"array_to_bytes":r={name:a.name,codec:c};break;default:i.push({name:a.name,codec:c})}}if(!r){if(!In(s))throw new m(`Cannot encode ${s.dataType} to bytes without a codec`);r={name:"bytes",codec:ae.fromConfig({endian:"little"},s)}}return{arrayToArray:n,arrayToBytes:r,bytesToBytes:i}}function In(e){return e.dataType!=="v2:object"&&e.dataType!=="string"}const it=18446744073709551615n;function mn(e,t,n,r){if(!e.store.getRange)throw new Te("sharding requires a store with getRange");let i=e.store.getRange.bind(e.store),s=t.map((l,A)=>l/r.chunk_shape[A]),o=Ie({dataType:"uint64",shape:[...s,2],codecs:r.index_codecs,fillValue:null}),a=16*s.reduce((l,A)=>l*A,1),c={};return async(l,A)=>{let u=l.map((_,N)=>Math.floor(_/s[N])),h=e.resolve(n(u)).path;h in c||(c[h]=(async()=>{let _=await o.computeEncodedSize(a),N=await i(h,{suffixLength:_},A);return N?await o.decode(N):null})().catch(_=>{throw delete c[h],_}));let w=await c[h];if(w===null)return;let{data:p,shape:C,stride:B}=w,y=l.map((_,N)=>_%C[N]).reduce((_,N,F)=>_+N*B[F],0),d=p[y],S=p[y+1];if(!(d===it&&S===it))return i(h,{offset:Number(d),length:Number(S)},A)}}class D{store;path;constructor(t,n="/"){this.store=t,this.path=n}resolve(t){let n=new URL(`file://${this.path.endsWith("/")?this.path:`${this.path}/`}`);return new D(this.store,decodeURIComponent(new URL(t,n).pathname))}}function En(e){return new D(e??new Map)}class ve extends D{kind="group";#e;constructor(t,n,r){super(t,n),this.#e=r}get attrs(){return this.#e.attributes}}function st(e){return e.find(n=>n.name==="transpose")?.configuration?.order??"C"}function Cn(e,t){let n=new Map(t.map((r,i)=>[r,i]));return e.filter(r=>n.has(r)).map(r=>n.get(r))}function ot(e){return(t,n)=>{let r=globalThis.Array.isArray(e)&&n?Cn(e,n):e;return Y(t,r)}}const V=Symbol("zarrita.context");function Bn(e){return e[V]}function bn(e,t){let{configuration:n}=t.codecs.find(Zt)??{},r={encodeChunkKey:qt(t.chunk_key_encoding),TypedArray:v(t.data_type),fillValue:t.fill_value};if(n){let s=st(n.codecs);return{...r,kind:"sharded",chunkShape:n.chunk_shape,codec:Ie({dataType:t.data_type,shape:n.chunk_shape,codecs:n.codecs,fillValue:t.fill_value}),getStrides:ot(s),getChunkBytes:mn(e,t.chunk_grid.configuration.chunk_shape,r.encodeChunkKey,n)}}let i=st(t.codecs);return{...r,kind:"regular",chunkShape:t.chunk_grid.configuration.chunk_shape,codec:Ie({dataType:t.data_type,shape:t.chunk_grid.configuration.chunk_shape,codecs:t.codecs,fillValue:t.fill_value}),getStrides:ot(i),async getChunkBytes(s,o){let a=r.encodeChunkKey(s),c=e.resolve(a).path;return e.store.get(c,o)}}}let L=class extends D{kind="array";#e;[V];constructor(t,n,r){super(t,n),this.#e={...r,fill_value:Lt(r)},this[V]=bn(this,this.#e)}get attrs(){return this.#e.attributes}get dimensionNames(){return this.#e.dimension_names}get fillValue(){return this.#e.fill_value}get shape(){return this.#e.shape}get chunks(){return this[V].chunkShape}get dtype(){return this.#e.data_type}async getChunk(t,n,r){r?.useSharedArrayBuffer&&Tt();let i=this[V],s=await i.getChunkBytes(t,n);if(!s){let o=i.chunkShape.reduce((c,l)=>c*l,1),a;if(r?.useSharedArrayBuffer){let c=new i.TypedArray(0);if(!("BYTES_PER_ELEMENT"in c))console.warn("zarrita: useSharedArrayBuffer is not supported for non-buffer-backed data types."),a=new i.TypedArray(o);else{let l=kt(o*c.BYTES_PER_ELEMENT);a=new i.TypedArray(l,0,o)}}else a=new i.TypedArray(o);return a.fill(i.fillValue),{data:a,shape:i.chunkShape,stride:i.getStrides(i.chunkShape)}}return i.codec.decode(s)}is(t){return pe(this.dtype,t)}};function Sn(e,t){let n=e;for(let r of t)n instanceof Promise?n=n.then(i=>r(i)):n=r(n);return n}function Nn(e,...t){return Sn(e,t)}async function xt(e){let t=e.store.arrayExtensions;return t?.length?await Nn(e,...t):e}let ce=Qn();function Qn(){let e=new WeakMap;function t(n){let r=e.get(n)??{v2:0,v3:0};return e.set(n,r),r}return{increment(n,r){t(n)[r]+=1},versionMax(n){let r=t(n);return r.v3>r.v2?"v3":"v2"}}}async function Tn(e,t){let n=await e.store.get(e.resolve(".zattrs").path,{signal:t});return n?q(n):{}}async function kn(e,t={}){let n="store"in e?e:new D(e),{signal:r}=t,i={};return(t.attrs??!0)&&(i=await Tn(n,r)),r?.throwIfAborted(),t.kind==="array"?at(n,i,r):t.kind==="group"?ct(n,i,r):at(n,i,r).catch(s=>(Mt(s,$,m),ct(n,i,r)))}async function at(e,t,n){let{path:r}=e.resolve(".zarray"),i=await e.store.get(r,{signal:n});if(!i)throw new $("v2 array",{path:r});return ce.increment(e.store,"v2"),xt(new L(e.store,e.path,Xt(q(i),t)))}async function ct(e,t,n){let{path:r}=e.resolve(".zgroup"),i=await e.store.get(r,{signal:n});if(!i)throw new $("v2 group",{path:r});return ce.increment(e.store,"v2"),new ve(e.store,e.path,Wt(q(i),t))}async function Ln(e,t){let{store:n,path:r}=e.resolve("zarr.json"),i=await e.store.get(r,{signal:t});if(!i)throw new $("v3 array or group",{path:r});let s=q(i);return s.node_type==="array"&&(s.fill_value=Lt(s)),s.node_type==="array"?xt(new L(n,e.path,s)):new ve(n,e.path,s)}async function Mn(e,t={}){let n="store"in e?e:new D(e),r=await Ln(n,t.signal);if(ce.increment(n.store,"v3"),t.kind===void 0||t.kind==="array"&&r instanceof L||t.kind==="group"&&r instanceof ve)return r;let i=r instanceof L?"array":"group";throw new $(`${t.kind} at ${n.path}`,{path:n.path,found:i})}async function T(e,t={}){let n="store"in e?e.store:e,r=ce.versionMax(n),i=r==="v2"?T.v2:T.v3,s=r==="v2"?T.v3:T.v2;return i(e,t).catch(o=>(Mt(o,$,m),s(e,t)))}T.v2=kn;T.v3=Mn;function*Dn(e,t,n=1){t===void 0&&(t=e,e=0);for(let r=e;r<t;r+=n)yield r}function*Fn(...e){if(e.length===0)return;const t=e.map(r=>r[Symbol.iterator]()),n=t.map(r=>r.next());if(n.some(r=>r.done))throw new Error("Input contains an empty iterator.");for(let r=0;;){if(n[r].done){if(t[r]=e[r][Symbol.iterator](),n[r]=t[r].next(),++r>=t.length)return}else yield n.map(({value:i})=>i),r=0;n[r]=t[r].next()}}function xn({start:e,stop:t,step:n},r){if(n===0)throw new j("slice step cannot be zero");n=n??1;const i=n<0,[s,o]=i?[-1,r-1]:[0,r];return e===null?e=i?o:s:e<0?(e+=r,e<s&&(e=s)):e>o&&(e=o),t===null?t=i?s:o:t<0?(t+=r,t<s&&(t=s)):t>o&&(t=o),[e,t,n]}function he(e){if(e==null)return null;if(typeof e=="bigint"){if(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)throw new j(`Cannot safely convert ${e} to a number. Value exceeds Number.MAX_SAFE_INTEGER.`);return Number(e)}return e}function me(e,t,n=null){return t===void 0&&(t=e,e=null),{start:he(e),stop:he(t),step:he(n)}}function Un(){const e=[];return{add:t=>e.push(t()),onIdle:()=>Promise.all(e)}}function Rn(e,t){throw new j(`too many indicies for array; expected ${t.length}, got ${e.length}`)}function On(e){throw new j(`index out of bounds for dimension with length ${e}`)}function $n(){throw new j("only slices with step >= 1 are supported")}function vn(e,t){e.length>t.length&&Rn(e,t)}function Yn(e,t){return e=Math.trunc(e),e<0&&(e=t+e),(e>=t||e<0)&&On(t),e}class Pn{dimSel;dimLen;dimChunkLen;nitems;constructor({dimSel:t,dimLen:n,dimChunkLen:r}){t=Yn(t,n),this.dimSel=t,this.dimLen=n,this.dimChunkLen=r,this.nitems=1}*[Symbol.iterator](){const t=Math.floor(this.dimSel/this.dimChunkLen),n=t*this.dimChunkLen,r=this.dimSel-n;yield{dimChunkIx:t,dimChunkSel:r}}}class ge{start;stop;step;dimLen;dimChunkLen;nitems;nchunks;constructor({dimSel:t,dimLen:n,dimChunkLen:r}){const[i,s,o]=xn(t,n);this.start=i,this.stop=s,this.step=o,this.step<1&&$n(),this.dimLen=n,this.dimChunkLen=r,this.nitems=Math.max(0,Math.ceil((this.stop-this.start)/this.step)),this.nchunks=Math.ceil(this.dimLen/this.dimChunkLen)}*[Symbol.iterator](){const t=Math.floor(this.start/this.dimChunkLen),n=Math.ceil(this.stop/this.dimChunkLen);for(const r of Dn(t,n)){const i=r*this.dimChunkLen,s=Math.min(this.dimLen,(r+1)*this.dimChunkLen),o=s-i;let a=0,c=0;if(this.start<i){const w=(i-this.start)%this.step;w&&(c+=this.step-w),a=Math.ceil((i-this.start)/this.step)}else c=this.start-i;const l=this.stop>s?o:this.stop-i,A=[c,l,this.step],u=Math.ceil((l-c)/this.step),h=[a,a+u,1];yield{dimChunkIx:r,dimChunkSel:A,dimOutSel:h}}}}function zn(e,t){let n=[];return e===null?n=t.map(r=>me(null)):Array.isArray(e)&&(n=e.map(r=>r??me(null))),vn(n,t),n}class Gn{dimIndexers;shape;outputAxes;constructor({selection:t,shape:n,chunkShape:r}){this.dimIndexers=zn(t,n).map((i,s)=>new(typeof i=="number"?Pn:ge)({dimSel:i,dimLen:n[s],dimChunkLen:r[s]})),this.shape=this.dimIndexers.filter(i=>i instanceof ge).map(i=>i.nitems),this.outputAxes=this.dimIndexers.map((i,s)=>({ixr:i,axis:s})).filter(({ixr:i})=>i instanceof ge).map(({axis:i})=>i)}*[Symbol.iterator](){for(const t of Fn(...this.dimIndexers)){const n=t.map(i=>i.dimChunkIx),r=t.map(i=>"dimOutSel"in i?{from:i.dimChunkSel,to:i.dimOutSel}:{from:i.dimChunkSel,to:null});yield{chunkCoords:n,mapping:r}}}}function ft(e,t){return"get"in e?e.get(t):e[t]}async function Jn(e,t,n,r){n.useSharedArrayBuffer&&Tt();let i=en(n),s=Bn(e),o=new Gn({selection:t,shape:e.shape,chunkShape:e.chunks});if(e.shape.length===0){let{data:u}=await e.getChunk([],{signal:i},{useSharedArrayBuffer:n.useSharedArrayBuffer});return ft(u,0)}let a=o.shape.reduce((u,h)=>u*h,1),c;if(n.useSharedArrayBuffer){let u=new s.TypedArray(0);if(!("BYTES_PER_ELEMENT"in u))console.warn("zarrita: useSharedArrayBuffer is not supported for non-buffer-backed data types."),c=new s.TypedArray(a);else{let h=kt(a*u.BYTES_PER_ELEMENT);c=new s.TypedArray(h,0,a)}}else c=new s.TypedArray(a);let l=r.prepare(c,o.shape,s.getStrides(o.shape,o.outputAxes)),A=n.createQueue?.()??Un();for(const{chunkCoords:u,mapping:h}of o)A.add(async()=>{i?.throwIfAborted();let{data:w,shape:p,stride:C}=await e.getChunk(u,{signal:i},{useSharedArrayBuffer:n.useSharedArrayBuffer}),B=r.prepare(w,p,C);r.setFromChunk(l,B,h)});return await A.onIdle(),o.shape.length===0?ft(l.data,0):l}function Ye(e,t=0,n){let r=n??e.length-t;return{length:r,subarray(i,s=r){return Ye(e,t+i,s-i)},set(i,s=0){for(let o=0;o<i.length;o++)e[t+s+o]=i.get(o)},get(i){return e[t+i]}}}function we(e){return globalThis.Array.isArray(e.data)?{data:Ye(e.data),stride:e.stride,bytesPerElement:1}:{data:new Uint8Array(e.data.buffer,e.data.byteOffset,e.data.byteLength),stride:e.stride,bytesPerElement:e.data.BYTES_PER_ELEMENT}}function Vn(e){return"chars"in e?e.constructor.bind(null,e.chars):e.constructor}function jn(e,t){if(globalThis.Array.isArray(e.data))return Ye([t]);let n=Vn(e.data),r=new n([t]);return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}const Hn={prepare(e,t,n){return{data:e,shape:t,stride:n}},setScalar(e,t,n){let r=we(e);Ee(r,t,jn(e,n),r.bytesPerElement)},setFromChunk(e,t,n){let r=we(e);Z(r,we(t),r.bytesPerElement,n)}};async function oe(e,t=null,n={}){return Jn(e,t,n,Hn)}function Pe(e,t,n){return n<0&&t<e?Math.floor((e-t-1)/-n)+1:e<t?Math.floor((t-e-1)/n)+1:0}function Ee(e,t,n,r){if(t.length===0){e.data.set(n,0);return}const[i,...s]=t,[o,...a]=e.stride;if(typeof i=="number"){const h=e.data.subarray(o*i*r);Ee({data:h,stride:a},s,n,r);return}const[c,l,A]=i,u=Pe(c,l,A);if(s.length===0){for(let h=0;h<u;h++)e.data.set(n,o*(c+A*h)*r);return}for(let h=0;h<u;h++){const w=e.data.subarray(o*(c+A*h)*r);Ee({data:w,stride:a},s,n,r)}}function qn(e,t,n){if(e.length!==t.length||e.length!==n.length)return null;let r=1,i=0,s=0;for(let o=e.length-1;o>=0;o--){const a=e[o];if(a.from===null||a.to===null||t[o]!==r||n[o]!==r)return null;const[c,l,A]=a.to,[u,,h]=a.from;if(A!==1||h!==1)return null;i+=r*c,s+=r*u,r*=Pe(c,l,A)}return{size:r,destOffset:i,srcOffset:s}}function Z(e,t,n,r){const i=qn(r,e.stride,t.stride);if(i!==null){const d=i.srcOffset*n;e.data.set(t.data.subarray(d,d+i.size*n),i.destOffset*n);return}const[s,...o]=r,[a,...c]=e.stride,[l,...A]=t.stride;if(s.from===null){if(o.length===0){e.data.set(t.data.subarray(0,n),a*s.to*n);return}Z({data:e.data.subarray(a*s.to*n),stride:c},t,n,o);return}if(s.to===null){if(o.length===0){let d=l*s.from*n;e.data.set(t.data.subarray(d,d+n),0);return}Z(e,{data:t.data.subarray(l*s.from*n),stride:A},n,o);return}const[u,h,w]=s.to,[p,C,B]=s.from,y=Pe(u,h,w);if(o.length===0){for(let d=0;d<y;d++){let S=l*(p+B*d)*n;e.data.set(t.data.subarray(S,S+n),a*(u+w*d)*n)}return}for(let d=0;d<y;d++)Z({data:e.data.subarray(a*(u+d*w)*n),stride:c},{data:t.data.subarray(l*(p+d*B)*n),stride:A},n,o)}typeof window<"u"&&window.location.protocol+""+window.location.hostname+(window.location.port?`:${window.location.port}`:"")+window.location.pathname.replace(/\/+$/,"");typeof window>"u"||new URLSearchParams(window.location.search).get("hlod");const Ut=e=>{if(!(e instanceof BigInt64Array||e instanceof BigUint64Array))return e;const t=new Float64Array(e.length);for(let n=0;n<e.length;n++)t[n]=Number(e[n]);return t},P=(e,t)=>typeof e.get=="function"?e.get(t):e[t],z=async e=>{if(!(e instanceof L))throw new Error(`${e.path} is not an array`);return(await oe(e)).data},G=(e,t)=>T(e.resolve(t)),Kn=async e=>{const t=await T(e,{kind:"group"}),n=String(t.attrs._index??"_index");return Xn(e,n)},Xn=async(e,t)=>{const n=await G(e,t);if(n instanceof L){const o=await z(n);return Array.from({length:o.length},(a,c)=>String(P(o,c)))}const r=e.resolve(t);if(n.attrs["encoding-type"]==="nullable-string-array"){const[o,a]=await Promise.all([G(r,"values").then(z),G(r,"mask").then(z)]);return Array.from({length:o.length},(c,l)=>P(a,l)?"":String(P(o,l)))}const[i,s]=await Promise.all([G(r,"categories").then(z),G(r,"codes").then(z)]);return Array.from({length:s.length},(o,a)=>String(P(i,P(s,a))))},lt=["BOOLEAN","INT32","INT64","INT96","FLOAT","DOUBLE","BYTE_ARRAY","FIXED_LEN_BYTE_ARRAY"],ut=["PLAIN","GROUP_VAR_INT","PLAIN_DICTIONARY","RLE","BIT_PACKED","DELTA_BINARY_PACKED","DELTA_LENGTH_BYTE_ARRAY","DELTA_BYTE_ARRAY","RLE_DICTIONARY","BYTE_STREAM_SPLIT"],Wn=["REQUIRED","OPTIONAL","REPEATED"],Zn=["UTF8","MAP","MAP_KEY_VALUE","LIST","ENUM","DECIMAL","DATE","TIME_MILLIS","TIME_MICROS","TIMESTAMP_MILLIS","TIMESTAMP_MICROS","UINT_8","UINT_16","UINT_32","UINT_64","INT_8","INT_16","INT_32","INT_64","JSON","BSON","INTERVAL"],er=["UNCOMPRESSED","SNAPPY","GZIP","LZO","BROTLI","LZ4","ZSTD","LZ4_RAW"],tr=["DATA_PAGE","INDEX_PAGE","DICTIONARY_PAGE","DATA_PAGE_V2"],nr=["SPHERICAL","VINCENTY","THOMAS","ANDOYER","KARNEY"];function Ce(e){const t=K(e);if(t.type===1)return{type:"Point",coordinates:Be(e,t)};if(t.type===2)return{type:"LineString",coordinates:be(e,t)};if(t.type===3)return{type:"Polygon",coordinates:At(e,t)};if(t.type===4){const n=[];for(let r=0;r<t.count;r++)n.push(Be(e,K(e)));return{type:"MultiPoint",coordinates:n}}else if(t.type===5){const n=[];for(let r=0;r<t.count;r++)n.push(be(e,K(e)));return{type:"MultiLineString",coordinates:n}}else if(t.type===6){const n=[];for(let r=0;r<t.count;r++)n.push(At(e,K(e)));return{type:"MultiPolygon",coordinates:n}}else if(t.type===7){const n=[];for(let r=0;r<t.count;r++)n.push(Ce(e));return{type:"GeometryCollection",geometries:n}}else throw new Error(`Unsupported geometry type: ${t.type}`)}function K(e){const{view:t}=e,n=t.getUint8(e.offset++)===1,r=t.getUint32(e.offset,n);e.offset+=4;const i=r%1e3,s=Math.floor(r/1e3);let o=0;i>1&&i<=7&&(o=t.getUint32(e.offset,n),e.offset+=4);let a=2;return s&&a++,s===3&&a++,{littleEndian:n,type:i,dim:a,count:o}}function Be(e,t){const n=[];for(let r=0;r<t.dim;r++){const i=e.view.getFloat64(e.offset,t.littleEndian);e.offset+=8,n.push(i)}return n}function be(e,t){const n=[];for(let r=0;r<t.count;r++)n.push(Be(e,t));return n}function At(e,t){const{view:n}=e,r=[];for(let i=0;i<t.count;i++){const s=n.getUint32(e.offset,t.littleEndian);e.offset+=4,r.push(be(e,{...t,count:s}))}return r}const dt=new TextDecoder,rr={timestampFromMilliseconds(e){return new Date(Number(e))},timestampFromMicroseconds(e){return new Date(Number(e/1000n))},timestampFromNanoseconds(e){return new Date(Number(e/1000000n))},dateFromDays(e){return new Date(e*864e5)},stringFromBytes(e){return e&&dt.decode(e)},jsonFromBytes(e){return e&&JSON.parse(dt.decode(e))},geometryFromBytes(e){return e&&Ce({view:new DataView(e.buffer,e.byteOffset,e.byteLength),offset:0})},geographyFromBytes(e){return e&&Ce({view:new DataView(e.buffer,e.byteOffset,e.byteLength),offset:0})},uuidFromBytes(e){if(!e)return;const t=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return t.slice(0,8)+"-"+t.slice(8,12)+"-"+t.slice(12,16)+"-"+t.slice(16,20)+"-"+t.slice(20,32)}};function ir(e){if(!e.length)return 0;let t=0n;for(const r of e)t=t*256n+BigInt(r);const n=e.length*8;return t>=2n**BigInt(n-1)&&(t-=2n**BigInt(n)),Number(t)}function sr(e){if(!e)return;const t=e[1]<<8|e[0],n=t>>15?-1:1,r=t>>10&31,i=t&1023;return r===0?n*2**-14*(i/1024):r===31?i?NaN:n*(1/0):n*2**(r-15)*(1+i/1024)}const or=0,ht=1,gt=2,wt=3,ar=4,cr=5,fr=6,lr=7,ur=8,Ar=9,dr=12;function Rt(e){const t={};let n=0;for(;e.offset<e.view.byteLength;){const r=e.view.getUint8(e.offset++),i=r&15;if(i===or)break;const s=r>>4;n=s?n+s:Ot(e),t[`field_${n}`]=Se(e,i)}return t}function Se(e,t){switch(t){case ht:return!0;case gt:return!1;case wt:return e.view.getInt8(e.offset++);case ar:case cr:return Ot(e);case fr:return gr(e);case lr:{const n=e.view.getFloat64(e.offset,!0);return e.offset+=8,n}case ur:{const n=Ne(e),r=new Uint8Array(e.view.buffer,e.view.byteOffset+e.offset,n);return e.offset+=n,r}case Ar:{const n=e.view.getUint8(e.offset++),r=n&15;let i=n>>4;i===15&&(i=Ne(e));const s=r===ht||r===gt,o=new Array(i);for(let a=0;a<i;a++)o[a]=s?Se(e,wt)===1:Se(e,r);return o}case dr:return Rt(e);default:throw new Error(`thrift unhandled type: ${t}`)}}function Ne(e){let t=0,n=0;for(;;){const r=e.view.getUint8(e.offset++);if(t|=(r&127)<<n,!(r&128))return t;n+=7}}function hr(e){let t=0n,n=0n;for(;;){const r=e.view.getUint8(e.offset++);if(t|=BigInt(r&127)<<n,!(r&128))return t;n+=7n}}function Ot(e){const t=Ne(e);return t>>>1^-(t&1)}function gr(e){const t=hr(e);return t>>1n^-(t&1n)}function wr(e,t){const n=new Map,r=t?.find(({key:s})=>s==="geo")?.value,i=(r&&JSON.parse(r)?.columns)??{};for(const[s,o]of Object.entries(i)){if(o.encoding!=="WKB")continue;const a=o.edges==="spherical"?"GEOGRAPHY":"GEOMETRY",c=o.crs?.id??o.crs?.ids?.[0],l=c?`${c.authority}:${c.code.toString()}`:void 0;n.set(s,{type:a,crs:l})}for(let s=1;s<e.length;s++){const{logical_type:o,name:a,num_children:c,type:l}=e[s];if(c){s+=c;continue}l==="BYTE_ARRAY"&&!o&&(e[s].logical_type=n.get(a))}}const yr=1<<19,pr=new TextDecoder;function Q(e){return e&&pr.decode(e)}async function _r(e,{parsers:t,initialFetchSize:n=yr,geoparquet:r=!0}={}){if(!e||!(e.byteLength>=0))throw new Error("parquet expected AsyncBuffer");const i=Math.max(0,e.byteLength-n),s=await e.slice(i,e.byteLength),o=new DataView(s);if(o.getUint32(s.byteLength-4,!0)!==827474256)throw new Error("parquet file invalid (footer != PAR1)");const a=o.getUint32(s.byteLength-8,!0);if(a>e.byteLength-8)throw new Error(`parquet metadata length ${a} exceeds available buffer ${e.byteLength-8}`);if(a+8>n){const c=e.byteLength-a-8,l=await e.slice(c,i),A=new ArrayBuffer(a+8),u=new Uint8Array(A);return u.set(new Uint8Array(l)),u.set(new Uint8Array(s),i-c),yt(A,{parsers:t,geoparquet:r})}else return yt(s,{parsers:t,geoparquet:r})}function yt(e,{parsers:t,geoparquet:n=!0}={}){if(!(e instanceof ArrayBuffer))throw new Error("parquet expected ArrayBuffer");const r=new DataView(e),i={...rr,...t};if(r.byteLength<8)throw new Error("parquet file is too short");if(r.getUint32(r.byteLength-4,!0)!==827474256)throw new Error("parquet file invalid (footer != PAR1)");const s=r.byteLength-8,o=r.getUint32(s,!0);if(o>r.byteLength-8)throw new Error(`parquet metadata length ${o} exceeds available buffer ${r.byteLength-8}`);const a=s-o,l=Rt({view:r,offset:a}),A=l.field_1,u=l.field_2.map(y=>({type:lt[y.field_1],type_length:y.field_2,repetition_type:Wn[y.field_3],name:Q(y.field_4),num_children:y.field_5,converted_type:Zn[y.field_6],scale:y.field_7,precision:y.field_8,field_id:y.field_9,logical_type:Ir(y.field_10)})),h=u.filter(y=>y.type),w=l.field_3,p=l.field_4.map(y=>({columns:y.field_1.map((d,S)=>({file_path:Q(d.field_1),file_offset:d.field_2,meta_data:d.field_3&&{type:lt[d.field_3.field_1],encodings:d.field_3.field_2?.map(_=>ut[_]),path_in_schema:d.field_3.field_3.map(Q),codec:er[d.field_3.field_4],num_values:d.field_3.field_5,total_uncompressed_size:d.field_3.field_6,total_compressed_size:d.field_3.field_7,key_value_metadata:d.field_3.field_8?.map(_=>({key:Q(_.field_1),value:Q(_.field_2)})),data_page_offset:d.field_3.field_9,index_page_offset:d.field_3.field_10,dictionary_page_offset:d.field_3.field_11,statistics:mr(d.field_3.field_12,h[S],i),encoding_stats:d.field_3.field_13?.map(_=>({page_type:tr[_.field_1],encoding:ut[_.field_2],count:_.field_3})),bloom_filter_offset:d.field_3.field_14,bloom_filter_length:d.field_3.field_15,size_statistics:d.field_3.field_16&&{unencoded_byte_array_data_bytes:d.field_3.field_16.field_1,repetition_level_histogram:d.field_3.field_16.field_2,definition_level_histogram:d.field_3.field_16.field_3},geospatial_statistics:d.field_3.field_17&&{bbox:d.field_3.field_17.field_1&&{xmin:d.field_3.field_17.field_1.field_1,xmax:d.field_3.field_17.field_1.field_2,ymin:d.field_3.field_17.field_1.field_3,ymax:d.field_3.field_17.field_1.field_4,zmin:d.field_3.field_17.field_1.field_5,zmax:d.field_3.field_17.field_1.field_6,mmin:d.field_3.field_17.field_1.field_7,mmax:d.field_3.field_17.field_1.field_8},geospatial_types:d.field_3.field_17.field_2}},offset_index_offset:d.field_4,offset_index_length:d.field_5,column_index_offset:d.field_6,column_index_length:d.field_7,crypto_metadata:d.field_8,encrypted_column_metadata:d.field_9})),total_byte_size:y.field_2,num_rows:y.field_3,sorting_columns:y.field_4?.map(d=>({column_idx:d.field_1,descending:d.field_2,nulls_first:d.field_3})),file_offset:y.field_5,total_compressed_size:y.field_6,ordinal:y.field_7})),C=l.field_5?.map(y=>({key:Q(y.field_1),value:Q(y.field_2)})),B=Q(l.field_6);return n&&wr(u,C),{version:A,schema:u,num_rows:w,row_groups:p,key_value_metadata:C,created_by:B,metadata_length:o}}function Ir(e){return e?.field_1?{type:"STRING"}:e?.field_2?{type:"MAP"}:e?.field_3?{type:"LIST"}:e?.field_4?{type:"ENUM"}:e?.field_5?{type:"DECIMAL",scale:e.field_5.field_1,precision:e.field_5.field_2}:e?.field_6?{type:"DATE"}:e?.field_7?{type:"TIME",isAdjustedToUTC:e.field_7.field_1,unit:pt(e.field_7.field_2)}:e?.field_8?{type:"TIMESTAMP",isAdjustedToUTC:e.field_8.field_1,unit:pt(e.field_8.field_2)}:e?.field_10?{type:"INTEGER",bitWidth:e.field_10.field_1,isSigned:e.field_10.field_2}:e?.field_11?{type:"NULL"}:e?.field_12?{type:"JSON"}:e?.field_13?{type:"BSON"}:e?.field_14?{type:"UUID"}:e?.field_15?{type:"FLOAT16"}:e?.field_16?{type:"VARIANT",specification_version:e.field_16.field_1}:e?.field_17?{type:"GEOMETRY",crs:Q(e.field_17.field_1)}:e?.field_18?{type:"GEOGRAPHY",crs:Q(e.field_18.field_1),algorithm:nr[e.field_18.field_2]}:e}function pt(e){if(e.field_1)return"MILLIS";if(e.field_2)return"MICROS";if(e.field_3)return"NANOS";throw new Error("parquet time unit required")}function mr(e,t,n){return e&&{max:X(e.field_1,t,n),min:X(e.field_2,t,n),null_count:e.field_3,distinct_count:e.field_4,max_value:X(e.field_5,t,n),min_value:X(e.field_6,t,n),is_max_value_exact:e.field_7,is_min_value_exact:e.field_8}}function X(e,t,n){const{type:r,converted_type:i,logical_type:s}=t;if(e===void 0)return e;if(r==="BOOLEAN")return e[0]===1;if(r==="BYTE_ARRAY")return n.stringFromBytes(e);const o=new DataView(e.buffer,e.byteOffset,e.byteLength);if(r==="FLOAT"&&o.byteLength===4)return o.getFloat32(0,!0);if(r==="DOUBLE"&&o.byteLength===8)return o.getFloat64(0,!0);if(r==="INT32"&&i==="DECIMAL"&&o.byteLength===4)return o.getInt32(0,!0)*10**-(t.scale||0);if(r==="INT64"&&i==="DECIMAL"&&o.byteLength===8)return Number(o.getBigInt64(0,!0))*10**-(t.scale||0);if(r==="INT32"&&i==="DATE")return n.dateFromDays(o.getInt32(0,!0));if(r==="INT64"&&i==="TIMESTAMP_MILLIS")return n.timestampFromMilliseconds(o.getBigInt64(0,!0));if(r==="INT64"&&i==="TIMESTAMP_MICROS")return n.timestampFromMicroseconds(o.getBigInt64(0,!0));if(r==="INT64"&&s?.type==="TIMESTAMP"&&s?.unit==="NANOS")return n.timestampFromNanoseconds(o.getBigInt64(0,!0));if(r==="INT64"&&s?.type==="TIMESTAMP"&&s?.unit==="MICROS")return n.timestampFromMicroseconds(o.getBigInt64(0,!0));if(r==="INT64"&&s?.type==="TIMESTAMP")return n.timestampFromMilliseconds(o.getBigInt64(0,!0));const a=i?.startsWith("UINT_")||s?.type==="INTEGER"&&!s.isSigned;return r==="INT32"&&a&&o.byteLength===4?o.getUint32(0,!0):r==="INT64"&&a&&o.byteLength===8?o.getBigUint64(0,!0):r==="INT32"&&o.byteLength===4?o.getInt32(0,!0):r==="INT64"&&o.byteLength===8?o.getBigInt64(0,!0):i==="DECIMAL"?ir(e)*10**-(t.scale||0):s?.type==="FLOAT16"?sr(e):s?.type==="UUID"?n.uuidFromBytes(e):e}async function _t(e,t={},n=globalThis.fetch){const r=new AbortController,i=new Headers(t.headers);i.set("Range","bytes=0-0");const s=await n(e,{...t,headers:i,signal:r.signal});if(!s.ok)throw new Error(`fetch with range failed ${s.status}`);if(s.status===206){const o=s.headers.get("Content-Range");if(!o)throw new Error("missing content-range header");const a=o.match(/bytes \d+-\d+\/(\d+)/);if(!a)throw new Error(`invalid content-range header: ${o}`);return parseInt(a[1])}if(s.status===200){const o=s.headers.get("Content-Length");if(r.abort(),o)return parseInt(o)}throw new Error("server does not support range requests and missing content-length")}async function Er(e,t,n){const r=n??globalThis.fetch,i=await r(e,{...t,method:"HEAD"});if(i.status===403)return _t(e,t,r);if(!i.ok)throw new Error(`fetch head failed ${i.status}`);const s=i.headers.get("Content-Length");return s?parseInt(s):_t(e,t,r)}async function Cr({url:e,byteLength:t,requestInit:n,fetch:r}){if(!e)throw new Error("missing url");const i=r??globalThis.fetch;t??=await Er(e,n,i);let s;const o=n||{};return{byteLength:t,async slice(a,c){if(s)return s.then(h=>h.slice(a,c));const l=new Headers(o.headers),A=c===void 0?"":c-1;l.set("Range",`bytes=${a}-${A}`);const u=await i(e,{...o,headers:l});if(!u.ok||!u.body)throw new Error(`fetch failed ${u.status}`);if(u.status===200)return s=u.arrayBuffer(),s.then(h=>h.slice(a,c));if(u.status===206)return u.arrayBuffer();throw new Error(`fetch received unexpected status code ${u.status}`)}}}function Br(){const e=br();return(t,n)=>{const{memory:r,uncompress:i}=e.exports,s=68e3,o=s+t.byteLength,a=s+t.byteLength+n;if(r.buffer.byteLength<a){const u=r.buffer.byteLength/65536,w=Math.ceil(a/65536)-u;r.grow(w)}const c=new Uint8Array(r.buffer);c.set(t,s);const l=i(s,t.byteLength,o);if(l===-1)throw new Error("invalid snappy length header");if(l===-2)throw new Error("missing eof marker");if(l===-3)throw new Error("premature end of input");if(l)throw new Error(`failed to uncompress data ${l}`);return c.slice(o,o+n)}}function br(){const e=atob(Sr),t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=1)t[r]=e.charCodeAt(r);const n=new WebAssembly.Module(t);return new WebAssembly.Instance(n)}const Sr="AGFzbQEAAAABEANgAABgA39/fwF/YAF/AX8DBgUAAQEBAgUDAQACBj8KfwFBoIwEC38AQYAIC38AQaAMC38AQaAMC38AQaCMBAt/AEGACAt/AEGgjAQLfwBBgIAIC38AQQALfwBBAQsHwQEOBm1lbW9yeQIAEV9fd2FzbV9jYWxsX2N0b3JzAAAGbWVtY3B5AAEHbWVtbW92ZQACCnVuY29tcHJlc3MAAwxfX2Rzb19oYW5kbGUDAQpfX2RhdGFfZW5kAwILX19zdGFja19sb3cDAwxfX3N0YWNrX2hpZ2gDBA1fX2dsb2JhbF9iYXNlAwULX19oZWFwX2Jhc2UDBgpfX2hlYXBfZW5kAwcNX19tZW1vcnlfYmFzZQMIDF9fdGFibGVfYmFzZQMJCuASBQIAC8sBAQN/AkAgAkUNAAJAAkAgAkEHcSIDDQAgACEEIAIhBQwBCyAAIQQgAiEFA0AgBCABLQAAOgAAIARBAWohBCABQQFqIQEgBUF/aiEFIANBf2oiAw0ACwsgAkEISQ0AA0AgBCABLQAAOgAAIAQgAS0AAToAASAEIAEtAAI6AAIgBCABLQADOgADIAQgAS0ABDoABCAEIAEtAAU6AAUgBCABLQAGOgAGIAQgAS0ABzoAByAEQQhqIQQgAUEIaiEBIAVBeGoiBQ0ACwsgAAugAwEEfwJAIAAgAUYNAAJAAkAgACABSQ0AIAEgAmoiAyAASw0BCyACRQ0BAkACQCACQQdxIgMNACAAIQQgAiEFDAELIAAhBCACIQUDQCAEIAEtAAA6AAAgBEEBaiEEIAFBAWohASAFQX9qIQUgA0F/aiIDDQALCyACQQhJDQEDQCAEIAEtAAA6AAAgBCABLQABOgABIAQgAS0AAjoAAiAEIAEtAAM6AAMgBCABLQAEOgAEIAQgAS0ABToABSAEIAEtAAY6AAYgBCABLQAHOgAHIARBCGohBCABQQhqIQEgBUF4aiIFDQAMAgsLIAJFDQACQAJAIAJBA3EiBA0AIAAgAmohBiACIQUMAQsgAiEFA0AgBUF/aiIFIABqIgYgBSABaiIDLQAAOgAAIARBf2oiBA0ACwsgAkEESQ0AIAZBfGohASADQXxqIQQDQCABQQNqIARBA2otAAA6AAAgAUECaiAEQQJqLQAAOgAAIAFBAWogBEEBai0AADoAACABIAQtAAA6AAAgAUF8aiEBIARBfGohBCAFQXxqIgUNAAsLIAALswoBCX8jgICAgABBIGsiAySAgICAACADQQlqQgA3AAAgA0IANwIEIAMgA0EYajYCAEF/IQQCQCABRQ0AIAMgAUF/aiIFNgIcIAMgAEEBajYCGCAALAAAIgZB/wBxIQcCQCAGQX9KDQAgBUUNASADIAFBfmoiBTYCHCADIABBAmo2AhggACwAASIGQf8AcUEHdCAHciEHQX8hBCAGQX9KDQAgBUUNASADIAFBfWoiBTYCHCADIABBA2o2AhggACwAAiIGQf8AcUEOdCAHciEHQX8hBCAGQX9KDQAgBUUNASADIAFBfGoiBTYCHCADIABBBGo2AhggACwAAyIGQf8AcUEVdCAHciEHQX8hBCAGQX9KDQAgBUUNASADIAFBe2o2AhwgAyAAQQVqNgIYIAAsAAQiAUEASA0BIAFBHHQgB3IhBwsgAiAHaiEIAkACQCADEISAgIAADQAgAiEADAELIAMoAgQhASACIQADQAJAIAMoAgggAWtBBEoNACADIAE2AgQgAxCEgICAAEUNAiADKAIEIQELIAFBAWohBQJAAkAgAS0AACIGQQNxDQAgCCAAayEJIAMoAggiCiAFayEEIAZBAnYiC0EBaiEHAkAgBkE/Sw0AIARBEEkNACAJQRBIDQAgACABKAIBNgIAIAAgASgCBTYCBCAAIAEoAgk2AgggACABKAINNgIMIAAgB2ohACADKAIIIAUgB2oiAWtBBEoNAyADIAE2AgQgAxCEgICAAEUNBAwCCwJAAkAgBkHwAU8NACAFIQYMAQsgCiAFIAtBRWoiAWoiBmshBCABQQJ0QYCIgIAAaigCACAFKAIAcUEBaiEHCwJAIAcgBE0NAANAIAggAGsgBEkNBSAAIAYgBBCBgICAACEAIAMoAgAiASABKAIAIgkgAygCDCIFaiIGNgIAIAFBBGoiASABKAIAIgogBWsiATYCACADIAE2AgwgACAEaiEAIAFFDQUgAyAJIApqNgIIIAcgBGshByABIQQgByABSw0ACyAIIABrIQkLIAkgB0kNAyAAIAYgBxCBgICAACAHaiEAIAMoAgggBiAHaiIBa0EESg0CIAMgATYCBCADEISAgIAADQEMAwsgACACayAGQQF0QaCIgIAAai8BACIBQQt2IgpBAnRBgIiAgABqKAIAIAUoAgBxIAFBgA5xaiIHQX9qTQ0CIAggAGshBAJAAkAgAUH/AXEiCUEQSw0AIAdBCEkNACAEQRBJDQAgACAAIAdrIgEoAgA2AgAgACABKAIENgIEIAAgASgCCDYCCCAAIAFBDGooAgA2AgwMAQsCQAJAAkAgBCAJQQpqSQ0AIAAgB2shBCAAIQEgCSEGIAdBB0wNAQwCCyAEIAlJDQUgCUEBaiEEQQAgB2shByAAIQEDQCABIAEgB2otAAA6AAAgAUEBaiEBIARBf2oiBEEBSw0ADAMLCwNAIAEgBCgCADYCACABIAQoAgQ2AgQgBiAHayEGIAEgB2oiASAEayIHQQhIDQALCyAGQQFIDQAgBkEIaiEHA0AgASAEKAIANgIAIAEgBCgCBDYCBCABQQhqIQEgBEEIaiEEIAdBeGoiB0EISw0ACwsgACAJaiEAIAMoAgggBSAKaiIBa0EESg0BIAMgATYCBCADEISAgIAARQ0CCyADKAIEIQEMAAsLIAMoAgAiASABKAIEIAMoAgwiBGs2AgQgASAEIAEoAgBqNgIAAkAgAy0AEA0AQX4hBAwBC0EAQX0gCCAARhshBAsgA0EgaiSAgICAACAEC7YDAQd/AkAgACgCBCIBIAAoAggiAkcNACAAKAIAIgIgAigCACIDIAAoAgwiBGoiATYCACACQQRqIgIgAigCACICIARrIgU2AgAgACAFNgIMAkAgAiAERw0AIABBAToAEEEADwsgACADIAJqIgI2AggLAkACQAJAIAIgAWsiAiABLQAAQQF0QaCIgIAAai8BAEELdkEBaiIFTw0AIABBEWogASACEIKAgIAAIQYgACgCDCEEQQAhByAAQQA2AgwgACgCACIBIAEoAgQgBGs2AgQgASAEIAEoAgBqIgM2AgADQCABQQRqKAIAIgFFDQMgBiACaiADIAUgAmsiBCABIAQgAUkbIgQQgYCAgAAaIAAoAgAiASABKAIEIARrNgIEIAEgASgCACAEaiIDNgIAIAQgAmoiAiAFSQ0ACyAAIAY2AgQgACAGIAVqNgIIDAELAkAgAkEESw0AIAAgAEERaiABIAIQgoCAgAAiASACajYCCCAAIAE2AgQgACgCDCECIABBADYCDCAAKAIAIgEgASgCBCACazYCBCABIAIgASgCAGo2AgAMAQsgACABNgIEC0EBIQcLIAcLC6gEAQBBgAgLoAQAAAAA/wAAAP//AAD///8A/////wAAAAAAAAAAAAAAAAEABAgBEAEgAgAFCAIQAiADAAYIAxADIAQABwgEEAQgBQAICAUQBSAGAAkIBhAGIAcACggHEAcgCAALCAgQCCAJAAQJCRAJIAoABQkKEAogCwAGCQsQCyAMAAcJDBAMIA0ACAkNEA0gDgAJCQ4QDiAPAAoJDxAPIBAACwkQEBAgEQAEChEQESASAAUKEhASIBMABgoTEBMgFAAHChQQFCAVAAgKFRAVIBYACQoWEBYgFwAKChcQFyAYAAsKGBAYIBkABAsZEBkgGgAFCxoQGiAbAAYLGxAbIBwABwscEBwgHQAICx0QHSAeAAkLHhAeIB8ACgsfEB8gIAALCyAQICAhAAQMIRAhICIABQwiECIgIwAGDCMQIyAkAAcMJBAkICUACAwlECUgJgAJDCYQJiAnAAoMJxAnICgACwwoECggKQAEDSkQKSAqAAUNKhAqICsABg0rECsgLAAHDSwQLCAtAAgNLRAtIC4ACQ0uEC4gLwAKDS8QLyAwAAsNMBAwIDEABA4xEDEgMgAFDjIQMiAzAAYOMxAzIDQABw40EDQgNQAIDjUQNSA2AAkONhA2IDcACg43EDcgOAALDjgQOCA5AAQPORA5IDoABQ86EDogOwAGDzsQOyA8AAcPPBA8IAEICA89ED0gARAJDz4QPiABGAoPPxA/IAEgCw9AEEAgAGQEbmFtZQE9BQARX193YXNtX2NhbGxfY3RvcnMBBm1lbWNweQIHbWVtbW92ZQMKdW5jb21wcmVzcwQKcmVmaWxsX3RhZwcSAQAPX19zdGFja19wb2ludGVyCQoBAAcucm9kYXRhADIJcHJvZHVjZXJzAQxwcm9jZXNzZWQtYnkBDFVidW50dSBjbGFuZwsxNi4wLjYgKDE1KQAsD3RhcmdldF9mZWF0dXJlcwIrD211dGFibGUtZ2xvYmFscysIc2lnbi1leHQ=";function ze([e,t]){return{offset:e,nbits:t}}[[1,2],[5,2],[9,2],[13,2],[17,3],[25,3],[33,3],[41,3],[49,4],[65,4],[81,4],[97,4],[113,5],[145,5],[177,5],[209,5],[241,6],[305,6],[369,7],[497,8],[753,9],[1265,10],[2289,11],[4337,12],[8433,13],[16625,24]].map(ze);[[0,0],[1,0],[2,0],[3,0],[4,0],[5,0],[6,1],[8,1],[10,2],[14,2],[18,3],[26,3],[34,4],[50,4],[66,5],[98,5],[130,6],[194,7],[322,8],[578,9],[1090,10],[2114,12],[6210,14],[22594,24]].map(ze);[[2,0],[3,0],[4,0],[5,0],[6,0],[7,0],[8,0],[9,0],[10,1],[12,1],[14,2],[18,2],[22,3],[30,3],[38,4],[54,4],[70,5],[102,5],[134,6],[198,7],[326,8],[582,9],[1094,10],[2118,24]].map(ze);const Nr=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Qr=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]);function $t(e,t){const n=new Uint16Array(31);for(let i=0;i<31;i++)n[i]=t+=1<<e[i-1];const r=new Int32Array(n[30]);for(let i=1;i<30;i++)for(let s=n[i];s<n[i+1];++s)r[s]=s-n[i]<<5|i;return{base:n,rev:r}}const{base:Tr,rev:kr}=$t(Nr,2);Tr[28]=258;kr[258]=28;$t(Qr,0);const Lr=new Uint16Array(32768);for(let e=0;e<32768;e++){let t=(e&43690)>>1|(e&21845)<<1;t=(t&52428)>>2|(t&13107)<<2,t=(t&61680)>>4|(t&3855)<<4,Lr[e]=((t&65280)>>8|(t&255)<<8)>>1}const fe=new Uint8Array(288);for(let e=0;e<144;e++)fe[e]=8;for(let e=144;e<256;e++)fe[e]=9;for(let e=256;e<280;e++)fe[e]=7;for(let e=280;e<288;e++)fe[e]=8;const Mr=new Uint8Array(32);for(let e=0;e<32;e++)Mr[e]=5;const g=0,It=1,Dr=2,Fr=3,xr=4,Ur=5,Rr=6,Or=7,$r=8,vr=9,I=10,E=11,Yr=12,Pr=13,zr=14,Gr=15,Jr=16,Vr=17,jr=18,Hr=20;class f{constructor(t,n,r){this.prefix=new Uint8Array(t.length),this.transform=n,this.suffix=new Uint8Array(r.length);for(let i=0;i<t.length;i++)this.prefix[i]=t.charCodeAt(i);for(let i=0;i<r.length;i++)this.suffix[i]=r.charCodeAt(i)}}new f("",g,""),new f("",g," "),new f(" ",g," "),new f("",Yr,""),new f("",I," "),new f("",g," the "),new f(" ",g,""),new f("s ",g," "),new f("",g," of "),new f("",I,""),new f("",g," and "),new f("",Pr,""),new f("",It,""),new f(", ",g," "),new f("",g,", "),new f(" ",I," "),new f("",g," in "),new f("",g," to "),new f("e ",g," "),new f("",g,'"'),new f("",g,"."),new f("",g,'">'),new f("",g,`
|
|
2
|
+
`),new f("",Fr,""),new f("",g,"]"),new f("",g," for "),new f("",zr,""),new f("",Dr,""),new f("",g," a "),new f("",g," that "),new f(" ",I,""),new f("",g,". "),new f(".",g,""),new f(" ",g,", "),new f("",Gr,""),new f("",g," with "),new f("",g,"'"),new f("",g," from "),new f("",g," by "),new f("",Jr,""),new f("",Vr,""),new f(" the ",g,""),new f("",xr,""),new f("",g,". The "),new f("",E,""),new f("",g," on "),new f("",g," as "),new f("",g," is "),new f("",Or,""),new f("",It,"ing "),new f("",g,`
|
|
3
|
+
`),new f("",g,":"),new f(" ",g,". "),new f("",g,"ed "),new f("",Hr,""),new f("",jr,""),new f("",Rr,""),new f("",g,"("),new f("",I,", "),new f("",$r,""),new f("",g," at "),new f("",g,"ly "),new f(" the ",g," of "),new f("",Ur,""),new f("",vr,""),new f(" ",I,", "),new f("",I,'"'),new f(".",g,"("),new f("",E," "),new f("",I,'">'),new f("",g,'="'),new f(" ",g,"."),new f(".com/",g,""),new f(" the ",g," of the "),new f("",I,"'"),new f("",g,". This "),new f("",g,","),new f(".",g," "),new f("",I,"("),new f("",I,"."),new f("",g," not "),new f(" ",g,'="'),new f("",g,"er "),new f(" ",E," "),new f("",g,"al "),new f(" ",E,""),new f("",g,"='"),new f("",E,'"'),new f("",I,". "),new f(" ",g,"("),new f("",g,"ful "),new f(" ",I,". "),new f("",g,"ive "),new f("",g,"less "),new f("",E,"'"),new f("",g,"est "),new f(" ",I,"."),new f("",E,'">'),new f(" ",g,"='"),new f("",I,","),new f("",g,"ize "),new f("",E,"."),new f("Â ",g,""),new f(" ",g,","),new f("",I,'="'),new f("",E,'="'),new f("",g,"ous "),new f("",E,", "),new f("",I,"='"),new f(" ",I,","),new f(" ",E,'="'),new f(" ",E,", "),new f("",E,","),new f("",E,"("),new f("",E,". "),new f(" ",E,"."),new f("",E,"='"),new f(" ",E,". "),new f(" ",I,'="'),new f(" ",E,"='"),new f(" ",I,"='");Br();const mt=async({url:e,byteLength:t})=>{const n=await Cr({url:e,byteLength:t});return{url:e,file:n,metadata:await _r(n)}},vt=(e,t)=>e.key_value_metadata?.find(n=>n.key===t)?.value??void 0,qr=e=>{try{const t=JSON.parse(vt(e,"pandas")??"{}").index_columns?.[0];return typeof t=="string"?t:null}catch{return null}},Et=e=>Number(e.num_rows),ye=["images","labels","shapes","points","tables"],R=async e=>{const t=await fetch(e);if(t.status===404||t.status===403)return null;if(!t.ok)throw new Error(`${e} returned ${t.status}`);const n=await t.text();try{return JSON.parse(n)}catch{return null}},Kr=async e=>{const t=await R(`${e}/zarr.json`);return t?.zarr_format===3&&t.node_type==="group"?t.attributes??{}:null},Xr=e=>{const t=new Map,n=r=>{let i=t.get(r);return i||(i={node_type:"group",attributes:{}},t.set(r,i)),i};for(const[r,i]of Object.entries(e)){const s=r.lastIndexOf("/"),o=s===-1?"":r.slice(0,s),a=r.slice(s+1);if(a===".zattrs")n(o).attributes=i??{};else if(a===".zarray"){const c=n(o);c.node_type="array",c.shape=i?.shape,c.data_type=i?.dtype}else a===".zgroup"&&n(o)}return t},Ct=(e,t)=>{const n=Object.fromEntries(ye.map(i=>[i,[]]));for(const i of e.keys()){const[s,o,...a]=i.split("/");a.length===0&&o&&ye.includes(s)&&n[s].push(o)}const r=[["images",t?.image],["shapes",t?.shapes],["points",t?.points],["tables",t?.table]];for(const[i,s]of r)s&&!n[i].includes(s)&&n[i].push(s);for(const i of ye)n[i].sort();return n},Wr=async(e,t)=>{const n=await R(`${e}/zarr.json`);if(n){const o=n.consolidated_metadata?.metadata??{},a=new Map(Object.entries(o));return{url:e,zarrFormat:3,rootAttrs:n.attributes??{},nodes:a,elements:Ct(a,t)}}const r=await R(`${e}/.zmetadata`),i=Xr(r?.metadata??{}),s=i.get("")?.attributes??await R(`${e}/.zattrs`)??{};if(!r&&!s.spatialdata_attrs)throw new Error(`No SpatialData store found at ${e}`);return{url:e,zarrFormat:2,rootAttrs:s,nodes:i,elements:Ct(i,t)}},Zr=8,k=new Map,ei=(e,t)=>`${e}/${t}.zarr`,ti=(e,t,n)=>{const r=ei(e,t),i=`${r}|${JSON.stringify(n??{})}`;let s=k.get(i);for(s?k.delete(i):(s=Wr(r,n),s.catch(()=>k.delete(i))),k.set(i,s);k.size>Zr;)k.delete(k.keys().next().value);return s},W=(e,t,n)=>{const r=e.elements[t];return n?r.includes(n)?n:null:r[0]??null},ee=async(e,t)=>{const n=e.nodes.get(t);if(n)return n.attributes??{};const r=e.zarrFormat===3?await R(`${e.url}/${t}/zarr.json`):{attributes:await R(`${e.url}/${t}/.zattrs`)},i=r?.attributes??{};return e.nodes.set(t,{node_type:r?.node_type??"group",attributes:i,shape:r?.shape,data_type:r?.data_type}),i},Bt=async e=>{try{const r=await fetch(e,{method:"HEAD"});if(r.status===404)return null;const i=Number(r.headers.get("Content-Length")),s=(r.headers.get("Content-Type")??"").includes("html");if(r.ok&&!s&&i>0)return i}catch{}const t=await fetch(e,{headers:{Range:"bytes=0-0"}});if(!t.ok||(t.headers.get("Content-Type")??"").includes("html"))return await t.body?.cancel(),null;const n=Number(t.headers.get("Content-Range")?.split("/")[1]);if(t.status===206){if(await t.body?.cancel(),n>0)return n;throw new Error(`${e}: the server answered a range request but its CORS policy hides Content-Range (allow HEAD, or add Content-Range to the exposed response headers)`)}return(await t.arrayBuffer()).byteLength||null},ni=async e=>{const t=await Bt(e);if(t)return[{url:e,byteLength:t}];const n=[],r=8;for(let i=0;;i+=r){const s=Array.from({length:r},(a,c)=>`${e}/part.${i+c}.parquet`),o=await Promise.all(s.map(Bt));for(let a=0;a<r;a++){if(!o[a])return n;n.push({url:s[a],byteLength:o[a]})}}},ri=(e,t)=>{const n=e.nodes.get(`tables/${t}/obs`)?.attributes??{};return Array.isArray(n["column-order"])?n["column-order"]:[]},Yt=(e,t)=>{const n=e.nodes.get(t)?.attributes?.["encoding-type"];return n==="categorical"?`${t}/codes`:typeof n=="string"&&n.startsWith("nullable-")?`${t}/values`:t},Pt=(e,t)=>{const n=e.nodes.get(`tables/${t}/obs`)?.attributes??{};return`tables/${t}/obs/${String(n._index??"_index")}`},zt=(e,t)=>e.nodes.get(Yt(e,Pt(e,t)))?.shape?.[0]??0,Gt=async(e,t)=>{await ee(e,`tables/${t}/obs`);const n=Pt(e,t);await ee(e,n);const r=Yt(e,n);r!==n&&await ee(e,r)},ii=(e,t,n,r)=>r===0?{mode:"none"}:e&&n.includes(e)?{mode:"column",column:e}:r===t?{mode:"order"}:{mode:"none"},si=async(e,t,n,r)=>{const i=await Kr(`${e.url}/shapes/${n}/shapes.zarr`);if(!i)return null;const s=i.join;if(!s||typeof i.number_cells!="number"||typeof i.n_shapes!="number")return null;const o=s.mode==="none"?null:i.table??null;return o!==null&&o!==r||o&&(await Gt(e,o),zt(e,o)!==i.number_cells)?null:{imageName:t,shapesName:n,shapesFiles:[],geometryColumn:"geometry",shapesIndexColumn:i.shapes_index_column??null,nShapes:i.n_shapes,tableName:o,nObs:o?i.number_cells:0,join:s,nCells:i.number_cells}},bt=new WeakMap,oi=async(e,t)=>{const n=W(e,"images",t?.image),r=W(e,"shapes",t?.shapes);if(!n||!r)return null;const i=await si(e,n,r,W(e,"tables",t?.table));if(i)return i;const s=await ni(`${e.url}/shapes/${r}/shapes.parquet`);if(s.length===0)return null;const{metadata:o}=await mt(s[0]);let a="geometry";try{a=JSON.parse(vt(o,"geo")??"{}").primary_column??"geometry"}catch{}const c=qr(o);let l=Et(o);for(const C of s.slice(1))l+=Et((await mt(C)).metadata);const A=W(e,"tables",t?.table);A&&(await ee(e,`tables/${A}`),await Gt(e,A));const u=A?zt(e,A):0,h=A?e.nodes.get(`tables/${A}`)?.attributes?.region:null,w=Array.isArray(h)&&h.length>1;w&&console.warn(`SpatialData: table '${A}' annotates ${h.length} regions; cells are shown unannotated.`);const p=w?{mode:"none"}:ii(c,l,A?ri(e,A):[],u);return p.mode==="order"&&console.warn(`SpatialData: table '${A}' shares no id column with shapes '${r}'; assuming both are in the same cell order.`),{imageName:n,shapesName:r,shapesFiles:s,geometryColumn:a,shapesIndexColumn:c,nShapes:l,tableName:p.mode==="none"?null:A,nObs:u,join:p,nCells:p.mode==="none"?l:u}},ai=(e,t)=>{let n=bt.get(e);n||(n=new Map,bt.set(e,n));const r=JSON.stringify(t??{});let i=n.get(r);return i||(i=oi(e,t),i.catch(()=>n.delete(r)),n.set(r,i)),i},ci=e=>{let t=0,n=null,r=null;return{add:(o,a)=>{n||(t=o.length,n=new Float64Array(t),r=new Float64Array(t));let c=0,l=1;if(e){let A=0,u=0,h=0;for(let w=0;w<t;w++){const p=o[w];Number.isFinite(p)&&(A+=p,u+=p*p,h+=1)}if(h>0){c=A/h;const w=u/h-c*c;l=w>0?Math.sqrt(w):1}}for(let A=0;A<t;A++){const u=o[A];if(Number.isFinite(u)){const h=e?(u-c)/l:u;n[A]+=a*h,r[A]+=a}}},result:()=>{const o=new Float32Array(t);let a=1/0,c=-1/0;for(let l=0;l<t;l++){const A=r[l],u=A>0?n[l]/A:NaN;o[l]=u,Number.isFinite(u)&&(u<a&&(a=u),u>c&&(c=u))}return{scoreValues:o,scoreRange:a<=c?[a,c]:[0,1]}}}},fi=(e,t,n)=>{const r=[],i=[];for(const s of t){const o=e.indexOf(s);if(o===-1){r.push(s);continue}const a=n[s];i.push({col:o,weight:Number.isFinite(a)?a:1})}return{resolved:i,missingGenes:r}},x=self,St=16,li=4,U=new Map;let J=null,Qe=null;const Nt=async(e,t,n)=>Ut((await oe(e,[me(t,n)])).data),ui=async()=>{const{rootUrl:e,uuid:t,elements:n}=Qe,r=await ti(e,t,n),i=(await ai(r,n))?.tableName;if(!i)throw new Error("No table joined to the cell outlines; expression is unavailable");const s=En(new Vt(`${r.url}/tables/${i}`)),o=await Kn(s.resolve("var")),a=await T(s.resolve("X")),c=a.attrs["encoding-type"];if(a instanceof L)return{genes:o,columns:C=>Promise.all(C.map(async B=>Float32Array.from((await oe(a,[null,B])).data)))};if(c!=="csc_matrix")throw new Error(`Table '${i}' X is ${String(c)}; expression needs a dense or CSC X (see data/prep_spatialdata.py)`);const[l]=a.attrs.shape,A=s.resolve("X"),[u,h,w]=await Promise.all(["indptr","indices","data"].map(C=>T(A.resolve(C),{kind:"array"}))),p=Ut((await oe(u)).data);return{genes:o,columns:C=>Promise.all(C.map(async B=>{const y=new Float32Array(l),[d,S]=[p[B],p[B+1]];if(S===d)return y;const[_,N]=await Promise.all([Nt(h,d,S),Nt(w,d,S)]);for(let F=0;F<_.length;F++)y[_[F]]+=N[F];return y}))}},Ai=()=>(J||(J=ui(),J.catch(()=>{J=null})),J);x.onmessage=async e=>{const t=e.data||{};try{if(t.type==="INIT"){Qe={rootUrl:t.rootUrl,uuid:t.uuid,elements:t.elements};return}if(!Qe)return;const n=await Ai();if(t.type==="COLUMN"){const r=n.genes.indexOf(t.gene);if(r===-1){x.postMessage({type:"COLUMN_DONE",requestId:t.requestId,values:null});return}let i=U.get(r);for(i?U.delete(r):[i]=await n.columns([r]),U.set(r,i);U.size>li;)U.delete(U.keys().next().value);const s=i.slice();x.postMessage({type:"COLUMN_DONE",requestId:t.requestId,values:s},[s.buffer]);return}if(t.type==="SCORES"){const{resolved:r,missingGenes:i}=fi(n.genes,t.genes,t.weights);if(r.length===0){const c=new Float32Array(0);x.postMessage({type:"SCORES_DONE",requestId:t.requestId,scoreValues:c,scoreRange:[0,1],missingGenes:i});return}const s=ci(!!t.useZScore);for(let c=0;c<r.length;c+=St){const l=r.slice(c,c+St);(await n.columns(l.map(u=>u.col))).forEach((u,h)=>{s.add(u,l[h].weight)})}const{scoreValues:o,scoreRange:a}=s.result();x.postMessage({type:"SCORES_DONE",requestId:t.requestId,scoreValues:o,scoreRange:a,missingGenes:i},[o.buffer])}}catch(n){console.error(n),x.postMessage({type:"ERROR",requestId:t.requestId,message:n instanceof Error?n.message:String(n)})}};
|
|
4
|
+
//# sourceMappingURL=spatialdataExpression.worker-D4W_OHS3.js.map
|